diff --git a/packages/google-dataflow/.eslintignore b/packages/google-dataflow/.eslintignore new file mode 100644 index 00000000000..ea5b04aebe6 --- /dev/null +++ b/packages/google-dataflow/.eslintignore @@ -0,0 +1,7 @@ +**/node_modules +**/coverage +test/fixtures +build/ +docs/ +protos/ +samples/generated/ diff --git a/packages/google-dataflow/.eslintrc.json b/packages/google-dataflow/.eslintrc.json new file mode 100644 index 00000000000..78215349546 --- /dev/null +++ b/packages/google-dataflow/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "./node_modules/gts" +} diff --git a/packages/google-dataflow/.gitattributes b/packages/google-dataflow/.gitattributes new file mode 100644 index 00000000000..33739cb74e4 --- /dev/null +++ b/packages/google-dataflow/.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-dataflow/.github/.OwlBot.yaml b/packages/google-dataflow/.github/.OwlBot.yaml new file mode 100644 index 00000000000..9cf5be7c59e --- /dev/null +++ b/packages/google-dataflow/.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/dataflow/(.*)/.*-nodejs/(.*) + dest: /owl-bot-staging/$1/$2 diff --git a/packages/google-dataflow/.gitignore b/packages/google-dataflow/.gitignore new file mode 100644 index 00000000000..5d32b23782f --- /dev/null +++ b/packages/google-dataflow/.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-dataflow/.jsdoc.js b/packages/google-dataflow/.jsdoc.js new file mode 100644 index 00000000000..e0a5fee4aef --- /dev/null +++ b/packages/google-dataflow/.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/dataflow', + theme: 'lumen', + default: { + outputSourceFiles: false + } + }, + markdown: { + idInHeadings: true + } +}; diff --git a/packages/google-dataflow/.mocharc.js b/packages/google-dataflow/.mocharc.js new file mode 100644 index 00000000000..0b600509bed --- /dev/null +++ b/packages/google-dataflow/.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-dataflow/.nycrc b/packages/google-dataflow/.nycrc new file mode 100644 index 00000000000..b18d5472b62 --- /dev/null +++ b/packages/google-dataflow/.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-dataflow/.prettierignore b/packages/google-dataflow/.prettierignore new file mode 100644 index 00000000000..9340ad9b86d --- /dev/null +++ b/packages/google-dataflow/.prettierignore @@ -0,0 +1,6 @@ +**/node_modules +**/coverage +test/fixtures +build/ +docs/ +protos/ diff --git a/packages/google-dataflow/.prettierrc.js b/packages/google-dataflow/.prettierrc.js new file mode 100644 index 00000000000..d1b95106f4c --- /dev/null +++ b/packages/google-dataflow/.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-dataflow/.repo-metadata.json b/packages/google-dataflow/.repo-metadata.json new file mode 100644 index 00000000000..af1e3b96efe --- /dev/null +++ b/packages/google-dataflow/.repo-metadata.json @@ -0,0 +1,16 @@ +{ + "name": "dataflow", + "name_pretty": "Dataflow", + "product_documentation": "https://cloud.google.com/dataflow/", + "client_documentation": "https://cloud.google.com/nodejs/docs/reference/dataflow/latest", + "issue_tracker": "https://github.com/googleapis/nodejs-dataflow/issues", + "release_level": "preview", + "language": "nodejs", + "repo": "googleapis/nodejs-dataflow", + "distribution_name": "@google-cloud/dataflow", + "api_id": "dataflow.googleapis.com", + "default_version": "v1beta3", + "requires_billing": true, + "api_shortname": "dataflow", + "library_type": "GAPIC_AUTO" +} diff --git a/packages/google-dataflow/CHANGELOG.md b/packages/google-dataflow/CHANGELOG.md new file mode 100644 index 00000000000..afecd97ad83 --- /dev/null +++ b/packages/google-dataflow/CHANGELOG.md @@ -0,0 +1,78 @@ +# Changelog + +## [2.0.1](https://github.com/googleapis/nodejs-dataflow/compare/v2.0.0...v2.0.1) (2022-11-11) + + +### Bug Fixes + +* Allow passing gax instance to client constructor ([#80](https://github.com/googleapis/nodejs-dataflow/issues/80)) ([9054e83](https://github.com/googleapis/nodejs-dataflow/commit/9054e835bff17366ca8810852c9d128b2ce6660f)) +* Better support for fallback mode ([#76](https://github.com/googleapis/nodejs-dataflow/issues/76)) ([7b4c304](https://github.com/googleapis/nodejs-dataflow/commit/7b4c30408db223dc273b4d82a7402f945b30aa21)) +* Change import long to require ([#77](https://github.com/googleapis/nodejs-dataflow/issues/77)) ([531996b](https://github.com/googleapis/nodejs-dataflow/commit/531996bb8c228f653dee2adf4a0488f275e85710)) +* **deps:** Use google-gax v3.5.2 ([#87](https://github.com/googleapis/nodejs-dataflow/issues/87)) ([9f856a5](https://github.com/googleapis/nodejs-dataflow/commit/9f856a5f95c68fe7310fdd5e4de747d551192136)) +* Do not import the whole google-gax from proto JS ([#1553](https://github.com/googleapis/nodejs-dataflow/issues/1553)) ([#79](https://github.com/googleapis/nodejs-dataflow/issues/79)) ([a0924da](https://github.com/googleapis/nodejs-dataflow/commit/a0924dac7a384c659650a3c61e4072d7206df678)) +* **docs:** Document fallback rest option ([#72](https://github.com/googleapis/nodejs-dataflow/issues/72)) ([bb637f7](https://github.com/googleapis/nodejs-dataflow/commit/bb637f7a64b1f3cbe78e45d1584a52874904a607)) +* Preserve default values in x-goog-request-params header ([#81](https://github.com/googleapis/nodejs-dataflow/issues/81)) ([18e64cc](https://github.com/googleapis/nodejs-dataflow/commit/18e64cc81f6d02e3a137f0a3cbee5e38bbaac5d9)) +* Regenerated protos JS and TS definitions ([#90](https://github.com/googleapis/nodejs-dataflow/issues/90)) ([920d3fe](https://github.com/googleapis/nodejs-dataflow/commit/920d3fea4f8900113fd24f72debc2d417e9c53c0)) +* Remove pip install statements ([#1546](https://github.com/googleapis/nodejs-dataflow/issues/1546)) ([#78](https://github.com/googleapis/nodejs-dataflow/issues/78)) ([884ea27](https://github.com/googleapis/nodejs-dataflow/commit/884ea27767fb25ff73d01899250000ea53360be5)) +* use google-gax v3.3.0 ([a0924da](https://github.com/googleapis/nodejs-dataflow/commit/a0924dac7a384c659650a3c61e4072d7206df678)) + +## [2.0.0](https://github.com/googleapis/nodejs-dataflow/compare/v1.2.0...v2.0.0) (2022-06-10) + + +### ⚠ BREAKING CHANGES + +* update library to use Node 12 (#65) + +### Bug Fixes + +* fixes for dynamic routing and streaming descriptors ([#68](https://github.com/googleapis/nodejs-dataflow/issues/68)) ([f6432cb](https://github.com/googleapis/nodejs-dataflow/commit/f6432cb34bae0773494dc29f30782c854892e6a0)) + + +### Build System + +* update library to use Node 12 ([#65](https://github.com/googleapis/nodejs-dataflow/issues/65)) ([a515a4a](https://github.com/googleapis/nodejs-dataflow/commit/a515a4a9be3a6dd0e307858312906f2022d65d25)) + +## [1.2.0](https://github.com/googleapis/nodejs-dataflow/compare/v1.1.0...v1.2.0) (2022-04-04) + + +### Features + +* Add the ability to plumb environment capabilities through v1beta3 protos. ([#53](https://github.com/googleapis/nodejs-dataflow/issues/53)) ([41c8fd6](https://github.com/googleapis/nodejs-dataflow/commit/41c8fd603155fd9158f88fdb95807c988f59875c)) +* new parameters in FlexTemplateRuntimeEnvironment ([f8bd01b](https://github.com/googleapis/nodejs-dataflow/commit/f8bd01b0c55f33e00ba33671ebeb2a8cabd51bbb)) + + +### Bug Fixes + +* Use http binding with location field as primary http bindings ([6bfb6bd](https://github.com/googleapis/nodejs-dataflow/commit/6bfb6bdee7f50b8353aa7fde8e4f764704ddb81a)) + +## [1.1.0](https://www.github.com/googleapis/nodejs-dataflow/compare/v1.0.2...v1.1.0) (2021-08-23) + + +### Features + +* turns on self-signed JWT feature flag ([#18](https://www.github.com/googleapis/nodejs-dataflow/issues/18)) ([ac48141](https://www.github.com/googleapis/nodejs-dataflow/commit/ac48141e34e60d95a6037e30d33b28db9467c2b7)) + +### [1.0.2](https://www.github.com/googleapis/nodejs-dataflow/compare/v1.0.1...v1.0.2) (2021-08-17) + + +### Bug Fixes + +* **build:** migrate to using main branch ([#15](https://www.github.com/googleapis/nodejs-dataflow/issues/15)) ([af1172d](https://www.github.com/googleapis/nodejs-dataflow/commit/af1172da72a97804f9d50ff91b388f20ff90124f)) +* **deps:** google-gax v2.24.1 ([#17](https://www.github.com/googleapis/nodejs-dataflow/issues/17)) ([d177477](https://www.github.com/googleapis/nodejs-dataflow/commit/d177477188036fa675a1b3f32f5d85aca27c4fcc)) + +### [1.0.1](https://www.github.com/googleapis/nodejs-dataflow/compare/v1.0.0...v1.0.1) (2021-07-21) + + +### Bug Fixes + +* **deps:** google-gax v2.17.1 ([#6](https://www.github.com/googleapis/nodejs-dataflow/issues/6)) ([c689196](https://www.github.com/googleapis/nodejs-dataflow/commit/c689196fd00e35fe702e16a6642e7fb06c9907b2)) +* Updating WORKSPACE files to use the newest version of the Typescript generator. ([#8](https://www.github.com/googleapis/nodejs-dataflow/issues/8)) ([ce940c1](https://www.github.com/googleapis/nodejs-dataflow/commit/ce940c13c9730f7ede30ad5dfc10cceb56c6953b)) + +## 1.0.0 (2021-07-08) + + +### Features + +* add initial samples and tests ([#2](https://www.github.com/googleapis/nodejs-dataflow/issues/2)) ([684094d](https://www.github.com/googleapis/nodejs-dataflow/commit/684094dfa2141f4b1974e6bd0cc906c16097a0ab)) +* initial stub of library ([3891183](https://www.github.com/googleapis/nodejs-dataflow/commit/389118343ec1a351b58755522f5336d2dfc3a976)) +* push templated files ([e05f9a8](https://www.github.com/googleapis/nodejs-dataflow/commit/e05f9a8d276dc9ddf6916620a951788ee42f41f5)) diff --git a/packages/google-dataflow/CODE_OF_CONDUCT.md b/packages/google-dataflow/CODE_OF_CONDUCT.md new file mode 100644 index 00000000000..2add2547a81 --- /dev/null +++ b/packages/google-dataflow/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-dataflow/CONTRIBUTING.md b/packages/google-dataflow/CONTRIBUTING.md new file mode 100644 index 00000000000..71214895816 --- /dev/null +++ b/packages/google-dataflow/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 Dataflow 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=dataflow.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/getting-started \ No newline at end of file diff --git a/packages/google-dataflow/LICENSE b/packages/google-dataflow/LICENSE new file mode 100644 index 00000000000..d6456956733 --- /dev/null +++ b/packages/google-dataflow/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-dataflow/README.md b/packages/google-dataflow/README.md new file mode 100644 index 00000000000..0d053c391c1 --- /dev/null +++ b/packages/google-dataflow/README.md @@ -0,0 +1,161 @@ +[//]: # "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 + +# [Dataflow: Node.js Client](https://github.com/googleapis/nodejs-dataflow) + +[![release level](https://img.shields.io/badge/release%20level-preview-yellow.svg?style=flat)](https://cloud.google.com/terms/launch-stages) +[![npm version](https://img.shields.io/npm/v/@google-cloud/dataflow.svg)](https://www.npmjs.org/package/@google-cloud/dataflow) + + + + +dataflow client for Node.js + + +A comprehensive list of changes in each version may be found in +[the CHANGELOG](https://github.com/googleapis/nodejs-dataflow/blob/main/CHANGELOG.md). + +* [Dataflow Node.js Client API Reference][client-docs] +* [Dataflow Documentation][product-docs] +* [github.com/googleapis/nodejs-dataflow](https://github.com/googleapis/nodejs-dataflow) + +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 Dataflow 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/dataflow +``` + + +### Using the client library + +```javascript +// Imports the Google Cloud client library + +const {TemplatesServiceClient} = require('@google-cloud/dataflow'); + +// TODO(developer): replace with your prefered project ID. +// const projectId = 'my-project' +// TODO(developer): replace with your bucket path. +// const gcsPath = 'gs:///path' + +// Creates a client +const client = new TemplatesServiceClient(); + +//TODO(library generator): write the actual function you will be testing +async function getTemplate() { + const template = await client.getTemplate({ + projectId, + gcsPath, + }); + console.info(template); +} +getTemplate(); + +``` + + + +## Samples + +Samples are in the [`samples/`](https://github.com/googleapis/nodejs-dataflow/tree/main/samples) directory. Each sample's `README.md` has instructions for running its sample. + +| Sample | Source Code | Try it | +| --------------------------- | --------------------------------- | ------ | +| Quickstart | [source code](https://github.com/googleapis/nodejs-dataflow/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-dataflow&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) | + + + +The [Dataflow 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/dataflow@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 in **preview**. This means it is still a +work-in-progress and under active development. Any release is subject to +backwards-incompatible changes at any time. + + +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-dataflow/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-dataflow/blob/main/LICENSE) + +[client-docs]: https://cloud.google.com/nodejs/docs/reference/dataflow/latest +[product-docs]: https://cloud.google.com/dataflow/ +[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=dataflow.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/getting-started diff --git a/packages/google-dataflow/linkinator.config.json b/packages/google-dataflow/linkinator.config.json new file mode 100644 index 00000000000..befd23c8633 --- /dev/null +++ b/packages/google-dataflow/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-dataflow/package.json b/packages/google-dataflow/package.json new file mode 100644 index 00000000000..8fe0d344188 --- /dev/null +++ b/packages/google-dataflow/package.json @@ -0,0 +1,66 @@ +{ + "name": "@google-cloud/dataflow", + "version": "2.0.1", + "description": "dataflow client for Node.js", + "repository": "googleapis/nodejs-dataflow", + "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 dataflow", + "dataflow", + "dataflow 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-dataflow/protos/google/dataflow/v1beta3/environment.proto b/packages/google-dataflow/protos/google/dataflow/v1beta3/environment.proto new file mode 100644 index 00000000000..04ad7d78e77 --- /dev/null +++ b/packages/google-dataflow/protos/google/dataflow/v1beta3/environment.proto @@ -0,0 +1,554 @@ +// 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.dataflow.v1beta3; + +import "google/api/field_behavior.proto"; +import "google/protobuf/any.proto"; +import "google/protobuf/struct.proto"; + +option csharp_namespace = "Google.Cloud.Dataflow.V1Beta3"; +option go_package = "google.golang.org/genproto/googleapis/dataflow/v1beta3;dataflow"; +option java_multiple_files = true; +option java_outer_classname = "EnvironmentProto"; +option java_package = "com.google.dataflow.v1beta3"; +option php_namespace = "Google\\Cloud\\Dataflow\\V1beta3"; +option ruby_package = "Google::Cloud::Dataflow::V1beta3"; + +// Describes the environment in which a Dataflow Job runs. +message Environment { + // The prefix of the resources the system should use for temporary + // storage. The system will append the suffix "/temp-{JOBNAME} to + // this resource prefix, where {JOBNAME} is the value of the + // job_name field. The resulting bucket and object prefix is used + // as the prefix of the resources used to store temporary data + // needed during the job execution. NOTE: This will override the + // value in taskrunner_settings. + // The supported resource type is: + // + // Google Cloud Storage: + // + // storage.googleapis.com/{bucket}/{object} + // bucket.storage.googleapis.com/{object} + string temp_storage_prefix = 1; + + // The type of cluster manager API to use. If unknown or + // unspecified, the service will attempt to choose a reasonable + // default. This should be in the form of the API service name, + // e.g. "compute.googleapis.com". + string cluster_manager_api_service = 2; + + // The list of experiments to enable. This field should be used for SDK + // related experiments and not for service related experiments. The proper + // field for service related experiments is service_options. + repeated string experiments = 3; + + // The list of service options to enable. This field should be used for + // service related experiments only. These experiments, when graduating to GA, + // should be replaced by dedicated fields or become default (i.e. always on). + repeated string service_options = 16; + + // If set, contains the Cloud KMS key identifier used to encrypt data + // at rest, AKA a Customer Managed Encryption Key (CMEK). + // + // Format: + // projects/PROJECT_ID/locations/LOCATION/keyRings/KEY_RING/cryptoKeys/KEY + string service_kms_key_name = 12; + + // The worker pools. At least one "harness" worker pool must be + // specified in order for the job to have workers. + repeated WorkerPool worker_pools = 4; + + // A description of the process that generated the request. + google.protobuf.Struct user_agent = 5; + + // A structure describing which components and their versions of the service + // are required in order to run the job. + google.protobuf.Struct version = 6; + + // The dataset for the current project where various workflow + // related tables are stored. + // + // The supported resource type is: + // + // Google BigQuery: + // bigquery.googleapis.com/{dataset} + string dataset = 7; + + // The Cloud Dataflow SDK pipeline options specified by the user. These + // options are passed through the service and are used to recreate the + // SDK pipeline options on the worker in a language agnostic and platform + // independent way. + google.protobuf.Struct sdk_pipeline_options = 8; + + // Experimental settings. + google.protobuf.Any internal_experiments = 9; + + // Identity to run virtual machines as. Defaults to the default account. + string service_account_email = 10; + + // Which Flexible Resource Scheduling mode to run in. + FlexResourceSchedulingGoal flex_resource_scheduling_goal = 11; + + // The Compute Engine region + // (https://cloud.google.com/compute/docs/regions-zones/regions-zones) in + // which worker processing should occur, e.g. "us-west1". Mutually exclusive + // with worker_zone. If neither worker_region nor worker_zone is specified, + // default to the control plane's region. + string worker_region = 13; + + // The Compute Engine zone + // (https://cloud.google.com/compute/docs/regions-zones/regions-zones) in + // which worker processing should occur, e.g. "us-west1-a". Mutually exclusive + // with worker_region. If neither worker_region nor worker_zone is specified, + // a zone in the control plane's region is chosen based on available capacity. + string worker_zone = 14; + + // Output only. The shuffle mode used for the job. + ShuffleMode shuffle_mode = 15 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Any debugging options to be supplied to the job. + DebugOptions debug_options = 17; +} + +// The packages that must be installed in order for a worker to run the +// steps of the Cloud Dataflow job that will be assigned to its worker +// pool. +// +// This is the mechanism by which the Cloud Dataflow SDK causes code to +// be loaded onto the workers. For example, the Cloud Dataflow Java SDK +// might use this to install jars containing the user's code and all of the +// various dependencies (libraries, data files, etc.) required in order +// for that code to run. +message Package { + // The name of the package. + string name = 1; + + // The resource to read the package from. The supported resource type is: + // + // Google Cloud Storage: + // + // storage.googleapis.com/{bucket} + // bucket.storage.googleapis.com/ + string location = 2; +} + +// Specifies the processing model used by a +// [google.dataflow.v1beta3.Job], which determines the way the Job is +// managed by the Cloud Dataflow service (how workers are scheduled, how +// inputs are sharded, etc). +enum JobType { + // The type of the job is unspecified, or unknown. + JOB_TYPE_UNKNOWN = 0; + + // A batch job with a well-defined end point: data is read, data is + // processed, data is written, and the job is done. + JOB_TYPE_BATCH = 1; + + // A continuously streaming job with no end: data is read, + // processed, and written continuously. + JOB_TYPE_STREAMING = 2; +} + +// Specifies the resource to optimize for in Flexible Resource Scheduling. +enum FlexResourceSchedulingGoal { + // Run in the default mode. + FLEXRS_UNSPECIFIED = 0; + + // Optimize for lower execution time. + FLEXRS_SPEED_OPTIMIZED = 1; + + // Optimize for lower cost. + FLEXRS_COST_OPTIMIZED = 2; +} + +// Describes the data disk used by a workflow job. +message Disk { + // Size of disk in GB. If zero or unspecified, the service will + // attempt to choose a reasonable default. + int32 size_gb = 1; + + // Disk storage type, as defined by Google Compute Engine. This + // must be a disk type appropriate to the project and zone in which + // the workers will run. If unknown or unspecified, the service + // will attempt to choose a reasonable default. + // + // For example, the standard persistent disk type is a resource name + // typically ending in "pd-standard". If SSD persistent disks are + // available, the resource name typically ends with "pd-ssd". The + // actual valid values are defined the Google Compute Engine API, + // not by the Cloud Dataflow API; consult the Google Compute Engine + // documentation for more information about determining the set of + // available disk types for a particular project and zone. + // + // Google Compute Engine Disk types are local to a particular + // project in a particular zone, and so the resource name will + // typically look something like this: + // + // compute.googleapis.com/projects/project-id/zones/zone/diskTypes/pd-standard + string disk_type = 2; + + // Directory in a VM where disk is mounted. + string mount_point = 3; +} + +// Provides data to pass through to the worker harness. +message WorkerSettings { + // The base URL for accessing Google Cloud APIs. + // + // When workers access Google Cloud APIs, they logically do so via + // relative URLs. If this field is specified, it supplies the base + // URL to use for resolving these relative URLs. The normative + // algorithm used is defined by RFC 1808, "Relative Uniform Resource + // Locators". + // + // If not specified, the default value is "http://www.googleapis.com/" + string base_url = 1; + + // Whether to send work progress updates to the service. + bool reporting_enabled = 2; + + // The Cloud Dataflow service path relative to the root URL, for example, + // "dataflow/v1b3/projects". + string service_path = 3; + + // The Shuffle service path relative to the root URL, for example, + // "shuffle/v1beta1". + string shuffle_service_path = 4; + + // The ID of the worker running this pipeline. + string worker_id = 5; + + // The prefix of the resources the system should use for temporary + // storage. + // + // The supported resource type is: + // + // Google Cloud Storage: + // + // storage.googleapis.com/{bucket}/{object} + // bucket.storage.googleapis.com/{object} + string temp_storage_prefix = 6; +} + +// Taskrunner configuration settings. +message TaskRunnerSettings { + // The UNIX user ID on the worker VM to use for tasks launched by + // taskrunner; e.g. "root". + string task_user = 1; + + // The UNIX group ID on the worker VM to use for tasks launched by + // taskrunner; e.g. "wheel". + string task_group = 2; + + // The OAuth2 scopes to be requested by the taskrunner in order to + // access the Cloud Dataflow API. + repeated string oauth_scopes = 3; + + // The base URL for the taskrunner to use when accessing Google Cloud APIs. + // + // When workers access Google Cloud APIs, they logically do so via + // relative URLs. If this field is specified, it supplies the base + // URL to use for resolving these relative URLs. The normative + // algorithm used is defined by RFC 1808, "Relative Uniform Resource + // Locators". + // + // If not specified, the default value is "http://www.googleapis.com/" + string base_url = 4; + + // The API version of endpoint, e.g. "v1b3" + string dataflow_api_version = 5; + + // The settings to pass to the parallel worker harness. + WorkerSettings parallel_worker_settings = 6; + + // The location on the worker for task-specific subdirectories. + string base_task_dir = 7; + + // Whether to continue taskrunner if an exception is hit. + bool continue_on_exception = 8; + + // Whether to send taskrunner log info to Google Compute Engine VM serial + // console. + bool log_to_serialconsole = 9; + + // Whether to also send taskrunner log info to stderr. + bool alsologtostderr = 10; + + // Indicates where to put logs. If this is not specified, the logs + // will not be uploaded. + // + // The supported resource type is: + // + // Google Cloud Storage: + // storage.googleapis.com/{bucket}/{object} + // bucket.storage.googleapis.com/{object} + string log_upload_location = 11; + + // The directory on the VM to store logs. + string log_dir = 12; + + // The prefix of the resources the taskrunner should use for + // temporary storage. + // + // The supported resource type is: + // + // Google Cloud Storage: + // storage.googleapis.com/{bucket}/{object} + // bucket.storage.googleapis.com/{object} + string temp_storage_prefix = 13; + + // The command to launch the worker harness. + string harness_command = 14; + + // The file to store the workflow in. + string workflow_file_name = 15; + + // The file to store preprocessing commands in. + string commandlines_file_name = 16; + + // The ID string of the VM. + string vm_id = 17; + + // The suggested backend language. + string language_hint = 18; + + // The streaming worker main class name. + string streaming_worker_main_class = 19; +} + +// Specifies what happens to a resource when a Cloud Dataflow +// [google.dataflow.v1beta3.Job][google.dataflow.v1beta3.Job] has completed. +enum TeardownPolicy { + // The teardown policy isn't specified, or is unknown. + TEARDOWN_POLICY_UNKNOWN = 0; + + // Always teardown the resource. + TEARDOWN_ALWAYS = 1; + + // Teardown the resource on success. This is useful for debugging + // failures. + TEARDOWN_ON_SUCCESS = 2; + + // Never teardown the resource. This is useful for debugging and + // development. + TEARDOWN_NEVER = 3; +} + +// The default set of packages to be staged on a pool of workers. +enum DefaultPackageSet { + // The default set of packages to stage is unknown, or unspecified. + DEFAULT_PACKAGE_SET_UNKNOWN = 0; + + // Indicates that no packages should be staged at the worker unless + // explicitly specified by the job. + DEFAULT_PACKAGE_SET_NONE = 1; + + // Stage packages typically useful to workers written in Java. + DEFAULT_PACKAGE_SET_JAVA = 2; + + // Stage packages typically useful to workers written in Python. + DEFAULT_PACKAGE_SET_PYTHON = 3; +} + +// Specifies the algorithm used to determine the number of worker +// processes to run at any given point in time, based on the amount of +// data left to process, the number of workers, and how quickly +// existing workers are processing data. +enum AutoscalingAlgorithm { + // The algorithm is unknown, or unspecified. + AUTOSCALING_ALGORITHM_UNKNOWN = 0; + + // Disable autoscaling. + AUTOSCALING_ALGORITHM_NONE = 1; + + // Increase worker count over time to reduce job execution time. + AUTOSCALING_ALGORITHM_BASIC = 2; +} + +// Settings for WorkerPool autoscaling. +message AutoscalingSettings { + // The algorithm to use for autoscaling. + AutoscalingAlgorithm algorithm = 1; + + // The maximum number of workers to cap scaling at. + int32 max_num_workers = 2; +} + +// Specifies how IP addresses should be allocated to the worker machines. +enum WorkerIPAddressConfiguration { + // The configuration is unknown, or unspecified. + WORKER_IP_UNSPECIFIED = 0; + + // Workers should have public IP addresses. + WORKER_IP_PUBLIC = 1; + + // Workers should have private IP addresses. + WORKER_IP_PRIVATE = 2; +} + +// Defines a SDK harness container for executing Dataflow pipelines. +message SdkHarnessContainerImage { + // A docker container image that resides in Google Container Registry. + string container_image = 1; + + // If true, recommends the Dataflow service to use only one core per SDK + // container instance with this image. If false (or unset) recommends using + // more than one core per SDK container instance with this image for + // efficiency. Note that Dataflow service may choose to override this property + // if needed. + bool use_single_core_per_container = 2; + + // Environment ID for the Beam runner API proto Environment that corresponds + // to the current SDK Harness. + string environment_id = 3; + + // The set of capabilities enumerated in the above Environment proto. See also + // https://github.com/apache/beam/blob/master/model/pipeline/src/main/proto/beam_runner_api.proto + repeated string capabilities = 4; +} + +// Describes one particular pool of Cloud Dataflow workers to be +// instantiated by the Cloud Dataflow service in order to perform the +// computations required by a job. Note that a workflow job may use +// multiple pools, in order to match the various computational +// requirements of the various stages of the job. +message WorkerPool { + // The kind of the worker pool; currently only `harness` and `shuffle` + // are supported. + string kind = 1; + + // Number of Google Compute Engine workers in this pool needed to + // execute the job. If zero or unspecified, the service will + // attempt to choose a reasonable default. + int32 num_workers = 2; + + // Packages to be installed on workers. + repeated Package packages = 3; + + // The default package set to install. This allows the service to + // select a default set of packages which are useful to worker + // harnesses written in a particular language. + DefaultPackageSet default_package_set = 4; + + // Machine type (e.g. "n1-standard-1"). If empty or unspecified, the + // service will attempt to choose a reasonable default. + string machine_type = 5; + + // Sets the policy for determining when to turndown worker pool. + // Allowed values are: `TEARDOWN_ALWAYS`, `TEARDOWN_ON_SUCCESS`, and + // `TEARDOWN_NEVER`. + // `TEARDOWN_ALWAYS` means workers are always torn down regardless of whether + // the job succeeds. `TEARDOWN_ON_SUCCESS` means workers are torn down + // if the job succeeds. `TEARDOWN_NEVER` means the workers are never torn + // down. + // + // If the workers are not torn down by the service, they will + // continue to run and use Google Compute Engine VM resources in the + // user's project until they are explicitly terminated by the user. + // Because of this, Google recommends using the `TEARDOWN_ALWAYS` + // policy except for small, manually supervised test jobs. + // + // If unknown or unspecified, the service will attempt to choose a reasonable + // default. + TeardownPolicy teardown_policy = 6; + + // Size of root disk for VMs, in GB. If zero or unspecified, the service will + // attempt to choose a reasonable default. + int32 disk_size_gb = 7; + + // Type of root disk for VMs. If empty or unspecified, the service will + // attempt to choose a reasonable default. + string disk_type = 16; + + // Fully qualified source image for disks. + string disk_source_image = 8; + + // Zone to run the worker pools in. If empty or unspecified, the service + // will attempt to choose a reasonable default. + string zone = 9; + + // Settings passed through to Google Compute Engine workers when + // using the standard Dataflow task runner. Users should ignore + // this field. + TaskRunnerSettings taskrunner_settings = 10; + + // The action to take on host maintenance, as defined by the Google + // Compute Engine API. + string on_host_maintenance = 11; + + // Data disks that are used by a VM in this workflow. + repeated Disk data_disks = 12; + + // Metadata to set on the Google Compute Engine VMs. + map metadata = 13; + + // Settings for autoscaling of this WorkerPool. + AutoscalingSettings autoscaling_settings = 14; + + // Extra arguments for this worker pool. + google.protobuf.Any pool_args = 15; + + // Network to which VMs will be assigned. If empty or unspecified, + // the service will use the network "default". + string network = 17; + + // Subnetwork to which VMs will be assigned, if desired. Expected to be of + // the form "regions/REGION/subnetworks/SUBNETWORK". + string subnetwork = 19; + + // Required. Docker container image that executes the Cloud Dataflow worker + // harness, residing in Google Container Registry. + // + // Deprecated for the Fn API path. Use sdk_harness_container_images instead. + string worker_harness_container_image = 18; + + // The number of threads per worker harness. If empty or unspecified, the + // service will choose a number of threads (according to the number of cores + // on the selected machine type for batch, or 1 by convention for streaming). + int32 num_threads_per_worker = 20; + + // Configuration for VM IPs. + WorkerIPAddressConfiguration ip_configuration = 21; + + // Set of SDK harness containers needed to execute this pipeline. This will + // only be set in the Fn API path. For non-cross-language pipelines this + // should have only one entry. Cross-language pipelines will have two or more + // entries. + repeated SdkHarnessContainerImage sdk_harness_container_images = 22; +} + +// Specifies the shuffle mode used by a +// [google.dataflow.v1beta3.Job], which determines the approach data is shuffled +// during processing. More details in: +// https://cloud.google.com/dataflow/docs/guides/deploying-a-pipeline#dataflow-shuffle +enum ShuffleMode { + // Shuffle mode information is not available. + SHUFFLE_MODE_UNSPECIFIED = 0; + + // Shuffle is done on the worker VMs. + VM_BASED = 1; + + // Shuffle is done on the service side. + SERVICE_BASED = 2; +} + +// Describes any options that have an effect on the debugging of pipelines. +message DebugOptions { + // When true, enables the logging of the literal hot key to the user's Cloud + // Logging. + bool enable_hot_key_logging = 1; +} diff --git a/packages/google-dataflow/protos/google/dataflow/v1beta3/jobs.proto b/packages/google-dataflow/protos/google/dataflow/v1beta3/jobs.proto new file mode 100644 index 00000000000..359b78732ea --- /dev/null +++ b/packages/google-dataflow/protos/google/dataflow/v1beta3/jobs.proto @@ -0,0 +1,926 @@ +// 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.dataflow.v1beta3; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/dataflow/v1beta3/environment.proto"; +import "google/dataflow/v1beta3/snapshots.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/struct.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.Dataflow.V1Beta3"; +option go_package = "google.golang.org/genproto/googleapis/dataflow/v1beta3;dataflow"; +option java_multiple_files = true; +option java_outer_classname = "JobsProto"; +option java_package = "com.google.dataflow.v1beta3"; +option php_namespace = "Google\\Cloud\\Dataflow\\V1beta3"; +option ruby_package = "Google::Cloud::Dataflow::V1beta3"; + +// Provides a method to create and modify Google Cloud Dataflow jobs. +// A Job is a multi-stage computation graph run by the Cloud Dataflow service. +service JobsV1Beta3 { + option (google.api.default_host) = "dataflow.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/compute," + "https://www.googleapis.com/auth/compute.readonly," + "https://www.googleapis.com/auth/userinfo.email"; + + // Creates a Cloud Dataflow job. + // + // To create a job, we recommend using `projects.locations.jobs.create` with a + // [regional endpoint] + // (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints). Using + // `projects.jobs.create` is not recommended, as your job will always start + // in `us-central1`. + rpc CreateJob(CreateJobRequest) returns (Job) { + option (google.api.http) = { + post: "/v1b3/projects/{project_id}/locations/{location}/jobs" + body: "job" + additional_bindings { + post: "/v1b3/projects/{project_id}/jobs" + body: "job" + } + }; + } + + // Gets the state of the specified Cloud Dataflow job. + // + // To get the state of a job, we recommend using `projects.locations.jobs.get` + // with a [regional endpoint] + // (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints). Using + // `projects.jobs.get` is not recommended, as you can only get the state of + // jobs that are running in `us-central1`. + rpc GetJob(GetJobRequest) returns (Job) { + option (google.api.http) = { + get: "/v1b3/projects/{project_id}/locations/{location}/jobs/{job_id}" + additional_bindings { + get: "/v1b3/projects/{project_id}/jobs/{job_id}" + } + }; + } + + // Updates the state of an existing Cloud Dataflow job. + // + // To update the state of an existing job, we recommend using + // `projects.locations.jobs.update` with a [regional endpoint] + // (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints). Using + // `projects.jobs.update` is not recommended, as you can only update the state + // of jobs that are running in `us-central1`. + rpc UpdateJob(UpdateJobRequest) returns (Job) { + option (google.api.http) = { + put: "/v1b3/projects/{project_id}/locations/{location}/jobs/{job_id}" + body: "job" + additional_bindings { + put: "/v1b3/projects/{project_id}/jobs/{job_id}" + body: "job" + } + }; + } + + // List the jobs of a project. + // + // To list the jobs of a project in a region, we recommend using + // `projects.locations.jobs.list` with a [regional endpoint] + // (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints). To + // list the all jobs across all regions, use `projects.jobs.aggregated`. Using + // `projects.jobs.list` is not recommended, as you can only get the list of + // jobs that are running in `us-central1`. + rpc ListJobs(ListJobsRequest) returns (ListJobsResponse) { + option (google.api.http) = { + get: "/v1b3/projects/{project_id}/locations/{location}/jobs" + additional_bindings { + get: "/v1b3/projects/{project_id}/jobs" + } + }; + } + + // List the jobs of a project across all regions. + rpc AggregatedListJobs(ListJobsRequest) returns (ListJobsResponse) { + option (google.api.http) = { + get: "/v1b3/projects/{project_id}/jobs:aggregated" + }; + } + + // Check for existence of active jobs in the given project across all regions. + rpc CheckActiveJobs(CheckActiveJobsRequest) returns (CheckActiveJobsResponse) { + } + + // Snapshot the state of a streaming job. + rpc SnapshotJob(SnapshotJobRequest) returns (Snapshot) { + option (google.api.http) = { + post: "/v1b3/projects/{project_id}/locations/{location}/jobs/{job_id}:snapshot" + body: "*" + additional_bindings { + post: "/v1b3/projects/{project_id}/jobs/{job_id}:snapshot" + body: "*" + } + }; + } +} + +// Defines a job to be run by the Cloud Dataflow service. +message Job { + // The unique ID of this job. + // + // This field is set by the Cloud Dataflow service when the Job is + // created, and is immutable for the life of the job. + string id = 1; + + // The ID of the Cloud Platform project that the job belongs to. + string project_id = 2; + + // The user-specified Cloud Dataflow job name. + // + // Only one Job with a given name may exist in a project at any + // given time. If a caller attempts to create a Job with the same + // name as an already-existing Job, the attempt returns the + // existing Job. + // + // The name must match the regular expression + // `[a-z]([-a-z0-9]{0,1022}[a-z0-9])?` + string name = 3; + + // The type of Cloud Dataflow job. + JobType type = 4; + + // The environment for the job. + Environment environment = 5; + + // Exactly one of step or steps_location should be specified. + // + // The top-level steps that constitute the entire job. Only retrieved with + // JOB_VIEW_ALL. + repeated Step steps = 6; + + // The Cloud Storage location where the steps are stored. + string steps_location = 24; + + // The current state of the job. + // + // Jobs are created in the `JOB_STATE_STOPPED` state unless otherwise + // specified. + // + // A job in the `JOB_STATE_RUNNING` state may asynchronously enter a + // terminal state. After a job has reached a terminal state, no + // further state updates may be made. + // + // This field may be mutated by the Cloud Dataflow service; + // callers cannot mutate it. + JobState current_state = 7; + + // The timestamp associated with the current state. + google.protobuf.Timestamp current_state_time = 8; + + // The job's requested state. + // + // `UpdateJob` may be used to switch between the `JOB_STATE_STOPPED` and + // `JOB_STATE_RUNNING` states, by setting requested_state. `UpdateJob` may + // also be used to directly set a job's requested state to + // `JOB_STATE_CANCELLED` or `JOB_STATE_DONE`, irrevocably terminating the + // job if it has not already reached a terminal state. + JobState requested_state = 9; + + // Deprecated. + JobExecutionInfo execution_info = 10; + + // The timestamp when the job was initially created. Immutable and set by the + // Cloud Dataflow service. + google.protobuf.Timestamp create_time = 11; + + // If this job is an update of an existing job, this field is the job ID + // of the job it replaced. + // + // When sending a `CreateJobRequest`, you can update a job by specifying it + // here. The job named here is stopped, and its intermediate state is + // transferred to this job. + string replace_job_id = 12; + + // The map of transform name prefixes of the job to be replaced to the + // corresponding name prefixes of the new job. + map transform_name_mapping = 13; + + // The client's unique identifier of the job, re-used across retried attempts. + // If this field is set, the service will ensure its uniqueness. + // The request to create a job will fail if the service has knowledge of a + // previously submitted job with the same client's ID and job name. + // The caller may use this field to ensure idempotence of job + // creation across retried attempts to create a job. + // By default, the field is empty and, in that case, the service ignores it. + string client_request_id = 14; + + // If another job is an update of this job (and thus, this job is in + // `JOB_STATE_UPDATED`), this field contains the ID of that job. + string replaced_by_job_id = 15; + + // A set of files the system should be aware of that are used + // for temporary storage. These temporary files will be + // removed on job completion. + // No duplicates are allowed. + // No file patterns are supported. + // + // The supported files are: + // + // Google Cloud Storage: + // + // storage.googleapis.com/{bucket}/{object} + // bucket.storage.googleapis.com/{object} + repeated string temp_files = 16; + + // User-defined labels for this job. + // + // The labels map can contain no more than 64 entries. Entries of the labels + // map are UTF8 strings that comply with the following restrictions: + // + // * Keys must conform to regexp: [\p{Ll}\p{Lo}][\p{Ll}\p{Lo}\p{N}_-]{0,62} + // * Values must conform to regexp: [\p{Ll}\p{Lo}\p{N}_-]{0,63} + // * Both keys and values are additionally constrained to be <= 128 bytes in + // size. + map labels = 17; + + // The [regional endpoint] + // (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) that + // contains this job. + string location = 18; + + // Preliminary field: The format of this data may change at any time. + // A description of the user pipeline and stages through which it is executed. + // Created by Cloud Dataflow service. Only retrieved with + // JOB_VIEW_DESCRIPTION or JOB_VIEW_ALL. + PipelineDescription pipeline_description = 19; + + // This field may be mutated by the Cloud Dataflow service; + // callers cannot mutate it. + repeated ExecutionStageState stage_states = 20; + + // This field is populated by the Dataflow service to support filtering jobs + // by the metadata values provided here. Populated for ListJobs and all GetJob + // views SUMMARY and higher. + JobMetadata job_metadata = 21; + + // The timestamp when the job was started (transitioned to JOB_STATE_PENDING). + // Flexible resource scheduling jobs are started with some delay after job + // creation, so start_time is unset before start and is updated when the + // job is started by the Cloud Dataflow service. For other jobs, start_time + // always equals to create_time and is immutable and set by the Cloud Dataflow + // service. + google.protobuf.Timestamp start_time = 22; + + // If this is specified, the job's initial state is populated from the given + // snapshot. + string created_from_snapshot_id = 23; + + // Reserved for future use. This field is set only in responses from the + // server; it is ignored if it is set in any requests. + bool satisfies_pzs = 25; +} + +// Metadata for a Datastore connector used by the job. +message DatastoreIODetails { + // Namespace used in the connection. + string namespace = 1; + + // ProjectId accessed in the connection. + string project_id = 2; +} + +// Metadata for a Pub/Sub connector used by the job. +message PubSubIODetails { + // Topic accessed in the connection. + string topic = 1; + + // Subscription used in the connection. + string subscription = 2; +} + +// Metadata for a File connector used by the job. +message FileIODetails { + // File Pattern used to access files by the connector. + string file_pattern = 1; +} + +// Metadata for a Cloud Bigtable connector used by the job. +message BigTableIODetails { + // ProjectId accessed in the connection. + string project_id = 1; + + // InstanceId accessed in the connection. + string instance_id = 2; + + // TableId accessed in the connection. + string table_id = 3; +} + +// Metadata for a BigQuery connector used by the job. +message BigQueryIODetails { + // Table accessed in the connection. + string table = 1; + + // Dataset accessed in the connection. + string dataset = 2; + + // Project accessed in the connection. + string project_id = 3; + + // Query used to access data in the connection. + string query = 4; +} + +// Metadata for a Spanner connector used by the job. +message SpannerIODetails { + // ProjectId accessed in the connection. + string project_id = 1; + + // InstanceId accessed in the connection. + string instance_id = 2; + + // DatabaseId accessed in the connection. + string database_id = 3; +} + +// The version of the SDK used to run the job. +message SdkVersion { + // The support status of the SDK used to run the job. + enum SdkSupportStatus { + // Cloud Dataflow is unaware of this version. + UNKNOWN = 0; + + // This is a known version of an SDK, and is supported. + SUPPORTED = 1; + + // A newer version of the SDK family exists, and an update is recommended. + STALE = 2; + + // This version of the SDK is deprecated and will eventually be + // unsupported. + DEPRECATED = 3; + + // Support for this SDK version has ended and it should no longer be used. + UNSUPPORTED = 4; + } + + // The version of the SDK used to run the job. + string version = 1; + + // A readable string describing the version of the SDK. + string version_display_name = 2; + + // The support status for this SDK version. + SdkSupportStatus sdk_support_status = 3; +} + +// Metadata available primarily for filtering jobs. Will be included in the +// ListJob response and Job SUMMARY view. +message JobMetadata { + // The SDK version used to run the job. + SdkVersion sdk_version = 1; + + // Identification of a Spanner source used in the Dataflow job. + repeated SpannerIODetails spanner_details = 2; + + // Identification of a BigQuery source used in the Dataflow job. + repeated BigQueryIODetails bigquery_details = 3; + + // Identification of a Cloud Bigtable source used in the Dataflow job. + repeated BigTableIODetails big_table_details = 4; + + // Identification of a Pub/Sub source used in the Dataflow job. + repeated PubSubIODetails pubsub_details = 5; + + // Identification of a File source used in the Dataflow job. + repeated FileIODetails file_details = 6; + + // Identification of a Datastore source used in the Dataflow job. + repeated DatastoreIODetails datastore_details = 7; +} + +// A message describing the state of a particular execution stage. +message ExecutionStageState { + // The name of the execution stage. + string execution_stage_name = 1; + + // Executions stage states allow the same set of values as JobState. + JobState execution_stage_state = 2; + + // The time at which the stage transitioned to this state. + google.protobuf.Timestamp current_state_time = 3; +} + +// A descriptive representation of submitted pipeline as well as the executed +// form. This data is provided by the Dataflow service for ease of visualizing +// the pipeline and interpreting Dataflow provided metrics. +message PipelineDescription { + // Description of each transform in the pipeline and collections between them. + repeated TransformSummary original_pipeline_transform = 1; + + // Description of each stage of execution of the pipeline. + repeated ExecutionStageSummary execution_pipeline_stage = 2; + + // Pipeline level display data. + repeated DisplayData display_data = 3; +} + +// Type of transform or stage operation. +enum KindType { + // Unrecognized transform type. + UNKNOWN_KIND = 0; + + // ParDo transform. + PAR_DO_KIND = 1; + + // Group By Key transform. + GROUP_BY_KEY_KIND = 2; + + // Flatten transform. + FLATTEN_KIND = 3; + + // Read transform. + READ_KIND = 4; + + // Write transform. + WRITE_KIND = 5; + + // Constructs from a constant value, such as with Create.of. + CONSTANT_KIND = 6; + + // Creates a Singleton view of a collection. + SINGLETON_KIND = 7; + + // Opening or closing a shuffle session, often as part of a GroupByKey. + SHUFFLE_KIND = 8; +} + +// Description of the type, names/ids, and input/outputs for a transform. +message TransformSummary { + // Type of transform. + KindType kind = 1; + + // SDK generated id of this transform instance. + string id = 2; + + // User provided name for this transform instance. + string name = 3; + + // Transform-specific display data. + repeated DisplayData display_data = 4; + + // User names for all collection outputs to this transform. + repeated string output_collection_name = 5; + + // User names for all collection inputs to this transform. + repeated string input_collection_name = 6; +} + +// Description of the composing transforms, names/ids, and input/outputs of a +// stage of execution. Some composing transforms and sources may have been +// generated by the Dataflow service during execution planning. +message ExecutionStageSummary { + // Description of an input or output of an execution stage. + message StageSource { + // Human-readable name for this source; may be user or system generated. + string user_name = 1; + + // Dataflow service generated name for this source. + string name = 2; + + // User name for the original user transform or collection with which this + // source is most closely associated. + string original_transform_or_collection = 3; + + // Size of the source, if measurable. + int64 size_bytes = 4; + } + + // Description of a transform executed as part of an execution stage. + message ComponentTransform { + // Human-readable name for this transform; may be user or system generated. + string user_name = 1; + + // Dataflow service generated name for this source. + string name = 2; + + // User name for the original user transform with which this transform is + // most closely associated. + string original_transform = 3; + } + + // Description of an interstitial value between transforms in an execution + // stage. + message ComponentSource { + // Human-readable name for this transform; may be user or system generated. + string user_name = 1; + + // Dataflow service generated name for this source. + string name = 2; + + // User name for the original user transform or collection with which this + // source is most closely associated. + string original_transform_or_collection = 3; + } + + // Dataflow service generated name for this stage. + string name = 1; + + // Dataflow service generated id for this stage. + string id = 2; + + // Type of transform this stage is executing. + KindType kind = 3; + + // Input sources for this stage. + repeated StageSource input_source = 4; + + // Output sources for this stage. + repeated StageSource output_source = 5; + + // Other stages that must complete before this stage can run. + repeated string prerequisite_stage = 8; + + // Transforms that comprise this execution stage. + repeated ComponentTransform component_transform = 6; + + // Collections produced and consumed by component transforms of this stage. + repeated ComponentSource component_source = 7; +} + +// Data provided with a pipeline or transform to provide descriptive info. +message DisplayData { + // The key identifying the display data. + // This is intended to be used as a label for the display data + // when viewed in a dax monitoring system. + string key = 1; + + // The namespace for the key. This is usually a class name or programming + // language namespace (i.e. python module) which defines the display data. + // This allows a dax monitoring system to specially handle the data + // and perform custom rendering. + string namespace = 2; + + // Various value types which can be used for display data. Only one will be + // set. + oneof Value { + // Contains value if the data is of string type. + string str_value = 4; + + // Contains value if the data is of int64 type. + int64 int64_value = 5; + + // Contains value if the data is of float type. + float float_value = 6; + + // Contains value if the data is of java class type. + string java_class_value = 7; + + // Contains value if the data is of timestamp type. + google.protobuf.Timestamp timestamp_value = 8; + + // Contains value if the data is of duration type. + google.protobuf.Duration duration_value = 9; + + // Contains value if the data is of a boolean type. + bool bool_value = 10; + } + + // A possible additional shorter value to display. + // For example a java_class_name_value of com.mypackage.MyDoFn + // will be stored with MyDoFn as the short_str_value and + // com.mypackage.MyDoFn as the java_class_name value. + // short_str_value can be displayed and java_class_name_value + // will be displayed as a tooltip. + string short_str_value = 11; + + // An optional full URL. + string url = 12; + + // An optional label to display in a dax UI for the element. + string label = 13; +} + +// Defines a particular step within a Cloud Dataflow job. +// +// A job consists of multiple steps, each of which performs some +// specific operation as part of the overall job. Data is typically +// passed from one step to another as part of the job. +// +// Here's an example of a sequence of steps which together implement a +// Map-Reduce job: +// +// * Read a collection of data from some source, parsing the +// collection's elements. +// +// * Validate the elements. +// +// * Apply a user-defined function to map each element to some value +// and extract an element-specific key value. +// +// * Group elements with the same key into a single element with +// that key, transforming a multiply-keyed collection into a +// uniquely-keyed collection. +// +// * Write the elements out to some data sink. +// +// Note that the Cloud Dataflow service may be used to run many different +// types of jobs, not just Map-Reduce. +message Step { + // The kind of step in the Cloud Dataflow job. + string kind = 1; + + // The name that identifies the step. This must be unique for each + // step with respect to all other steps in the Cloud Dataflow job. + string name = 2; + + // Named properties associated with the step. Each kind of + // predefined step has its own required set of properties. + // Must be provided on Create. Only retrieved with JOB_VIEW_ALL. + google.protobuf.Struct properties = 3; +} + +// Describes the overall state of a [google.dataflow.v1beta3.Job][google.dataflow.v1beta3.Job]. +enum JobState { + // The job's run state isn't specified. + JOB_STATE_UNKNOWN = 0; + + // `JOB_STATE_STOPPED` indicates that the job has not + // yet started to run. + JOB_STATE_STOPPED = 1; + + // `JOB_STATE_RUNNING` indicates that the job is currently running. + JOB_STATE_RUNNING = 2; + + // `JOB_STATE_DONE` indicates that the job has successfully completed. + // This is a terminal job state. This state may be set by the Cloud Dataflow + // service, as a transition from `JOB_STATE_RUNNING`. It may also be set via a + // Cloud Dataflow `UpdateJob` call, if the job has not yet reached a terminal + // state. + JOB_STATE_DONE = 3; + + // `JOB_STATE_FAILED` indicates that the job has failed. This is a + // terminal job state. This state may only be set by the Cloud Dataflow + // service, and only as a transition from `JOB_STATE_RUNNING`. + JOB_STATE_FAILED = 4; + + // `JOB_STATE_CANCELLED` indicates that the job has been explicitly + // cancelled. This is a terminal job state. This state may only be + // set via a Cloud Dataflow `UpdateJob` call, and only if the job has not + // yet reached another terminal state. + JOB_STATE_CANCELLED = 5; + + // `JOB_STATE_UPDATED` indicates that the job was successfully updated, + // meaning that this job was stopped and another job was started, inheriting + // state from this one. This is a terminal job state. This state may only be + // set by the Cloud Dataflow service, and only as a transition from + // `JOB_STATE_RUNNING`. + JOB_STATE_UPDATED = 6; + + // `JOB_STATE_DRAINING` indicates that the job is in the process of draining. + // A draining job has stopped pulling from its input sources and is processing + // any data that remains in-flight. This state may be set via a Cloud Dataflow + // `UpdateJob` call, but only as a transition from `JOB_STATE_RUNNING`. Jobs + // that are draining may only transition to `JOB_STATE_DRAINED`, + // `JOB_STATE_CANCELLED`, or `JOB_STATE_FAILED`. + JOB_STATE_DRAINING = 7; + + // `JOB_STATE_DRAINED` indicates that the job has been drained. + // A drained job terminated by stopping pulling from its input sources and + // processing any data that remained in-flight when draining was requested. + // This state is a terminal state, may only be set by the Cloud Dataflow + // service, and only as a transition from `JOB_STATE_DRAINING`. + JOB_STATE_DRAINED = 8; + + // `JOB_STATE_PENDING` indicates that the job has been created but is not yet + // running. Jobs that are pending may only transition to `JOB_STATE_RUNNING`, + // or `JOB_STATE_FAILED`. + JOB_STATE_PENDING = 9; + + // `JOB_STATE_CANCELLING` indicates that the job has been explicitly cancelled + // and is in the process of stopping. Jobs that are cancelling may only + // transition to `JOB_STATE_CANCELLED` or `JOB_STATE_FAILED`. + JOB_STATE_CANCELLING = 10; + + // `JOB_STATE_QUEUED` indicates that the job has been created but is being + // delayed until launch. Jobs that are queued may only transition to + // `JOB_STATE_PENDING` or `JOB_STATE_CANCELLED`. + JOB_STATE_QUEUED = 11; + + // `JOB_STATE_RESOURCE_CLEANING_UP` indicates that the batch job's associated + // resources are currently being cleaned up after a successful run. + // Currently, this is an opt-in feature, please reach out to Cloud support + // team if you are interested. + JOB_STATE_RESOURCE_CLEANING_UP = 12; +} + +// Additional information about how a Cloud Dataflow job will be executed that +// isn't contained in the submitted job. +message JobExecutionInfo { + // A mapping from each stage to the information about that stage. + map stages = 1; +} + +// Contains information about how a particular +// [google.dataflow.v1beta3.Step][google.dataflow.v1beta3.Step] will be executed. +message JobExecutionStageInfo { + // The steps associated with the execution stage. + // Note that stages may have several steps, and that a given step + // might be run by more than one stage. + repeated string step_name = 1; +} + +// Selector for how much information is returned in Job responses. +enum JobView { + // The job view to return isn't specified, or is unknown. + // Responses will contain at least the `JOB_VIEW_SUMMARY` information, + // and may contain additional information. + JOB_VIEW_UNKNOWN = 0; + + // Request summary information only: + // Project ID, Job ID, job name, job type, job status, start/end time, + // and Cloud SDK version details. + JOB_VIEW_SUMMARY = 1; + + // Request all information available for this job. + JOB_VIEW_ALL = 2; + + // Request summary info and limited job description data for steps, labels and + // environment. + JOB_VIEW_DESCRIPTION = 3; +} + +// Request to create a Cloud Dataflow job. +message CreateJobRequest { + // The ID of the Cloud Platform project that the job belongs to. + string project_id = 1; + + // The job to create. + Job job = 2; + + // The level of information requested in response. + JobView view = 3; + + // Deprecated. This field is now in the Job message. + string replace_job_id = 4; + + // The [regional endpoint] + // (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) that + // contains this job. + string location = 5; +} + +// Request to get the state of a Cloud Dataflow job. +message GetJobRequest { + // The ID of the Cloud Platform project that the job belongs to. + string project_id = 1; + + // The job ID. + string job_id = 2; + + // The level of information requested in response. + JobView view = 3; + + // The [regional endpoint] + // (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) that + // contains this job. + string location = 4; +} + +// Request to update a Cloud Dataflow job. +message UpdateJobRequest { + // The ID of the Cloud Platform project that the job belongs to. + string project_id = 1; + + // The job ID. + string job_id = 2; + + // The updated job. + // Only the job state is updatable; other fields will be ignored. + Job job = 3; + + // The [regional endpoint] + // (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) that + // contains this job. + string location = 4; +} + +// Request to list Cloud Dataflow jobs. +message ListJobsRequest { + // This field filters out and returns jobs in the specified job state. The + // order of data returned is determined by the filter used, and is subject to + // change. + enum Filter { + // The filter isn't specified, or is unknown. This returns all jobs ordered + // on descending `JobUuid`. + UNKNOWN = 0; + + // Returns all running jobs first ordered on creation timestamp, then + // returns all terminated jobs ordered on the termination timestamp. + ALL = 1; + + // Filters the jobs that have a terminated state, ordered on the + // termination timestamp. Example terminated states: `JOB_STATE_STOPPED`, + // `JOB_STATE_UPDATED`, `JOB_STATE_DRAINED`, etc. + TERMINATED = 2; + + // Filters the jobs that are running ordered on the creation timestamp. + ACTIVE = 3; + } + + // The kind of filter to use. + Filter filter = 5; + + // The project which owns the jobs. + string project_id = 1; + + // Deprecated. ListJobs always returns summaries now. + // Use GetJob for other JobViews. + JobView view = 2 [deprecated = true]; + + // If there are many jobs, limit response to at most this many. + // The actual number of jobs returned will be the lesser of max_responses + // and an unspecified server-defined limit. + int32 page_size = 3; + + // Set this to the 'next_page_token' field of a previous response + // to request additional results in a long list. + string page_token = 4; + + // The [regional endpoint] + // (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) that + // contains this job. + string location = 17; +} + +// Indicates which [regional endpoint] +// (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) failed +// to respond to a request for data. +message FailedLocation { + // The name of the [regional endpoint] + // (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) that + // failed to respond. + string name = 1; +} + +// Response to a request to list Cloud Dataflow jobs in a project. This might +// be a partial response, depending on the page size in the ListJobsRequest. +// However, if the project does not have any jobs, an instance of +// ListJobsResponse is not returned and the requests's response +// body is empty {}. +message ListJobsResponse { + // A subset of the requested job information. + repeated Job jobs = 1; + + // Set if there may be more results than fit in this response. + string next_page_token = 2; + + // Zero or more messages describing the [regional endpoints] + // (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) that + // failed to respond. + repeated FailedLocation failed_location = 3; +} + +// Request to create a snapshot of a job. +message SnapshotJobRequest { + // The project which owns the job to be snapshotted. + string project_id = 1; + + // The job to be snapshotted. + string job_id = 2; + + // TTL for the snapshot. + google.protobuf.Duration ttl = 3; + + // The location that contains this job. + string location = 4; + + // If true, perform snapshots for sources which support this. + bool snapshot_sources = 5; + + // User specified description of the snapshot. Maybe empty. + string description = 6; +} + +// Request to check is active jobs exists for a project +message CheckActiveJobsRequest { + // The project which owns the jobs. + string project_id = 1; +} + +// Response for CheckActiveJobsRequest. +message CheckActiveJobsResponse { + // If True, active jobs exists for project. False otherwise. + bool active_jobs_exist = 1; +} diff --git a/packages/google-dataflow/protos/google/dataflow/v1beta3/messages.proto b/packages/google-dataflow/protos/google/dataflow/v1beta3/messages.proto new file mode 100644 index 00000000000..f8d151ecef1 --- /dev/null +++ b/packages/google-dataflow/protos/google/dataflow/v1beta3/messages.proto @@ -0,0 +1,238 @@ +// 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.dataflow.v1beta3; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/protobuf/struct.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.Dataflow.V1Beta3"; +option go_package = "google.golang.org/genproto/googleapis/dataflow/v1beta3;dataflow"; +option java_multiple_files = true; +option java_outer_classname = "MessagesProto"; +option java_package = "com.google.dataflow.v1beta3"; +option php_namespace = "Google\\Cloud\\Dataflow\\V1beta3"; +option ruby_package = "Google::Cloud::Dataflow::V1beta3"; + +// The Dataflow Messages API is used for monitoring the progress of +// Dataflow jobs. +service MessagesV1Beta3 { + option (google.api.default_host) = "dataflow.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/compute," + "https://www.googleapis.com/auth/compute.readonly," + "https://www.googleapis.com/auth/userinfo.email"; + + // Request the job status. + // + // To request the status of a job, we recommend using + // `projects.locations.jobs.messages.list` with a [regional endpoint] + // (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints). Using + // `projects.jobs.messages.list` is not recommended, as you can only request + // the status of jobs that are running in `us-central1`. + rpc ListJobMessages(ListJobMessagesRequest) returns (ListJobMessagesResponse) { + option (google.api.http) = { + get: "/v1b3/projects/{project_id}/locations/{location}/jobs/{job_id}/messages" + additional_bindings { + get: "/v1b3/projects/{project_id}/jobs/{job_id}/messages" + } + }; + } +} + +// A particular message pertaining to a Dataflow job. +message JobMessage { + // Deprecated. + string id = 1; + + // The timestamp of the message. + google.protobuf.Timestamp time = 2; + + // The text of the message. + string message_text = 3; + + // Importance level of the message. + JobMessageImportance message_importance = 4; +} + +// Indicates the importance of the message. +enum JobMessageImportance { + // The message importance isn't specified, or is unknown. + JOB_MESSAGE_IMPORTANCE_UNKNOWN = 0; + + // The message is at the 'debug' level: typically only useful for + // software engineers working on the code the job is running. + // Typically, Dataflow pipeline runners do not display log messages + // at this level by default. + JOB_MESSAGE_DEBUG = 1; + + // The message is at the 'detailed' level: somewhat verbose, but + // potentially useful to users. Typically, Dataflow pipeline + // runners do not display log messages at this level by default. + // These messages are displayed by default in the Dataflow + // monitoring UI. + JOB_MESSAGE_DETAILED = 2; + + // The message is at the 'basic' level: useful for keeping + // track of the execution of a Dataflow pipeline. Typically, + // Dataflow pipeline runners display log messages at this level by + // default, and these messages are displayed by default in the + // Dataflow monitoring UI. + JOB_MESSAGE_BASIC = 5; + + // The message is at the 'warning' level: indicating a condition + // pertaining to a job which may require human intervention. + // Typically, Dataflow pipeline runners display log messages at this + // level by default, and these messages are displayed by default in + // the Dataflow monitoring UI. + JOB_MESSAGE_WARNING = 3; + + // The message is at the 'error' level: indicating a condition + // preventing a job from succeeding. Typically, Dataflow pipeline + // runners display log messages at this level by default, and these + // messages are displayed by default in the Dataflow monitoring UI. + JOB_MESSAGE_ERROR = 4; +} + +// A rich message format, including a human readable string, a key for +// identifying the message, and structured data associated with the message for +// programmatic consumption. +message StructuredMessage { + // Structured data associated with this message. + message Parameter { + // Key or name for this parameter. + string key = 1; + + // Value for this parameter. + google.protobuf.Value value = 2; + } + + // Human-readable version of message. + string message_text = 1; + + // Identifier for this message type. Used by external systems to + // internationalize or personalize message. + string message_key = 2; + + // The structured data associated with this message. + repeated Parameter parameters = 3; +} + +// A structured message reporting an autoscaling decision made by the Dataflow +// service. +message AutoscalingEvent { + // Indicates the type of autoscaling event. + enum AutoscalingEventType { + // Default type for the enum. Value should never be returned. + TYPE_UNKNOWN = 0; + + // The TARGET_NUM_WORKERS_CHANGED type should be used when the target + // worker pool size has changed at the start of an actuation. An event + // should always be specified as TARGET_NUM_WORKERS_CHANGED if it reflects + // a change in the target_num_workers. + TARGET_NUM_WORKERS_CHANGED = 1; + + // The CURRENT_NUM_WORKERS_CHANGED type should be used when actual worker + // pool size has been changed, but the target_num_workers has not changed. + CURRENT_NUM_WORKERS_CHANGED = 2; + + // The ACTUATION_FAILURE type should be used when we want to report + // an error to the user indicating why the current number of workers + // in the pool could not be changed. + // Displayed in the current status and history widgets. + ACTUATION_FAILURE = 3; + + // Used when we want to report to the user a reason why we are + // not currently adjusting the number of workers. + // Should specify both target_num_workers, current_num_workers and a + // decision_message. + NO_CHANGE = 4; + } + + // The current number of workers the job has. + int64 current_num_workers = 1; + + // The target number of workers the worker pool wants to resize to use. + int64 target_num_workers = 2; + + // The type of autoscaling event to report. + AutoscalingEventType event_type = 3; + + // A message describing why the system decided to adjust the current + // number of workers, why it failed, or why the system decided to + // not make any changes to the number of workers. + StructuredMessage description = 4; + + // The time this event was emitted to indicate a new target or current + // num_workers value. + google.protobuf.Timestamp time = 5; + + // A short and friendly name for the worker pool this event refers to. + string worker_pool = 7; +} + +// Request to list job messages. +// Up to max_results messages will be returned in the time range specified +// starting with the oldest messages first. If no time range is specified +// the results with start with the oldest message. +message ListJobMessagesRequest { + // A project id. + string project_id = 1; + + // The job to get messages about. + string job_id = 2; + + // Filter to only get messages with importance >= level + JobMessageImportance minimum_importance = 3; + + // If specified, determines the maximum number of messages to + // return. If unspecified, the service may choose an appropriate + // default, or may return an arbitrarily large number of results. + int32 page_size = 4; + + // If supplied, this should be the value of next_page_token returned + // by an earlier call. This will cause the next page of results to + // be returned. + string page_token = 5; + + // If specified, return only messages with timestamps >= start_time. + // The default is the job creation time (i.e. beginning of messages). + google.protobuf.Timestamp start_time = 6; + + // Return only messages with timestamps < end_time. The default is now + // (i.e. return up to the latest messages available). + google.protobuf.Timestamp end_time = 7; + + // The [regional endpoint] + // (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) that + // contains the job specified by job_id. + string location = 8; +} + +// Response to a request to list job messages. +message ListJobMessagesResponse { + // Messages in ascending timestamp order. + repeated JobMessage job_messages = 1; + + // The token to obtain the next page of results if there are more. + string next_page_token = 2; + + // Autoscaling events in ascending timestamp order. + repeated AutoscalingEvent autoscaling_events = 3; +} diff --git a/packages/google-dataflow/protos/google/dataflow/v1beta3/metrics.proto b/packages/google-dataflow/protos/google/dataflow/v1beta3/metrics.proto new file mode 100644 index 00000000000..823eeb7af31 --- /dev/null +++ b/packages/google-dataflow/protos/google/dataflow/v1beta3/metrics.proto @@ -0,0 +1,369 @@ +// 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.dataflow.v1beta3; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/protobuf/struct.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.Dataflow.V1Beta3"; +option go_package = "google.golang.org/genproto/googleapis/dataflow/v1beta3;dataflow"; +option java_multiple_files = true; +option java_outer_classname = "MetricsProto"; +option java_package = "com.google.dataflow.v1beta3"; +option php_namespace = "Google\\Cloud\\Dataflow\\V1beta3"; +option ruby_package = "Google::Cloud::Dataflow::V1beta3"; + +// The Dataflow Metrics API lets you monitor the progress of Dataflow +// jobs. +service MetricsV1Beta3 { + option (google.api.default_host) = "dataflow.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/compute," + "https://www.googleapis.com/auth/compute.readonly," + "https://www.googleapis.com/auth/userinfo.email"; + + // Request the job status. + // + // To request the status of a job, we recommend using + // `projects.locations.jobs.getMetrics` with a [regional endpoint] + // (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints). Using + // `projects.jobs.getMetrics` is not recommended, as you can only request the + // status of jobs that are running in `us-central1`. + rpc GetJobMetrics(GetJobMetricsRequest) returns (JobMetrics) { + option (google.api.http) = { + get: "/v1b3/projects/{project_id}/locations/{location}/jobs/{job_id}/metrics" + additional_bindings { + get: "/v1b3/projects/{project_id}/jobs/{job_id}/metrics" + } + }; + } + + // Request detailed information about the execution status of the job. + // + // EXPERIMENTAL. This API is subject to change or removal without notice. + rpc GetJobExecutionDetails(GetJobExecutionDetailsRequest) returns (JobExecutionDetails) { + option (google.api.http) = { + get: "/v1b3/projects/{project_id}/locations/{location}/jobs/{job_id}/executionDetails" + }; + } + + // Request detailed information about the execution status of a stage of the + // job. + // + // EXPERIMENTAL. This API is subject to change or removal without notice. + rpc GetStageExecutionDetails(GetStageExecutionDetailsRequest) returns (StageExecutionDetails) { + option (google.api.http) = { + get: "/v1b3/projects/{project_id}/locations/{location}/jobs/{job_id}/stages/{stage_id}/executionDetails" + }; + } +} + +// Identifies a metric, by describing the source which generated the +// metric. +message MetricStructuredName { + // Origin (namespace) of metric name. May be blank for user-define metrics; + // will be "dataflow" for metrics defined by the Dataflow service or SDK. + string origin = 1; + + // Worker-defined metric name. + string name = 2; + + // Zero or more labeled fields which identify the part of the job this + // metric is associated with, such as the name of a step or collection. + // + // For example, built-in counters associated with steps will have + // context['step'] = . Counters associated with PCollections + // in the SDK will have context['pcollection'] = . + map context = 3; +} + +// Describes the state of a metric. +message MetricUpdate { + // Name of the metric. + MetricStructuredName name = 1; + + // Metric aggregation kind. The possible metric aggregation kinds are + // "Sum", "Max", "Min", "Mean", "Set", "And", "Or", and "Distribution". + // The specified aggregation kind is case-insensitive. + // + // If omitted, this is not an aggregated value but instead + // a single metric sample value. + string kind = 2; + + // True if this metric is reported as the total cumulative aggregate + // value accumulated since the worker started working on this WorkItem. + // By default this is false, indicating that this metric is reported + // as a delta that is not associated with any WorkItem. + bool cumulative = 3; + + // Worker-computed aggregate value for aggregation kinds "Sum", "Max", "Min", + // "And", and "Or". The possible value types are Long, Double, and Boolean. + google.protobuf.Value scalar = 4; + + // Worker-computed aggregate value for the "Mean" aggregation kind. + // This holds the sum of the aggregated values and is used in combination + // with mean_count below to obtain the actual mean aggregate value. + // The only possible value types are Long and Double. + google.protobuf.Value mean_sum = 5; + + // Worker-computed aggregate value for the "Mean" aggregation kind. + // This holds the count of the aggregated values and is used in combination + // with mean_sum above to obtain the actual mean aggregate value. + // The only possible value type is Long. + google.protobuf.Value mean_count = 6; + + // Worker-computed aggregate value for the "Set" aggregation kind. The only + // possible value type is a list of Values whose type can be Long, Double, + // or String, according to the metric's type. All Values in the list must + // be of the same type. + google.protobuf.Value set = 7; + + // A struct value describing properties of a distribution of numeric values. + google.protobuf.Value distribution = 11; + + // A struct value describing properties of a Gauge. + // Metrics of gauge type show the value of a metric across time, and is + // aggregated based on the newest value. + google.protobuf.Value gauge = 12; + + // Worker-computed aggregate value for internal use by the Dataflow + // service. + google.protobuf.Value internal = 8; + + // Timestamp associated with the metric value. Optional when workers are + // reporting work progress; it will be filled in responses from the + // metrics API. + google.protobuf.Timestamp update_time = 9; +} + +// Request to get job metrics. +message GetJobMetricsRequest { + // A project id. + string project_id = 1; + + // The job to get metrics for. + string job_id = 2; + + // Return only metric data that has changed since this time. + // Default is to return all information about all metrics for the job. + google.protobuf.Timestamp start_time = 3; + + // The [regional endpoint] + // (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) that + // contains the job specified by job_id. + string location = 4; +} + +// JobMetrics contains a collection of metrics describing the detailed progress +// of a Dataflow job. Metrics correspond to user-defined and system-defined +// metrics in the job. +// +// This resource captures only the most recent values of each metric; +// time-series data can be queried for them (under the same metric names) +// from Cloud Monitoring. +message JobMetrics { + // Timestamp as of which metric values are current. + google.protobuf.Timestamp metric_time = 1; + + // All metrics for this job. + repeated MetricUpdate metrics = 2; +} + +// Request to get job execution details. +message GetJobExecutionDetailsRequest { + // A project id. + string project_id = 1; + + // The job to get execution details for. + string job_id = 2; + + // The [regional endpoint] + // (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) that + // contains the job specified by job_id. + string location = 3; + + // If specified, determines the maximum number of stages to + // return. If unspecified, the service may choose an appropriate + // default, or may return an arbitrarily large number of results. + int32 page_size = 4; + + // If supplied, this should be the value of next_page_token returned + // by an earlier call. This will cause the next page of results to + // be returned. + string page_token = 5; +} + +// Information about the progress of some component of job execution. +message ProgressTimeseries { + // A point in the timeseries. + message Point { + // The timestamp of the point. + google.protobuf.Timestamp time = 1; + + // The value of the point. + double value = 2; + } + + // The current progress of the component, in the range [0,1]. + double current_progress = 1; + + // History of progress for the component. + // + // Points are sorted by time. + repeated Point data_points = 2; +} + +// The state of some component of job execution. +enum ExecutionState { + // The component state is unknown or unspecified. + EXECUTION_STATE_UNKNOWN = 0; + + // The component is not yet running. + EXECUTION_STATE_NOT_STARTED = 1; + + // The component is currently running. + EXECUTION_STATE_RUNNING = 2; + + // The component succeeded. + EXECUTION_STATE_SUCCEEDED = 3; + + // The component failed. + EXECUTION_STATE_FAILED = 4; + + // Execution of the component was cancelled. + EXECUTION_STATE_CANCELLED = 5; +} + +// Information about a particular execution stage of a job. +message StageSummary { + // ID of this stage + string stage_id = 1; + + // State of this stage. + ExecutionState state = 2; + + // Start time of this stage. + google.protobuf.Timestamp start_time = 3; + + // End time of this stage. + // + // If the work item is completed, this is the actual end time of the stage. + // Otherwise, it is the predicted end time. + google.protobuf.Timestamp end_time = 4; + + // Progress for this stage. + // Only applicable to Batch jobs. + ProgressTimeseries progress = 5; + + // Metrics for this stage. + repeated MetricUpdate metrics = 6; +} + +// Information about the execution of a job. +message JobExecutionDetails { + // The stages of the job execution. + repeated StageSummary stages = 1; + + // If present, this response does not contain all requested tasks. To obtain + // the next page of results, repeat the request with page_token set to this + // value. + string next_page_token = 2; +} + +// Request to get information about a particular execution stage of a job. +// Currently only tracked for Batch jobs. +message GetStageExecutionDetailsRequest { + // A project id. + string project_id = 1; + + // The job to get execution details for. + string job_id = 2; + + // The [regional endpoint] + // (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) that + // contains the job specified by job_id. + string location = 3; + + // The stage for which to fetch information. + string stage_id = 4; + + // If specified, determines the maximum number of work items to + // return. If unspecified, the service may choose an appropriate + // default, or may return an arbitrarily large number of results. + int32 page_size = 5; + + // If supplied, this should be the value of next_page_token returned + // by an earlier call. This will cause the next page of results to + // be returned. + string page_token = 6; + + // Lower time bound of work items to include, by start time. + google.protobuf.Timestamp start_time = 7; + + // Upper time bound of work items to include, by start time. + google.protobuf.Timestamp end_time = 8; +} + +// Information about an individual work item execution. +message WorkItemDetails { + // Name of this work item. + string task_id = 1; + + // Attempt ID of this work item + string attempt_id = 2; + + // Start time of this work item attempt. + google.protobuf.Timestamp start_time = 3; + + // End time of this work item attempt. + // + // If the work item is completed, this is the actual end time of the work + // item. Otherwise, it is the predicted end time. + google.protobuf.Timestamp end_time = 4; + + // State of this work item. + ExecutionState state = 5; + + // Progress of this work item. + ProgressTimeseries progress = 6; + + // Metrics for this work item. + repeated MetricUpdate metrics = 7; +} + +// Information about a worker +message WorkerDetails { + // Name of this worker + string worker_name = 1; + + // Work items processed by this worker, sorted by time. + repeated WorkItemDetails work_items = 2; +} + +// Information about the workers and work items within a stage. +message StageExecutionDetails { + // Workers that have done work on the stage. + repeated WorkerDetails workers = 1; + + // If present, this response does not contain all requested tasks. To obtain + // the next page of results, repeat the request with page_token set to this + // value. + string next_page_token = 2; +} diff --git a/packages/google-dataflow/protos/google/dataflow/v1beta3/snapshots.proto b/packages/google-dataflow/protos/google/dataflow/v1beta3/snapshots.proto new file mode 100644 index 00000000000..0868db8d3b4 --- /dev/null +++ b/packages/google-dataflow/protos/google/dataflow/v1beta3/snapshots.proto @@ -0,0 +1,188 @@ +// 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.dataflow.v1beta3; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.Dataflow.V1Beta3"; +option go_package = "google.golang.org/genproto/googleapis/dataflow/v1beta3;dataflow"; +option java_multiple_files = true; +option java_outer_classname = "SnapshotsProto"; +option java_package = "com.google.dataflow.v1beta3"; +option php_namespace = "Google\\Cloud\\Dataflow\\V1beta3"; +option ruby_package = "Google::Cloud::Dataflow::V1beta3"; + +// Provides methods to manage snapshots of Google Cloud Dataflow jobs. +service SnapshotsV1Beta3 { + option (google.api.default_host) = "dataflow.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/compute," + "https://www.googleapis.com/auth/compute.readonly," + "https://www.googleapis.com/auth/userinfo.email"; + + // Gets information about a snapshot. + rpc GetSnapshot(GetSnapshotRequest) returns (Snapshot) { + option (google.api.http) = { + get: "/v1b3/projects/{project_id}/locations/{location}/snapshots/{snapshot_id}" + additional_bindings { + get: "/v1b3/projects/{project_id}/snapshots/{snapshot_id}" + } + }; + } + + // Deletes a snapshot. + rpc DeleteSnapshot(DeleteSnapshotRequest) returns (DeleteSnapshotResponse) { + option (google.api.http) = { + delete: "/v1b3/projects/{project_id}/locations/{location}/snapshots/{snapshot_id}" + additional_bindings { + delete: "/v1b3/projects/{project_id}/snapshots" + } + }; + } + + // Lists snapshots. + rpc ListSnapshots(ListSnapshotsRequest) returns (ListSnapshotsResponse) { + option (google.api.http) = { + get: "/v1b3/projects/{project_id}/locations/{location}/jobs/{job_id}/snapshots" + additional_bindings { + get: "/v1b3/projects/{project_id}/locations/{location}/snapshots" + } + additional_bindings { + get: "/v1b3/projects/{project_id}/snapshots" + } + }; + } +} + +// Snapshot state. +enum SnapshotState { + // Unknown state. + UNKNOWN_SNAPSHOT_STATE = 0; + + // Snapshot intent to create has been persisted, snapshotting of state has not + // yet started. + PENDING = 1; + + // Snapshotting is being performed. + RUNNING = 2; + + // Snapshot has been created and is ready to be used. + READY = 3; + + // Snapshot failed to be created. + FAILED = 4; + + // Snapshot has been deleted. + DELETED = 5; +} + +// Represents a Pubsub snapshot. +message PubsubSnapshotMetadata { + // The name of the Pubsub topic. + string topic_name = 1; + + // The name of the Pubsub snapshot. + string snapshot_name = 2; + + // The expire time of the Pubsub snapshot. + google.protobuf.Timestamp expire_time = 3; +} + +// Represents a snapshot of a job. +message Snapshot { + // The unique ID of this snapshot. + string id = 1; + + // The project this snapshot belongs to. + string project_id = 2; + + // The job this snapshot was created from. + string source_job_id = 3; + + // The time this snapshot was created. + google.protobuf.Timestamp creation_time = 4; + + // The time after which this snapshot will be automatically deleted. + google.protobuf.Duration ttl = 5; + + // State of the snapshot. + SnapshotState state = 6; + + // Pub/Sub snapshot metadata. + repeated PubsubSnapshotMetadata pubsub_metadata = 7; + + // User specified description of the snapshot. Maybe empty. + string description = 8; + + // The disk byte size of the snapshot. Only available for snapshots in READY + // state. + int64 disk_size_bytes = 9; + + // Cloud region where this snapshot lives in, e.g., "us-central1". + string region = 10; +} + +// Request to get information about a snapshot +message GetSnapshotRequest { + // The ID of the Cloud Platform project that the snapshot belongs to. + string project_id = 1; + + // The ID of the snapshot. + string snapshot_id = 2; + + // The location that contains this snapshot. + string location = 3; +} + +// Request to delete a snapshot. +message DeleteSnapshotRequest { + // The ID of the Cloud Platform project that the snapshot belongs to. + string project_id = 1; + + // The ID of the snapshot. + string snapshot_id = 2; + + // The location that contains this snapshot. + string location = 3; +} + +// Response from deleting a snapshot. +message DeleteSnapshotResponse { + +} + +// Request to list snapshots. +message ListSnapshotsRequest { + // The project ID to list snapshots for. + string project_id = 1; + + // If specified, list snapshots created from this job. + string job_id = 3; + + // The location to list snapshots in. + string location = 2; +} + +// List of snapshots. +message ListSnapshotsResponse { + // Returned snapshots. + repeated Snapshot snapshots = 1; +} diff --git a/packages/google-dataflow/protos/google/dataflow/v1beta3/streaming.proto b/packages/google-dataflow/protos/google/dataflow/v1beta3/streaming.proto new file mode 100644 index 00000000000..77577ca1b45 --- /dev/null +++ b/packages/google-dataflow/protos/google/dataflow/v1beta3/streaming.proto @@ -0,0 +1,231 @@ +// 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.dataflow.v1beta3; + +option csharp_namespace = "Google.Cloud.Dataflow.V1Beta3"; +option go_package = "google.golang.org/genproto/googleapis/dataflow/v1beta3;dataflow"; +option java_multiple_files = true; +option java_outer_classname = "StreamingProto"; +option java_package = "com.google.dataflow.v1beta3"; +option php_namespace = "Google\\Cloud\\Dataflow\\V1beta3"; +option ruby_package = "Google::Cloud::Dataflow::V1beta3"; + +// Global topology of the streaming Dataflow job, including all +// computations and their sharded locations. +message TopologyConfig { + // The computations associated with a streaming Dataflow job. + repeated ComputationTopology computations = 1; + + // The disks assigned to a streaming Dataflow job. + repeated DataDiskAssignment data_disk_assignments = 2; + + // Maps user stage names to stable computation names. + map user_stage_to_computation_name_map = 3; + + // The size (in bits) of keys that will be assigned to source messages. + int32 forwarding_key_bits = 4; + + // Version number for persistent state. + int32 persistent_state_version = 5; +} + +// Identifies a pubsub location to use for transferring data into or +// out of a streaming Dataflow job. +message PubsubLocation { + // A pubsub topic, in the form of + // "pubsub.googleapis.com/topics//" + string topic = 1; + + // A pubsub subscription, in the form of + // "pubsub.googleapis.com/subscriptions//" + string subscription = 2; + + // If set, contains a pubsub label from which to extract record timestamps. + // If left empty, record timestamps will be generated upon arrival. + string timestamp_label = 3; + + // If set, contains a pubsub label from which to extract record ids. + // If left empty, record deduplication will be strictly best effort. + string id_label = 4; + + // Indicates whether the pipeline allows late-arriving data. + bool drop_late_data = 5; + + // If set, specifies the pubsub subscription that will be used for tracking + // custom time timestamps for watermark estimation. + string tracking_subscription = 6; + + // If true, then the client has requested to get pubsub attributes. + bool with_attributes = 7; +} + +// Identifies the location of a streaming computation stage, for +// stage-to-stage communication. +message StreamingStageLocation { + // Identifies the particular stream within the streaming Dataflow + // job. + string stream_id = 1; +} + +// Identifies the location of a streaming side input. +message StreamingSideInputLocation { + // Identifies the particular side input within the streaming Dataflow job. + string tag = 1; + + // Identifies the state family where this side input is stored. + string state_family = 2; +} + +// Identifies the location of a custom souce. +message CustomSourceLocation { + // Whether this source is stateful. + bool stateful = 1; +} + +// Describes a stream of data, either as input to be processed or as +// output of a streaming Dataflow job. +message StreamLocation { + // A specification of a stream's location. + oneof location { + // The stream is part of another computation within the current + // streaming Dataflow job. + StreamingStageLocation streaming_stage_location = 1; + + // The stream is a pubsub stream. + PubsubLocation pubsub_location = 2; + + // The stream is a streaming side input. + StreamingSideInputLocation side_input_location = 3; + + // The stream is a custom source. + CustomSourceLocation custom_source_location = 4; + } +} + +// State family configuration. +message StateFamilyConfig { + // The state family value. + string state_family = 1; + + // If true, this family corresponds to a read operation. + bool is_read = 2; +} + +// All configuration data for a particular Computation. +message ComputationTopology { + // The system stage name. + string system_stage_name = 1; + + // The ID of the computation. + string computation_id = 5; + + // The key ranges processed by the computation. + repeated KeyRangeLocation key_ranges = 2; + + // The inputs to the computation. + repeated StreamLocation inputs = 3; + + // The outputs from the computation. + repeated StreamLocation outputs = 4; + + // The state family values. + repeated StateFamilyConfig state_families = 7; +} + +// Location information for a specific key-range of a sharded computation. +// Currently we only support UTF-8 character splits to simplify encoding into +// JSON. +message KeyRangeLocation { + // The start (inclusive) of the key range. + string start = 1; + + // The end (exclusive) of the key range. + string end = 2; + + // The physical location of this range assignment to be used for + // streaming computation cross-worker message delivery. + string delivery_endpoint = 3; + + // The name of the data disk where data for this range is stored. + // This name is local to the Google Cloud Platform project and uniquely + // identifies the disk within that project, for example + // "myproject-1014-104817-4c2-harness-0-disk-1". + string data_disk = 5; + + // DEPRECATED. The location of the persistent state for this range, as a + // persistent directory in the worker local filesystem. + string deprecated_persistent_directory = 4 [deprecated = true]; +} + +// Describes mounted data disk. +message MountedDataDisk { + // The name of the data disk. + // This name is local to the Google Cloud Platform project and uniquely + // identifies the disk within that project, for example + // "myproject-1014-104817-4c2-harness-0-disk-1". + string data_disk = 1; +} + +// Data disk assignment for a given VM instance. +message DataDiskAssignment { + // VM instance name the data disks mounted to, for example + // "myproject-1014-104817-4c2-harness-0". + string vm_instance = 1; + + // Mounted data disks. The order is important a data disk's 0-based index in + // this list defines which persistent directory the disk is mounted to, for + // example the list of { "myproject-1014-104817-4c2-harness-0-disk-0" }, + // { "myproject-1014-104817-4c2-harness-0-disk-1" }. + repeated string data_disks = 2; +} + +// Data disk assignment information for a specific key-range of a sharded +// computation. +// Currently we only support UTF-8 character splits to simplify encoding into +// JSON. +message KeyRangeDataDiskAssignment { + // The start (inclusive) of the key range. + string start = 1; + + // The end (exclusive) of the key range. + string end = 2; + + // The name of the data disk where data for this range is stored. + // This name is local to the Google Cloud Platform project and uniquely + // identifies the disk within that project, for example + // "myproject-1014-104817-4c2-harness-0-disk-1". + string data_disk = 3; +} + +// Describes full or partial data disk assignment information of the computation +// ranges. +message StreamingComputationRanges { + // The ID of the computation. + string computation_id = 1; + + // Data disk assignments for ranges from this computation. + repeated KeyRangeDataDiskAssignment range_assignments = 2; +} + +// Streaming appliance snapshot configuration. +message StreamingApplianceSnapshotConfig { + // If set, indicates the snapshot id for the snapshot being performed. + string snapshot_id = 1; + + // Indicates which endpoint is used to import appliance state. + string import_state_endpoint = 2; +} diff --git a/packages/google-dataflow/protos/google/dataflow/v1beta3/templates.proto b/packages/google-dataflow/protos/google/dataflow/v1beta3/templates.proto new file mode 100644 index 00000000000..064e3a8a16a --- /dev/null +++ b/packages/google-dataflow/protos/google/dataflow/v1beta3/templates.proto @@ -0,0 +1,632 @@ +// 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.dataflow.v1beta3; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/dataflow/v1beta3/environment.proto"; +import "google/dataflow/v1beta3/jobs.proto"; +import "google/rpc/status.proto"; + +option csharp_namespace = "Google.Cloud.Dataflow.V1Beta3"; +option go_package = "google.golang.org/genproto/googleapis/dataflow/v1beta3;dataflow"; +option java_multiple_files = true; +option java_outer_classname = "TemplatesProto"; +option java_package = "com.google.dataflow.v1beta3"; +option php_namespace = "Google\\Cloud\\Dataflow\\V1beta3"; +option ruby_package = "Google::Cloud::Dataflow::V1beta3"; + +// Provides a method to create Cloud Dataflow jobs from templates. +service TemplatesService { + option (google.api.default_host) = "dataflow.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/compute," + "https://www.googleapis.com/auth/compute.readonly," + "https://www.googleapis.com/auth/userinfo.email"; + + // Creates a Cloud Dataflow job from a template. + rpc CreateJobFromTemplate(CreateJobFromTemplateRequest) returns (Job) { + option (google.api.http) = { + post: "/v1b3/projects/{project_id}/locations/{location}/templates" + body: "*" + additional_bindings { + post: "/v1b3/projects/{project_id}/templates" + body: "*" + } + }; + } + + // Launch a template. + rpc LaunchTemplate(LaunchTemplateRequest) returns (LaunchTemplateResponse) { + option (google.api.http) = { + post: "/v1b3/projects/{project_id}/locations/{location}/templates:launch" + body: "launch_parameters" + additional_bindings { + post: "/v1b3/projects/{project_id}/templates:launch" + body: "launch_parameters" + } + }; + } + + // Get the template associated with a template. + rpc GetTemplate(GetTemplateRequest) returns (GetTemplateResponse) { + option (google.api.http) = { + get: "/v1b3/projects/{project_id}/locations/{location}/templates:get" + additional_bindings { + get: "/v1b3/projects/{project_id}/templates:get" + } + }; + } +} + +// Provides a service for Flex templates. This feature is not ready yet. +service FlexTemplatesService { + option (google.api.default_host) = "dataflow.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/compute," + "https://www.googleapis.com/auth/compute.readonly," + "https://www.googleapis.com/auth/userinfo.email"; + + // Launch a job with a FlexTemplate. + rpc LaunchFlexTemplate(LaunchFlexTemplateRequest) returns (LaunchFlexTemplateResponse) { + option (google.api.http) = { + post: "/v1b3/projects/{project_id}/locations/{location}/flexTemplates:launch" + body: "*" + }; + } +} + +// Response to the request to launch a job from Flex Template. +message LaunchFlexTemplateResponse { + // The job that was launched, if the request was not a dry run and + // the job was successfully launched. + Job job = 1; +} + +// Container Spec. +message ContainerSpec { + // Name of the docker container image. E.g., gcr.io/project/some-image + string image = 1; + + // Metadata describing a template including description and validation rules. + TemplateMetadata metadata = 2; + + // Required. SDK info of the Flex Template. + SDKInfo sdk_info = 3; + + // Default runtime environment for the job. + FlexTemplateRuntimeEnvironment default_environment = 4; +} + +// Launch FlexTemplate Parameter. +message LaunchFlexTemplateParameter { + // Required. The job name to use for the created job. For update job request, + // job name should be same as the existing running job. + string job_name = 1; + + // Launch Mechanism. + oneof template { + // Spec about the container image to launch. + ContainerSpec container_spec = 4; + + // Cloud Storage path to a file with json serialized ContainerSpec as + // content. + string container_spec_gcs_path = 5; + } + + // The parameters for FlexTemplate. + // Ex. {"num_workers":"5"} + map parameters = 2; + + // Launch options for this flex template job. This is a common set of options + // across languages and templates. This should not be used to pass job + // parameters. + map launch_options = 6; + + // The runtime environment for the FlexTemplate job + FlexTemplateRuntimeEnvironment environment = 7; + + // Set this to true if you are sending a request to update a running + // streaming job. When set, the job name should be the same as the + // running job. + bool update = 8; + + // Use this to pass transform_name_mappings for streaming update jobs. + // Ex:{"oldTransformName":"newTransformName",...}' + map transform_name_mappings = 9; +} + +// The environment values to be set at runtime for flex template. +message FlexTemplateRuntimeEnvironment { + // The initial number of Google Compute Engine instances for the job. + int32 num_workers = 1; + + // The maximum number of Google Compute Engine instances to be made + // available to your pipeline during execution, from 1 to 1000. + int32 max_workers = 2; + + // The Compute Engine [availability + // zone](https://cloud.google.com/compute/docs/regions-zones/regions-zones) + // for launching worker instances to run your pipeline. + // In the future, worker_zone will take precedence. + string zone = 3; + + // The email address of the service account to run the job as. + string service_account_email = 4; + + // The Cloud Storage path to use for temporary files. + // Must be a valid Cloud Storage URL, beginning with `gs://`. + string temp_location = 5; + + // The machine type to use for the job. Defaults to the value from the + // template if not specified. + string machine_type = 6; + + // Additional experiment flags for the job. + repeated string additional_experiments = 7; + + // Network to which VMs will be assigned. If empty or unspecified, + // the service will use the network "default". + string network = 8; + + // Subnetwork to which VMs will be assigned, if desired. You can specify a + // subnetwork using either a complete URL or an abbreviated path. Expected to + // be of the form + // "https://www.googleapis.com/compute/v1/projects/HOST_PROJECT_ID/regions/REGION/subnetworks/SUBNETWORK" + // or "regions/REGION/subnetworks/SUBNETWORK". If the subnetwork is located in + // a Shared VPC network, you must use the complete URL. + string subnetwork = 9; + + // Additional user labels to be specified for the job. + // Keys and values must follow the restrictions specified in the [labeling + // restrictions](https://cloud.google.com/compute/docs/labeling-resources#restrictions) + // page. + // An object containing a list of "key": value pairs. + // Example: { "name": "wrench", "mass": "1kg", "count": "3" }. + map additional_user_labels = 10; + + // Name for the Cloud KMS key for the job. + // Key format is: + // projects//locations//keyRings//cryptoKeys/ + string kms_key_name = 11; + + // Configuration for VM IPs. + WorkerIPAddressConfiguration ip_configuration = 12; + + // The Compute Engine region + // (https://cloud.google.com/compute/docs/regions-zones/regions-zones) in + // which worker processing should occur, e.g. "us-west1". Mutually exclusive + // with worker_zone. If neither worker_region nor worker_zone is specified, + // default to the control plane's region. + string worker_region = 13; + + // The Compute Engine zone + // (https://cloud.google.com/compute/docs/regions-zones/regions-zones) in + // which worker processing should occur, e.g. "us-west1-a". Mutually exclusive + // with worker_region. If neither worker_region nor worker_zone is specified, + // a zone in the control plane's region is chosen based on available capacity. + // If both `worker_zone` and `zone` are set, `worker_zone` takes precedence. + string worker_zone = 14; + + // Whether to enable Streaming Engine for the job. + bool enable_streaming_engine = 15; + + // Set FlexRS goal for the job. + // https://cloud.google.com/dataflow/docs/guides/flexrs + FlexResourceSchedulingGoal flexrs_goal = 16; + + // The Cloud Storage path for staging local files. + // Must be a valid Cloud Storage URL, beginning with `gs://`. + string staging_location = 17; + + // Docker registry location of container image to use for the 'worker harness. + // Default is the container for the version of the SDK. Note this field is + // only valid for portable pipelines. + string sdk_container_image = 18; + + // Worker disk size, in gigabytes. + int32 disk_size_gb = 20; + + // The algorithm to use for autoscaling + AutoscalingAlgorithm autoscaling_algorithm = 21; + + // If true, save a heap dump before killing a thread or process which is GC + // thrashing or out of memory. The location of the heap file will either be + // echoed back to the user, or the user will be given the opportunity to + // download the heap file. + bool dump_heap_on_oom = 22; + + // Cloud Storage bucket (directory) to upload heap dumps to the given + // location. Enabling this implies that heap dumps should be generated on OOM + // (dump_heap_on_oom is set to true). + string save_heap_dumps_to_gcs_path = 23; + + // The machine type to use for launching the job. The default is + // n1-standard-1. + string launcher_machine_type = 24; +} + +// A request to launch a Cloud Dataflow job from a FlexTemplate. +message LaunchFlexTemplateRequest { + // Required. The ID of the Cloud Platform project that the job belongs to. + string project_id = 1; + + // Required. Parameter to launch a job form Flex Template. + LaunchFlexTemplateParameter launch_parameter = 2; + + // Required. The [regional endpoint] + // (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) to + // which to direct the request. E.g., us-central1, us-west1. + string location = 3; + + // If true, the request is validated but not actually executed. + // Defaults to false. + bool validate_only = 4; +} + +// The environment values to set at runtime. +message RuntimeEnvironment { + // The initial number of Google Compute Engine instnaces for the job. + int32 num_workers = 11; + + // The maximum number of Google Compute Engine instances to be made + // available to your pipeline during execution, from 1 to 1000. + int32 max_workers = 1; + + // The Compute Engine [availability + // zone](https://cloud.google.com/compute/docs/regions-zones/regions-zones) + // for launching worker instances to run your pipeline. + // In the future, worker_zone will take precedence. + string zone = 2; + + // The email address of the service account to run the job as. + string service_account_email = 3; + + // The Cloud Storage path to use for temporary files. + // Must be a valid Cloud Storage URL, beginning with `gs://`. + string temp_location = 4; + + // Whether to bypass the safety checks for the job's temporary directory. + // Use with caution. + bool bypass_temp_dir_validation = 5; + + // The machine type to use for the job. Defaults to the value from the + // template if not specified. + string machine_type = 6; + + // Additional experiment flags for the job, specified with the + // `--experiments` option. + repeated string additional_experiments = 7; + + // Network to which VMs will be assigned. If empty or unspecified, + // the service will use the network "default". + string network = 8; + + // Subnetwork to which VMs will be assigned, if desired. You can specify a + // subnetwork using either a complete URL or an abbreviated path. Expected to + // be of the form + // "https://www.googleapis.com/compute/v1/projects/HOST_PROJECT_ID/regions/REGION/subnetworks/SUBNETWORK" + // or "regions/REGION/subnetworks/SUBNETWORK". If the subnetwork is located in + // a Shared VPC network, you must use the complete URL. + string subnetwork = 9; + + // Additional user labels to be specified for the job. + // Keys and values should follow the restrictions specified in the [labeling + // restrictions](https://cloud.google.com/compute/docs/labeling-resources#restrictions) + // page. + // An object containing a list of "key": value pairs. + // Example: { "name": "wrench", "mass": "1kg", "count": "3" }. + map additional_user_labels = 10; + + // Name for the Cloud KMS key for the job. + // Key format is: + // projects//locations//keyRings//cryptoKeys/ + string kms_key_name = 12; + + // Configuration for VM IPs. + WorkerIPAddressConfiguration ip_configuration = 14; + + // The Compute Engine region + // (https://cloud.google.com/compute/docs/regions-zones/regions-zones) in + // which worker processing should occur, e.g. "us-west1". Mutually exclusive + // with worker_zone. If neither worker_region nor worker_zone is specified, + // default to the control plane's region. + string worker_region = 15; + + // The Compute Engine zone + // (https://cloud.google.com/compute/docs/regions-zones/regions-zones) in + // which worker processing should occur, e.g. "us-west1-a". Mutually exclusive + // with worker_region. If neither worker_region nor worker_zone is specified, + // a zone in the control plane's region is chosen based on available capacity. + // If both `worker_zone` and `zone` are set, `worker_zone` takes precedence. + string worker_zone = 16; + + // Whether to enable Streaming Engine for the job. + bool enable_streaming_engine = 17; +} + +// Metadata for a specific parameter. +message ParameterMetadata { + // Required. The name of the parameter. + string name = 1; + + // Required. The label to display for the parameter. + string label = 2; + + // Required. The help text to display for the parameter. + string help_text = 3; + + // Optional. Whether the parameter is optional. Defaults to false. + bool is_optional = 4; + + // Optional. Regexes that the parameter must match. + repeated string regexes = 5; + + // Optional. The type of the parameter. + // Used for selecting input picker. + ParameterType param_type = 6; + + // Optional. Additional metadata for describing this parameter. + map custom_metadata = 7; +} + +// ParameterType specifies what kind of input we need for this parameter. +enum ParameterType { + // Default input type. + DEFAULT = 0; + + // The parameter specifies generic text input. + TEXT = 1; + + // The parameter specifies a Cloud Storage Bucket to read from. + GCS_READ_BUCKET = 2; + + // The parameter specifies a Cloud Storage Bucket to write to. + GCS_WRITE_BUCKET = 3; + + // The parameter specifies a Cloud Storage file path to read from. + GCS_READ_FILE = 4; + + // The parameter specifies a Cloud Storage file path to write to. + GCS_WRITE_FILE = 5; + + // The parameter specifies a Cloud Storage folder path to read from. + GCS_READ_FOLDER = 6; + + // The parameter specifies a Cloud Storage folder to write to. + GCS_WRITE_FOLDER = 7; + + // The parameter specifies a Pub/Sub Topic. + PUBSUB_TOPIC = 8; + + // The parameter specifies a Pub/Sub Subscription. + PUBSUB_SUBSCRIPTION = 9; +} + +// Metadata describing a template. +message TemplateMetadata { + // Required. The name of the template. + string name = 1; + + // Optional. A description of the template. + string description = 2; + + // The parameters for the template. + repeated ParameterMetadata parameters = 3; +} + +// SDK Information. +message SDKInfo { + // SDK Language. + enum Language { + // UNKNOWN Language. + UNKNOWN = 0; + + // Java. + JAVA = 1; + + // Python. + PYTHON = 2; + } + + // Required. The SDK Language. + Language language = 1; + + // Optional. The SDK version. + string version = 2; +} + +// RuntimeMetadata describing a runtime environment. +message RuntimeMetadata { + // SDK Info for the template. + SDKInfo sdk_info = 1; + + // The parameters for the template. + repeated ParameterMetadata parameters = 2; +} + +// A request to create a Cloud Dataflow job from a template. +message CreateJobFromTemplateRequest { + // Required. The ID of the Cloud Platform project that the job belongs to. + string project_id = 1; + + // Required. The job name to use for the created job. + string job_name = 4; + + // The template from which to create the job. + oneof template { + // Required. A Cloud Storage path to the template from which to + // create the job. + // Must be a valid Cloud Storage URL, beginning with `gs://`. + string gcs_path = 2; + } + + // The runtime parameters to pass to the job. + map parameters = 3; + + // The runtime environment for the job. + RuntimeEnvironment environment = 5; + + // The [regional endpoint] + // (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) to + // which to direct the request. + string location = 6; +} + +// A request to retrieve a Cloud Dataflow job template. +message GetTemplateRequest { + // The various views of a template that may be retrieved. + enum TemplateView { + // Template view that retrieves only the metadata associated with the + // template. + METADATA_ONLY = 0; + } + + // Required. The ID of the Cloud Platform project that the job belongs to. + string project_id = 1; + + // The template from which to create the job. + oneof template { + // Required. A Cloud Storage path to the template from which to + // create the job. + // Must be valid Cloud Storage URL, beginning with 'gs://'. + string gcs_path = 2; + } + + // The view to retrieve. Defaults to METADATA_ONLY. + TemplateView view = 3; + + // The [regional endpoint] + // (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) to + // which to direct the request. + string location = 4; +} + +// The response to a GetTemplate request. +message GetTemplateResponse { + // Template Type. + enum TemplateType { + // Unknown Template Type. + UNKNOWN = 0; + + // Legacy Template. + LEGACY = 1; + + // Flex Template. + FLEX = 2; + } + + // The status of the get template request. Any problems with the + // request will be indicated in the error_details. + google.rpc.Status status = 1; + + // The template metadata describing the template name, available + // parameters, etc. + TemplateMetadata metadata = 2; + + // Template Type. + TemplateType template_type = 3; + + // Describes the runtime metadata with SDKInfo and available parameters. + RuntimeMetadata runtime_metadata = 4; +} + +// Parameters to provide to the template being launched. +message LaunchTemplateParameters { + // Required. The job name to use for the created job. + string job_name = 1; + + // The runtime parameters to pass to the job. + map parameters = 2; + + // The runtime environment for the job. + RuntimeEnvironment environment = 3; + + // If set, replace the existing pipeline with the name specified by jobName + // with this pipeline, preserving state. + bool update = 4; + + // Only applicable when updating a pipeline. Map of transform name prefixes of + // the job to be replaced to the corresponding name prefixes of the new job. + map transform_name_mapping = 5; +} + +// A request to launch a template. +message LaunchTemplateRequest { + // Required. The ID of the Cloud Platform project that the job belongs to. + string project_id = 1; + + // If true, the request is validated but not actually executed. + // Defaults to false. + bool validate_only = 2; + + // The template from which to create the job. + oneof template { + // A Cloud Storage path to the template from which to create + // the job. + // Must be valid Cloud Storage URL, beginning with 'gs://'. + string gcs_path = 3; + + // Params for launching a dynamic template. + DynamicTemplateLaunchParams dynamic_template = 6; + } + + // The parameters of the template to launch. This should be part of the + // body of the POST request. + LaunchTemplateParameters launch_parameters = 4; + + // The [regional endpoint] + // (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) to + // which to direct the request. + string location = 5; +} + +// Response to the request to launch a template. +message LaunchTemplateResponse { + // The job that was launched, if the request was not a dry run and + // the job was successfully launched. + Job job = 1; +} + +// Used in the error_details field of a google.rpc.Status message, this +// indicates problems with the template parameter. +message InvalidTemplateParameters { + // A specific template-parameter violation. + message ParameterViolation { + // The parameter that failed to validate. + string parameter = 1; + + // A description of why the parameter failed to validate. + string description = 2; + } + + // Describes all parameter violations in a template request. + repeated ParameterViolation parameter_violations = 1; +} + +// Params which should be passed when launching a dynamic template. +message DynamicTemplateLaunchParams { + // Path to dynamic template spec file on Cloud Storage. + // The file must be a Json serialized DynamicTemplateFieSpec object. + string gcs_path = 1; + + // Cloud Storage path for staging dependencies. + // Must be a valid Cloud Storage URL, beginning with `gs://`. + string staging_location = 2; +} diff --git a/packages/google-dataflow/protos/protos.d.ts b/packages/google-dataflow/protos/protos.d.ts new file mode 100644 index 00000000000..a5bb364647a --- /dev/null +++ b/packages/google-dataflow/protos/protos.d.ts @@ -0,0 +1,16785 @@ +// 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 dataflow. */ + namespace dataflow { + + /** Namespace v1beta3. */ + namespace v1beta3 { + + /** Properties of an Environment. */ + interface IEnvironment { + + /** Environment tempStoragePrefix */ + tempStoragePrefix?: (string|null); + + /** Environment clusterManagerApiService */ + clusterManagerApiService?: (string|null); + + /** Environment experiments */ + experiments?: (string[]|null); + + /** Environment serviceOptions */ + serviceOptions?: (string[]|null); + + /** Environment serviceKmsKeyName */ + serviceKmsKeyName?: (string|null); + + /** Environment workerPools */ + workerPools?: (google.dataflow.v1beta3.IWorkerPool[]|null); + + /** Environment userAgent */ + userAgent?: (google.protobuf.IStruct|null); + + /** Environment version */ + version?: (google.protobuf.IStruct|null); + + /** Environment dataset */ + dataset?: (string|null); + + /** Environment sdkPipelineOptions */ + sdkPipelineOptions?: (google.protobuf.IStruct|null); + + /** Environment internalExperiments */ + internalExperiments?: (google.protobuf.IAny|null); + + /** Environment serviceAccountEmail */ + serviceAccountEmail?: (string|null); + + /** Environment flexResourceSchedulingGoal */ + flexResourceSchedulingGoal?: (google.dataflow.v1beta3.FlexResourceSchedulingGoal|keyof typeof google.dataflow.v1beta3.FlexResourceSchedulingGoal|null); + + /** Environment workerRegion */ + workerRegion?: (string|null); + + /** Environment workerZone */ + workerZone?: (string|null); + + /** Environment shuffleMode */ + shuffleMode?: (google.dataflow.v1beta3.ShuffleMode|keyof typeof google.dataflow.v1beta3.ShuffleMode|null); + + /** Environment debugOptions */ + debugOptions?: (google.dataflow.v1beta3.IDebugOptions|null); + } + + /** Represents an Environment. */ + class Environment implements IEnvironment { + + /** + * Constructs a new Environment. + * @param [properties] Properties to set + */ + constructor(properties?: google.dataflow.v1beta3.IEnvironment); + + /** Environment tempStoragePrefix. */ + public tempStoragePrefix: string; + + /** Environment clusterManagerApiService. */ + public clusterManagerApiService: string; + + /** Environment experiments. */ + public experiments: string[]; + + /** Environment serviceOptions. */ + public serviceOptions: string[]; + + /** Environment serviceKmsKeyName. */ + public serviceKmsKeyName: string; + + /** Environment workerPools. */ + public workerPools: google.dataflow.v1beta3.IWorkerPool[]; + + /** Environment userAgent. */ + public userAgent?: (google.protobuf.IStruct|null); + + /** Environment version. */ + public version?: (google.protobuf.IStruct|null); + + /** Environment dataset. */ + public dataset: string; + + /** Environment sdkPipelineOptions. */ + public sdkPipelineOptions?: (google.protobuf.IStruct|null); + + /** Environment internalExperiments. */ + public internalExperiments?: (google.protobuf.IAny|null); + + /** Environment serviceAccountEmail. */ + public serviceAccountEmail: string; + + /** Environment flexResourceSchedulingGoal. */ + public flexResourceSchedulingGoal: (google.dataflow.v1beta3.FlexResourceSchedulingGoal|keyof typeof google.dataflow.v1beta3.FlexResourceSchedulingGoal); + + /** Environment workerRegion. */ + public workerRegion: string; + + /** Environment workerZone. */ + public workerZone: string; + + /** Environment shuffleMode. */ + public shuffleMode: (google.dataflow.v1beta3.ShuffleMode|keyof typeof google.dataflow.v1beta3.ShuffleMode); + + /** Environment debugOptions. */ + public debugOptions?: (google.dataflow.v1beta3.IDebugOptions|null); + + /** + * Creates a new Environment instance using the specified properties. + * @param [properties] Properties to set + * @returns Environment instance + */ + public static create(properties?: google.dataflow.v1beta3.IEnvironment): google.dataflow.v1beta3.Environment; + + /** + * Encodes the specified Environment message. Does not implicitly {@link google.dataflow.v1beta3.Environment.verify|verify} messages. + * @param message Environment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.dataflow.v1beta3.IEnvironment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Environment message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.Environment.verify|verify} messages. + * @param message Environment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.dataflow.v1beta3.IEnvironment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Environment message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Environment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.dataflow.v1beta3.Environment; + + /** + * Decodes an Environment message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Environment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.dataflow.v1beta3.Environment; + + /** + * Verifies an Environment message. + * @param message Plain 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 Environment message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Environment + */ + public static fromObject(object: { [k: string]: any }): google.dataflow.v1beta3.Environment; + + /** + * Creates a plain object from an Environment message. Also converts values to other types if specified. + * @param message Environment + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.dataflow.v1beta3.Environment, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Environment to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Environment + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Package. */ + interface IPackage { + + /** Package name */ + name?: (string|null); + + /** Package location */ + location?: (string|null); + } + + /** Represents a Package. */ + class Package implements IPackage { + + /** + * Constructs a new Package. + * @param [properties] Properties to set + */ + constructor(properties?: google.dataflow.v1beta3.IPackage); + + /** Package name. */ + public name: string; + + /** Package location. */ + public location: string; + + /** + * Creates a new Package instance using the specified properties. + * @param [properties] Properties to set + * @returns Package instance + */ + public static create(properties?: google.dataflow.v1beta3.IPackage): google.dataflow.v1beta3.Package; + + /** + * Encodes the specified Package message. Does not implicitly {@link google.dataflow.v1beta3.Package.verify|verify} messages. + * @param message Package message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.dataflow.v1beta3.IPackage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Package message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.Package.verify|verify} messages. + * @param message Package message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.dataflow.v1beta3.IPackage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Package message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Package + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.dataflow.v1beta3.Package; + + /** + * Decodes a Package message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Package + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.dataflow.v1beta3.Package; + + /** + * Verifies a Package message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Package message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Package + */ + public static fromObject(object: { [k: string]: any }): google.dataflow.v1beta3.Package; + + /** + * Creates a plain object from a Package message. Also converts values to other types if specified. + * @param message Package + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.dataflow.v1beta3.Package, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Package to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Package + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** JobType enum. */ + enum JobType { + JOB_TYPE_UNKNOWN = 0, + JOB_TYPE_BATCH = 1, + JOB_TYPE_STREAMING = 2 + } + + /** FlexResourceSchedulingGoal enum. */ + enum FlexResourceSchedulingGoal { + FLEXRS_UNSPECIFIED = 0, + FLEXRS_SPEED_OPTIMIZED = 1, + FLEXRS_COST_OPTIMIZED = 2 + } + + /** Properties of a Disk. */ + interface IDisk { + + /** Disk sizeGb */ + sizeGb?: (number|null); + + /** Disk diskType */ + diskType?: (string|null); + + /** Disk mountPoint */ + mountPoint?: (string|null); + } + + /** Represents a Disk. */ + class Disk implements IDisk { + + /** + * Constructs a new Disk. + * @param [properties] Properties to set + */ + constructor(properties?: google.dataflow.v1beta3.IDisk); + + /** Disk sizeGb. */ + public sizeGb: number; + + /** Disk diskType. */ + public diskType: string; + + /** Disk mountPoint. */ + public mountPoint: string; + + /** + * Creates a new Disk instance using the specified properties. + * @param [properties] Properties to set + * @returns Disk instance + */ + public static create(properties?: google.dataflow.v1beta3.IDisk): google.dataflow.v1beta3.Disk; + + /** + * Encodes the specified Disk message. Does not implicitly {@link google.dataflow.v1beta3.Disk.verify|verify} messages. + * @param message Disk message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.dataflow.v1beta3.IDisk, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Disk message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.Disk.verify|verify} messages. + * @param message Disk message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.dataflow.v1beta3.IDisk, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Disk message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Disk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.dataflow.v1beta3.Disk; + + /** + * Decodes a Disk message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Disk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.dataflow.v1beta3.Disk; + + /** + * Verifies a Disk message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Disk message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Disk + */ + public static fromObject(object: { [k: string]: any }): google.dataflow.v1beta3.Disk; + + /** + * Creates a plain object from a Disk message. Also converts values to other types if specified. + * @param message Disk + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.dataflow.v1beta3.Disk, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Disk to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Disk + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a WorkerSettings. */ + interface IWorkerSettings { + + /** WorkerSettings baseUrl */ + baseUrl?: (string|null); + + /** WorkerSettings reportingEnabled */ + reportingEnabled?: (boolean|null); + + /** WorkerSettings servicePath */ + servicePath?: (string|null); + + /** WorkerSettings shuffleServicePath */ + shuffleServicePath?: (string|null); + + /** WorkerSettings workerId */ + workerId?: (string|null); + + /** WorkerSettings tempStoragePrefix */ + tempStoragePrefix?: (string|null); + } + + /** Represents a WorkerSettings. */ + class WorkerSettings implements IWorkerSettings { + + /** + * Constructs a new WorkerSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.dataflow.v1beta3.IWorkerSettings); + + /** WorkerSettings baseUrl. */ + public baseUrl: string; + + /** WorkerSettings reportingEnabled. */ + public reportingEnabled: boolean; + + /** WorkerSettings servicePath. */ + public servicePath: string; + + /** WorkerSettings shuffleServicePath. */ + public shuffleServicePath: string; + + /** WorkerSettings workerId. */ + public workerId: string; + + /** WorkerSettings tempStoragePrefix. */ + public tempStoragePrefix: string; + + /** + * Creates a new WorkerSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns WorkerSettings instance + */ + public static create(properties?: google.dataflow.v1beta3.IWorkerSettings): google.dataflow.v1beta3.WorkerSettings; + + /** + * Encodes the specified WorkerSettings message. Does not implicitly {@link google.dataflow.v1beta3.WorkerSettings.verify|verify} messages. + * @param message WorkerSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.dataflow.v1beta3.IWorkerSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WorkerSettings message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.WorkerSettings.verify|verify} messages. + * @param message WorkerSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.dataflow.v1beta3.IWorkerSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WorkerSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WorkerSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.dataflow.v1beta3.WorkerSettings; + + /** + * Decodes a WorkerSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WorkerSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.dataflow.v1beta3.WorkerSettings; + + /** + * Verifies a WorkerSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WorkerSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WorkerSettings + */ + public static fromObject(object: { [k: string]: any }): google.dataflow.v1beta3.WorkerSettings; + + /** + * Creates a plain object from a WorkerSettings message. Also converts values to other types if specified. + * @param message WorkerSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.dataflow.v1beta3.WorkerSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WorkerSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WorkerSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TaskRunnerSettings. */ + interface ITaskRunnerSettings { + + /** TaskRunnerSettings taskUser */ + taskUser?: (string|null); + + /** TaskRunnerSettings taskGroup */ + taskGroup?: (string|null); + + /** TaskRunnerSettings oauthScopes */ + oauthScopes?: (string[]|null); + + /** TaskRunnerSettings baseUrl */ + baseUrl?: (string|null); + + /** TaskRunnerSettings dataflowApiVersion */ + dataflowApiVersion?: (string|null); + + /** TaskRunnerSettings parallelWorkerSettings */ + parallelWorkerSettings?: (google.dataflow.v1beta3.IWorkerSettings|null); + + /** TaskRunnerSettings baseTaskDir */ + baseTaskDir?: (string|null); + + /** TaskRunnerSettings continueOnException */ + continueOnException?: (boolean|null); + + /** TaskRunnerSettings logToSerialconsole */ + logToSerialconsole?: (boolean|null); + + /** TaskRunnerSettings alsologtostderr */ + alsologtostderr?: (boolean|null); + + /** TaskRunnerSettings logUploadLocation */ + logUploadLocation?: (string|null); + + /** TaskRunnerSettings logDir */ + logDir?: (string|null); + + /** TaskRunnerSettings tempStoragePrefix */ + tempStoragePrefix?: (string|null); + + /** TaskRunnerSettings harnessCommand */ + harnessCommand?: (string|null); + + /** TaskRunnerSettings workflowFileName */ + workflowFileName?: (string|null); + + /** TaskRunnerSettings commandlinesFileName */ + commandlinesFileName?: (string|null); + + /** TaskRunnerSettings vmId */ + vmId?: (string|null); + + /** TaskRunnerSettings languageHint */ + languageHint?: (string|null); + + /** TaskRunnerSettings streamingWorkerMainClass */ + streamingWorkerMainClass?: (string|null); + } + + /** Represents a TaskRunnerSettings. */ + class TaskRunnerSettings implements ITaskRunnerSettings { + + /** + * Constructs a new TaskRunnerSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.dataflow.v1beta3.ITaskRunnerSettings); + + /** TaskRunnerSettings taskUser. */ + public taskUser: string; + + /** TaskRunnerSettings taskGroup. */ + public taskGroup: string; + + /** TaskRunnerSettings oauthScopes. */ + public oauthScopes: string[]; + + /** TaskRunnerSettings baseUrl. */ + public baseUrl: string; + + /** TaskRunnerSettings dataflowApiVersion. */ + public dataflowApiVersion: string; + + /** TaskRunnerSettings parallelWorkerSettings. */ + public parallelWorkerSettings?: (google.dataflow.v1beta3.IWorkerSettings|null); + + /** TaskRunnerSettings baseTaskDir. */ + public baseTaskDir: string; + + /** TaskRunnerSettings continueOnException. */ + public continueOnException: boolean; + + /** TaskRunnerSettings logToSerialconsole. */ + public logToSerialconsole: boolean; + + /** TaskRunnerSettings alsologtostderr. */ + public alsologtostderr: boolean; + + /** TaskRunnerSettings logUploadLocation. */ + public logUploadLocation: string; + + /** TaskRunnerSettings logDir. */ + public logDir: string; + + /** TaskRunnerSettings tempStoragePrefix. */ + public tempStoragePrefix: string; + + /** TaskRunnerSettings harnessCommand. */ + public harnessCommand: string; + + /** TaskRunnerSettings workflowFileName. */ + public workflowFileName: string; + + /** TaskRunnerSettings commandlinesFileName. */ + public commandlinesFileName: string; + + /** TaskRunnerSettings vmId. */ + public vmId: string; + + /** TaskRunnerSettings languageHint. */ + public languageHint: string; + + /** TaskRunnerSettings streamingWorkerMainClass. */ + public streamingWorkerMainClass: string; + + /** + * Creates a new TaskRunnerSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns TaskRunnerSettings instance + */ + public static create(properties?: google.dataflow.v1beta3.ITaskRunnerSettings): google.dataflow.v1beta3.TaskRunnerSettings; + + /** + * Encodes the specified TaskRunnerSettings message. Does not implicitly {@link google.dataflow.v1beta3.TaskRunnerSettings.verify|verify} messages. + * @param message TaskRunnerSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.dataflow.v1beta3.ITaskRunnerSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TaskRunnerSettings message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.TaskRunnerSettings.verify|verify} messages. + * @param message TaskRunnerSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.dataflow.v1beta3.ITaskRunnerSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TaskRunnerSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TaskRunnerSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.dataflow.v1beta3.TaskRunnerSettings; + + /** + * Decodes a TaskRunnerSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TaskRunnerSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.dataflow.v1beta3.TaskRunnerSettings; + + /** + * Verifies a TaskRunnerSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TaskRunnerSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TaskRunnerSettings + */ + public static fromObject(object: { [k: string]: any }): google.dataflow.v1beta3.TaskRunnerSettings; + + /** + * Creates a plain object from a TaskRunnerSettings message. Also converts values to other types if specified. + * @param message TaskRunnerSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.dataflow.v1beta3.TaskRunnerSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TaskRunnerSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TaskRunnerSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** TeardownPolicy enum. */ + enum TeardownPolicy { + TEARDOWN_POLICY_UNKNOWN = 0, + TEARDOWN_ALWAYS = 1, + TEARDOWN_ON_SUCCESS = 2, + TEARDOWN_NEVER = 3 + } + + /** DefaultPackageSet enum. */ + enum DefaultPackageSet { + DEFAULT_PACKAGE_SET_UNKNOWN = 0, + DEFAULT_PACKAGE_SET_NONE = 1, + DEFAULT_PACKAGE_SET_JAVA = 2, + DEFAULT_PACKAGE_SET_PYTHON = 3 + } + + /** AutoscalingAlgorithm enum. */ + enum AutoscalingAlgorithm { + AUTOSCALING_ALGORITHM_UNKNOWN = 0, + AUTOSCALING_ALGORITHM_NONE = 1, + AUTOSCALING_ALGORITHM_BASIC = 2 + } + + /** Properties of an AutoscalingSettings. */ + interface IAutoscalingSettings { + + /** AutoscalingSettings algorithm */ + algorithm?: (google.dataflow.v1beta3.AutoscalingAlgorithm|keyof typeof google.dataflow.v1beta3.AutoscalingAlgorithm|null); + + /** AutoscalingSettings maxNumWorkers */ + maxNumWorkers?: (number|null); + } + + /** Represents an AutoscalingSettings. */ + class AutoscalingSettings implements IAutoscalingSettings { + + /** + * Constructs a new AutoscalingSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.dataflow.v1beta3.IAutoscalingSettings); + + /** AutoscalingSettings algorithm. */ + public algorithm: (google.dataflow.v1beta3.AutoscalingAlgorithm|keyof typeof google.dataflow.v1beta3.AutoscalingAlgorithm); + + /** AutoscalingSettings maxNumWorkers. */ + public maxNumWorkers: number; + + /** + * Creates a new AutoscalingSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns AutoscalingSettings instance + */ + public static create(properties?: google.dataflow.v1beta3.IAutoscalingSettings): google.dataflow.v1beta3.AutoscalingSettings; + + /** + * Encodes the specified AutoscalingSettings message. Does not implicitly {@link google.dataflow.v1beta3.AutoscalingSettings.verify|verify} messages. + * @param message AutoscalingSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.dataflow.v1beta3.IAutoscalingSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AutoscalingSettings message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.AutoscalingSettings.verify|verify} messages. + * @param message AutoscalingSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.dataflow.v1beta3.IAutoscalingSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AutoscalingSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AutoscalingSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.dataflow.v1beta3.AutoscalingSettings; + + /** + * Decodes an AutoscalingSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AutoscalingSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.dataflow.v1beta3.AutoscalingSettings; + + /** + * Verifies an AutoscalingSettings message. + * @param message Plain 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 AutoscalingSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AutoscalingSettings + */ + public static fromObject(object: { [k: string]: any }): google.dataflow.v1beta3.AutoscalingSettings; + + /** + * Creates a plain object from an AutoscalingSettings message. Also converts values to other types if specified. + * @param message AutoscalingSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.dataflow.v1beta3.AutoscalingSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AutoscalingSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AutoscalingSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** WorkerIPAddressConfiguration enum. */ + enum WorkerIPAddressConfiguration { + WORKER_IP_UNSPECIFIED = 0, + WORKER_IP_PUBLIC = 1, + WORKER_IP_PRIVATE = 2 + } + + /** Properties of a SdkHarnessContainerImage. */ + interface ISdkHarnessContainerImage { + + /** SdkHarnessContainerImage containerImage */ + containerImage?: (string|null); + + /** SdkHarnessContainerImage useSingleCorePerContainer */ + useSingleCorePerContainer?: (boolean|null); + + /** SdkHarnessContainerImage environmentId */ + environmentId?: (string|null); + + /** SdkHarnessContainerImage capabilities */ + capabilities?: (string[]|null); + } + + /** Represents a SdkHarnessContainerImage. */ + class SdkHarnessContainerImage implements ISdkHarnessContainerImage { + + /** + * Constructs a new SdkHarnessContainerImage. + * @param [properties] Properties to set + */ + constructor(properties?: google.dataflow.v1beta3.ISdkHarnessContainerImage); + + /** SdkHarnessContainerImage containerImage. */ + public containerImage: string; + + /** SdkHarnessContainerImage useSingleCorePerContainer. */ + public useSingleCorePerContainer: boolean; + + /** SdkHarnessContainerImage environmentId. */ + public environmentId: string; + + /** SdkHarnessContainerImage capabilities. */ + public capabilities: string[]; + + /** + * Creates a new SdkHarnessContainerImage instance using the specified properties. + * @param [properties] Properties to set + * @returns SdkHarnessContainerImage instance + */ + public static create(properties?: google.dataflow.v1beta3.ISdkHarnessContainerImage): google.dataflow.v1beta3.SdkHarnessContainerImage; + + /** + * Encodes the specified SdkHarnessContainerImage message. Does not implicitly {@link google.dataflow.v1beta3.SdkHarnessContainerImage.verify|verify} messages. + * @param message SdkHarnessContainerImage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.dataflow.v1beta3.ISdkHarnessContainerImage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SdkHarnessContainerImage message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.SdkHarnessContainerImage.verify|verify} messages. + * @param message SdkHarnessContainerImage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.dataflow.v1beta3.ISdkHarnessContainerImage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SdkHarnessContainerImage message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SdkHarnessContainerImage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.dataflow.v1beta3.SdkHarnessContainerImage; + + /** + * Decodes a SdkHarnessContainerImage message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SdkHarnessContainerImage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.dataflow.v1beta3.SdkHarnessContainerImage; + + /** + * Verifies a SdkHarnessContainerImage message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SdkHarnessContainerImage message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SdkHarnessContainerImage + */ + public static fromObject(object: { [k: string]: any }): google.dataflow.v1beta3.SdkHarnessContainerImage; + + /** + * Creates a plain object from a SdkHarnessContainerImage message. Also converts values to other types if specified. + * @param message SdkHarnessContainerImage + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.dataflow.v1beta3.SdkHarnessContainerImage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SdkHarnessContainerImage to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SdkHarnessContainerImage + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a WorkerPool. */ + interface IWorkerPool { + + /** WorkerPool kind */ + kind?: (string|null); + + /** WorkerPool numWorkers */ + numWorkers?: (number|null); + + /** WorkerPool packages */ + packages?: (google.dataflow.v1beta3.IPackage[]|null); + + /** WorkerPool defaultPackageSet */ + defaultPackageSet?: (google.dataflow.v1beta3.DefaultPackageSet|keyof typeof google.dataflow.v1beta3.DefaultPackageSet|null); + + /** WorkerPool machineType */ + machineType?: (string|null); + + /** WorkerPool teardownPolicy */ + teardownPolicy?: (google.dataflow.v1beta3.TeardownPolicy|keyof typeof google.dataflow.v1beta3.TeardownPolicy|null); + + /** WorkerPool diskSizeGb */ + diskSizeGb?: (number|null); + + /** WorkerPool diskType */ + diskType?: (string|null); + + /** WorkerPool diskSourceImage */ + diskSourceImage?: (string|null); + + /** WorkerPool zone */ + zone?: (string|null); + + /** WorkerPool taskrunnerSettings */ + taskrunnerSettings?: (google.dataflow.v1beta3.ITaskRunnerSettings|null); + + /** WorkerPool onHostMaintenance */ + onHostMaintenance?: (string|null); + + /** WorkerPool dataDisks */ + dataDisks?: (google.dataflow.v1beta3.IDisk[]|null); + + /** WorkerPool metadata */ + metadata?: ({ [k: string]: string }|null); + + /** WorkerPool autoscalingSettings */ + autoscalingSettings?: (google.dataflow.v1beta3.IAutoscalingSettings|null); + + /** WorkerPool poolArgs */ + poolArgs?: (google.protobuf.IAny|null); + + /** WorkerPool network */ + network?: (string|null); + + /** WorkerPool subnetwork */ + subnetwork?: (string|null); + + /** WorkerPool workerHarnessContainerImage */ + workerHarnessContainerImage?: (string|null); + + /** WorkerPool numThreadsPerWorker */ + numThreadsPerWorker?: (number|null); + + /** WorkerPool ipConfiguration */ + ipConfiguration?: (google.dataflow.v1beta3.WorkerIPAddressConfiguration|keyof typeof google.dataflow.v1beta3.WorkerIPAddressConfiguration|null); + + /** WorkerPool sdkHarnessContainerImages */ + sdkHarnessContainerImages?: (google.dataflow.v1beta3.ISdkHarnessContainerImage[]|null); + } + + /** Represents a WorkerPool. */ + class WorkerPool implements IWorkerPool { + + /** + * Constructs a new WorkerPool. + * @param [properties] Properties to set + */ + constructor(properties?: google.dataflow.v1beta3.IWorkerPool); + + /** WorkerPool kind. */ + public kind: string; + + /** WorkerPool numWorkers. */ + public numWorkers: number; + + /** WorkerPool packages. */ + public packages: google.dataflow.v1beta3.IPackage[]; + + /** WorkerPool defaultPackageSet. */ + public defaultPackageSet: (google.dataflow.v1beta3.DefaultPackageSet|keyof typeof google.dataflow.v1beta3.DefaultPackageSet); + + /** WorkerPool machineType. */ + public machineType: string; + + /** WorkerPool teardownPolicy. */ + public teardownPolicy: (google.dataflow.v1beta3.TeardownPolicy|keyof typeof google.dataflow.v1beta3.TeardownPolicy); + + /** WorkerPool diskSizeGb. */ + public diskSizeGb: number; + + /** WorkerPool diskType. */ + public diskType: string; + + /** WorkerPool diskSourceImage. */ + public diskSourceImage: string; + + /** WorkerPool zone. */ + public zone: string; + + /** WorkerPool taskrunnerSettings. */ + public taskrunnerSettings?: (google.dataflow.v1beta3.ITaskRunnerSettings|null); + + /** WorkerPool onHostMaintenance. */ + public onHostMaintenance: string; + + /** WorkerPool dataDisks. */ + public dataDisks: google.dataflow.v1beta3.IDisk[]; + + /** WorkerPool metadata. */ + public metadata: { [k: string]: string }; + + /** WorkerPool autoscalingSettings. */ + public autoscalingSettings?: (google.dataflow.v1beta3.IAutoscalingSettings|null); + + /** WorkerPool poolArgs. */ + public poolArgs?: (google.protobuf.IAny|null); + + /** WorkerPool network. */ + public network: string; + + /** WorkerPool subnetwork. */ + public subnetwork: string; + + /** WorkerPool workerHarnessContainerImage. */ + public workerHarnessContainerImage: string; + + /** WorkerPool numThreadsPerWorker. */ + public numThreadsPerWorker: number; + + /** WorkerPool ipConfiguration. */ + public ipConfiguration: (google.dataflow.v1beta3.WorkerIPAddressConfiguration|keyof typeof google.dataflow.v1beta3.WorkerIPAddressConfiguration); + + /** WorkerPool sdkHarnessContainerImages. */ + public sdkHarnessContainerImages: google.dataflow.v1beta3.ISdkHarnessContainerImage[]; + + /** + * Creates a new WorkerPool instance using the specified properties. + * @param [properties] Properties to set + * @returns WorkerPool instance + */ + public static create(properties?: google.dataflow.v1beta3.IWorkerPool): google.dataflow.v1beta3.WorkerPool; + + /** + * Encodes the specified WorkerPool message. Does not implicitly {@link google.dataflow.v1beta3.WorkerPool.verify|verify} messages. + * @param message WorkerPool message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.dataflow.v1beta3.IWorkerPool, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WorkerPool message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.WorkerPool.verify|verify} messages. + * @param message WorkerPool message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.dataflow.v1beta3.IWorkerPool, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WorkerPool message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WorkerPool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.dataflow.v1beta3.WorkerPool; + + /** + * Decodes a WorkerPool message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WorkerPool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.dataflow.v1beta3.WorkerPool; + + /** + * Verifies a WorkerPool message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WorkerPool message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WorkerPool + */ + public static fromObject(object: { [k: string]: any }): google.dataflow.v1beta3.WorkerPool; + + /** + * Creates a plain object from a WorkerPool message. Also converts values to other types if specified. + * @param message WorkerPool + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.dataflow.v1beta3.WorkerPool, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WorkerPool to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WorkerPool + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** ShuffleMode enum. */ + enum ShuffleMode { + SHUFFLE_MODE_UNSPECIFIED = 0, + VM_BASED = 1, + SERVICE_BASED = 2 + } + + /** Properties of a DebugOptions. */ + interface IDebugOptions { + + /** DebugOptions enableHotKeyLogging */ + enableHotKeyLogging?: (boolean|null); + } + + /** Represents a DebugOptions. */ + class DebugOptions implements IDebugOptions { + + /** + * Constructs a new DebugOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.dataflow.v1beta3.IDebugOptions); + + /** DebugOptions enableHotKeyLogging. */ + public enableHotKeyLogging: boolean; + + /** + * Creates a new DebugOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns DebugOptions instance + */ + public static create(properties?: google.dataflow.v1beta3.IDebugOptions): google.dataflow.v1beta3.DebugOptions; + + /** + * Encodes the specified DebugOptions message. Does not implicitly {@link google.dataflow.v1beta3.DebugOptions.verify|verify} messages. + * @param message DebugOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.dataflow.v1beta3.IDebugOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DebugOptions message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.DebugOptions.verify|verify} messages. + * @param message DebugOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.dataflow.v1beta3.IDebugOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DebugOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DebugOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.dataflow.v1beta3.DebugOptions; + + /** + * Decodes a DebugOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DebugOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.dataflow.v1beta3.DebugOptions; + + /** + * Verifies a DebugOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DebugOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DebugOptions + */ + public static fromObject(object: { [k: string]: any }): google.dataflow.v1beta3.DebugOptions; + + /** + * Creates a plain object from a DebugOptions message. Also converts values to other types if specified. + * @param message DebugOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.dataflow.v1beta3.DebugOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DebugOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DebugOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents a JobsV1Beta3 */ + class JobsV1Beta3 extends $protobuf.rpc.Service { + + /** + * Constructs a new JobsV1Beta3 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 JobsV1Beta3 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): JobsV1Beta3; + + /** + * Calls CreateJob. + * @param request CreateJobRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Job + */ + public createJob(request: google.dataflow.v1beta3.ICreateJobRequest, callback: google.dataflow.v1beta3.JobsV1Beta3.CreateJobCallback): void; + + /** + * Calls CreateJob. + * @param request CreateJobRequest message or plain object + * @returns Promise + */ + public createJob(request: google.dataflow.v1beta3.ICreateJobRequest): Promise; + + /** + * Calls GetJob. + * @param request GetJobRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Job + */ + public getJob(request: google.dataflow.v1beta3.IGetJobRequest, callback: google.dataflow.v1beta3.JobsV1Beta3.GetJobCallback): void; + + /** + * Calls GetJob. + * @param request GetJobRequest message or plain object + * @returns Promise + */ + public getJob(request: google.dataflow.v1beta3.IGetJobRequest): Promise; + + /** + * Calls UpdateJob. + * @param request UpdateJobRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Job + */ + public updateJob(request: google.dataflow.v1beta3.IUpdateJobRequest, callback: google.dataflow.v1beta3.JobsV1Beta3.UpdateJobCallback): void; + + /** + * Calls UpdateJob. + * @param request UpdateJobRequest message or plain object + * @returns Promise + */ + public updateJob(request: google.dataflow.v1beta3.IUpdateJobRequest): Promise; + + /** + * Calls ListJobs. + * @param request ListJobsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListJobsResponse + */ + public listJobs(request: google.dataflow.v1beta3.IListJobsRequest, callback: google.dataflow.v1beta3.JobsV1Beta3.ListJobsCallback): void; + + /** + * Calls ListJobs. + * @param request ListJobsRequest message or plain object + * @returns Promise + */ + public listJobs(request: google.dataflow.v1beta3.IListJobsRequest): Promise; + + /** + * Calls AggregatedListJobs. + * @param request ListJobsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListJobsResponse + */ + public aggregatedListJobs(request: google.dataflow.v1beta3.IListJobsRequest, callback: google.dataflow.v1beta3.JobsV1Beta3.AggregatedListJobsCallback): void; + + /** + * Calls AggregatedListJobs. + * @param request ListJobsRequest message or plain object + * @returns Promise + */ + public aggregatedListJobs(request: google.dataflow.v1beta3.IListJobsRequest): Promise; + + /** + * Calls CheckActiveJobs. + * @param request CheckActiveJobsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and CheckActiveJobsResponse + */ + public checkActiveJobs(request: google.dataflow.v1beta3.ICheckActiveJobsRequest, callback: google.dataflow.v1beta3.JobsV1Beta3.CheckActiveJobsCallback): void; + + /** + * Calls CheckActiveJobs. + * @param request CheckActiveJobsRequest message or plain object + * @returns Promise + */ + public checkActiveJobs(request: google.dataflow.v1beta3.ICheckActiveJobsRequest): Promise; + + /** + * Calls SnapshotJob. + * @param request SnapshotJobRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Snapshot + */ + public snapshotJob(request: google.dataflow.v1beta3.ISnapshotJobRequest, callback: google.dataflow.v1beta3.JobsV1Beta3.SnapshotJobCallback): void; + + /** + * Calls SnapshotJob. + * @param request SnapshotJobRequest message or plain object + * @returns Promise + */ + public snapshotJob(request: google.dataflow.v1beta3.ISnapshotJobRequest): Promise; + } + + namespace JobsV1Beta3 { + + /** + * Callback as used by {@link google.dataflow.v1beta3.JobsV1Beta3|createJob}. + * @param error Error, if any + * @param [response] Job + */ + type CreateJobCallback = (error: (Error|null), response?: google.dataflow.v1beta3.Job) => void; + + /** + * Callback as used by {@link google.dataflow.v1beta3.JobsV1Beta3|getJob}. + * @param error Error, if any + * @param [response] Job + */ + type GetJobCallback = (error: (Error|null), response?: google.dataflow.v1beta3.Job) => void; + + /** + * Callback as used by {@link google.dataflow.v1beta3.JobsV1Beta3|updateJob}. + * @param error Error, if any + * @param [response] Job + */ + type UpdateJobCallback = (error: (Error|null), response?: google.dataflow.v1beta3.Job) => void; + + /** + * Callback as used by {@link google.dataflow.v1beta3.JobsV1Beta3|listJobs}. + * @param error Error, if any + * @param [response] ListJobsResponse + */ + type ListJobsCallback = (error: (Error|null), response?: google.dataflow.v1beta3.ListJobsResponse) => void; + + /** + * Callback as used by {@link google.dataflow.v1beta3.JobsV1Beta3|aggregatedListJobs}. + * @param error Error, if any + * @param [response] ListJobsResponse + */ + type AggregatedListJobsCallback = (error: (Error|null), response?: google.dataflow.v1beta3.ListJobsResponse) => void; + + /** + * Callback as used by {@link google.dataflow.v1beta3.JobsV1Beta3|checkActiveJobs}. + * @param error Error, if any + * @param [response] CheckActiveJobsResponse + */ + type CheckActiveJobsCallback = (error: (Error|null), response?: google.dataflow.v1beta3.CheckActiveJobsResponse) => void; + + /** + * Callback as used by {@link google.dataflow.v1beta3.JobsV1Beta3|snapshotJob}. + * @param error Error, if any + * @param [response] Snapshot + */ + type SnapshotJobCallback = (error: (Error|null), response?: google.dataflow.v1beta3.Snapshot) => void; + } + + /** Properties of a Job. */ + interface IJob { + + /** Job id */ + id?: (string|null); + + /** Job projectId */ + projectId?: (string|null); + + /** Job name */ + name?: (string|null); + + /** Job type */ + type?: (google.dataflow.v1beta3.JobType|keyof typeof google.dataflow.v1beta3.JobType|null); + + /** Job environment */ + environment?: (google.dataflow.v1beta3.IEnvironment|null); + + /** Job steps */ + steps?: (google.dataflow.v1beta3.IStep[]|null); + + /** Job stepsLocation */ + stepsLocation?: (string|null); + + /** Job currentState */ + currentState?: (google.dataflow.v1beta3.JobState|keyof typeof google.dataflow.v1beta3.JobState|null); + + /** Job currentStateTime */ + currentStateTime?: (google.protobuf.ITimestamp|null); + + /** Job requestedState */ + requestedState?: (google.dataflow.v1beta3.JobState|keyof typeof google.dataflow.v1beta3.JobState|null); + + /** Job executionInfo */ + executionInfo?: (google.dataflow.v1beta3.IJobExecutionInfo|null); + + /** Job createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Job replaceJobId */ + replaceJobId?: (string|null); + + /** Job transformNameMapping */ + transformNameMapping?: ({ [k: string]: string }|null); + + /** Job clientRequestId */ + clientRequestId?: (string|null); + + /** Job replacedByJobId */ + replacedByJobId?: (string|null); + + /** Job tempFiles */ + tempFiles?: (string[]|null); + + /** Job labels */ + labels?: ({ [k: string]: string }|null); + + /** Job location */ + location?: (string|null); + + /** Job pipelineDescription */ + pipelineDescription?: (google.dataflow.v1beta3.IPipelineDescription|null); + + /** Job stageStates */ + stageStates?: (google.dataflow.v1beta3.IExecutionStageState[]|null); + + /** Job jobMetadata */ + jobMetadata?: (google.dataflow.v1beta3.IJobMetadata|null); + + /** Job startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** Job createdFromSnapshotId */ + createdFromSnapshotId?: (string|null); + + /** Job satisfiesPzs */ + satisfiesPzs?: (boolean|null); + } + + /** Represents a Job. */ + class Job implements IJob { + + /** + * Constructs a new Job. + * @param [properties] Properties to set + */ + constructor(properties?: google.dataflow.v1beta3.IJob); + + /** Job id. */ + public id: string; + + /** Job projectId. */ + public projectId: string; + + /** Job name. */ + public name: string; + + /** Job type. */ + public type: (google.dataflow.v1beta3.JobType|keyof typeof google.dataflow.v1beta3.JobType); + + /** Job environment. */ + public environment?: (google.dataflow.v1beta3.IEnvironment|null); + + /** Job steps. */ + public steps: google.dataflow.v1beta3.IStep[]; + + /** Job stepsLocation. */ + public stepsLocation: string; + + /** Job currentState. */ + public currentState: (google.dataflow.v1beta3.JobState|keyof typeof google.dataflow.v1beta3.JobState); + + /** Job currentStateTime. */ + public currentStateTime?: (google.protobuf.ITimestamp|null); + + /** Job requestedState. */ + public requestedState: (google.dataflow.v1beta3.JobState|keyof typeof google.dataflow.v1beta3.JobState); + + /** Job executionInfo. */ + public executionInfo?: (google.dataflow.v1beta3.IJobExecutionInfo|null); + + /** Job createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Job replaceJobId. */ + public replaceJobId: string; + + /** Job transformNameMapping. */ + public transformNameMapping: { [k: string]: string }; + + /** Job clientRequestId. */ + public clientRequestId: string; + + /** Job replacedByJobId. */ + public replacedByJobId: string; + + /** Job tempFiles. */ + public tempFiles: string[]; + + /** Job labels. */ + public labels: { [k: string]: string }; + + /** Job location. */ + public location: string; + + /** Job pipelineDescription. */ + public pipelineDescription?: (google.dataflow.v1beta3.IPipelineDescription|null); + + /** Job stageStates. */ + public stageStates: google.dataflow.v1beta3.IExecutionStageState[]; + + /** Job jobMetadata. */ + public jobMetadata?: (google.dataflow.v1beta3.IJobMetadata|null); + + /** Job startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** Job createdFromSnapshotId. */ + public createdFromSnapshotId: string; + + /** Job satisfiesPzs. */ + public satisfiesPzs: boolean; + + /** + * Creates a new Job instance using the specified properties. + * @param [properties] Properties to set + * @returns Job instance + */ + public static create(properties?: google.dataflow.v1beta3.IJob): google.dataflow.v1beta3.Job; + + /** + * Encodes the specified Job message. Does not implicitly {@link google.dataflow.v1beta3.Job.verify|verify} messages. + * @param message Job message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.dataflow.v1beta3.IJob, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Job message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.Job.verify|verify} messages. + * @param message Job message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.dataflow.v1beta3.IJob, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Job message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Job + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.dataflow.v1beta3.Job; + + /** + * Decodes a Job message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Job + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.dataflow.v1beta3.Job; + + /** + * Verifies a Job message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Job message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Job + */ + public static fromObject(object: { [k: string]: any }): google.dataflow.v1beta3.Job; + + /** + * Creates a plain object from a Job message. Also converts values to other types if specified. + * @param message Job + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.dataflow.v1beta3.Job, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Job to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Job + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DatastoreIODetails. */ + interface IDatastoreIODetails { + + /** DatastoreIODetails namespace */ + namespace?: (string|null); + + /** DatastoreIODetails projectId */ + projectId?: (string|null); + } + + /** Represents a DatastoreIODetails. */ + class DatastoreIODetails implements IDatastoreIODetails { + + /** + * Constructs a new DatastoreIODetails. + * @param [properties] Properties to set + */ + constructor(properties?: google.dataflow.v1beta3.IDatastoreIODetails); + + /** DatastoreIODetails namespace. */ + public namespace: string; + + /** DatastoreIODetails projectId. */ + public projectId: string; + + /** + * Creates a new DatastoreIODetails instance using the specified properties. + * @param [properties] Properties to set + * @returns DatastoreIODetails instance + */ + public static create(properties?: google.dataflow.v1beta3.IDatastoreIODetails): google.dataflow.v1beta3.DatastoreIODetails; + + /** + * Encodes the specified DatastoreIODetails message. Does not implicitly {@link google.dataflow.v1beta3.DatastoreIODetails.verify|verify} messages. + * @param message DatastoreIODetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.dataflow.v1beta3.IDatastoreIODetails, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DatastoreIODetails message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.DatastoreIODetails.verify|verify} messages. + * @param message DatastoreIODetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.dataflow.v1beta3.IDatastoreIODetails, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DatastoreIODetails message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DatastoreIODetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.dataflow.v1beta3.DatastoreIODetails; + + /** + * Decodes a DatastoreIODetails message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DatastoreIODetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.dataflow.v1beta3.DatastoreIODetails; + + /** + * Verifies a DatastoreIODetails message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DatastoreIODetails message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DatastoreIODetails + */ + public static fromObject(object: { [k: string]: any }): google.dataflow.v1beta3.DatastoreIODetails; + + /** + * Creates a plain object from a DatastoreIODetails message. Also converts values to other types if specified. + * @param message DatastoreIODetails + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.dataflow.v1beta3.DatastoreIODetails, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DatastoreIODetails to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DatastoreIODetails + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PubSubIODetails. */ + interface IPubSubIODetails { + + /** PubSubIODetails topic */ + topic?: (string|null); + + /** PubSubIODetails subscription */ + subscription?: (string|null); + } + + /** Represents a PubSubIODetails. */ + class PubSubIODetails implements IPubSubIODetails { + + /** + * Constructs a new PubSubIODetails. + * @param [properties] Properties to set + */ + constructor(properties?: google.dataflow.v1beta3.IPubSubIODetails); + + /** PubSubIODetails topic. */ + public topic: string; + + /** PubSubIODetails subscription. */ + public subscription: string; + + /** + * Creates a new PubSubIODetails instance using the specified properties. + * @param [properties] Properties to set + * @returns PubSubIODetails instance + */ + public static create(properties?: google.dataflow.v1beta3.IPubSubIODetails): google.dataflow.v1beta3.PubSubIODetails; + + /** + * Encodes the specified PubSubIODetails message. Does not implicitly {@link google.dataflow.v1beta3.PubSubIODetails.verify|verify} messages. + * @param message PubSubIODetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.dataflow.v1beta3.IPubSubIODetails, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PubSubIODetails message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.PubSubIODetails.verify|verify} messages. + * @param message PubSubIODetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.dataflow.v1beta3.IPubSubIODetails, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PubSubIODetails message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PubSubIODetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.dataflow.v1beta3.PubSubIODetails; + + /** + * Decodes a PubSubIODetails message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PubSubIODetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.dataflow.v1beta3.PubSubIODetails; + + /** + * Verifies a PubSubIODetails message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PubSubIODetails message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PubSubIODetails + */ + public static fromObject(object: { [k: string]: any }): google.dataflow.v1beta3.PubSubIODetails; + + /** + * Creates a plain object from a PubSubIODetails message. Also converts values to other types if specified. + * @param message PubSubIODetails + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.dataflow.v1beta3.PubSubIODetails, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PubSubIODetails to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PubSubIODetails + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FileIODetails. */ + interface IFileIODetails { + + /** FileIODetails filePattern */ + filePattern?: (string|null); + } + + /** Represents a FileIODetails. */ + class FileIODetails implements IFileIODetails { + + /** + * Constructs a new FileIODetails. + * @param [properties] Properties to set + */ + constructor(properties?: google.dataflow.v1beta3.IFileIODetails); + + /** FileIODetails filePattern. */ + public filePattern: string; + + /** + * Creates a new FileIODetails instance using the specified properties. + * @param [properties] Properties to set + * @returns FileIODetails instance + */ + public static create(properties?: google.dataflow.v1beta3.IFileIODetails): google.dataflow.v1beta3.FileIODetails; + + /** + * Encodes the specified FileIODetails message. Does not implicitly {@link google.dataflow.v1beta3.FileIODetails.verify|verify} messages. + * @param message FileIODetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.dataflow.v1beta3.IFileIODetails, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileIODetails message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.FileIODetails.verify|verify} messages. + * @param message FileIODetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.dataflow.v1beta3.IFileIODetails, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileIODetails message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileIODetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.dataflow.v1beta3.FileIODetails; + + /** + * Decodes a FileIODetails message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileIODetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.dataflow.v1beta3.FileIODetails; + + /** + * Verifies a FileIODetails message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FileIODetails message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileIODetails + */ + public static fromObject(object: { [k: string]: any }): google.dataflow.v1beta3.FileIODetails; + + /** + * Creates a plain object from a FileIODetails message. Also converts values to other types if specified. + * @param message FileIODetails + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.dataflow.v1beta3.FileIODetails, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileIODetails to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FileIODetails + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BigTableIODetails. */ + interface IBigTableIODetails { + + /** BigTableIODetails projectId */ + projectId?: (string|null); + + /** BigTableIODetails instanceId */ + instanceId?: (string|null); + + /** BigTableIODetails tableId */ + tableId?: (string|null); + } + + /** Represents a BigTableIODetails. */ + class BigTableIODetails implements IBigTableIODetails { + + /** + * Constructs a new BigTableIODetails. + * @param [properties] Properties to set + */ + constructor(properties?: google.dataflow.v1beta3.IBigTableIODetails); + + /** BigTableIODetails projectId. */ + public projectId: string; + + /** BigTableIODetails instanceId. */ + public instanceId: string; + + /** BigTableIODetails tableId. */ + public tableId: string; + + /** + * Creates a new BigTableIODetails instance using the specified properties. + * @param [properties] Properties to set + * @returns BigTableIODetails instance + */ + public static create(properties?: google.dataflow.v1beta3.IBigTableIODetails): google.dataflow.v1beta3.BigTableIODetails; + + /** + * Encodes the specified BigTableIODetails message. Does not implicitly {@link google.dataflow.v1beta3.BigTableIODetails.verify|verify} messages. + * @param message BigTableIODetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.dataflow.v1beta3.IBigTableIODetails, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BigTableIODetails message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.BigTableIODetails.verify|verify} messages. + * @param message BigTableIODetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.dataflow.v1beta3.IBigTableIODetails, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BigTableIODetails message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BigTableIODetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.dataflow.v1beta3.BigTableIODetails; + + /** + * Decodes a BigTableIODetails message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BigTableIODetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.dataflow.v1beta3.BigTableIODetails; + + /** + * Verifies a BigTableIODetails message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BigTableIODetails message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BigTableIODetails + */ + public static fromObject(object: { [k: string]: any }): google.dataflow.v1beta3.BigTableIODetails; + + /** + * Creates a plain object from a BigTableIODetails message. Also converts values to other types if specified. + * @param message BigTableIODetails + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.dataflow.v1beta3.BigTableIODetails, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BigTableIODetails to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BigTableIODetails + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BigQueryIODetails. */ + interface IBigQueryIODetails { + + /** BigQueryIODetails table */ + table?: (string|null); + + /** BigQueryIODetails dataset */ + dataset?: (string|null); + + /** BigQueryIODetails projectId */ + projectId?: (string|null); + + /** BigQueryIODetails query */ + query?: (string|null); + } + + /** Represents a BigQueryIODetails. */ + class BigQueryIODetails implements IBigQueryIODetails { + + /** + * Constructs a new BigQueryIODetails. + * @param [properties] Properties to set + */ + constructor(properties?: google.dataflow.v1beta3.IBigQueryIODetails); + + /** BigQueryIODetails table. */ + public table: string; + + /** BigQueryIODetails dataset. */ + public dataset: string; + + /** BigQueryIODetails projectId. */ + public projectId: string; + + /** BigQueryIODetails query. */ + public query: string; + + /** + * Creates a new BigQueryIODetails instance using the specified properties. + * @param [properties] Properties to set + * @returns BigQueryIODetails instance + */ + public static create(properties?: google.dataflow.v1beta3.IBigQueryIODetails): google.dataflow.v1beta3.BigQueryIODetails; + + /** + * Encodes the specified BigQueryIODetails message. Does not implicitly {@link google.dataflow.v1beta3.BigQueryIODetails.verify|verify} messages. + * @param message BigQueryIODetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.dataflow.v1beta3.IBigQueryIODetails, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BigQueryIODetails message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.BigQueryIODetails.verify|verify} messages. + * @param message BigQueryIODetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.dataflow.v1beta3.IBigQueryIODetails, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BigQueryIODetails message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BigQueryIODetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.dataflow.v1beta3.BigQueryIODetails; + + /** + * Decodes a BigQueryIODetails message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BigQueryIODetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.dataflow.v1beta3.BigQueryIODetails; + + /** + * Verifies a BigQueryIODetails message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BigQueryIODetails message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BigQueryIODetails + */ + public static fromObject(object: { [k: string]: any }): google.dataflow.v1beta3.BigQueryIODetails; + + /** + * Creates a plain object from a BigQueryIODetails message. Also converts values to other types if specified. + * @param message BigQueryIODetails + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.dataflow.v1beta3.BigQueryIODetails, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BigQueryIODetails to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BigQueryIODetails + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SpannerIODetails. */ + interface ISpannerIODetails { + + /** SpannerIODetails projectId */ + projectId?: (string|null); + + /** SpannerIODetails instanceId */ + instanceId?: (string|null); + + /** SpannerIODetails databaseId */ + databaseId?: (string|null); + } + + /** Represents a SpannerIODetails. */ + class SpannerIODetails implements ISpannerIODetails { + + /** + * Constructs a new SpannerIODetails. + * @param [properties] Properties to set + */ + constructor(properties?: google.dataflow.v1beta3.ISpannerIODetails); + + /** SpannerIODetails projectId. */ + public projectId: string; + + /** SpannerIODetails instanceId. */ + public instanceId: string; + + /** SpannerIODetails databaseId. */ + public databaseId: string; + + /** + * Creates a new SpannerIODetails instance using the specified properties. + * @param [properties] Properties to set + * @returns SpannerIODetails instance + */ + public static create(properties?: google.dataflow.v1beta3.ISpannerIODetails): google.dataflow.v1beta3.SpannerIODetails; + + /** + * Encodes the specified SpannerIODetails message. Does not implicitly {@link google.dataflow.v1beta3.SpannerIODetails.verify|verify} messages. + * @param message SpannerIODetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.dataflow.v1beta3.ISpannerIODetails, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SpannerIODetails message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.SpannerIODetails.verify|verify} messages. + * @param message SpannerIODetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.dataflow.v1beta3.ISpannerIODetails, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SpannerIODetails message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SpannerIODetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.dataflow.v1beta3.SpannerIODetails; + + /** + * Decodes a SpannerIODetails message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SpannerIODetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.dataflow.v1beta3.SpannerIODetails; + + /** + * Verifies a SpannerIODetails message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SpannerIODetails message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SpannerIODetails + */ + public static fromObject(object: { [k: string]: any }): google.dataflow.v1beta3.SpannerIODetails; + + /** + * Creates a plain object from a SpannerIODetails message. Also converts values to other types if specified. + * @param message SpannerIODetails + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.dataflow.v1beta3.SpannerIODetails, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SpannerIODetails to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SpannerIODetails + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SdkVersion. */ + interface ISdkVersion { + + /** SdkVersion version */ + version?: (string|null); + + /** SdkVersion versionDisplayName */ + versionDisplayName?: (string|null); + + /** SdkVersion sdkSupportStatus */ + sdkSupportStatus?: (google.dataflow.v1beta3.SdkVersion.SdkSupportStatus|keyof typeof google.dataflow.v1beta3.SdkVersion.SdkSupportStatus|null); + } + + /** Represents a SdkVersion. */ + class SdkVersion implements ISdkVersion { + + /** + * Constructs a new SdkVersion. + * @param [properties] Properties to set + */ + constructor(properties?: google.dataflow.v1beta3.ISdkVersion); + + /** SdkVersion version. */ + public version: string; + + /** SdkVersion versionDisplayName. */ + public versionDisplayName: string; + + /** SdkVersion sdkSupportStatus. */ + public sdkSupportStatus: (google.dataflow.v1beta3.SdkVersion.SdkSupportStatus|keyof typeof google.dataflow.v1beta3.SdkVersion.SdkSupportStatus); + + /** + * Creates a new SdkVersion instance using the specified properties. + * @param [properties] Properties to set + * @returns SdkVersion instance + */ + public static create(properties?: google.dataflow.v1beta3.ISdkVersion): google.dataflow.v1beta3.SdkVersion; + + /** + * Encodes the specified SdkVersion message. Does not implicitly {@link google.dataflow.v1beta3.SdkVersion.verify|verify} messages. + * @param message SdkVersion message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.dataflow.v1beta3.ISdkVersion, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SdkVersion message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.SdkVersion.verify|verify} messages. + * @param message SdkVersion message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.dataflow.v1beta3.ISdkVersion, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SdkVersion message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SdkVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.dataflow.v1beta3.SdkVersion; + + /** + * Decodes a SdkVersion message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SdkVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.dataflow.v1beta3.SdkVersion; + + /** + * Verifies a SdkVersion message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SdkVersion message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SdkVersion + */ + public static fromObject(object: { [k: string]: any }): google.dataflow.v1beta3.SdkVersion; + + /** + * Creates a plain object from a SdkVersion message. Also converts values to other types if specified. + * @param message SdkVersion + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.dataflow.v1beta3.SdkVersion, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SdkVersion to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SdkVersion + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SdkVersion { + + /** SdkSupportStatus enum. */ + enum SdkSupportStatus { + UNKNOWN = 0, + SUPPORTED = 1, + STALE = 2, + DEPRECATED = 3, + UNSUPPORTED = 4 + } + } + + /** Properties of a JobMetadata. */ + interface IJobMetadata { + + /** JobMetadata sdkVersion */ + sdkVersion?: (google.dataflow.v1beta3.ISdkVersion|null); + + /** JobMetadata spannerDetails */ + spannerDetails?: (google.dataflow.v1beta3.ISpannerIODetails[]|null); + + /** JobMetadata bigqueryDetails */ + bigqueryDetails?: (google.dataflow.v1beta3.IBigQueryIODetails[]|null); + + /** JobMetadata bigTableDetails */ + bigTableDetails?: (google.dataflow.v1beta3.IBigTableIODetails[]|null); + + /** JobMetadata pubsubDetails */ + pubsubDetails?: (google.dataflow.v1beta3.IPubSubIODetails[]|null); + + /** JobMetadata fileDetails */ + fileDetails?: (google.dataflow.v1beta3.IFileIODetails[]|null); + + /** JobMetadata datastoreDetails */ + datastoreDetails?: (google.dataflow.v1beta3.IDatastoreIODetails[]|null); + } + + /** Represents a JobMetadata. */ + class JobMetadata implements IJobMetadata { + + /** + * Constructs a new JobMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.dataflow.v1beta3.IJobMetadata); + + /** JobMetadata sdkVersion. */ + public sdkVersion?: (google.dataflow.v1beta3.ISdkVersion|null); + + /** JobMetadata spannerDetails. */ + public spannerDetails: google.dataflow.v1beta3.ISpannerIODetails[]; + + /** JobMetadata bigqueryDetails. */ + public bigqueryDetails: google.dataflow.v1beta3.IBigQueryIODetails[]; + + /** JobMetadata bigTableDetails. */ + public bigTableDetails: google.dataflow.v1beta3.IBigTableIODetails[]; + + /** JobMetadata pubsubDetails. */ + public pubsubDetails: google.dataflow.v1beta3.IPubSubIODetails[]; + + /** JobMetadata fileDetails. */ + public fileDetails: google.dataflow.v1beta3.IFileIODetails[]; + + /** JobMetadata datastoreDetails. */ + public datastoreDetails: google.dataflow.v1beta3.IDatastoreIODetails[]; + + /** + * Creates a new JobMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns JobMetadata instance + */ + public static create(properties?: google.dataflow.v1beta3.IJobMetadata): google.dataflow.v1beta3.JobMetadata; + + /** + * Encodes the specified JobMetadata message. Does not implicitly {@link google.dataflow.v1beta3.JobMetadata.verify|verify} messages. + * @param message JobMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.dataflow.v1beta3.IJobMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified JobMetadata message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.JobMetadata.verify|verify} messages. + * @param message JobMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.dataflow.v1beta3.IJobMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a JobMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns JobMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.dataflow.v1beta3.JobMetadata; + + /** + * Decodes a JobMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns JobMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.dataflow.v1beta3.JobMetadata; + + /** + * Verifies a JobMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a JobMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns JobMetadata + */ + public static fromObject(object: { [k: string]: any }): google.dataflow.v1beta3.JobMetadata; + + /** + * Creates a plain object from a JobMetadata message. Also converts values to other types if specified. + * @param message JobMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.dataflow.v1beta3.JobMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this JobMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for JobMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ExecutionStageState. */ + interface IExecutionStageState { + + /** ExecutionStageState executionStageName */ + executionStageName?: (string|null); + + /** ExecutionStageState executionStageState */ + executionStageState?: (google.dataflow.v1beta3.JobState|keyof typeof google.dataflow.v1beta3.JobState|null); + + /** ExecutionStageState currentStateTime */ + currentStateTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents an ExecutionStageState. */ + class ExecutionStageState implements IExecutionStageState { + + /** + * Constructs a new ExecutionStageState. + * @param [properties] Properties to set + */ + constructor(properties?: google.dataflow.v1beta3.IExecutionStageState); + + /** ExecutionStageState executionStageName. */ + public executionStageName: string; + + /** ExecutionStageState executionStageState. */ + public executionStageState: (google.dataflow.v1beta3.JobState|keyof typeof google.dataflow.v1beta3.JobState); + + /** ExecutionStageState currentStateTime. */ + public currentStateTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new ExecutionStageState instance using the specified properties. + * @param [properties] Properties to set + * @returns ExecutionStageState instance + */ + public static create(properties?: google.dataflow.v1beta3.IExecutionStageState): google.dataflow.v1beta3.ExecutionStageState; + + /** + * Encodes the specified ExecutionStageState message. Does not implicitly {@link google.dataflow.v1beta3.ExecutionStageState.verify|verify} messages. + * @param message ExecutionStageState message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.dataflow.v1beta3.IExecutionStageState, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExecutionStageState message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.ExecutionStageState.verify|verify} messages. + * @param message ExecutionStageState message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.dataflow.v1beta3.IExecutionStageState, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExecutionStageState message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExecutionStageState + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.dataflow.v1beta3.ExecutionStageState; + + /** + * Decodes an ExecutionStageState message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExecutionStageState + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.dataflow.v1beta3.ExecutionStageState; + + /** + * Verifies an ExecutionStageState message. + * @param message Plain 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 ExecutionStageState message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExecutionStageState + */ + public static fromObject(object: { [k: string]: any }): google.dataflow.v1beta3.ExecutionStageState; + + /** + * Creates a plain object from an ExecutionStageState message. Also converts values to other types if specified. + * @param message ExecutionStageState + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.dataflow.v1beta3.ExecutionStageState, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExecutionStageState to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExecutionStageState + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PipelineDescription. */ + interface IPipelineDescription { + + /** PipelineDescription originalPipelineTransform */ + originalPipelineTransform?: (google.dataflow.v1beta3.ITransformSummary[]|null); + + /** PipelineDescription executionPipelineStage */ + executionPipelineStage?: (google.dataflow.v1beta3.IExecutionStageSummary[]|null); + + /** PipelineDescription displayData */ + displayData?: (google.dataflow.v1beta3.IDisplayData[]|null); + } + + /** Represents a PipelineDescription. */ + class PipelineDescription implements IPipelineDescription { + + /** + * Constructs a new PipelineDescription. + * @param [properties] Properties to set + */ + constructor(properties?: google.dataflow.v1beta3.IPipelineDescription); + + /** PipelineDescription originalPipelineTransform. */ + public originalPipelineTransform: google.dataflow.v1beta3.ITransformSummary[]; + + /** PipelineDescription executionPipelineStage. */ + public executionPipelineStage: google.dataflow.v1beta3.IExecutionStageSummary[]; + + /** PipelineDescription displayData. */ + public displayData: google.dataflow.v1beta3.IDisplayData[]; + + /** + * Creates a new PipelineDescription instance using the specified properties. + * @param [properties] Properties to set + * @returns PipelineDescription instance + */ + public static create(properties?: google.dataflow.v1beta3.IPipelineDescription): google.dataflow.v1beta3.PipelineDescription; + + /** + * Encodes the specified PipelineDescription message. Does not implicitly {@link google.dataflow.v1beta3.PipelineDescription.verify|verify} messages. + * @param message PipelineDescription message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.dataflow.v1beta3.IPipelineDescription, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PipelineDescription message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.PipelineDescription.verify|verify} messages. + * @param message PipelineDescription message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.dataflow.v1beta3.IPipelineDescription, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PipelineDescription message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PipelineDescription + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.dataflow.v1beta3.PipelineDescription; + + /** + * Decodes a PipelineDescription message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PipelineDescription + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.dataflow.v1beta3.PipelineDescription; + + /** + * Verifies a PipelineDescription message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PipelineDescription message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PipelineDescription + */ + public static fromObject(object: { [k: string]: any }): google.dataflow.v1beta3.PipelineDescription; + + /** + * Creates a plain object from a PipelineDescription message. Also converts values to other types if specified. + * @param message PipelineDescription + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.dataflow.v1beta3.PipelineDescription, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PipelineDescription to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PipelineDescription + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** KindType enum. */ + enum KindType { + UNKNOWN_KIND = 0, + PAR_DO_KIND = 1, + GROUP_BY_KEY_KIND = 2, + FLATTEN_KIND = 3, + READ_KIND = 4, + WRITE_KIND = 5, + CONSTANT_KIND = 6, + SINGLETON_KIND = 7, + SHUFFLE_KIND = 8 + } + + /** Properties of a TransformSummary. */ + interface ITransformSummary { + + /** TransformSummary kind */ + kind?: (google.dataflow.v1beta3.KindType|keyof typeof google.dataflow.v1beta3.KindType|null); + + /** TransformSummary id */ + id?: (string|null); + + /** TransformSummary name */ + name?: (string|null); + + /** TransformSummary displayData */ + displayData?: (google.dataflow.v1beta3.IDisplayData[]|null); + + /** TransformSummary outputCollectionName */ + outputCollectionName?: (string[]|null); + + /** TransformSummary inputCollectionName */ + inputCollectionName?: (string[]|null); + } + + /** Represents a TransformSummary. */ + class TransformSummary implements ITransformSummary { + + /** + * Constructs a new TransformSummary. + * @param [properties] Properties to set + */ + constructor(properties?: google.dataflow.v1beta3.ITransformSummary); + + /** TransformSummary kind. */ + public kind: (google.dataflow.v1beta3.KindType|keyof typeof google.dataflow.v1beta3.KindType); + + /** TransformSummary id. */ + public id: string; + + /** TransformSummary name. */ + public name: string; + + /** TransformSummary displayData. */ + public displayData: google.dataflow.v1beta3.IDisplayData[]; + + /** TransformSummary outputCollectionName. */ + public outputCollectionName: string[]; + + /** TransformSummary inputCollectionName. */ + public inputCollectionName: string[]; + + /** + * Creates a new TransformSummary instance using the specified properties. + * @param [properties] Properties to set + * @returns TransformSummary instance + */ + public static create(properties?: google.dataflow.v1beta3.ITransformSummary): google.dataflow.v1beta3.TransformSummary; + + /** + * Encodes the specified TransformSummary message. Does not implicitly {@link google.dataflow.v1beta3.TransformSummary.verify|verify} messages. + * @param message TransformSummary message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.dataflow.v1beta3.ITransformSummary, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TransformSummary message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.TransformSummary.verify|verify} messages. + * @param message TransformSummary message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.dataflow.v1beta3.ITransformSummary, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransformSummary message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TransformSummary + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.dataflow.v1beta3.TransformSummary; + + /** + * Decodes a TransformSummary message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TransformSummary + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.dataflow.v1beta3.TransformSummary; + + /** + * Verifies a TransformSummary message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TransformSummary message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TransformSummary + */ + public static fromObject(object: { [k: string]: any }): google.dataflow.v1beta3.TransformSummary; + + /** + * Creates a plain object from a TransformSummary message. Also converts values to other types if specified. + * @param message TransformSummary + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.dataflow.v1beta3.TransformSummary, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TransformSummary to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TransformSummary + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ExecutionStageSummary. */ + interface IExecutionStageSummary { + + /** ExecutionStageSummary name */ + name?: (string|null); + + /** ExecutionStageSummary id */ + id?: (string|null); + + /** ExecutionStageSummary kind */ + kind?: (google.dataflow.v1beta3.KindType|keyof typeof google.dataflow.v1beta3.KindType|null); + + /** ExecutionStageSummary inputSource */ + inputSource?: (google.dataflow.v1beta3.ExecutionStageSummary.IStageSource[]|null); + + /** ExecutionStageSummary outputSource */ + outputSource?: (google.dataflow.v1beta3.ExecutionStageSummary.IStageSource[]|null); + + /** ExecutionStageSummary prerequisiteStage */ + prerequisiteStage?: (string[]|null); + + /** ExecutionStageSummary componentTransform */ + componentTransform?: (google.dataflow.v1beta3.ExecutionStageSummary.IComponentTransform[]|null); + + /** ExecutionStageSummary componentSource */ + componentSource?: (google.dataflow.v1beta3.ExecutionStageSummary.IComponentSource[]|null); + } + + /** Represents an ExecutionStageSummary. */ + class ExecutionStageSummary implements IExecutionStageSummary { + + /** + * Constructs a new ExecutionStageSummary. + * @param [properties] Properties to set + */ + constructor(properties?: google.dataflow.v1beta3.IExecutionStageSummary); + + /** ExecutionStageSummary name. */ + public name: string; + + /** ExecutionStageSummary id. */ + public id: string; + + /** ExecutionStageSummary kind. */ + public kind: (google.dataflow.v1beta3.KindType|keyof typeof google.dataflow.v1beta3.KindType); + + /** ExecutionStageSummary inputSource. */ + public inputSource: google.dataflow.v1beta3.ExecutionStageSummary.IStageSource[]; + + /** ExecutionStageSummary outputSource. */ + public outputSource: google.dataflow.v1beta3.ExecutionStageSummary.IStageSource[]; + + /** ExecutionStageSummary prerequisiteStage. */ + public prerequisiteStage: string[]; + + /** ExecutionStageSummary componentTransform. */ + public componentTransform: google.dataflow.v1beta3.ExecutionStageSummary.IComponentTransform[]; + + /** ExecutionStageSummary componentSource. */ + public componentSource: google.dataflow.v1beta3.ExecutionStageSummary.IComponentSource[]; + + /** + * Creates a new ExecutionStageSummary instance using the specified properties. + * @param [properties] Properties to set + * @returns ExecutionStageSummary instance + */ + public static create(properties?: google.dataflow.v1beta3.IExecutionStageSummary): google.dataflow.v1beta3.ExecutionStageSummary; + + /** + * Encodes the specified ExecutionStageSummary message. Does not implicitly {@link google.dataflow.v1beta3.ExecutionStageSummary.verify|verify} messages. + * @param message ExecutionStageSummary message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.dataflow.v1beta3.IExecutionStageSummary, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExecutionStageSummary message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.ExecutionStageSummary.verify|verify} messages. + * @param message ExecutionStageSummary message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.dataflow.v1beta3.IExecutionStageSummary, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExecutionStageSummary message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExecutionStageSummary + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.dataflow.v1beta3.ExecutionStageSummary; + + /** + * Decodes an ExecutionStageSummary message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExecutionStageSummary + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.dataflow.v1beta3.ExecutionStageSummary; + + /** + * Verifies an ExecutionStageSummary message. + * @param message Plain 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 ExecutionStageSummary message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExecutionStageSummary + */ + public static fromObject(object: { [k: string]: any }): google.dataflow.v1beta3.ExecutionStageSummary; + + /** + * Creates a plain object from an ExecutionStageSummary message. Also converts values to other types if specified. + * @param message ExecutionStageSummary + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.dataflow.v1beta3.ExecutionStageSummary, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExecutionStageSummary to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExecutionStageSummary + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ExecutionStageSummary { + + /** Properties of a StageSource. */ + interface IStageSource { + + /** StageSource userName */ + userName?: (string|null); + + /** StageSource name */ + name?: (string|null); + + /** StageSource originalTransformOrCollection */ + originalTransformOrCollection?: (string|null); + + /** StageSource sizeBytes */ + sizeBytes?: (number|Long|string|null); + } + + /** Represents a StageSource. */ + class StageSource implements IStageSource { + + /** + * Constructs a new StageSource. + * @param [properties] Properties to set + */ + constructor(properties?: google.dataflow.v1beta3.ExecutionStageSummary.IStageSource); + + /** StageSource userName. */ + public userName: string; + + /** StageSource name. */ + public name: string; + + /** StageSource originalTransformOrCollection. */ + public originalTransformOrCollection: string; + + /** StageSource sizeBytes. */ + public sizeBytes: (number|Long|string); + + /** + * Creates a new StageSource instance using the specified properties. + * @param [properties] Properties to set + * @returns StageSource instance + */ + public static create(properties?: google.dataflow.v1beta3.ExecutionStageSummary.IStageSource): google.dataflow.v1beta3.ExecutionStageSummary.StageSource; + + /** + * Encodes the specified StageSource message. Does not implicitly {@link google.dataflow.v1beta3.ExecutionStageSummary.StageSource.verify|verify} messages. + * @param message StageSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.dataflow.v1beta3.ExecutionStageSummary.IStageSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StageSource message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.ExecutionStageSummary.StageSource.verify|verify} messages. + * @param message StageSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.dataflow.v1beta3.ExecutionStageSummary.IStageSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StageSource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StageSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.dataflow.v1beta3.ExecutionStageSummary.StageSource; + + /** + * Decodes a StageSource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StageSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.dataflow.v1beta3.ExecutionStageSummary.StageSource; + + /** + * Verifies a StageSource message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StageSource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StageSource + */ + public static fromObject(object: { [k: string]: any }): google.dataflow.v1beta3.ExecutionStageSummary.StageSource; + + /** + * Creates a plain object from a StageSource message. Also converts values to other types if specified. + * @param message StageSource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.dataflow.v1beta3.ExecutionStageSummary.StageSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StageSource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StageSource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ComponentTransform. */ + interface IComponentTransform { + + /** ComponentTransform userName */ + userName?: (string|null); + + /** ComponentTransform name */ + name?: (string|null); + + /** ComponentTransform originalTransform */ + originalTransform?: (string|null); + } + + /** Represents a ComponentTransform. */ + class ComponentTransform implements IComponentTransform { + + /** + * Constructs a new ComponentTransform. + * @param [properties] Properties to set + */ + constructor(properties?: google.dataflow.v1beta3.ExecutionStageSummary.IComponentTransform); + + /** ComponentTransform userName. */ + public userName: string; + + /** ComponentTransform name. */ + public name: string; + + /** ComponentTransform originalTransform. */ + public originalTransform: string; + + /** + * Creates a new ComponentTransform instance using the specified properties. + * @param [properties] Properties to set + * @returns ComponentTransform instance + */ + public static create(properties?: google.dataflow.v1beta3.ExecutionStageSummary.IComponentTransform): google.dataflow.v1beta3.ExecutionStageSummary.ComponentTransform; + + /** + * Encodes the specified ComponentTransform message. Does not implicitly {@link google.dataflow.v1beta3.ExecutionStageSummary.ComponentTransform.verify|verify} messages. + * @param message ComponentTransform message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.dataflow.v1beta3.ExecutionStageSummary.IComponentTransform, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ComponentTransform message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.ExecutionStageSummary.ComponentTransform.verify|verify} messages. + * @param message ComponentTransform message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.dataflow.v1beta3.ExecutionStageSummary.IComponentTransform, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ComponentTransform message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ComponentTransform + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.dataflow.v1beta3.ExecutionStageSummary.ComponentTransform; + + /** + * Decodes a ComponentTransform message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ComponentTransform + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.dataflow.v1beta3.ExecutionStageSummary.ComponentTransform; + + /** + * Verifies a ComponentTransform message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ComponentTransform message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ComponentTransform + */ + public static fromObject(object: { [k: string]: any }): google.dataflow.v1beta3.ExecutionStageSummary.ComponentTransform; + + /** + * Creates a plain object from a ComponentTransform message. Also converts values to other types if specified. + * @param message ComponentTransform + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.dataflow.v1beta3.ExecutionStageSummary.ComponentTransform, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ComponentTransform to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ComponentTransform + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ComponentSource. */ + interface IComponentSource { + + /** ComponentSource userName */ + userName?: (string|null); + + /** ComponentSource name */ + name?: (string|null); + + /** ComponentSource originalTransformOrCollection */ + originalTransformOrCollection?: (string|null); + } + + /** Represents a ComponentSource. */ + class ComponentSource implements IComponentSource { + + /** + * Constructs a new ComponentSource. + * @param [properties] Properties to set + */ + constructor(properties?: google.dataflow.v1beta3.ExecutionStageSummary.IComponentSource); + + /** ComponentSource userName. */ + public userName: string; + + /** ComponentSource name. */ + public name: string; + + /** ComponentSource originalTransformOrCollection. */ + public originalTransformOrCollection: string; + + /** + * Creates a new ComponentSource instance using the specified properties. + * @param [properties] Properties to set + * @returns ComponentSource instance + */ + public static create(properties?: google.dataflow.v1beta3.ExecutionStageSummary.IComponentSource): google.dataflow.v1beta3.ExecutionStageSummary.ComponentSource; + + /** + * Encodes the specified ComponentSource message. Does not implicitly {@link google.dataflow.v1beta3.ExecutionStageSummary.ComponentSource.verify|verify} messages. + * @param message ComponentSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.dataflow.v1beta3.ExecutionStageSummary.IComponentSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ComponentSource message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.ExecutionStageSummary.ComponentSource.verify|verify} messages. + * @param message ComponentSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.dataflow.v1beta3.ExecutionStageSummary.IComponentSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ComponentSource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ComponentSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.dataflow.v1beta3.ExecutionStageSummary.ComponentSource; + + /** + * Decodes a ComponentSource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ComponentSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.dataflow.v1beta3.ExecutionStageSummary.ComponentSource; + + /** + * Verifies a ComponentSource message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ComponentSource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ComponentSource + */ + public static fromObject(object: { [k: string]: any }): google.dataflow.v1beta3.ExecutionStageSummary.ComponentSource; + + /** + * Creates a plain object from a ComponentSource message. Also converts values to other types if specified. + * @param message ComponentSource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.dataflow.v1beta3.ExecutionStageSummary.ComponentSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ComponentSource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ComponentSource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a DisplayData. */ + interface IDisplayData { + + /** DisplayData key */ + key?: (string|null); + + /** DisplayData namespace */ + namespace?: (string|null); + + /** DisplayData strValue */ + strValue?: (string|null); + + /** DisplayData int64Value */ + int64Value?: (number|Long|string|null); + + /** DisplayData floatValue */ + floatValue?: (number|null); + + /** DisplayData javaClassValue */ + javaClassValue?: (string|null); + + /** DisplayData timestampValue */ + timestampValue?: (google.protobuf.ITimestamp|null); + + /** DisplayData durationValue */ + durationValue?: (google.protobuf.IDuration|null); + + /** DisplayData boolValue */ + boolValue?: (boolean|null); + + /** DisplayData shortStrValue */ + shortStrValue?: (string|null); + + /** DisplayData url */ + url?: (string|null); + + /** DisplayData label */ + label?: (string|null); + } + + /** Represents a DisplayData. */ + class DisplayData implements IDisplayData { + + /** + * Constructs a new DisplayData. + * @param [properties] Properties to set + */ + constructor(properties?: google.dataflow.v1beta3.IDisplayData); + + /** DisplayData key. */ + public key: string; + + /** DisplayData namespace. */ + public namespace: string; + + /** DisplayData strValue. */ + public strValue?: (string|null); + + /** DisplayData int64Value. */ + public int64Value?: (number|Long|string|null); + + /** DisplayData floatValue. */ + public floatValue?: (number|null); + + /** DisplayData javaClassValue. */ + public javaClassValue?: (string|null); + + /** DisplayData timestampValue. */ + public timestampValue?: (google.protobuf.ITimestamp|null); + + /** DisplayData durationValue. */ + public durationValue?: (google.protobuf.IDuration|null); + + /** DisplayData boolValue. */ + public boolValue?: (boolean|null); + + /** DisplayData shortStrValue. */ + public shortStrValue: string; + + /** DisplayData url. */ + public url: string; + + /** DisplayData label. */ + public label: string; + + /** DisplayData Value. */ + public Value?: ("strValue"|"int64Value"|"floatValue"|"javaClassValue"|"timestampValue"|"durationValue"|"boolValue"); + + /** + * Creates a new DisplayData instance using the specified properties. + * @param [properties] Properties to set + * @returns DisplayData instance + */ + public static create(properties?: google.dataflow.v1beta3.IDisplayData): google.dataflow.v1beta3.DisplayData; + + /** + * Encodes the specified DisplayData message. Does not implicitly {@link google.dataflow.v1beta3.DisplayData.verify|verify} messages. + * @param message DisplayData message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.dataflow.v1beta3.IDisplayData, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DisplayData message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.DisplayData.verify|verify} messages. + * @param message DisplayData message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.dataflow.v1beta3.IDisplayData, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DisplayData message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DisplayData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.dataflow.v1beta3.DisplayData; + + /** + * Decodes a DisplayData message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DisplayData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.dataflow.v1beta3.DisplayData; + + /** + * Verifies a DisplayData message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DisplayData message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DisplayData + */ + public static fromObject(object: { [k: string]: any }): google.dataflow.v1beta3.DisplayData; + + /** + * Creates a plain object from a DisplayData message. Also converts values to other types if specified. + * @param message DisplayData + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.dataflow.v1beta3.DisplayData, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DisplayData to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DisplayData + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Step. */ + interface IStep { + + /** Step kind */ + kind?: (string|null); + + /** Step name */ + name?: (string|null); + + /** Step properties */ + properties?: (google.protobuf.IStruct|null); + } + + /** Represents a Step. */ + class Step implements IStep { + + /** + * Constructs a new Step. + * @param [properties] Properties to set + */ + constructor(properties?: google.dataflow.v1beta3.IStep); + + /** Step kind. */ + public kind: string; + + /** Step name. */ + public name: string; + + /** Step properties. */ + public properties?: (google.protobuf.IStruct|null); + + /** + * Creates a new Step instance using the specified properties. + * @param [properties] Properties to set + * @returns Step instance + */ + public static create(properties?: google.dataflow.v1beta3.IStep): google.dataflow.v1beta3.Step; + + /** + * Encodes the specified Step message. Does not implicitly {@link google.dataflow.v1beta3.Step.verify|verify} messages. + * @param message Step message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.dataflow.v1beta3.IStep, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Step message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.Step.verify|verify} messages. + * @param message Step message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.dataflow.v1beta3.IStep, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Step message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Step + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.dataflow.v1beta3.Step; + + /** + * Decodes a Step message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Step + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.dataflow.v1beta3.Step; + + /** + * Verifies a Step message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Step message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Step + */ + public static fromObject(object: { [k: string]: any }): google.dataflow.v1beta3.Step; + + /** + * Creates a plain object from a Step message. Also converts values to other types if specified. + * @param message Step + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.dataflow.v1beta3.Step, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Step to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Step + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** JobState enum. */ + enum JobState { + JOB_STATE_UNKNOWN = 0, + JOB_STATE_STOPPED = 1, + JOB_STATE_RUNNING = 2, + JOB_STATE_DONE = 3, + JOB_STATE_FAILED = 4, + JOB_STATE_CANCELLED = 5, + JOB_STATE_UPDATED = 6, + JOB_STATE_DRAINING = 7, + JOB_STATE_DRAINED = 8, + JOB_STATE_PENDING = 9, + JOB_STATE_CANCELLING = 10, + JOB_STATE_QUEUED = 11, + JOB_STATE_RESOURCE_CLEANING_UP = 12 + } + + /** Properties of a JobExecutionInfo. */ + interface IJobExecutionInfo { + + /** JobExecutionInfo stages */ + stages?: ({ [k: string]: google.dataflow.v1beta3.IJobExecutionStageInfo }|null); + } + + /** Represents a JobExecutionInfo. */ + class JobExecutionInfo implements IJobExecutionInfo { + + /** + * Constructs a new JobExecutionInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.dataflow.v1beta3.IJobExecutionInfo); + + /** JobExecutionInfo stages. */ + public stages: { [k: string]: google.dataflow.v1beta3.IJobExecutionStageInfo }; + + /** + * Creates a new JobExecutionInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns JobExecutionInfo instance + */ + public static create(properties?: google.dataflow.v1beta3.IJobExecutionInfo): google.dataflow.v1beta3.JobExecutionInfo; + + /** + * Encodes the specified JobExecutionInfo message. Does not implicitly {@link google.dataflow.v1beta3.JobExecutionInfo.verify|verify} messages. + * @param message JobExecutionInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.dataflow.v1beta3.IJobExecutionInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified JobExecutionInfo message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.JobExecutionInfo.verify|verify} messages. + * @param message JobExecutionInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.dataflow.v1beta3.IJobExecutionInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a JobExecutionInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns JobExecutionInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.dataflow.v1beta3.JobExecutionInfo; + + /** + * Decodes a JobExecutionInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns JobExecutionInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.dataflow.v1beta3.JobExecutionInfo; + + /** + * Verifies a JobExecutionInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a JobExecutionInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns JobExecutionInfo + */ + public static fromObject(object: { [k: string]: any }): google.dataflow.v1beta3.JobExecutionInfo; + + /** + * Creates a plain object from a JobExecutionInfo message. Also converts values to other types if specified. + * @param message JobExecutionInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.dataflow.v1beta3.JobExecutionInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this JobExecutionInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for JobExecutionInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a JobExecutionStageInfo. */ + interface IJobExecutionStageInfo { + + /** JobExecutionStageInfo stepName */ + stepName?: (string[]|null); + } + + /** Represents a JobExecutionStageInfo. */ + class JobExecutionStageInfo implements IJobExecutionStageInfo { + + /** + * Constructs a new JobExecutionStageInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.dataflow.v1beta3.IJobExecutionStageInfo); + + /** JobExecutionStageInfo stepName. */ + public stepName: string[]; + + /** + * Creates a new JobExecutionStageInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns JobExecutionStageInfo instance + */ + public static create(properties?: google.dataflow.v1beta3.IJobExecutionStageInfo): google.dataflow.v1beta3.JobExecutionStageInfo; + + /** + * Encodes the specified JobExecutionStageInfo message. Does not implicitly {@link google.dataflow.v1beta3.JobExecutionStageInfo.verify|verify} messages. + * @param message JobExecutionStageInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.dataflow.v1beta3.IJobExecutionStageInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified JobExecutionStageInfo message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.JobExecutionStageInfo.verify|verify} messages. + * @param message JobExecutionStageInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.dataflow.v1beta3.IJobExecutionStageInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a JobExecutionStageInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns JobExecutionStageInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.dataflow.v1beta3.JobExecutionStageInfo; + + /** + * Decodes a JobExecutionStageInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns JobExecutionStageInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.dataflow.v1beta3.JobExecutionStageInfo; + + /** + * Verifies a JobExecutionStageInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a JobExecutionStageInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns JobExecutionStageInfo + */ + public static fromObject(object: { [k: string]: any }): google.dataflow.v1beta3.JobExecutionStageInfo; + + /** + * Creates a plain object from a JobExecutionStageInfo message. Also converts values to other types if specified. + * @param message JobExecutionStageInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.dataflow.v1beta3.JobExecutionStageInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this JobExecutionStageInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for JobExecutionStageInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** JobView enum. */ + enum JobView { + JOB_VIEW_UNKNOWN = 0, + JOB_VIEW_SUMMARY = 1, + JOB_VIEW_ALL = 2, + JOB_VIEW_DESCRIPTION = 3 + } + + /** Properties of a CreateJobRequest. */ + interface ICreateJobRequest { + + /** CreateJobRequest projectId */ + projectId?: (string|null); + + /** CreateJobRequest job */ + job?: (google.dataflow.v1beta3.IJob|null); + + /** CreateJobRequest view */ + view?: (google.dataflow.v1beta3.JobView|keyof typeof google.dataflow.v1beta3.JobView|null); + + /** CreateJobRequest replaceJobId */ + replaceJobId?: (string|null); + + /** CreateJobRequest location */ + location?: (string|null); + } + + /** Represents a CreateJobRequest. */ + class CreateJobRequest implements ICreateJobRequest { + + /** + * Constructs a new CreateJobRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.dataflow.v1beta3.ICreateJobRequest); + + /** CreateJobRequest projectId. */ + public projectId: string; + + /** CreateJobRequest job. */ + public job?: (google.dataflow.v1beta3.IJob|null); + + /** CreateJobRequest view. */ + public view: (google.dataflow.v1beta3.JobView|keyof typeof google.dataflow.v1beta3.JobView); + + /** CreateJobRequest replaceJobId. */ + public replaceJobId: string; + + /** CreateJobRequest location. */ + public location: string; + + /** + * Creates a new CreateJobRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateJobRequest instance + */ + public static create(properties?: google.dataflow.v1beta3.ICreateJobRequest): google.dataflow.v1beta3.CreateJobRequest; + + /** + * Encodes the specified CreateJobRequest message. Does not implicitly {@link google.dataflow.v1beta3.CreateJobRequest.verify|verify} messages. + * @param message CreateJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.dataflow.v1beta3.ICreateJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateJobRequest message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.CreateJobRequest.verify|verify} messages. + * @param message CreateJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.dataflow.v1beta3.ICreateJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateJobRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.dataflow.v1beta3.CreateJobRequest; + + /** + * Decodes a CreateJobRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.dataflow.v1beta3.CreateJobRequest; + + /** + * Verifies a CreateJobRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateJobRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateJobRequest + */ + public static fromObject(object: { [k: string]: any }): google.dataflow.v1beta3.CreateJobRequest; + + /** + * Creates a plain object from a CreateJobRequest message. Also converts values to other types if specified. + * @param message CreateJobRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.dataflow.v1beta3.CreateJobRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateJobRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateJobRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetJobRequest. */ + interface IGetJobRequest { + + /** GetJobRequest projectId */ + projectId?: (string|null); + + /** GetJobRequest jobId */ + jobId?: (string|null); + + /** GetJobRequest view */ + view?: (google.dataflow.v1beta3.JobView|keyof typeof google.dataflow.v1beta3.JobView|null); + + /** GetJobRequest location */ + location?: (string|null); + } + + /** Represents a GetJobRequest. */ + class GetJobRequest implements IGetJobRequest { + + /** + * Constructs a new GetJobRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.dataflow.v1beta3.IGetJobRequest); + + /** GetJobRequest projectId. */ + public projectId: string; + + /** GetJobRequest jobId. */ + public jobId: string; + + /** GetJobRequest view. */ + public view: (google.dataflow.v1beta3.JobView|keyof typeof google.dataflow.v1beta3.JobView); + + /** GetJobRequest location. */ + public location: string; + + /** + * Creates a new GetJobRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetJobRequest instance + */ + public static create(properties?: google.dataflow.v1beta3.IGetJobRequest): google.dataflow.v1beta3.GetJobRequest; + + /** + * Encodes the specified GetJobRequest message. Does not implicitly {@link google.dataflow.v1beta3.GetJobRequest.verify|verify} messages. + * @param message GetJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.dataflow.v1beta3.IGetJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetJobRequest message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.GetJobRequest.verify|verify} messages. + * @param message GetJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.dataflow.v1beta3.IGetJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetJobRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.dataflow.v1beta3.GetJobRequest; + + /** + * Decodes a GetJobRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.dataflow.v1beta3.GetJobRequest; + + /** + * Verifies a GetJobRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetJobRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetJobRequest + */ + public static fromObject(object: { [k: string]: any }): google.dataflow.v1beta3.GetJobRequest; + + /** + * Creates a plain object from a GetJobRequest message. Also converts values to other types if specified. + * @param message GetJobRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.dataflow.v1beta3.GetJobRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetJobRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetJobRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateJobRequest. */ + interface IUpdateJobRequest { + + /** UpdateJobRequest projectId */ + projectId?: (string|null); + + /** UpdateJobRequest jobId */ + jobId?: (string|null); + + /** UpdateJobRequest job */ + job?: (google.dataflow.v1beta3.IJob|null); + + /** UpdateJobRequest location */ + location?: (string|null); + } + + /** Represents an UpdateJobRequest. */ + class UpdateJobRequest implements IUpdateJobRequest { + + /** + * Constructs a new UpdateJobRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.dataflow.v1beta3.IUpdateJobRequest); + + /** UpdateJobRequest projectId. */ + public projectId: string; + + /** UpdateJobRequest jobId. */ + public jobId: string; + + /** UpdateJobRequest job. */ + public job?: (google.dataflow.v1beta3.IJob|null); + + /** UpdateJobRequest location. */ + public location: string; + + /** + * Creates a new UpdateJobRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateJobRequest instance + */ + public static create(properties?: google.dataflow.v1beta3.IUpdateJobRequest): google.dataflow.v1beta3.UpdateJobRequest; + + /** + * Encodes the specified UpdateJobRequest message. Does not implicitly {@link google.dataflow.v1beta3.UpdateJobRequest.verify|verify} messages. + * @param message UpdateJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.dataflow.v1beta3.IUpdateJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateJobRequest message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.UpdateJobRequest.verify|verify} messages. + * @param message UpdateJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.dataflow.v1beta3.IUpdateJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateJobRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.dataflow.v1beta3.UpdateJobRequest; + + /** + * Decodes an UpdateJobRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.dataflow.v1beta3.UpdateJobRequest; + + /** + * Verifies an UpdateJobRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateJobRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateJobRequest + */ + public static fromObject(object: { [k: string]: any }): google.dataflow.v1beta3.UpdateJobRequest; + + /** + * Creates a plain object from an UpdateJobRequest message. Also converts values to other types if specified. + * @param message UpdateJobRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.dataflow.v1beta3.UpdateJobRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateJobRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateJobRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListJobsRequest. */ + interface IListJobsRequest { + + /** ListJobsRequest filter */ + filter?: (google.dataflow.v1beta3.ListJobsRequest.Filter|keyof typeof google.dataflow.v1beta3.ListJobsRequest.Filter|null); + + /** ListJobsRequest projectId */ + projectId?: (string|null); + + /** ListJobsRequest view */ + view?: (google.dataflow.v1beta3.JobView|keyof typeof google.dataflow.v1beta3.JobView|null); + + /** ListJobsRequest pageSize */ + pageSize?: (number|null); + + /** ListJobsRequest pageToken */ + pageToken?: (string|null); + + /** ListJobsRequest location */ + location?: (string|null); + } + + /** Represents a ListJobsRequest. */ + class ListJobsRequest implements IListJobsRequest { + + /** + * Constructs a new ListJobsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.dataflow.v1beta3.IListJobsRequest); + + /** ListJobsRequest filter. */ + public filter: (google.dataflow.v1beta3.ListJobsRequest.Filter|keyof typeof google.dataflow.v1beta3.ListJobsRequest.Filter); + + /** ListJobsRequest projectId. */ + public projectId: string; + + /** ListJobsRequest view. */ + public view: (google.dataflow.v1beta3.JobView|keyof typeof google.dataflow.v1beta3.JobView); + + /** ListJobsRequest pageSize. */ + public pageSize: number; + + /** ListJobsRequest pageToken. */ + public pageToken: string; + + /** ListJobsRequest location. */ + public location: string; + + /** + * Creates a new ListJobsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListJobsRequest instance + */ + public static create(properties?: google.dataflow.v1beta3.IListJobsRequest): google.dataflow.v1beta3.ListJobsRequest; + + /** + * Encodes the specified ListJobsRequest message. Does not implicitly {@link google.dataflow.v1beta3.ListJobsRequest.verify|verify} messages. + * @param message ListJobsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.dataflow.v1beta3.IListJobsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListJobsRequest message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.ListJobsRequest.verify|verify} messages. + * @param message ListJobsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.dataflow.v1beta3.IListJobsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListJobsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListJobsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.dataflow.v1beta3.ListJobsRequest; + + /** + * Decodes a ListJobsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListJobsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.dataflow.v1beta3.ListJobsRequest; + + /** + * Verifies a ListJobsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListJobsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListJobsRequest + */ + public static fromObject(object: { [k: string]: any }): google.dataflow.v1beta3.ListJobsRequest; + + /** + * Creates a plain object from a ListJobsRequest message. Also converts values to other types if specified. + * @param message ListJobsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.dataflow.v1beta3.ListJobsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListJobsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListJobsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ListJobsRequest { + + /** Filter enum. */ + enum Filter { + UNKNOWN = 0, + ALL = 1, + TERMINATED = 2, + ACTIVE = 3 + } + } + + /** Properties of a FailedLocation. */ + interface IFailedLocation { + + /** FailedLocation name */ + name?: (string|null); + } + + /** Represents a FailedLocation. */ + class FailedLocation implements IFailedLocation { + + /** + * Constructs a new FailedLocation. + * @param [properties] Properties to set + */ + constructor(properties?: google.dataflow.v1beta3.IFailedLocation); + + /** FailedLocation name. */ + public name: string; + + /** + * Creates a new FailedLocation instance using the specified properties. + * @param [properties] Properties to set + * @returns FailedLocation instance + */ + public static create(properties?: google.dataflow.v1beta3.IFailedLocation): google.dataflow.v1beta3.FailedLocation; + + /** + * Encodes the specified FailedLocation message. Does not implicitly {@link google.dataflow.v1beta3.FailedLocation.verify|verify} messages. + * @param message FailedLocation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.dataflow.v1beta3.IFailedLocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FailedLocation message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.FailedLocation.verify|verify} messages. + * @param message FailedLocation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.dataflow.v1beta3.IFailedLocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FailedLocation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FailedLocation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.dataflow.v1beta3.FailedLocation; + + /** + * Decodes a FailedLocation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FailedLocation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.dataflow.v1beta3.FailedLocation; + + /** + * Verifies a FailedLocation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FailedLocation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FailedLocation + */ + public static fromObject(object: { [k: string]: any }): google.dataflow.v1beta3.FailedLocation; + + /** + * Creates a plain object from a FailedLocation message. Also converts values to other types if specified. + * @param message FailedLocation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.dataflow.v1beta3.FailedLocation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FailedLocation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FailedLocation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListJobsResponse. */ + interface IListJobsResponse { + + /** ListJobsResponse jobs */ + jobs?: (google.dataflow.v1beta3.IJob[]|null); + + /** ListJobsResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListJobsResponse failedLocation */ + failedLocation?: (google.dataflow.v1beta3.IFailedLocation[]|null); + } + + /** Represents a ListJobsResponse. */ + class ListJobsResponse implements IListJobsResponse { + + /** + * Constructs a new ListJobsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.dataflow.v1beta3.IListJobsResponse); + + /** ListJobsResponse jobs. */ + public jobs: google.dataflow.v1beta3.IJob[]; + + /** ListJobsResponse nextPageToken. */ + public nextPageToken: string; + + /** ListJobsResponse failedLocation. */ + public failedLocation: google.dataflow.v1beta3.IFailedLocation[]; + + /** + * Creates a new ListJobsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListJobsResponse instance + */ + public static create(properties?: google.dataflow.v1beta3.IListJobsResponse): google.dataflow.v1beta3.ListJobsResponse; + + /** + * Encodes the specified ListJobsResponse message. Does not implicitly {@link google.dataflow.v1beta3.ListJobsResponse.verify|verify} messages. + * @param message ListJobsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.dataflow.v1beta3.IListJobsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListJobsResponse message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.ListJobsResponse.verify|verify} messages. + * @param message ListJobsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.dataflow.v1beta3.IListJobsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListJobsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListJobsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.dataflow.v1beta3.ListJobsResponse; + + /** + * Decodes a ListJobsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListJobsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.dataflow.v1beta3.ListJobsResponse; + + /** + * Verifies a ListJobsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListJobsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListJobsResponse + */ + public static fromObject(object: { [k: string]: any }): google.dataflow.v1beta3.ListJobsResponse; + + /** + * Creates a plain object from a ListJobsResponse message. Also converts values to other types if specified. + * @param message ListJobsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.dataflow.v1beta3.ListJobsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListJobsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListJobsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SnapshotJobRequest. */ + interface ISnapshotJobRequest { + + /** SnapshotJobRequest projectId */ + projectId?: (string|null); + + /** SnapshotJobRequest jobId */ + jobId?: (string|null); + + /** SnapshotJobRequest ttl */ + ttl?: (google.protobuf.IDuration|null); + + /** SnapshotJobRequest location */ + location?: (string|null); + + /** SnapshotJobRequest snapshotSources */ + snapshotSources?: (boolean|null); + + /** SnapshotJobRequest description */ + description?: (string|null); + } + + /** Represents a SnapshotJobRequest. */ + class SnapshotJobRequest implements ISnapshotJobRequest { + + /** + * Constructs a new SnapshotJobRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.dataflow.v1beta3.ISnapshotJobRequest); + + /** SnapshotJobRequest projectId. */ + public projectId: string; + + /** SnapshotJobRequest jobId. */ + public jobId: string; + + /** SnapshotJobRequest ttl. */ + public ttl?: (google.protobuf.IDuration|null); + + /** SnapshotJobRequest location. */ + public location: string; + + /** SnapshotJobRequest snapshotSources. */ + public snapshotSources: boolean; + + /** SnapshotJobRequest description. */ + public description: string; + + /** + * Creates a new SnapshotJobRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SnapshotJobRequest instance + */ + public static create(properties?: google.dataflow.v1beta3.ISnapshotJobRequest): google.dataflow.v1beta3.SnapshotJobRequest; + + /** + * Encodes the specified SnapshotJobRequest message. Does not implicitly {@link google.dataflow.v1beta3.SnapshotJobRequest.verify|verify} messages. + * @param message SnapshotJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.dataflow.v1beta3.ISnapshotJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SnapshotJobRequest message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.SnapshotJobRequest.verify|verify} messages. + * @param message SnapshotJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.dataflow.v1beta3.ISnapshotJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SnapshotJobRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SnapshotJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.dataflow.v1beta3.SnapshotJobRequest; + + /** + * Decodes a SnapshotJobRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SnapshotJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.dataflow.v1beta3.SnapshotJobRequest; + + /** + * Verifies a SnapshotJobRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SnapshotJobRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SnapshotJobRequest + */ + public static fromObject(object: { [k: string]: any }): google.dataflow.v1beta3.SnapshotJobRequest; + + /** + * Creates a plain object from a SnapshotJobRequest message. Also converts values to other types if specified. + * @param message SnapshotJobRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.dataflow.v1beta3.SnapshotJobRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SnapshotJobRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SnapshotJobRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CheckActiveJobsRequest. */ + interface ICheckActiveJobsRequest { + + /** CheckActiveJobsRequest projectId */ + projectId?: (string|null); + } + + /** Represents a CheckActiveJobsRequest. */ + class CheckActiveJobsRequest implements ICheckActiveJobsRequest { + + /** + * Constructs a new CheckActiveJobsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.dataflow.v1beta3.ICheckActiveJobsRequest); + + /** CheckActiveJobsRequest projectId. */ + public projectId: string; + + /** + * Creates a new CheckActiveJobsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CheckActiveJobsRequest instance + */ + public static create(properties?: google.dataflow.v1beta3.ICheckActiveJobsRequest): google.dataflow.v1beta3.CheckActiveJobsRequest; + + /** + * Encodes the specified CheckActiveJobsRequest message. Does not implicitly {@link google.dataflow.v1beta3.CheckActiveJobsRequest.verify|verify} messages. + * @param message CheckActiveJobsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.dataflow.v1beta3.ICheckActiveJobsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CheckActiveJobsRequest message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.CheckActiveJobsRequest.verify|verify} messages. + * @param message CheckActiveJobsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.dataflow.v1beta3.ICheckActiveJobsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CheckActiveJobsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CheckActiveJobsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.dataflow.v1beta3.CheckActiveJobsRequest; + + /** + * Decodes a CheckActiveJobsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CheckActiveJobsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.dataflow.v1beta3.CheckActiveJobsRequest; + + /** + * Verifies a CheckActiveJobsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CheckActiveJobsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CheckActiveJobsRequest + */ + public static fromObject(object: { [k: string]: any }): google.dataflow.v1beta3.CheckActiveJobsRequest; + + /** + * Creates a plain object from a CheckActiveJobsRequest message. Also converts values to other types if specified. + * @param message CheckActiveJobsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.dataflow.v1beta3.CheckActiveJobsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CheckActiveJobsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CheckActiveJobsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CheckActiveJobsResponse. */ + interface ICheckActiveJobsResponse { + + /** CheckActiveJobsResponse activeJobsExist */ + activeJobsExist?: (boolean|null); + } + + /** Represents a CheckActiveJobsResponse. */ + class CheckActiveJobsResponse implements ICheckActiveJobsResponse { + + /** + * Constructs a new CheckActiveJobsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.dataflow.v1beta3.ICheckActiveJobsResponse); + + /** CheckActiveJobsResponse activeJobsExist. */ + public activeJobsExist: boolean; + + /** + * Creates a new CheckActiveJobsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns CheckActiveJobsResponse instance + */ + public static create(properties?: google.dataflow.v1beta3.ICheckActiveJobsResponse): google.dataflow.v1beta3.CheckActiveJobsResponse; + + /** + * Encodes the specified CheckActiveJobsResponse message. Does not implicitly {@link google.dataflow.v1beta3.CheckActiveJobsResponse.verify|verify} messages. + * @param message CheckActiveJobsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.dataflow.v1beta3.ICheckActiveJobsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CheckActiveJobsResponse message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.CheckActiveJobsResponse.verify|verify} messages. + * @param message CheckActiveJobsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.dataflow.v1beta3.ICheckActiveJobsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CheckActiveJobsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CheckActiveJobsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.dataflow.v1beta3.CheckActiveJobsResponse; + + /** + * Decodes a CheckActiveJobsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CheckActiveJobsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.dataflow.v1beta3.CheckActiveJobsResponse; + + /** + * Verifies a CheckActiveJobsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CheckActiveJobsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CheckActiveJobsResponse + */ + public static fromObject(object: { [k: string]: any }): google.dataflow.v1beta3.CheckActiveJobsResponse; + + /** + * Creates a plain object from a CheckActiveJobsResponse message. Also converts values to other types if specified. + * @param message CheckActiveJobsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.dataflow.v1beta3.CheckActiveJobsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CheckActiveJobsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CheckActiveJobsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents a SnapshotsV1Beta3 */ + class SnapshotsV1Beta3 extends $protobuf.rpc.Service { + + /** + * Constructs a new SnapshotsV1Beta3 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 SnapshotsV1Beta3 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): SnapshotsV1Beta3; + + /** + * Calls GetSnapshot. + * @param request GetSnapshotRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Snapshot + */ + public getSnapshot(request: google.dataflow.v1beta3.IGetSnapshotRequest, callback: google.dataflow.v1beta3.SnapshotsV1Beta3.GetSnapshotCallback): void; + + /** + * Calls GetSnapshot. + * @param request GetSnapshotRequest message or plain object + * @returns Promise + */ + public getSnapshot(request: google.dataflow.v1beta3.IGetSnapshotRequest): Promise; + + /** + * Calls DeleteSnapshot. + * @param request DeleteSnapshotRequest message or plain object + * @param callback Node-style callback called with the error, if any, and DeleteSnapshotResponse + */ + public deleteSnapshot(request: google.dataflow.v1beta3.IDeleteSnapshotRequest, callback: google.dataflow.v1beta3.SnapshotsV1Beta3.DeleteSnapshotCallback): void; + + /** + * Calls DeleteSnapshot. + * @param request DeleteSnapshotRequest message or plain object + * @returns Promise + */ + public deleteSnapshot(request: google.dataflow.v1beta3.IDeleteSnapshotRequest): Promise; + + /** + * Calls ListSnapshots. + * @param request ListSnapshotsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListSnapshotsResponse + */ + public listSnapshots(request: google.dataflow.v1beta3.IListSnapshotsRequest, callback: google.dataflow.v1beta3.SnapshotsV1Beta3.ListSnapshotsCallback): void; + + /** + * Calls ListSnapshots. + * @param request ListSnapshotsRequest message or plain object + * @returns Promise + */ + public listSnapshots(request: google.dataflow.v1beta3.IListSnapshotsRequest): Promise; + } + + namespace SnapshotsV1Beta3 { + + /** + * Callback as used by {@link google.dataflow.v1beta3.SnapshotsV1Beta3|getSnapshot}. + * @param error Error, if any + * @param [response] Snapshot + */ + type GetSnapshotCallback = (error: (Error|null), response?: google.dataflow.v1beta3.Snapshot) => void; + + /** + * Callback as used by {@link google.dataflow.v1beta3.SnapshotsV1Beta3|deleteSnapshot}. + * @param error Error, if any + * @param [response] DeleteSnapshotResponse + */ + type DeleteSnapshotCallback = (error: (Error|null), response?: google.dataflow.v1beta3.DeleteSnapshotResponse) => void; + + /** + * Callback as used by {@link google.dataflow.v1beta3.SnapshotsV1Beta3|listSnapshots}. + * @param error Error, if any + * @param [response] ListSnapshotsResponse + */ + type ListSnapshotsCallback = (error: (Error|null), response?: google.dataflow.v1beta3.ListSnapshotsResponse) => void; + } + + /** SnapshotState enum. */ + enum SnapshotState { + UNKNOWN_SNAPSHOT_STATE = 0, + PENDING = 1, + RUNNING = 2, + READY = 3, + FAILED = 4, + DELETED = 5 + } + + /** Properties of a PubsubSnapshotMetadata. */ + interface IPubsubSnapshotMetadata { + + /** PubsubSnapshotMetadata topicName */ + topicName?: (string|null); + + /** PubsubSnapshotMetadata snapshotName */ + snapshotName?: (string|null); + + /** PubsubSnapshotMetadata expireTime */ + expireTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a PubsubSnapshotMetadata. */ + class PubsubSnapshotMetadata implements IPubsubSnapshotMetadata { + + /** + * Constructs a new PubsubSnapshotMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.dataflow.v1beta3.IPubsubSnapshotMetadata); + + /** PubsubSnapshotMetadata topicName. */ + public topicName: string; + + /** PubsubSnapshotMetadata snapshotName. */ + public snapshotName: string; + + /** PubsubSnapshotMetadata expireTime. */ + public expireTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new PubsubSnapshotMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns PubsubSnapshotMetadata instance + */ + public static create(properties?: google.dataflow.v1beta3.IPubsubSnapshotMetadata): google.dataflow.v1beta3.PubsubSnapshotMetadata; + + /** + * Encodes the specified PubsubSnapshotMetadata message. Does not implicitly {@link google.dataflow.v1beta3.PubsubSnapshotMetadata.verify|verify} messages. + * @param message PubsubSnapshotMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.dataflow.v1beta3.IPubsubSnapshotMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PubsubSnapshotMetadata message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.PubsubSnapshotMetadata.verify|verify} messages. + * @param message PubsubSnapshotMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.dataflow.v1beta3.IPubsubSnapshotMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PubsubSnapshotMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PubsubSnapshotMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.dataflow.v1beta3.PubsubSnapshotMetadata; + + /** + * Decodes a PubsubSnapshotMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PubsubSnapshotMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.dataflow.v1beta3.PubsubSnapshotMetadata; + + /** + * Verifies a PubsubSnapshotMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PubsubSnapshotMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PubsubSnapshotMetadata + */ + public static fromObject(object: { [k: string]: any }): google.dataflow.v1beta3.PubsubSnapshotMetadata; + + /** + * Creates a plain object from a PubsubSnapshotMetadata message. Also converts values to other types if specified. + * @param message PubsubSnapshotMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.dataflow.v1beta3.PubsubSnapshotMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PubsubSnapshotMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PubsubSnapshotMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Snapshot. */ + interface ISnapshot { + + /** Snapshot id */ + id?: (string|null); + + /** Snapshot projectId */ + projectId?: (string|null); + + /** Snapshot sourceJobId */ + sourceJobId?: (string|null); + + /** Snapshot creationTime */ + creationTime?: (google.protobuf.ITimestamp|null); + + /** Snapshot ttl */ + ttl?: (google.protobuf.IDuration|null); + + /** Snapshot state */ + state?: (google.dataflow.v1beta3.SnapshotState|keyof typeof google.dataflow.v1beta3.SnapshotState|null); + + /** Snapshot pubsubMetadata */ + pubsubMetadata?: (google.dataflow.v1beta3.IPubsubSnapshotMetadata[]|null); + + /** Snapshot description */ + description?: (string|null); + + /** Snapshot diskSizeBytes */ + diskSizeBytes?: (number|Long|string|null); + + /** Snapshot region */ + region?: (string|null); + } + + /** Represents a Snapshot. */ + class Snapshot implements ISnapshot { + + /** + * Constructs a new Snapshot. + * @param [properties] Properties to set + */ + constructor(properties?: google.dataflow.v1beta3.ISnapshot); + + /** Snapshot id. */ + public id: string; + + /** Snapshot projectId. */ + public projectId: string; + + /** Snapshot sourceJobId. */ + public sourceJobId: string; + + /** Snapshot creationTime. */ + public creationTime?: (google.protobuf.ITimestamp|null); + + /** Snapshot ttl. */ + public ttl?: (google.protobuf.IDuration|null); + + /** Snapshot state. */ + public state: (google.dataflow.v1beta3.SnapshotState|keyof typeof google.dataflow.v1beta3.SnapshotState); + + /** Snapshot pubsubMetadata. */ + public pubsubMetadata: google.dataflow.v1beta3.IPubsubSnapshotMetadata[]; + + /** Snapshot description. */ + public description: string; + + /** Snapshot diskSizeBytes. */ + public diskSizeBytes: (number|Long|string); + + /** Snapshot region. */ + public region: string; + + /** + * Creates a new Snapshot instance using the specified properties. + * @param [properties] Properties to set + * @returns Snapshot instance + */ + public static create(properties?: google.dataflow.v1beta3.ISnapshot): google.dataflow.v1beta3.Snapshot; + + /** + * Encodes the specified Snapshot message. Does not implicitly {@link google.dataflow.v1beta3.Snapshot.verify|verify} messages. + * @param message Snapshot message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.dataflow.v1beta3.ISnapshot, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Snapshot message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.Snapshot.verify|verify} messages. + * @param message Snapshot message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.dataflow.v1beta3.ISnapshot, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Snapshot message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Snapshot + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.dataflow.v1beta3.Snapshot; + + /** + * Decodes a Snapshot message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Snapshot + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.dataflow.v1beta3.Snapshot; + + /** + * Verifies a Snapshot message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Snapshot message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Snapshot + */ + public static fromObject(object: { [k: string]: any }): google.dataflow.v1beta3.Snapshot; + + /** + * Creates a plain object from a Snapshot message. Also converts values to other types if specified. + * @param message Snapshot + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.dataflow.v1beta3.Snapshot, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Snapshot to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Snapshot + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetSnapshotRequest. */ + interface IGetSnapshotRequest { + + /** GetSnapshotRequest projectId */ + projectId?: (string|null); + + /** GetSnapshotRequest snapshotId */ + snapshotId?: (string|null); + + /** GetSnapshotRequest location */ + location?: (string|null); + } + + /** Represents a GetSnapshotRequest. */ + class GetSnapshotRequest implements IGetSnapshotRequest { + + /** + * Constructs a new GetSnapshotRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.dataflow.v1beta3.IGetSnapshotRequest); + + /** GetSnapshotRequest projectId. */ + public projectId: string; + + /** GetSnapshotRequest snapshotId. */ + public snapshotId: string; + + /** GetSnapshotRequest location. */ + public location: string; + + /** + * Creates a new GetSnapshotRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetSnapshotRequest instance + */ + public static create(properties?: google.dataflow.v1beta3.IGetSnapshotRequest): google.dataflow.v1beta3.GetSnapshotRequest; + + /** + * Encodes the specified GetSnapshotRequest message. Does not implicitly {@link google.dataflow.v1beta3.GetSnapshotRequest.verify|verify} messages. + * @param message GetSnapshotRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.dataflow.v1beta3.IGetSnapshotRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetSnapshotRequest message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.GetSnapshotRequest.verify|verify} messages. + * @param message GetSnapshotRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.dataflow.v1beta3.IGetSnapshotRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetSnapshotRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetSnapshotRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.dataflow.v1beta3.GetSnapshotRequest; + + /** + * Decodes a GetSnapshotRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetSnapshotRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.dataflow.v1beta3.GetSnapshotRequest; + + /** + * Verifies a GetSnapshotRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetSnapshotRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetSnapshotRequest + */ + public static fromObject(object: { [k: string]: any }): google.dataflow.v1beta3.GetSnapshotRequest; + + /** + * Creates a plain object from a GetSnapshotRequest message. Also converts values to other types if specified. + * @param message GetSnapshotRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.dataflow.v1beta3.GetSnapshotRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetSnapshotRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetSnapshotRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteSnapshotRequest. */ + interface IDeleteSnapshotRequest { + + /** DeleteSnapshotRequest projectId */ + projectId?: (string|null); + + /** DeleteSnapshotRequest snapshotId */ + snapshotId?: (string|null); + + /** DeleteSnapshotRequest location */ + location?: (string|null); + } + + /** Represents a DeleteSnapshotRequest. */ + class DeleteSnapshotRequest implements IDeleteSnapshotRequest { + + /** + * Constructs a new DeleteSnapshotRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.dataflow.v1beta3.IDeleteSnapshotRequest); + + /** DeleteSnapshotRequest projectId. */ + public projectId: string; + + /** DeleteSnapshotRequest snapshotId. */ + public snapshotId: string; + + /** DeleteSnapshotRequest location. */ + public location: string; + + /** + * Creates a new DeleteSnapshotRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteSnapshotRequest instance + */ + public static create(properties?: google.dataflow.v1beta3.IDeleteSnapshotRequest): google.dataflow.v1beta3.DeleteSnapshotRequest; + + /** + * Encodes the specified DeleteSnapshotRequest message. Does not implicitly {@link google.dataflow.v1beta3.DeleteSnapshotRequest.verify|verify} messages. + * @param message DeleteSnapshotRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.dataflow.v1beta3.IDeleteSnapshotRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteSnapshotRequest message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.DeleteSnapshotRequest.verify|verify} messages. + * @param message DeleteSnapshotRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.dataflow.v1beta3.IDeleteSnapshotRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteSnapshotRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteSnapshotRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.dataflow.v1beta3.DeleteSnapshotRequest; + + /** + * Decodes a DeleteSnapshotRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteSnapshotRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.dataflow.v1beta3.DeleteSnapshotRequest; + + /** + * Verifies a DeleteSnapshotRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteSnapshotRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteSnapshotRequest + */ + public static fromObject(object: { [k: string]: any }): google.dataflow.v1beta3.DeleteSnapshotRequest; + + /** + * Creates a plain object from a DeleteSnapshotRequest message. Also converts values to other types if specified. + * @param message DeleteSnapshotRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.dataflow.v1beta3.DeleteSnapshotRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteSnapshotRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteSnapshotRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteSnapshotResponse. */ + interface IDeleteSnapshotResponse { + } + + /** Represents a DeleteSnapshotResponse. */ + class DeleteSnapshotResponse implements IDeleteSnapshotResponse { + + /** + * Constructs a new DeleteSnapshotResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.dataflow.v1beta3.IDeleteSnapshotResponse); + + /** + * Creates a new DeleteSnapshotResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteSnapshotResponse instance + */ + public static create(properties?: google.dataflow.v1beta3.IDeleteSnapshotResponse): google.dataflow.v1beta3.DeleteSnapshotResponse; + + /** + * Encodes the specified DeleteSnapshotResponse message. Does not implicitly {@link google.dataflow.v1beta3.DeleteSnapshotResponse.verify|verify} messages. + * @param message DeleteSnapshotResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.dataflow.v1beta3.IDeleteSnapshotResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteSnapshotResponse message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.DeleteSnapshotResponse.verify|verify} messages. + * @param message DeleteSnapshotResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.dataflow.v1beta3.IDeleteSnapshotResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteSnapshotResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteSnapshotResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.dataflow.v1beta3.DeleteSnapshotResponse; + + /** + * Decodes a DeleteSnapshotResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteSnapshotResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.dataflow.v1beta3.DeleteSnapshotResponse; + + /** + * Verifies a DeleteSnapshotResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteSnapshotResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteSnapshotResponse + */ + public static fromObject(object: { [k: string]: any }): google.dataflow.v1beta3.DeleteSnapshotResponse; + + /** + * Creates a plain object from a DeleteSnapshotResponse message. Also converts values to other types if specified. + * @param message DeleteSnapshotResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.dataflow.v1beta3.DeleteSnapshotResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteSnapshotResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteSnapshotResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListSnapshotsRequest. */ + interface IListSnapshotsRequest { + + /** ListSnapshotsRequest projectId */ + projectId?: (string|null); + + /** ListSnapshotsRequest jobId */ + jobId?: (string|null); + + /** ListSnapshotsRequest location */ + location?: (string|null); + } + + /** Represents a ListSnapshotsRequest. */ + class ListSnapshotsRequest implements IListSnapshotsRequest { + + /** + * Constructs a new ListSnapshotsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.dataflow.v1beta3.IListSnapshotsRequest); + + /** ListSnapshotsRequest projectId. */ + public projectId: string; + + /** ListSnapshotsRequest jobId. */ + public jobId: string; + + /** ListSnapshotsRequest location. */ + public location: string; + + /** + * Creates a new ListSnapshotsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListSnapshotsRequest instance + */ + public static create(properties?: google.dataflow.v1beta3.IListSnapshotsRequest): google.dataflow.v1beta3.ListSnapshotsRequest; + + /** + * Encodes the specified ListSnapshotsRequest message. Does not implicitly {@link google.dataflow.v1beta3.ListSnapshotsRequest.verify|verify} messages. + * @param message ListSnapshotsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.dataflow.v1beta3.IListSnapshotsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListSnapshotsRequest message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.ListSnapshotsRequest.verify|verify} messages. + * @param message ListSnapshotsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.dataflow.v1beta3.IListSnapshotsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListSnapshotsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListSnapshotsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.dataflow.v1beta3.ListSnapshotsRequest; + + /** + * Decodes a ListSnapshotsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListSnapshotsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.dataflow.v1beta3.ListSnapshotsRequest; + + /** + * Verifies a ListSnapshotsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListSnapshotsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListSnapshotsRequest + */ + public static fromObject(object: { [k: string]: any }): google.dataflow.v1beta3.ListSnapshotsRequest; + + /** + * Creates a plain object from a ListSnapshotsRequest message. Also converts values to other types if specified. + * @param message ListSnapshotsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.dataflow.v1beta3.ListSnapshotsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListSnapshotsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListSnapshotsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListSnapshotsResponse. */ + interface IListSnapshotsResponse { + + /** ListSnapshotsResponse snapshots */ + snapshots?: (google.dataflow.v1beta3.ISnapshot[]|null); + } + + /** Represents a ListSnapshotsResponse. */ + class ListSnapshotsResponse implements IListSnapshotsResponse { + + /** + * Constructs a new ListSnapshotsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.dataflow.v1beta3.IListSnapshotsResponse); + + /** ListSnapshotsResponse snapshots. */ + public snapshots: google.dataflow.v1beta3.ISnapshot[]; + + /** + * Creates a new ListSnapshotsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListSnapshotsResponse instance + */ + public static create(properties?: google.dataflow.v1beta3.IListSnapshotsResponse): google.dataflow.v1beta3.ListSnapshotsResponse; + + /** + * Encodes the specified ListSnapshotsResponse message. Does not implicitly {@link google.dataflow.v1beta3.ListSnapshotsResponse.verify|verify} messages. + * @param message ListSnapshotsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.dataflow.v1beta3.IListSnapshotsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListSnapshotsResponse message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.ListSnapshotsResponse.verify|verify} messages. + * @param message ListSnapshotsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.dataflow.v1beta3.IListSnapshotsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListSnapshotsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListSnapshotsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.dataflow.v1beta3.ListSnapshotsResponse; + + /** + * Decodes a ListSnapshotsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListSnapshotsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.dataflow.v1beta3.ListSnapshotsResponse; + + /** + * Verifies a ListSnapshotsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListSnapshotsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListSnapshotsResponse + */ + public static fromObject(object: { [k: string]: any }): google.dataflow.v1beta3.ListSnapshotsResponse; + + /** + * Creates a plain object from a ListSnapshotsResponse message. Also converts values to other types if specified. + * @param message ListSnapshotsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.dataflow.v1beta3.ListSnapshotsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListSnapshotsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListSnapshotsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents a MessagesV1Beta3 */ + class MessagesV1Beta3 extends $protobuf.rpc.Service { + + /** + * Constructs a new MessagesV1Beta3 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 MessagesV1Beta3 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): MessagesV1Beta3; + + /** + * Calls ListJobMessages. + * @param request ListJobMessagesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListJobMessagesResponse + */ + public listJobMessages(request: google.dataflow.v1beta3.IListJobMessagesRequest, callback: google.dataflow.v1beta3.MessagesV1Beta3.ListJobMessagesCallback): void; + + /** + * Calls ListJobMessages. + * @param request ListJobMessagesRequest message or plain object + * @returns Promise + */ + public listJobMessages(request: google.dataflow.v1beta3.IListJobMessagesRequest): Promise; + } + + namespace MessagesV1Beta3 { + + /** + * Callback as used by {@link google.dataflow.v1beta3.MessagesV1Beta3|listJobMessages}. + * @param error Error, if any + * @param [response] ListJobMessagesResponse + */ + type ListJobMessagesCallback = (error: (Error|null), response?: google.dataflow.v1beta3.ListJobMessagesResponse) => void; + } + + /** Properties of a JobMessage. */ + interface IJobMessage { + + /** JobMessage id */ + id?: (string|null); + + /** JobMessage time */ + time?: (google.protobuf.ITimestamp|null); + + /** JobMessage messageText */ + messageText?: (string|null); + + /** JobMessage messageImportance */ + messageImportance?: (google.dataflow.v1beta3.JobMessageImportance|keyof typeof google.dataflow.v1beta3.JobMessageImportance|null); + } + + /** Represents a JobMessage. */ + class JobMessage implements IJobMessage { + + /** + * Constructs a new JobMessage. + * @param [properties] Properties to set + */ + constructor(properties?: google.dataflow.v1beta3.IJobMessage); + + /** JobMessage id. */ + public id: string; + + /** JobMessage time. */ + public time?: (google.protobuf.ITimestamp|null); + + /** JobMessage messageText. */ + public messageText: string; + + /** JobMessage messageImportance. */ + public messageImportance: (google.dataflow.v1beta3.JobMessageImportance|keyof typeof google.dataflow.v1beta3.JobMessageImportance); + + /** + * Creates a new JobMessage instance using the specified properties. + * @param [properties] Properties to set + * @returns JobMessage instance + */ + public static create(properties?: google.dataflow.v1beta3.IJobMessage): google.dataflow.v1beta3.JobMessage; + + /** + * Encodes the specified JobMessage message. Does not implicitly {@link google.dataflow.v1beta3.JobMessage.verify|verify} messages. + * @param message JobMessage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.dataflow.v1beta3.IJobMessage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified JobMessage message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.JobMessage.verify|verify} messages. + * @param message JobMessage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.dataflow.v1beta3.IJobMessage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a JobMessage message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns JobMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.dataflow.v1beta3.JobMessage; + + /** + * Decodes a JobMessage message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns JobMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.dataflow.v1beta3.JobMessage; + + /** + * Verifies a JobMessage message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a JobMessage message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns JobMessage + */ + public static fromObject(object: { [k: string]: any }): google.dataflow.v1beta3.JobMessage; + + /** + * Creates a plain object from a JobMessage message. Also converts values to other types if specified. + * @param message JobMessage + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.dataflow.v1beta3.JobMessage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this JobMessage to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for JobMessage + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** JobMessageImportance enum. */ + enum JobMessageImportance { + JOB_MESSAGE_IMPORTANCE_UNKNOWN = 0, + JOB_MESSAGE_DEBUG = 1, + JOB_MESSAGE_DETAILED = 2, + JOB_MESSAGE_BASIC = 5, + JOB_MESSAGE_WARNING = 3, + JOB_MESSAGE_ERROR = 4 + } + + /** Properties of a StructuredMessage. */ + interface IStructuredMessage { + + /** StructuredMessage messageText */ + messageText?: (string|null); + + /** StructuredMessage messageKey */ + messageKey?: (string|null); + + /** StructuredMessage parameters */ + parameters?: (google.dataflow.v1beta3.StructuredMessage.IParameter[]|null); + } + + /** Represents a StructuredMessage. */ + class StructuredMessage implements IStructuredMessage { + + /** + * Constructs a new StructuredMessage. + * @param [properties] Properties to set + */ + constructor(properties?: google.dataflow.v1beta3.IStructuredMessage); + + /** StructuredMessage messageText. */ + public messageText: string; + + /** StructuredMessage messageKey. */ + public messageKey: string; + + /** StructuredMessage parameters. */ + public parameters: google.dataflow.v1beta3.StructuredMessage.IParameter[]; + + /** + * Creates a new StructuredMessage instance using the specified properties. + * @param [properties] Properties to set + * @returns StructuredMessage instance + */ + public static create(properties?: google.dataflow.v1beta3.IStructuredMessage): google.dataflow.v1beta3.StructuredMessage; + + /** + * Encodes the specified StructuredMessage message. Does not implicitly {@link google.dataflow.v1beta3.StructuredMessage.verify|verify} messages. + * @param message StructuredMessage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.dataflow.v1beta3.IStructuredMessage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StructuredMessage message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.StructuredMessage.verify|verify} messages. + * @param message StructuredMessage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.dataflow.v1beta3.IStructuredMessage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StructuredMessage message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StructuredMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.dataflow.v1beta3.StructuredMessage; + + /** + * Decodes a StructuredMessage message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StructuredMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.dataflow.v1beta3.StructuredMessage; + + /** + * Verifies a StructuredMessage message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StructuredMessage message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StructuredMessage + */ + public static fromObject(object: { [k: string]: any }): google.dataflow.v1beta3.StructuredMessage; + + /** + * Creates a plain object from a StructuredMessage message. Also converts values to other types if specified. + * @param message StructuredMessage + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.dataflow.v1beta3.StructuredMessage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StructuredMessage to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StructuredMessage + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace StructuredMessage { + + /** Properties of a Parameter. */ + interface IParameter { + + /** Parameter key */ + key?: (string|null); + + /** Parameter value */ + value?: (google.protobuf.IValue|null); + } + + /** Represents a Parameter. */ + class Parameter implements IParameter { + + /** + * Constructs a new Parameter. + * @param [properties] Properties to set + */ + constructor(properties?: google.dataflow.v1beta3.StructuredMessage.IParameter); + + /** Parameter key. */ + public key: string; + + /** Parameter value. */ + public value?: (google.protobuf.IValue|null); + + /** + * Creates a new Parameter instance using the specified properties. + * @param [properties] Properties to set + * @returns Parameter instance + */ + public static create(properties?: google.dataflow.v1beta3.StructuredMessage.IParameter): google.dataflow.v1beta3.StructuredMessage.Parameter; + + /** + * Encodes the specified Parameter message. Does not implicitly {@link google.dataflow.v1beta3.StructuredMessage.Parameter.verify|verify} messages. + * @param message Parameter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.dataflow.v1beta3.StructuredMessage.IParameter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Parameter message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.StructuredMessage.Parameter.verify|verify} messages. + * @param message Parameter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.dataflow.v1beta3.StructuredMessage.IParameter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Parameter message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Parameter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.dataflow.v1beta3.StructuredMessage.Parameter; + + /** + * Decodes a Parameter message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Parameter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.dataflow.v1beta3.StructuredMessage.Parameter; + + /** + * Verifies a Parameter message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Parameter message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Parameter + */ + public static fromObject(object: { [k: string]: any }): google.dataflow.v1beta3.StructuredMessage.Parameter; + + /** + * Creates a plain object from a Parameter message. Also converts values to other types if specified. + * @param message Parameter + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.dataflow.v1beta3.StructuredMessage.Parameter, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Parameter to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Parameter + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an AutoscalingEvent. */ + interface IAutoscalingEvent { + + /** AutoscalingEvent currentNumWorkers */ + currentNumWorkers?: (number|Long|string|null); + + /** AutoscalingEvent targetNumWorkers */ + targetNumWorkers?: (number|Long|string|null); + + /** AutoscalingEvent eventType */ + eventType?: (google.dataflow.v1beta3.AutoscalingEvent.AutoscalingEventType|keyof typeof google.dataflow.v1beta3.AutoscalingEvent.AutoscalingEventType|null); + + /** AutoscalingEvent description */ + description?: (google.dataflow.v1beta3.IStructuredMessage|null); + + /** AutoscalingEvent time */ + time?: (google.protobuf.ITimestamp|null); + + /** AutoscalingEvent workerPool */ + workerPool?: (string|null); + } + + /** Represents an AutoscalingEvent. */ + class AutoscalingEvent implements IAutoscalingEvent { + + /** + * Constructs a new AutoscalingEvent. + * @param [properties] Properties to set + */ + constructor(properties?: google.dataflow.v1beta3.IAutoscalingEvent); + + /** AutoscalingEvent currentNumWorkers. */ + public currentNumWorkers: (number|Long|string); + + /** AutoscalingEvent targetNumWorkers. */ + public targetNumWorkers: (number|Long|string); + + /** AutoscalingEvent eventType. */ + public eventType: (google.dataflow.v1beta3.AutoscalingEvent.AutoscalingEventType|keyof typeof google.dataflow.v1beta3.AutoscalingEvent.AutoscalingEventType); + + /** AutoscalingEvent description. */ + public description?: (google.dataflow.v1beta3.IStructuredMessage|null); + + /** AutoscalingEvent time. */ + public time?: (google.protobuf.ITimestamp|null); + + /** AutoscalingEvent workerPool. */ + public workerPool: string; + + /** + * Creates a new AutoscalingEvent instance using the specified properties. + * @param [properties] Properties to set + * @returns AutoscalingEvent instance + */ + public static create(properties?: google.dataflow.v1beta3.IAutoscalingEvent): google.dataflow.v1beta3.AutoscalingEvent; + + /** + * Encodes the specified AutoscalingEvent message. Does not implicitly {@link google.dataflow.v1beta3.AutoscalingEvent.verify|verify} messages. + * @param message AutoscalingEvent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.dataflow.v1beta3.IAutoscalingEvent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AutoscalingEvent message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.AutoscalingEvent.verify|verify} messages. + * @param message AutoscalingEvent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.dataflow.v1beta3.IAutoscalingEvent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AutoscalingEvent message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AutoscalingEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.dataflow.v1beta3.AutoscalingEvent; + + /** + * Decodes an AutoscalingEvent message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AutoscalingEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.dataflow.v1beta3.AutoscalingEvent; + + /** + * Verifies an AutoscalingEvent message. + * @param message Plain 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 AutoscalingEvent message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AutoscalingEvent + */ + public static fromObject(object: { [k: string]: any }): google.dataflow.v1beta3.AutoscalingEvent; + + /** + * Creates a plain object from an AutoscalingEvent message. Also converts values to other types if specified. + * @param message AutoscalingEvent + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.dataflow.v1beta3.AutoscalingEvent, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AutoscalingEvent to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AutoscalingEvent + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace AutoscalingEvent { + + /** AutoscalingEventType enum. */ + enum AutoscalingEventType { + TYPE_UNKNOWN = 0, + TARGET_NUM_WORKERS_CHANGED = 1, + CURRENT_NUM_WORKERS_CHANGED = 2, + ACTUATION_FAILURE = 3, + NO_CHANGE = 4 + } + } + + /** Properties of a ListJobMessagesRequest. */ + interface IListJobMessagesRequest { + + /** ListJobMessagesRequest projectId */ + projectId?: (string|null); + + /** ListJobMessagesRequest jobId */ + jobId?: (string|null); + + /** ListJobMessagesRequest minimumImportance */ + minimumImportance?: (google.dataflow.v1beta3.JobMessageImportance|keyof typeof google.dataflow.v1beta3.JobMessageImportance|null); + + /** ListJobMessagesRequest pageSize */ + pageSize?: (number|null); + + /** ListJobMessagesRequest pageToken */ + pageToken?: (string|null); + + /** ListJobMessagesRequest startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** ListJobMessagesRequest endTime */ + endTime?: (google.protobuf.ITimestamp|null); + + /** ListJobMessagesRequest location */ + location?: (string|null); + } + + /** Represents a ListJobMessagesRequest. */ + class ListJobMessagesRequest implements IListJobMessagesRequest { + + /** + * Constructs a new ListJobMessagesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.dataflow.v1beta3.IListJobMessagesRequest); + + /** ListJobMessagesRequest projectId. */ + public projectId: string; + + /** ListJobMessagesRequest jobId. */ + public jobId: string; + + /** ListJobMessagesRequest minimumImportance. */ + public minimumImportance: (google.dataflow.v1beta3.JobMessageImportance|keyof typeof google.dataflow.v1beta3.JobMessageImportance); + + /** ListJobMessagesRequest pageSize. */ + public pageSize: number; + + /** ListJobMessagesRequest pageToken. */ + public pageToken: string; + + /** ListJobMessagesRequest startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** ListJobMessagesRequest endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** ListJobMessagesRequest location. */ + public location: string; + + /** + * Creates a new ListJobMessagesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListJobMessagesRequest instance + */ + public static create(properties?: google.dataflow.v1beta3.IListJobMessagesRequest): google.dataflow.v1beta3.ListJobMessagesRequest; + + /** + * Encodes the specified ListJobMessagesRequest message. Does not implicitly {@link google.dataflow.v1beta3.ListJobMessagesRequest.verify|verify} messages. + * @param message ListJobMessagesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.dataflow.v1beta3.IListJobMessagesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListJobMessagesRequest message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.ListJobMessagesRequest.verify|verify} messages. + * @param message ListJobMessagesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.dataflow.v1beta3.IListJobMessagesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListJobMessagesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListJobMessagesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.dataflow.v1beta3.ListJobMessagesRequest; + + /** + * Decodes a ListJobMessagesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListJobMessagesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.dataflow.v1beta3.ListJobMessagesRequest; + + /** + * Verifies a ListJobMessagesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListJobMessagesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListJobMessagesRequest + */ + public static fromObject(object: { [k: string]: any }): google.dataflow.v1beta3.ListJobMessagesRequest; + + /** + * Creates a plain object from a ListJobMessagesRequest message. Also converts values to other types if specified. + * @param message ListJobMessagesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.dataflow.v1beta3.ListJobMessagesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListJobMessagesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListJobMessagesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListJobMessagesResponse. */ + interface IListJobMessagesResponse { + + /** ListJobMessagesResponse jobMessages */ + jobMessages?: (google.dataflow.v1beta3.IJobMessage[]|null); + + /** ListJobMessagesResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListJobMessagesResponse autoscalingEvents */ + autoscalingEvents?: (google.dataflow.v1beta3.IAutoscalingEvent[]|null); + } + + /** Represents a ListJobMessagesResponse. */ + class ListJobMessagesResponse implements IListJobMessagesResponse { + + /** + * Constructs a new ListJobMessagesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.dataflow.v1beta3.IListJobMessagesResponse); + + /** ListJobMessagesResponse jobMessages. */ + public jobMessages: google.dataflow.v1beta3.IJobMessage[]; + + /** ListJobMessagesResponse nextPageToken. */ + public nextPageToken: string; + + /** ListJobMessagesResponse autoscalingEvents. */ + public autoscalingEvents: google.dataflow.v1beta3.IAutoscalingEvent[]; + + /** + * Creates a new ListJobMessagesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListJobMessagesResponse instance + */ + public static create(properties?: google.dataflow.v1beta3.IListJobMessagesResponse): google.dataflow.v1beta3.ListJobMessagesResponse; + + /** + * Encodes the specified ListJobMessagesResponse message. Does not implicitly {@link google.dataflow.v1beta3.ListJobMessagesResponse.verify|verify} messages. + * @param message ListJobMessagesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.dataflow.v1beta3.IListJobMessagesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListJobMessagesResponse message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.ListJobMessagesResponse.verify|verify} messages. + * @param message ListJobMessagesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.dataflow.v1beta3.IListJobMessagesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListJobMessagesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListJobMessagesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.dataflow.v1beta3.ListJobMessagesResponse; + + /** + * Decodes a ListJobMessagesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListJobMessagesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.dataflow.v1beta3.ListJobMessagesResponse; + + /** + * Verifies a ListJobMessagesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListJobMessagesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListJobMessagesResponse + */ + public static fromObject(object: { [k: string]: any }): google.dataflow.v1beta3.ListJobMessagesResponse; + + /** + * Creates a plain object from a ListJobMessagesResponse message. Also converts values to other types if specified. + * @param message ListJobMessagesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.dataflow.v1beta3.ListJobMessagesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListJobMessagesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListJobMessagesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents a MetricsV1Beta3 */ + class MetricsV1Beta3 extends $protobuf.rpc.Service { + + /** + * Constructs a new MetricsV1Beta3 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 MetricsV1Beta3 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): MetricsV1Beta3; + + /** + * Calls GetJobMetrics. + * @param request GetJobMetricsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and JobMetrics + */ + public getJobMetrics(request: google.dataflow.v1beta3.IGetJobMetricsRequest, callback: google.dataflow.v1beta3.MetricsV1Beta3.GetJobMetricsCallback): void; + + /** + * Calls GetJobMetrics. + * @param request GetJobMetricsRequest message or plain object + * @returns Promise + */ + public getJobMetrics(request: google.dataflow.v1beta3.IGetJobMetricsRequest): Promise; + + /** + * Calls GetJobExecutionDetails. + * @param request GetJobExecutionDetailsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and JobExecutionDetails + */ + public getJobExecutionDetails(request: google.dataflow.v1beta3.IGetJobExecutionDetailsRequest, callback: google.dataflow.v1beta3.MetricsV1Beta3.GetJobExecutionDetailsCallback): void; + + /** + * Calls GetJobExecutionDetails. + * @param request GetJobExecutionDetailsRequest message or plain object + * @returns Promise + */ + public getJobExecutionDetails(request: google.dataflow.v1beta3.IGetJobExecutionDetailsRequest): Promise; + + /** + * Calls GetStageExecutionDetails. + * @param request GetStageExecutionDetailsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and StageExecutionDetails + */ + public getStageExecutionDetails(request: google.dataflow.v1beta3.IGetStageExecutionDetailsRequest, callback: google.dataflow.v1beta3.MetricsV1Beta3.GetStageExecutionDetailsCallback): void; + + /** + * Calls GetStageExecutionDetails. + * @param request GetStageExecutionDetailsRequest message or plain object + * @returns Promise + */ + public getStageExecutionDetails(request: google.dataflow.v1beta3.IGetStageExecutionDetailsRequest): Promise; + } + + namespace MetricsV1Beta3 { + + /** + * Callback as used by {@link google.dataflow.v1beta3.MetricsV1Beta3|getJobMetrics}. + * @param error Error, if any + * @param [response] JobMetrics + */ + type GetJobMetricsCallback = (error: (Error|null), response?: google.dataflow.v1beta3.JobMetrics) => void; + + /** + * Callback as used by {@link google.dataflow.v1beta3.MetricsV1Beta3|getJobExecutionDetails}. + * @param error Error, if any + * @param [response] JobExecutionDetails + */ + type GetJobExecutionDetailsCallback = (error: (Error|null), response?: google.dataflow.v1beta3.JobExecutionDetails) => void; + + /** + * Callback as used by {@link google.dataflow.v1beta3.MetricsV1Beta3|getStageExecutionDetails}. + * @param error Error, if any + * @param [response] StageExecutionDetails + */ + type GetStageExecutionDetailsCallback = (error: (Error|null), response?: google.dataflow.v1beta3.StageExecutionDetails) => void; + } + + /** Properties of a MetricStructuredName. */ + interface IMetricStructuredName { + + /** MetricStructuredName origin */ + origin?: (string|null); + + /** MetricStructuredName name */ + name?: (string|null); + + /** MetricStructuredName context */ + context?: ({ [k: string]: string }|null); + } + + /** Represents a MetricStructuredName. */ + class MetricStructuredName implements IMetricStructuredName { + + /** + * Constructs a new MetricStructuredName. + * @param [properties] Properties to set + */ + constructor(properties?: google.dataflow.v1beta3.IMetricStructuredName); + + /** MetricStructuredName origin. */ + public origin: string; + + /** MetricStructuredName name. */ + public name: string; + + /** MetricStructuredName context. */ + public context: { [k: string]: string }; + + /** + * Creates a new MetricStructuredName instance using the specified properties. + * @param [properties] Properties to set + * @returns MetricStructuredName instance + */ + public static create(properties?: google.dataflow.v1beta3.IMetricStructuredName): google.dataflow.v1beta3.MetricStructuredName; + + /** + * Encodes the specified MetricStructuredName message. Does not implicitly {@link google.dataflow.v1beta3.MetricStructuredName.verify|verify} messages. + * @param message MetricStructuredName message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.dataflow.v1beta3.IMetricStructuredName, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MetricStructuredName message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.MetricStructuredName.verify|verify} messages. + * @param message MetricStructuredName message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.dataflow.v1beta3.IMetricStructuredName, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MetricStructuredName message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MetricStructuredName + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.dataflow.v1beta3.MetricStructuredName; + + /** + * Decodes a MetricStructuredName message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MetricStructuredName + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.dataflow.v1beta3.MetricStructuredName; + + /** + * Verifies a MetricStructuredName message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MetricStructuredName message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MetricStructuredName + */ + public static fromObject(object: { [k: string]: any }): google.dataflow.v1beta3.MetricStructuredName; + + /** + * Creates a plain object from a MetricStructuredName message. Also converts values to other types if specified. + * @param message MetricStructuredName + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.dataflow.v1beta3.MetricStructuredName, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MetricStructuredName to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MetricStructuredName + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MetricUpdate. */ + interface IMetricUpdate { + + /** MetricUpdate name */ + name?: (google.dataflow.v1beta3.IMetricStructuredName|null); + + /** MetricUpdate kind */ + kind?: (string|null); + + /** MetricUpdate cumulative */ + cumulative?: (boolean|null); + + /** MetricUpdate scalar */ + scalar?: (google.protobuf.IValue|null); + + /** MetricUpdate meanSum */ + meanSum?: (google.protobuf.IValue|null); + + /** MetricUpdate meanCount */ + meanCount?: (google.protobuf.IValue|null); + + /** MetricUpdate set */ + set?: (google.protobuf.IValue|null); + + /** MetricUpdate distribution */ + distribution?: (google.protobuf.IValue|null); + + /** MetricUpdate gauge */ + gauge?: (google.protobuf.IValue|null); + + /** MetricUpdate internal */ + internal?: (google.protobuf.IValue|null); + + /** MetricUpdate updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a MetricUpdate. */ + class MetricUpdate implements IMetricUpdate { + + /** + * Constructs a new MetricUpdate. + * @param [properties] Properties to set + */ + constructor(properties?: google.dataflow.v1beta3.IMetricUpdate); + + /** MetricUpdate name. */ + public name?: (google.dataflow.v1beta3.IMetricStructuredName|null); + + /** MetricUpdate kind. */ + public kind: string; + + /** MetricUpdate cumulative. */ + public cumulative: boolean; + + /** MetricUpdate scalar. */ + public scalar?: (google.protobuf.IValue|null); + + /** MetricUpdate meanSum. */ + public meanSum?: (google.protobuf.IValue|null); + + /** MetricUpdate meanCount. */ + public meanCount?: (google.protobuf.IValue|null); + + /** MetricUpdate set. */ + public set?: (google.protobuf.IValue|null); + + /** MetricUpdate distribution. */ + public distribution?: (google.protobuf.IValue|null); + + /** MetricUpdate gauge. */ + public gauge?: (google.protobuf.IValue|null); + + /** MetricUpdate internal. */ + public internal?: (google.protobuf.IValue|null); + + /** MetricUpdate updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new MetricUpdate instance using the specified properties. + * @param [properties] Properties to set + * @returns MetricUpdate instance + */ + public static create(properties?: google.dataflow.v1beta3.IMetricUpdate): google.dataflow.v1beta3.MetricUpdate; + + /** + * Encodes the specified MetricUpdate message. Does not implicitly {@link google.dataflow.v1beta3.MetricUpdate.verify|verify} messages. + * @param message MetricUpdate message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.dataflow.v1beta3.IMetricUpdate, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MetricUpdate message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.MetricUpdate.verify|verify} messages. + * @param message MetricUpdate message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.dataflow.v1beta3.IMetricUpdate, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MetricUpdate message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MetricUpdate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.dataflow.v1beta3.MetricUpdate; + + /** + * Decodes a MetricUpdate message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MetricUpdate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.dataflow.v1beta3.MetricUpdate; + + /** + * Verifies a MetricUpdate message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MetricUpdate message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MetricUpdate + */ + public static fromObject(object: { [k: string]: any }): google.dataflow.v1beta3.MetricUpdate; + + /** + * Creates a plain object from a MetricUpdate message. Also converts values to other types if specified. + * @param message MetricUpdate + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.dataflow.v1beta3.MetricUpdate, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MetricUpdate to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MetricUpdate + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetJobMetricsRequest. */ + interface IGetJobMetricsRequest { + + /** GetJobMetricsRequest projectId */ + projectId?: (string|null); + + /** GetJobMetricsRequest jobId */ + jobId?: (string|null); + + /** GetJobMetricsRequest startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** GetJobMetricsRequest location */ + location?: (string|null); + } + + /** Represents a GetJobMetricsRequest. */ + class GetJobMetricsRequest implements IGetJobMetricsRequest { + + /** + * Constructs a new GetJobMetricsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.dataflow.v1beta3.IGetJobMetricsRequest); + + /** GetJobMetricsRequest projectId. */ + public projectId: string; + + /** GetJobMetricsRequest jobId. */ + public jobId: string; + + /** GetJobMetricsRequest startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** GetJobMetricsRequest location. */ + public location: string; + + /** + * Creates a new GetJobMetricsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetJobMetricsRequest instance + */ + public static create(properties?: google.dataflow.v1beta3.IGetJobMetricsRequest): google.dataflow.v1beta3.GetJobMetricsRequest; + + /** + * Encodes the specified GetJobMetricsRequest message. Does not implicitly {@link google.dataflow.v1beta3.GetJobMetricsRequest.verify|verify} messages. + * @param message GetJobMetricsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.dataflow.v1beta3.IGetJobMetricsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetJobMetricsRequest message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.GetJobMetricsRequest.verify|verify} messages. + * @param message GetJobMetricsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.dataflow.v1beta3.IGetJobMetricsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetJobMetricsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetJobMetricsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.dataflow.v1beta3.GetJobMetricsRequest; + + /** + * Decodes a GetJobMetricsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetJobMetricsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.dataflow.v1beta3.GetJobMetricsRequest; + + /** + * Verifies a GetJobMetricsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetJobMetricsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetJobMetricsRequest + */ + public static fromObject(object: { [k: string]: any }): google.dataflow.v1beta3.GetJobMetricsRequest; + + /** + * Creates a plain object from a GetJobMetricsRequest message. Also converts values to other types if specified. + * @param message GetJobMetricsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.dataflow.v1beta3.GetJobMetricsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetJobMetricsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetJobMetricsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a JobMetrics. */ + interface IJobMetrics { + + /** JobMetrics metricTime */ + metricTime?: (google.protobuf.ITimestamp|null); + + /** JobMetrics metrics */ + metrics?: (google.dataflow.v1beta3.IMetricUpdate[]|null); + } + + /** Represents a JobMetrics. */ + class JobMetrics implements IJobMetrics { + + /** + * Constructs a new JobMetrics. + * @param [properties] Properties to set + */ + constructor(properties?: google.dataflow.v1beta3.IJobMetrics); + + /** JobMetrics metricTime. */ + public metricTime?: (google.protobuf.ITimestamp|null); + + /** JobMetrics metrics. */ + public metrics: google.dataflow.v1beta3.IMetricUpdate[]; + + /** + * Creates a new JobMetrics instance using the specified properties. + * @param [properties] Properties to set + * @returns JobMetrics instance + */ + public static create(properties?: google.dataflow.v1beta3.IJobMetrics): google.dataflow.v1beta3.JobMetrics; + + /** + * Encodes the specified JobMetrics message. Does not implicitly {@link google.dataflow.v1beta3.JobMetrics.verify|verify} messages. + * @param message JobMetrics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.dataflow.v1beta3.IJobMetrics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified JobMetrics message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.JobMetrics.verify|verify} messages. + * @param message JobMetrics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.dataflow.v1beta3.IJobMetrics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a JobMetrics message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns JobMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.dataflow.v1beta3.JobMetrics; + + /** + * Decodes a JobMetrics message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns JobMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.dataflow.v1beta3.JobMetrics; + + /** + * Verifies a JobMetrics message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a JobMetrics message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns JobMetrics + */ + public static fromObject(object: { [k: string]: any }): google.dataflow.v1beta3.JobMetrics; + + /** + * Creates a plain object from a JobMetrics message. Also converts values to other types if specified. + * @param message JobMetrics + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.dataflow.v1beta3.JobMetrics, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this JobMetrics to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for JobMetrics + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetJobExecutionDetailsRequest. */ + interface IGetJobExecutionDetailsRequest { + + /** GetJobExecutionDetailsRequest projectId */ + projectId?: (string|null); + + /** GetJobExecutionDetailsRequest jobId */ + jobId?: (string|null); + + /** GetJobExecutionDetailsRequest location */ + location?: (string|null); + + /** GetJobExecutionDetailsRequest pageSize */ + pageSize?: (number|null); + + /** GetJobExecutionDetailsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a GetJobExecutionDetailsRequest. */ + class GetJobExecutionDetailsRequest implements IGetJobExecutionDetailsRequest { + + /** + * Constructs a new GetJobExecutionDetailsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.dataflow.v1beta3.IGetJobExecutionDetailsRequest); + + /** GetJobExecutionDetailsRequest projectId. */ + public projectId: string; + + /** GetJobExecutionDetailsRequest jobId. */ + public jobId: string; + + /** GetJobExecutionDetailsRequest location. */ + public location: string; + + /** GetJobExecutionDetailsRequest pageSize. */ + public pageSize: number; + + /** GetJobExecutionDetailsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new GetJobExecutionDetailsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetJobExecutionDetailsRequest instance + */ + public static create(properties?: google.dataflow.v1beta3.IGetJobExecutionDetailsRequest): google.dataflow.v1beta3.GetJobExecutionDetailsRequest; + + /** + * Encodes the specified GetJobExecutionDetailsRequest message. Does not implicitly {@link google.dataflow.v1beta3.GetJobExecutionDetailsRequest.verify|verify} messages. + * @param message GetJobExecutionDetailsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.dataflow.v1beta3.IGetJobExecutionDetailsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetJobExecutionDetailsRequest message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.GetJobExecutionDetailsRequest.verify|verify} messages. + * @param message GetJobExecutionDetailsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.dataflow.v1beta3.IGetJobExecutionDetailsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetJobExecutionDetailsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetJobExecutionDetailsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.dataflow.v1beta3.GetJobExecutionDetailsRequest; + + /** + * Decodes a GetJobExecutionDetailsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetJobExecutionDetailsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.dataflow.v1beta3.GetJobExecutionDetailsRequest; + + /** + * Verifies a GetJobExecutionDetailsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetJobExecutionDetailsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetJobExecutionDetailsRequest + */ + public static fromObject(object: { [k: string]: any }): google.dataflow.v1beta3.GetJobExecutionDetailsRequest; + + /** + * Creates a plain object from a GetJobExecutionDetailsRequest message. Also converts values to other types if specified. + * @param message GetJobExecutionDetailsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.dataflow.v1beta3.GetJobExecutionDetailsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetJobExecutionDetailsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetJobExecutionDetailsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ProgressTimeseries. */ + interface IProgressTimeseries { + + /** ProgressTimeseries currentProgress */ + currentProgress?: (number|null); + + /** ProgressTimeseries dataPoints */ + dataPoints?: (google.dataflow.v1beta3.ProgressTimeseries.IPoint[]|null); + } + + /** Represents a ProgressTimeseries. */ + class ProgressTimeseries implements IProgressTimeseries { + + /** + * Constructs a new ProgressTimeseries. + * @param [properties] Properties to set + */ + constructor(properties?: google.dataflow.v1beta3.IProgressTimeseries); + + /** ProgressTimeseries currentProgress. */ + public currentProgress: number; + + /** ProgressTimeseries dataPoints. */ + public dataPoints: google.dataflow.v1beta3.ProgressTimeseries.IPoint[]; + + /** + * Creates a new ProgressTimeseries instance using the specified properties. + * @param [properties] Properties to set + * @returns ProgressTimeseries instance + */ + public static create(properties?: google.dataflow.v1beta3.IProgressTimeseries): google.dataflow.v1beta3.ProgressTimeseries; + + /** + * Encodes the specified ProgressTimeseries message. Does not implicitly {@link google.dataflow.v1beta3.ProgressTimeseries.verify|verify} messages. + * @param message ProgressTimeseries message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.dataflow.v1beta3.IProgressTimeseries, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ProgressTimeseries message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.ProgressTimeseries.verify|verify} messages. + * @param message ProgressTimeseries message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.dataflow.v1beta3.IProgressTimeseries, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ProgressTimeseries message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ProgressTimeseries + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.dataflow.v1beta3.ProgressTimeseries; + + /** + * Decodes a ProgressTimeseries message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ProgressTimeseries + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.dataflow.v1beta3.ProgressTimeseries; + + /** + * Verifies a ProgressTimeseries message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ProgressTimeseries message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ProgressTimeseries + */ + public static fromObject(object: { [k: string]: any }): google.dataflow.v1beta3.ProgressTimeseries; + + /** + * Creates a plain object from a ProgressTimeseries message. Also converts values to other types if specified. + * @param message ProgressTimeseries + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.dataflow.v1beta3.ProgressTimeseries, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ProgressTimeseries to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ProgressTimeseries + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ProgressTimeseries { + + /** Properties of a Point. */ + interface IPoint { + + /** Point time */ + time?: (google.protobuf.ITimestamp|null); + + /** Point value */ + value?: (number|null); + } + + /** Represents a Point. */ + class Point implements IPoint { + + /** + * Constructs a new Point. + * @param [properties] Properties to set + */ + constructor(properties?: google.dataflow.v1beta3.ProgressTimeseries.IPoint); + + /** Point time. */ + public time?: (google.protobuf.ITimestamp|null); + + /** Point value. */ + public value: number; + + /** + * Creates a new Point instance using the specified properties. + * @param [properties] Properties to set + * @returns Point instance + */ + public static create(properties?: google.dataflow.v1beta3.ProgressTimeseries.IPoint): google.dataflow.v1beta3.ProgressTimeseries.Point; + + /** + * Encodes the specified Point message. Does not implicitly {@link google.dataflow.v1beta3.ProgressTimeseries.Point.verify|verify} messages. + * @param message Point message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.dataflow.v1beta3.ProgressTimeseries.IPoint, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Point message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.ProgressTimeseries.Point.verify|verify} messages. + * @param message Point message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.dataflow.v1beta3.ProgressTimeseries.IPoint, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Point message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Point + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.dataflow.v1beta3.ProgressTimeseries.Point; + + /** + * Decodes a Point message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Point + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.dataflow.v1beta3.ProgressTimeseries.Point; + + /** + * Verifies a Point message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Point message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Point + */ + public static fromObject(object: { [k: string]: any }): google.dataflow.v1beta3.ProgressTimeseries.Point; + + /** + * Creates a plain object from a Point message. Also converts values to other types if specified. + * @param message Point + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.dataflow.v1beta3.ProgressTimeseries.Point, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Point to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Point + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** ExecutionState enum. */ + enum ExecutionState { + EXECUTION_STATE_UNKNOWN = 0, + EXECUTION_STATE_NOT_STARTED = 1, + EXECUTION_STATE_RUNNING = 2, + EXECUTION_STATE_SUCCEEDED = 3, + EXECUTION_STATE_FAILED = 4, + EXECUTION_STATE_CANCELLED = 5 + } + + /** Properties of a StageSummary. */ + interface IStageSummary { + + /** StageSummary stageId */ + stageId?: (string|null); + + /** StageSummary state */ + state?: (google.dataflow.v1beta3.ExecutionState|keyof typeof google.dataflow.v1beta3.ExecutionState|null); + + /** StageSummary startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** StageSummary endTime */ + endTime?: (google.protobuf.ITimestamp|null); + + /** StageSummary progress */ + progress?: (google.dataflow.v1beta3.IProgressTimeseries|null); + + /** StageSummary metrics */ + metrics?: (google.dataflow.v1beta3.IMetricUpdate[]|null); + } + + /** Represents a StageSummary. */ + class StageSummary implements IStageSummary { + + /** + * Constructs a new StageSummary. + * @param [properties] Properties to set + */ + constructor(properties?: google.dataflow.v1beta3.IStageSummary); + + /** StageSummary stageId. */ + public stageId: string; + + /** StageSummary state. */ + public state: (google.dataflow.v1beta3.ExecutionState|keyof typeof google.dataflow.v1beta3.ExecutionState); + + /** StageSummary startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** StageSummary endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** StageSummary progress. */ + public progress?: (google.dataflow.v1beta3.IProgressTimeseries|null); + + /** StageSummary metrics. */ + public metrics: google.dataflow.v1beta3.IMetricUpdate[]; + + /** + * Creates a new StageSummary instance using the specified properties. + * @param [properties] Properties to set + * @returns StageSummary instance + */ + public static create(properties?: google.dataflow.v1beta3.IStageSummary): google.dataflow.v1beta3.StageSummary; + + /** + * Encodes the specified StageSummary message. Does not implicitly {@link google.dataflow.v1beta3.StageSummary.verify|verify} messages. + * @param message StageSummary message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.dataflow.v1beta3.IStageSummary, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StageSummary message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.StageSummary.verify|verify} messages. + * @param message StageSummary message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.dataflow.v1beta3.IStageSummary, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StageSummary message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StageSummary + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.dataflow.v1beta3.StageSummary; + + /** + * Decodes a StageSummary message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StageSummary + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.dataflow.v1beta3.StageSummary; + + /** + * Verifies a StageSummary message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StageSummary message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StageSummary + */ + public static fromObject(object: { [k: string]: any }): google.dataflow.v1beta3.StageSummary; + + /** + * Creates a plain object from a StageSummary message. Also converts values to other types if specified. + * @param message StageSummary + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.dataflow.v1beta3.StageSummary, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StageSummary to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StageSummary + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a JobExecutionDetails. */ + interface IJobExecutionDetails { + + /** JobExecutionDetails stages */ + stages?: (google.dataflow.v1beta3.IStageSummary[]|null); + + /** JobExecutionDetails nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a JobExecutionDetails. */ + class JobExecutionDetails implements IJobExecutionDetails { + + /** + * Constructs a new JobExecutionDetails. + * @param [properties] Properties to set + */ + constructor(properties?: google.dataflow.v1beta3.IJobExecutionDetails); + + /** JobExecutionDetails stages. */ + public stages: google.dataflow.v1beta3.IStageSummary[]; + + /** JobExecutionDetails nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new JobExecutionDetails instance using the specified properties. + * @param [properties] Properties to set + * @returns JobExecutionDetails instance + */ + public static create(properties?: google.dataflow.v1beta3.IJobExecutionDetails): google.dataflow.v1beta3.JobExecutionDetails; + + /** + * Encodes the specified JobExecutionDetails message. Does not implicitly {@link google.dataflow.v1beta3.JobExecutionDetails.verify|verify} messages. + * @param message JobExecutionDetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.dataflow.v1beta3.IJobExecutionDetails, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified JobExecutionDetails message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.JobExecutionDetails.verify|verify} messages. + * @param message JobExecutionDetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.dataflow.v1beta3.IJobExecutionDetails, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a JobExecutionDetails message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns JobExecutionDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.dataflow.v1beta3.JobExecutionDetails; + + /** + * Decodes a JobExecutionDetails message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns JobExecutionDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.dataflow.v1beta3.JobExecutionDetails; + + /** + * Verifies a JobExecutionDetails message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a JobExecutionDetails message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns JobExecutionDetails + */ + public static fromObject(object: { [k: string]: any }): google.dataflow.v1beta3.JobExecutionDetails; + + /** + * Creates a plain object from a JobExecutionDetails message. Also converts values to other types if specified. + * @param message JobExecutionDetails + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.dataflow.v1beta3.JobExecutionDetails, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this JobExecutionDetails to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for JobExecutionDetails + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetStageExecutionDetailsRequest. */ + interface IGetStageExecutionDetailsRequest { + + /** GetStageExecutionDetailsRequest projectId */ + projectId?: (string|null); + + /** GetStageExecutionDetailsRequest jobId */ + jobId?: (string|null); + + /** GetStageExecutionDetailsRequest location */ + location?: (string|null); + + /** GetStageExecutionDetailsRequest stageId */ + stageId?: (string|null); + + /** GetStageExecutionDetailsRequest pageSize */ + pageSize?: (number|null); + + /** GetStageExecutionDetailsRequest pageToken */ + pageToken?: (string|null); + + /** GetStageExecutionDetailsRequest startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** GetStageExecutionDetailsRequest endTime */ + endTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a GetStageExecutionDetailsRequest. */ + class GetStageExecutionDetailsRequest implements IGetStageExecutionDetailsRequest { + + /** + * Constructs a new GetStageExecutionDetailsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.dataflow.v1beta3.IGetStageExecutionDetailsRequest); + + /** GetStageExecutionDetailsRequest projectId. */ + public projectId: string; + + /** GetStageExecutionDetailsRequest jobId. */ + public jobId: string; + + /** GetStageExecutionDetailsRequest location. */ + public location: string; + + /** GetStageExecutionDetailsRequest stageId. */ + public stageId: string; + + /** GetStageExecutionDetailsRequest pageSize. */ + public pageSize: number; + + /** GetStageExecutionDetailsRequest pageToken. */ + public pageToken: string; + + /** GetStageExecutionDetailsRequest startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** GetStageExecutionDetailsRequest endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new GetStageExecutionDetailsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetStageExecutionDetailsRequest instance + */ + public static create(properties?: google.dataflow.v1beta3.IGetStageExecutionDetailsRequest): google.dataflow.v1beta3.GetStageExecutionDetailsRequest; + + /** + * Encodes the specified GetStageExecutionDetailsRequest message. Does not implicitly {@link google.dataflow.v1beta3.GetStageExecutionDetailsRequest.verify|verify} messages. + * @param message GetStageExecutionDetailsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.dataflow.v1beta3.IGetStageExecutionDetailsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetStageExecutionDetailsRequest message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.GetStageExecutionDetailsRequest.verify|verify} messages. + * @param message GetStageExecutionDetailsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.dataflow.v1beta3.IGetStageExecutionDetailsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetStageExecutionDetailsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetStageExecutionDetailsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.dataflow.v1beta3.GetStageExecutionDetailsRequest; + + /** + * Decodes a GetStageExecutionDetailsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetStageExecutionDetailsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.dataflow.v1beta3.GetStageExecutionDetailsRequest; + + /** + * Verifies a GetStageExecutionDetailsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetStageExecutionDetailsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetStageExecutionDetailsRequest + */ + public static fromObject(object: { [k: string]: any }): google.dataflow.v1beta3.GetStageExecutionDetailsRequest; + + /** + * Creates a plain object from a GetStageExecutionDetailsRequest message. Also converts values to other types if specified. + * @param message GetStageExecutionDetailsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.dataflow.v1beta3.GetStageExecutionDetailsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetStageExecutionDetailsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetStageExecutionDetailsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a WorkItemDetails. */ + interface IWorkItemDetails { + + /** WorkItemDetails taskId */ + taskId?: (string|null); + + /** WorkItemDetails attemptId */ + attemptId?: (string|null); + + /** WorkItemDetails startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** WorkItemDetails endTime */ + endTime?: (google.protobuf.ITimestamp|null); + + /** WorkItemDetails state */ + state?: (google.dataflow.v1beta3.ExecutionState|keyof typeof google.dataflow.v1beta3.ExecutionState|null); + + /** WorkItemDetails progress */ + progress?: (google.dataflow.v1beta3.IProgressTimeseries|null); + + /** WorkItemDetails metrics */ + metrics?: (google.dataflow.v1beta3.IMetricUpdate[]|null); + } + + /** Represents a WorkItemDetails. */ + class WorkItemDetails implements IWorkItemDetails { + + /** + * Constructs a new WorkItemDetails. + * @param [properties] Properties to set + */ + constructor(properties?: google.dataflow.v1beta3.IWorkItemDetails); + + /** WorkItemDetails taskId. */ + public taskId: string; + + /** WorkItemDetails attemptId. */ + public attemptId: string; + + /** WorkItemDetails startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** WorkItemDetails endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** WorkItemDetails state. */ + public state: (google.dataflow.v1beta3.ExecutionState|keyof typeof google.dataflow.v1beta3.ExecutionState); + + /** WorkItemDetails progress. */ + public progress?: (google.dataflow.v1beta3.IProgressTimeseries|null); + + /** WorkItemDetails metrics. */ + public metrics: google.dataflow.v1beta3.IMetricUpdate[]; + + /** + * Creates a new WorkItemDetails instance using the specified properties. + * @param [properties] Properties to set + * @returns WorkItemDetails instance + */ + public static create(properties?: google.dataflow.v1beta3.IWorkItemDetails): google.dataflow.v1beta3.WorkItemDetails; + + /** + * Encodes the specified WorkItemDetails message. Does not implicitly {@link google.dataflow.v1beta3.WorkItemDetails.verify|verify} messages. + * @param message WorkItemDetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.dataflow.v1beta3.IWorkItemDetails, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WorkItemDetails message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.WorkItemDetails.verify|verify} messages. + * @param message WorkItemDetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.dataflow.v1beta3.IWorkItemDetails, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WorkItemDetails message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WorkItemDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.dataflow.v1beta3.WorkItemDetails; + + /** + * Decodes a WorkItemDetails message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WorkItemDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.dataflow.v1beta3.WorkItemDetails; + + /** + * Verifies a WorkItemDetails message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WorkItemDetails message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WorkItemDetails + */ + public static fromObject(object: { [k: string]: any }): google.dataflow.v1beta3.WorkItemDetails; + + /** + * Creates a plain object from a WorkItemDetails message. Also converts values to other types if specified. + * @param message WorkItemDetails + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.dataflow.v1beta3.WorkItemDetails, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WorkItemDetails to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WorkItemDetails + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a WorkerDetails. */ + interface IWorkerDetails { + + /** WorkerDetails workerName */ + workerName?: (string|null); + + /** WorkerDetails workItems */ + workItems?: (google.dataflow.v1beta3.IWorkItemDetails[]|null); + } + + /** Represents a WorkerDetails. */ + class WorkerDetails implements IWorkerDetails { + + /** + * Constructs a new WorkerDetails. + * @param [properties] Properties to set + */ + constructor(properties?: google.dataflow.v1beta3.IWorkerDetails); + + /** WorkerDetails workerName. */ + public workerName: string; + + /** WorkerDetails workItems. */ + public workItems: google.dataflow.v1beta3.IWorkItemDetails[]; + + /** + * Creates a new WorkerDetails instance using the specified properties. + * @param [properties] Properties to set + * @returns WorkerDetails instance + */ + public static create(properties?: google.dataflow.v1beta3.IWorkerDetails): google.dataflow.v1beta3.WorkerDetails; + + /** + * Encodes the specified WorkerDetails message. Does not implicitly {@link google.dataflow.v1beta3.WorkerDetails.verify|verify} messages. + * @param message WorkerDetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.dataflow.v1beta3.IWorkerDetails, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WorkerDetails message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.WorkerDetails.verify|verify} messages. + * @param message WorkerDetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.dataflow.v1beta3.IWorkerDetails, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WorkerDetails message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WorkerDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.dataflow.v1beta3.WorkerDetails; + + /** + * Decodes a WorkerDetails message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WorkerDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.dataflow.v1beta3.WorkerDetails; + + /** + * Verifies a WorkerDetails message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WorkerDetails message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WorkerDetails + */ + public static fromObject(object: { [k: string]: any }): google.dataflow.v1beta3.WorkerDetails; + + /** + * Creates a plain object from a WorkerDetails message. Also converts values to other types if specified. + * @param message WorkerDetails + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.dataflow.v1beta3.WorkerDetails, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WorkerDetails to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WorkerDetails + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StageExecutionDetails. */ + interface IStageExecutionDetails { + + /** StageExecutionDetails workers */ + workers?: (google.dataflow.v1beta3.IWorkerDetails[]|null); + + /** StageExecutionDetails nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a StageExecutionDetails. */ + class StageExecutionDetails implements IStageExecutionDetails { + + /** + * Constructs a new StageExecutionDetails. + * @param [properties] Properties to set + */ + constructor(properties?: google.dataflow.v1beta3.IStageExecutionDetails); + + /** StageExecutionDetails workers. */ + public workers: google.dataflow.v1beta3.IWorkerDetails[]; + + /** StageExecutionDetails nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new StageExecutionDetails instance using the specified properties. + * @param [properties] Properties to set + * @returns StageExecutionDetails instance + */ + public static create(properties?: google.dataflow.v1beta3.IStageExecutionDetails): google.dataflow.v1beta3.StageExecutionDetails; + + /** + * Encodes the specified StageExecutionDetails message. Does not implicitly {@link google.dataflow.v1beta3.StageExecutionDetails.verify|verify} messages. + * @param message StageExecutionDetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.dataflow.v1beta3.IStageExecutionDetails, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StageExecutionDetails message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.StageExecutionDetails.verify|verify} messages. + * @param message StageExecutionDetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.dataflow.v1beta3.IStageExecutionDetails, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StageExecutionDetails message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StageExecutionDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.dataflow.v1beta3.StageExecutionDetails; + + /** + * Decodes a StageExecutionDetails message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StageExecutionDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.dataflow.v1beta3.StageExecutionDetails; + + /** + * Verifies a StageExecutionDetails message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StageExecutionDetails message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StageExecutionDetails + */ + public static fromObject(object: { [k: string]: any }): google.dataflow.v1beta3.StageExecutionDetails; + + /** + * Creates a plain object from a StageExecutionDetails message. Also converts values to other types if specified. + * @param message StageExecutionDetails + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.dataflow.v1beta3.StageExecutionDetails, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StageExecutionDetails to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StageExecutionDetails + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TopologyConfig. */ + interface ITopologyConfig { + + /** TopologyConfig computations */ + computations?: (google.dataflow.v1beta3.IComputationTopology[]|null); + + /** TopologyConfig dataDiskAssignments */ + dataDiskAssignments?: (google.dataflow.v1beta3.IDataDiskAssignment[]|null); + + /** TopologyConfig userStageToComputationNameMap */ + userStageToComputationNameMap?: ({ [k: string]: string }|null); + + /** TopologyConfig forwardingKeyBits */ + forwardingKeyBits?: (number|null); + + /** TopologyConfig persistentStateVersion */ + persistentStateVersion?: (number|null); + } + + /** Represents a TopologyConfig. */ + class TopologyConfig implements ITopologyConfig { + + /** + * Constructs a new TopologyConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.dataflow.v1beta3.ITopologyConfig); + + /** TopologyConfig computations. */ + public computations: google.dataflow.v1beta3.IComputationTopology[]; + + /** TopologyConfig dataDiskAssignments. */ + public dataDiskAssignments: google.dataflow.v1beta3.IDataDiskAssignment[]; + + /** TopologyConfig userStageToComputationNameMap. */ + public userStageToComputationNameMap: { [k: string]: string }; + + /** TopologyConfig forwardingKeyBits. */ + public forwardingKeyBits: number; + + /** TopologyConfig persistentStateVersion. */ + public persistentStateVersion: number; + + /** + * Creates a new TopologyConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns TopologyConfig instance + */ + public static create(properties?: google.dataflow.v1beta3.ITopologyConfig): google.dataflow.v1beta3.TopologyConfig; + + /** + * Encodes the specified TopologyConfig message. Does not implicitly {@link google.dataflow.v1beta3.TopologyConfig.verify|verify} messages. + * @param message TopologyConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.dataflow.v1beta3.ITopologyConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TopologyConfig message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.TopologyConfig.verify|verify} messages. + * @param message TopologyConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.dataflow.v1beta3.ITopologyConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TopologyConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TopologyConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.dataflow.v1beta3.TopologyConfig; + + /** + * Decodes a TopologyConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TopologyConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.dataflow.v1beta3.TopologyConfig; + + /** + * Verifies a TopologyConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TopologyConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TopologyConfig + */ + public static fromObject(object: { [k: string]: any }): google.dataflow.v1beta3.TopologyConfig; + + /** + * Creates a plain object from a TopologyConfig message. Also converts values to other types if specified. + * @param message TopologyConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.dataflow.v1beta3.TopologyConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TopologyConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TopologyConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PubsubLocation. */ + interface IPubsubLocation { + + /** PubsubLocation topic */ + topic?: (string|null); + + /** PubsubLocation subscription */ + subscription?: (string|null); + + /** PubsubLocation timestampLabel */ + timestampLabel?: (string|null); + + /** PubsubLocation idLabel */ + idLabel?: (string|null); + + /** PubsubLocation dropLateData */ + dropLateData?: (boolean|null); + + /** PubsubLocation trackingSubscription */ + trackingSubscription?: (string|null); + + /** PubsubLocation withAttributes */ + withAttributes?: (boolean|null); + } + + /** Represents a PubsubLocation. */ + class PubsubLocation implements IPubsubLocation { + + /** + * Constructs a new PubsubLocation. + * @param [properties] Properties to set + */ + constructor(properties?: google.dataflow.v1beta3.IPubsubLocation); + + /** PubsubLocation topic. */ + public topic: string; + + /** PubsubLocation subscription. */ + public subscription: string; + + /** PubsubLocation timestampLabel. */ + public timestampLabel: string; + + /** PubsubLocation idLabel. */ + public idLabel: string; + + /** PubsubLocation dropLateData. */ + public dropLateData: boolean; + + /** PubsubLocation trackingSubscription. */ + public trackingSubscription: string; + + /** PubsubLocation withAttributes. */ + public withAttributes: boolean; + + /** + * Creates a new PubsubLocation instance using the specified properties. + * @param [properties] Properties to set + * @returns PubsubLocation instance + */ + public static create(properties?: google.dataflow.v1beta3.IPubsubLocation): google.dataflow.v1beta3.PubsubLocation; + + /** + * Encodes the specified PubsubLocation message. Does not implicitly {@link google.dataflow.v1beta3.PubsubLocation.verify|verify} messages. + * @param message PubsubLocation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.dataflow.v1beta3.IPubsubLocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PubsubLocation message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.PubsubLocation.verify|verify} messages. + * @param message PubsubLocation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.dataflow.v1beta3.IPubsubLocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PubsubLocation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PubsubLocation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.dataflow.v1beta3.PubsubLocation; + + /** + * Decodes a PubsubLocation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PubsubLocation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.dataflow.v1beta3.PubsubLocation; + + /** + * Verifies a PubsubLocation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PubsubLocation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PubsubLocation + */ + public static fromObject(object: { [k: string]: any }): google.dataflow.v1beta3.PubsubLocation; + + /** + * Creates a plain object from a PubsubLocation message. Also converts values to other types if specified. + * @param message PubsubLocation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.dataflow.v1beta3.PubsubLocation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PubsubLocation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PubsubLocation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StreamingStageLocation. */ + interface IStreamingStageLocation { + + /** StreamingStageLocation streamId */ + streamId?: (string|null); + } + + /** Represents a StreamingStageLocation. */ + class StreamingStageLocation implements IStreamingStageLocation { + + /** + * Constructs a new StreamingStageLocation. + * @param [properties] Properties to set + */ + constructor(properties?: google.dataflow.v1beta3.IStreamingStageLocation); + + /** StreamingStageLocation streamId. */ + public streamId: string; + + /** + * Creates a new StreamingStageLocation instance using the specified properties. + * @param [properties] Properties to set + * @returns StreamingStageLocation instance + */ + public static create(properties?: google.dataflow.v1beta3.IStreamingStageLocation): google.dataflow.v1beta3.StreamingStageLocation; + + /** + * Encodes the specified StreamingStageLocation message. Does not implicitly {@link google.dataflow.v1beta3.StreamingStageLocation.verify|verify} messages. + * @param message StreamingStageLocation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.dataflow.v1beta3.IStreamingStageLocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StreamingStageLocation message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.StreamingStageLocation.verify|verify} messages. + * @param message StreamingStageLocation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.dataflow.v1beta3.IStreamingStageLocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StreamingStageLocation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StreamingStageLocation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.dataflow.v1beta3.StreamingStageLocation; + + /** + * Decodes a StreamingStageLocation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StreamingStageLocation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.dataflow.v1beta3.StreamingStageLocation; + + /** + * Verifies a StreamingStageLocation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StreamingStageLocation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StreamingStageLocation + */ + public static fromObject(object: { [k: string]: any }): google.dataflow.v1beta3.StreamingStageLocation; + + /** + * Creates a plain object from a StreamingStageLocation message. Also converts values to other types if specified. + * @param message StreamingStageLocation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.dataflow.v1beta3.StreamingStageLocation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StreamingStageLocation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StreamingStageLocation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StreamingSideInputLocation. */ + interface IStreamingSideInputLocation { + + /** StreamingSideInputLocation tag */ + tag?: (string|null); + + /** StreamingSideInputLocation stateFamily */ + stateFamily?: (string|null); + } + + /** Represents a StreamingSideInputLocation. */ + class StreamingSideInputLocation implements IStreamingSideInputLocation { + + /** + * Constructs a new StreamingSideInputLocation. + * @param [properties] Properties to set + */ + constructor(properties?: google.dataflow.v1beta3.IStreamingSideInputLocation); + + /** StreamingSideInputLocation tag. */ + public tag: string; + + /** StreamingSideInputLocation stateFamily. */ + public stateFamily: string; + + /** + * Creates a new StreamingSideInputLocation instance using the specified properties. + * @param [properties] Properties to set + * @returns StreamingSideInputLocation instance + */ + public static create(properties?: google.dataflow.v1beta3.IStreamingSideInputLocation): google.dataflow.v1beta3.StreamingSideInputLocation; + + /** + * Encodes the specified StreamingSideInputLocation message. Does not implicitly {@link google.dataflow.v1beta3.StreamingSideInputLocation.verify|verify} messages. + * @param message StreamingSideInputLocation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.dataflow.v1beta3.IStreamingSideInputLocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StreamingSideInputLocation message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.StreamingSideInputLocation.verify|verify} messages. + * @param message StreamingSideInputLocation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.dataflow.v1beta3.IStreamingSideInputLocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StreamingSideInputLocation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StreamingSideInputLocation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.dataflow.v1beta3.StreamingSideInputLocation; + + /** + * Decodes a StreamingSideInputLocation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StreamingSideInputLocation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.dataflow.v1beta3.StreamingSideInputLocation; + + /** + * Verifies a StreamingSideInputLocation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StreamingSideInputLocation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StreamingSideInputLocation + */ + public static fromObject(object: { [k: string]: any }): google.dataflow.v1beta3.StreamingSideInputLocation; + + /** + * Creates a plain object from a StreamingSideInputLocation message. Also converts values to other types if specified. + * @param message StreamingSideInputLocation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.dataflow.v1beta3.StreamingSideInputLocation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StreamingSideInputLocation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StreamingSideInputLocation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomSourceLocation. */ + interface ICustomSourceLocation { + + /** CustomSourceLocation stateful */ + stateful?: (boolean|null); + } + + /** Represents a CustomSourceLocation. */ + class CustomSourceLocation implements ICustomSourceLocation { + + /** + * Constructs a new CustomSourceLocation. + * @param [properties] Properties to set + */ + constructor(properties?: google.dataflow.v1beta3.ICustomSourceLocation); + + /** CustomSourceLocation stateful. */ + public stateful: boolean; + + /** + * Creates a new CustomSourceLocation instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomSourceLocation instance + */ + public static create(properties?: google.dataflow.v1beta3.ICustomSourceLocation): google.dataflow.v1beta3.CustomSourceLocation; + + /** + * Encodes the specified CustomSourceLocation message. Does not implicitly {@link google.dataflow.v1beta3.CustomSourceLocation.verify|verify} messages. + * @param message CustomSourceLocation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.dataflow.v1beta3.ICustomSourceLocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CustomSourceLocation message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.CustomSourceLocation.verify|verify} messages. + * @param message CustomSourceLocation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.dataflow.v1beta3.ICustomSourceLocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomSourceLocation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CustomSourceLocation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.dataflow.v1beta3.CustomSourceLocation; + + /** + * Decodes a CustomSourceLocation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CustomSourceLocation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.dataflow.v1beta3.CustomSourceLocation; + + /** + * Verifies a CustomSourceLocation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CustomSourceLocation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CustomSourceLocation + */ + public static fromObject(object: { [k: string]: any }): google.dataflow.v1beta3.CustomSourceLocation; + + /** + * Creates a plain object from a CustomSourceLocation message. Also converts values to other types if specified. + * @param message CustomSourceLocation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.dataflow.v1beta3.CustomSourceLocation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CustomSourceLocation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CustomSourceLocation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StreamLocation. */ + interface IStreamLocation { + + /** StreamLocation streamingStageLocation */ + streamingStageLocation?: (google.dataflow.v1beta3.IStreamingStageLocation|null); + + /** StreamLocation pubsubLocation */ + pubsubLocation?: (google.dataflow.v1beta3.IPubsubLocation|null); + + /** StreamLocation sideInputLocation */ + sideInputLocation?: (google.dataflow.v1beta3.IStreamingSideInputLocation|null); + + /** StreamLocation customSourceLocation */ + customSourceLocation?: (google.dataflow.v1beta3.ICustomSourceLocation|null); + } + + /** Represents a StreamLocation. */ + class StreamLocation implements IStreamLocation { + + /** + * Constructs a new StreamLocation. + * @param [properties] Properties to set + */ + constructor(properties?: google.dataflow.v1beta3.IStreamLocation); + + /** StreamLocation streamingStageLocation. */ + public streamingStageLocation?: (google.dataflow.v1beta3.IStreamingStageLocation|null); + + /** StreamLocation pubsubLocation. */ + public pubsubLocation?: (google.dataflow.v1beta3.IPubsubLocation|null); + + /** StreamLocation sideInputLocation. */ + public sideInputLocation?: (google.dataflow.v1beta3.IStreamingSideInputLocation|null); + + /** StreamLocation customSourceLocation. */ + public customSourceLocation?: (google.dataflow.v1beta3.ICustomSourceLocation|null); + + /** StreamLocation location. */ + public location?: ("streamingStageLocation"|"pubsubLocation"|"sideInputLocation"|"customSourceLocation"); + + /** + * Creates a new StreamLocation instance using the specified properties. + * @param [properties] Properties to set + * @returns StreamLocation instance + */ + public static create(properties?: google.dataflow.v1beta3.IStreamLocation): google.dataflow.v1beta3.StreamLocation; + + /** + * Encodes the specified StreamLocation message. Does not implicitly {@link google.dataflow.v1beta3.StreamLocation.verify|verify} messages. + * @param message StreamLocation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.dataflow.v1beta3.IStreamLocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StreamLocation message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.StreamLocation.verify|verify} messages. + * @param message StreamLocation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.dataflow.v1beta3.IStreamLocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StreamLocation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StreamLocation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.dataflow.v1beta3.StreamLocation; + + /** + * Decodes a StreamLocation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StreamLocation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.dataflow.v1beta3.StreamLocation; + + /** + * Verifies a StreamLocation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StreamLocation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StreamLocation + */ + public static fromObject(object: { [k: string]: any }): google.dataflow.v1beta3.StreamLocation; + + /** + * Creates a plain object from a StreamLocation message. Also converts values to other types if specified. + * @param message StreamLocation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.dataflow.v1beta3.StreamLocation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StreamLocation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StreamLocation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StateFamilyConfig. */ + interface IStateFamilyConfig { + + /** StateFamilyConfig stateFamily */ + stateFamily?: (string|null); + + /** StateFamilyConfig isRead */ + isRead?: (boolean|null); + } + + /** Represents a StateFamilyConfig. */ + class StateFamilyConfig implements IStateFamilyConfig { + + /** + * Constructs a new StateFamilyConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.dataflow.v1beta3.IStateFamilyConfig); + + /** StateFamilyConfig stateFamily. */ + public stateFamily: string; + + /** StateFamilyConfig isRead. */ + public isRead: boolean; + + /** + * Creates a new StateFamilyConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns StateFamilyConfig instance + */ + public static create(properties?: google.dataflow.v1beta3.IStateFamilyConfig): google.dataflow.v1beta3.StateFamilyConfig; + + /** + * Encodes the specified StateFamilyConfig message. Does not implicitly {@link google.dataflow.v1beta3.StateFamilyConfig.verify|verify} messages. + * @param message StateFamilyConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.dataflow.v1beta3.IStateFamilyConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StateFamilyConfig message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.StateFamilyConfig.verify|verify} messages. + * @param message StateFamilyConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.dataflow.v1beta3.IStateFamilyConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StateFamilyConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StateFamilyConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.dataflow.v1beta3.StateFamilyConfig; + + /** + * Decodes a StateFamilyConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StateFamilyConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.dataflow.v1beta3.StateFamilyConfig; + + /** + * Verifies a StateFamilyConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StateFamilyConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StateFamilyConfig + */ + public static fromObject(object: { [k: string]: any }): google.dataflow.v1beta3.StateFamilyConfig; + + /** + * Creates a plain object from a StateFamilyConfig message. Also converts values to other types if specified. + * @param message StateFamilyConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.dataflow.v1beta3.StateFamilyConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StateFamilyConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StateFamilyConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ComputationTopology. */ + interface IComputationTopology { + + /** ComputationTopology systemStageName */ + systemStageName?: (string|null); + + /** ComputationTopology computationId */ + computationId?: (string|null); + + /** ComputationTopology keyRanges */ + keyRanges?: (google.dataflow.v1beta3.IKeyRangeLocation[]|null); + + /** ComputationTopology inputs */ + inputs?: (google.dataflow.v1beta3.IStreamLocation[]|null); + + /** ComputationTopology outputs */ + outputs?: (google.dataflow.v1beta3.IStreamLocation[]|null); + + /** ComputationTopology stateFamilies */ + stateFamilies?: (google.dataflow.v1beta3.IStateFamilyConfig[]|null); + } + + /** Represents a ComputationTopology. */ + class ComputationTopology implements IComputationTopology { + + /** + * Constructs a new ComputationTopology. + * @param [properties] Properties to set + */ + constructor(properties?: google.dataflow.v1beta3.IComputationTopology); + + /** ComputationTopology systemStageName. */ + public systemStageName: string; + + /** ComputationTopology computationId. */ + public computationId: string; + + /** ComputationTopology keyRanges. */ + public keyRanges: google.dataflow.v1beta3.IKeyRangeLocation[]; + + /** ComputationTopology inputs. */ + public inputs: google.dataflow.v1beta3.IStreamLocation[]; + + /** ComputationTopology outputs. */ + public outputs: google.dataflow.v1beta3.IStreamLocation[]; + + /** ComputationTopology stateFamilies. */ + public stateFamilies: google.dataflow.v1beta3.IStateFamilyConfig[]; + + /** + * Creates a new ComputationTopology instance using the specified properties. + * @param [properties] Properties to set + * @returns ComputationTopology instance + */ + public static create(properties?: google.dataflow.v1beta3.IComputationTopology): google.dataflow.v1beta3.ComputationTopology; + + /** + * Encodes the specified ComputationTopology message. Does not implicitly {@link google.dataflow.v1beta3.ComputationTopology.verify|verify} messages. + * @param message ComputationTopology message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.dataflow.v1beta3.IComputationTopology, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ComputationTopology message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.ComputationTopology.verify|verify} messages. + * @param message ComputationTopology message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.dataflow.v1beta3.IComputationTopology, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ComputationTopology message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ComputationTopology + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.dataflow.v1beta3.ComputationTopology; + + /** + * Decodes a ComputationTopology message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ComputationTopology + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.dataflow.v1beta3.ComputationTopology; + + /** + * Verifies a ComputationTopology message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ComputationTopology message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ComputationTopology + */ + public static fromObject(object: { [k: string]: any }): google.dataflow.v1beta3.ComputationTopology; + + /** + * Creates a plain object from a ComputationTopology message. Also converts values to other types if specified. + * @param message ComputationTopology + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.dataflow.v1beta3.ComputationTopology, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ComputationTopology to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ComputationTopology + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a KeyRangeLocation. */ + interface IKeyRangeLocation { + + /** KeyRangeLocation start */ + start?: (string|null); + + /** KeyRangeLocation end */ + end?: (string|null); + + /** KeyRangeLocation deliveryEndpoint */ + deliveryEndpoint?: (string|null); + + /** KeyRangeLocation dataDisk */ + dataDisk?: (string|null); + + /** KeyRangeLocation deprecatedPersistentDirectory */ + deprecatedPersistentDirectory?: (string|null); + } + + /** Represents a KeyRangeLocation. */ + class KeyRangeLocation implements IKeyRangeLocation { + + /** + * Constructs a new KeyRangeLocation. + * @param [properties] Properties to set + */ + constructor(properties?: google.dataflow.v1beta3.IKeyRangeLocation); + + /** KeyRangeLocation start. */ + public start: string; + + /** KeyRangeLocation end. */ + public end: string; + + /** KeyRangeLocation deliveryEndpoint. */ + public deliveryEndpoint: string; + + /** KeyRangeLocation dataDisk. */ + public dataDisk: string; + + /** KeyRangeLocation deprecatedPersistentDirectory. */ + public deprecatedPersistentDirectory: string; + + /** + * Creates a new KeyRangeLocation instance using the specified properties. + * @param [properties] Properties to set + * @returns KeyRangeLocation instance + */ + public static create(properties?: google.dataflow.v1beta3.IKeyRangeLocation): google.dataflow.v1beta3.KeyRangeLocation; + + /** + * Encodes the specified KeyRangeLocation message. Does not implicitly {@link google.dataflow.v1beta3.KeyRangeLocation.verify|verify} messages. + * @param message KeyRangeLocation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.dataflow.v1beta3.IKeyRangeLocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified KeyRangeLocation message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.KeyRangeLocation.verify|verify} messages. + * @param message KeyRangeLocation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.dataflow.v1beta3.IKeyRangeLocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a KeyRangeLocation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns KeyRangeLocation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.dataflow.v1beta3.KeyRangeLocation; + + /** + * Decodes a KeyRangeLocation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns KeyRangeLocation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.dataflow.v1beta3.KeyRangeLocation; + + /** + * Verifies a KeyRangeLocation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a KeyRangeLocation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns KeyRangeLocation + */ + public static fromObject(object: { [k: string]: any }): google.dataflow.v1beta3.KeyRangeLocation; + + /** + * Creates a plain object from a KeyRangeLocation message. Also converts values to other types if specified. + * @param message KeyRangeLocation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.dataflow.v1beta3.KeyRangeLocation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this KeyRangeLocation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for KeyRangeLocation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MountedDataDisk. */ + interface IMountedDataDisk { + + /** MountedDataDisk dataDisk */ + dataDisk?: (string|null); + } + + /** Represents a MountedDataDisk. */ + class MountedDataDisk implements IMountedDataDisk { + + /** + * Constructs a new MountedDataDisk. + * @param [properties] Properties to set + */ + constructor(properties?: google.dataflow.v1beta3.IMountedDataDisk); + + /** MountedDataDisk dataDisk. */ + public dataDisk: string; + + /** + * Creates a new MountedDataDisk instance using the specified properties. + * @param [properties] Properties to set + * @returns MountedDataDisk instance + */ + public static create(properties?: google.dataflow.v1beta3.IMountedDataDisk): google.dataflow.v1beta3.MountedDataDisk; + + /** + * Encodes the specified MountedDataDisk message. Does not implicitly {@link google.dataflow.v1beta3.MountedDataDisk.verify|verify} messages. + * @param message MountedDataDisk message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.dataflow.v1beta3.IMountedDataDisk, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MountedDataDisk message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.MountedDataDisk.verify|verify} messages. + * @param message MountedDataDisk message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.dataflow.v1beta3.IMountedDataDisk, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MountedDataDisk message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MountedDataDisk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.dataflow.v1beta3.MountedDataDisk; + + /** + * Decodes a MountedDataDisk message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MountedDataDisk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.dataflow.v1beta3.MountedDataDisk; + + /** + * Verifies a MountedDataDisk message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MountedDataDisk message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MountedDataDisk + */ + public static fromObject(object: { [k: string]: any }): google.dataflow.v1beta3.MountedDataDisk; + + /** + * Creates a plain object from a MountedDataDisk message. Also converts values to other types if specified. + * @param message MountedDataDisk + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.dataflow.v1beta3.MountedDataDisk, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MountedDataDisk to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MountedDataDisk + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DataDiskAssignment. */ + interface IDataDiskAssignment { + + /** DataDiskAssignment vmInstance */ + vmInstance?: (string|null); + + /** DataDiskAssignment dataDisks */ + dataDisks?: (string[]|null); + } + + /** Represents a DataDiskAssignment. */ + class DataDiskAssignment implements IDataDiskAssignment { + + /** + * Constructs a new DataDiskAssignment. + * @param [properties] Properties to set + */ + constructor(properties?: google.dataflow.v1beta3.IDataDiskAssignment); + + /** DataDiskAssignment vmInstance. */ + public vmInstance: string; + + /** DataDiskAssignment dataDisks. */ + public dataDisks: string[]; + + /** + * Creates a new DataDiskAssignment instance using the specified properties. + * @param [properties] Properties to set + * @returns DataDiskAssignment instance + */ + public static create(properties?: google.dataflow.v1beta3.IDataDiskAssignment): google.dataflow.v1beta3.DataDiskAssignment; + + /** + * Encodes the specified DataDiskAssignment message. Does not implicitly {@link google.dataflow.v1beta3.DataDiskAssignment.verify|verify} messages. + * @param message DataDiskAssignment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.dataflow.v1beta3.IDataDiskAssignment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DataDiskAssignment message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.DataDiskAssignment.verify|verify} messages. + * @param message DataDiskAssignment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.dataflow.v1beta3.IDataDiskAssignment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DataDiskAssignment message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DataDiskAssignment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.dataflow.v1beta3.DataDiskAssignment; + + /** + * Decodes a DataDiskAssignment message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DataDiskAssignment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.dataflow.v1beta3.DataDiskAssignment; + + /** + * Verifies a DataDiskAssignment message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DataDiskAssignment message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DataDiskAssignment + */ + public static fromObject(object: { [k: string]: any }): google.dataflow.v1beta3.DataDiskAssignment; + + /** + * Creates a plain object from a DataDiskAssignment message. Also converts values to other types if specified. + * @param message DataDiskAssignment + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.dataflow.v1beta3.DataDiskAssignment, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DataDiskAssignment to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DataDiskAssignment + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a KeyRangeDataDiskAssignment. */ + interface IKeyRangeDataDiskAssignment { + + /** KeyRangeDataDiskAssignment start */ + start?: (string|null); + + /** KeyRangeDataDiskAssignment end */ + end?: (string|null); + + /** KeyRangeDataDiskAssignment dataDisk */ + dataDisk?: (string|null); + } + + /** Represents a KeyRangeDataDiskAssignment. */ + class KeyRangeDataDiskAssignment implements IKeyRangeDataDiskAssignment { + + /** + * Constructs a new KeyRangeDataDiskAssignment. + * @param [properties] Properties to set + */ + constructor(properties?: google.dataflow.v1beta3.IKeyRangeDataDiskAssignment); + + /** KeyRangeDataDiskAssignment start. */ + public start: string; + + /** KeyRangeDataDiskAssignment end. */ + public end: string; + + /** KeyRangeDataDiskAssignment dataDisk. */ + public dataDisk: string; + + /** + * Creates a new KeyRangeDataDiskAssignment instance using the specified properties. + * @param [properties] Properties to set + * @returns KeyRangeDataDiskAssignment instance + */ + public static create(properties?: google.dataflow.v1beta3.IKeyRangeDataDiskAssignment): google.dataflow.v1beta3.KeyRangeDataDiskAssignment; + + /** + * Encodes the specified KeyRangeDataDiskAssignment message. Does not implicitly {@link google.dataflow.v1beta3.KeyRangeDataDiskAssignment.verify|verify} messages. + * @param message KeyRangeDataDiskAssignment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.dataflow.v1beta3.IKeyRangeDataDiskAssignment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified KeyRangeDataDiskAssignment message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.KeyRangeDataDiskAssignment.verify|verify} messages. + * @param message KeyRangeDataDiskAssignment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.dataflow.v1beta3.IKeyRangeDataDiskAssignment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a KeyRangeDataDiskAssignment message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns KeyRangeDataDiskAssignment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.dataflow.v1beta3.KeyRangeDataDiskAssignment; + + /** + * Decodes a KeyRangeDataDiskAssignment message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns KeyRangeDataDiskAssignment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.dataflow.v1beta3.KeyRangeDataDiskAssignment; + + /** + * Verifies a KeyRangeDataDiskAssignment message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a KeyRangeDataDiskAssignment message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns KeyRangeDataDiskAssignment + */ + public static fromObject(object: { [k: string]: any }): google.dataflow.v1beta3.KeyRangeDataDiskAssignment; + + /** + * Creates a plain object from a KeyRangeDataDiskAssignment message. Also converts values to other types if specified. + * @param message KeyRangeDataDiskAssignment + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.dataflow.v1beta3.KeyRangeDataDiskAssignment, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this KeyRangeDataDiskAssignment to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for KeyRangeDataDiskAssignment + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StreamingComputationRanges. */ + interface IStreamingComputationRanges { + + /** StreamingComputationRanges computationId */ + computationId?: (string|null); + + /** StreamingComputationRanges rangeAssignments */ + rangeAssignments?: (google.dataflow.v1beta3.IKeyRangeDataDiskAssignment[]|null); + } + + /** Represents a StreamingComputationRanges. */ + class StreamingComputationRanges implements IStreamingComputationRanges { + + /** + * Constructs a new StreamingComputationRanges. + * @param [properties] Properties to set + */ + constructor(properties?: google.dataflow.v1beta3.IStreamingComputationRanges); + + /** StreamingComputationRanges computationId. */ + public computationId: string; + + /** StreamingComputationRanges rangeAssignments. */ + public rangeAssignments: google.dataflow.v1beta3.IKeyRangeDataDiskAssignment[]; + + /** + * Creates a new StreamingComputationRanges instance using the specified properties. + * @param [properties] Properties to set + * @returns StreamingComputationRanges instance + */ + public static create(properties?: google.dataflow.v1beta3.IStreamingComputationRanges): google.dataflow.v1beta3.StreamingComputationRanges; + + /** + * Encodes the specified StreamingComputationRanges message. Does not implicitly {@link google.dataflow.v1beta3.StreamingComputationRanges.verify|verify} messages. + * @param message StreamingComputationRanges message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.dataflow.v1beta3.IStreamingComputationRanges, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StreamingComputationRanges message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.StreamingComputationRanges.verify|verify} messages. + * @param message StreamingComputationRanges message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.dataflow.v1beta3.IStreamingComputationRanges, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StreamingComputationRanges message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StreamingComputationRanges + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.dataflow.v1beta3.StreamingComputationRanges; + + /** + * Decodes a StreamingComputationRanges message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StreamingComputationRanges + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.dataflow.v1beta3.StreamingComputationRanges; + + /** + * Verifies a StreamingComputationRanges message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StreamingComputationRanges message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StreamingComputationRanges + */ + public static fromObject(object: { [k: string]: any }): google.dataflow.v1beta3.StreamingComputationRanges; + + /** + * Creates a plain object from a StreamingComputationRanges message. Also converts values to other types if specified. + * @param message StreamingComputationRanges + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.dataflow.v1beta3.StreamingComputationRanges, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StreamingComputationRanges to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StreamingComputationRanges + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StreamingApplianceSnapshotConfig. */ + interface IStreamingApplianceSnapshotConfig { + + /** StreamingApplianceSnapshotConfig snapshotId */ + snapshotId?: (string|null); + + /** StreamingApplianceSnapshotConfig importStateEndpoint */ + importStateEndpoint?: (string|null); + } + + /** Represents a StreamingApplianceSnapshotConfig. */ + class StreamingApplianceSnapshotConfig implements IStreamingApplianceSnapshotConfig { + + /** + * Constructs a new StreamingApplianceSnapshotConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.dataflow.v1beta3.IStreamingApplianceSnapshotConfig); + + /** StreamingApplianceSnapshotConfig snapshotId. */ + public snapshotId: string; + + /** StreamingApplianceSnapshotConfig importStateEndpoint. */ + public importStateEndpoint: string; + + /** + * Creates a new StreamingApplianceSnapshotConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns StreamingApplianceSnapshotConfig instance + */ + public static create(properties?: google.dataflow.v1beta3.IStreamingApplianceSnapshotConfig): google.dataflow.v1beta3.StreamingApplianceSnapshotConfig; + + /** + * Encodes the specified StreamingApplianceSnapshotConfig message. Does not implicitly {@link google.dataflow.v1beta3.StreamingApplianceSnapshotConfig.verify|verify} messages. + * @param message StreamingApplianceSnapshotConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.dataflow.v1beta3.IStreamingApplianceSnapshotConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StreamingApplianceSnapshotConfig message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.StreamingApplianceSnapshotConfig.verify|verify} messages. + * @param message StreamingApplianceSnapshotConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.dataflow.v1beta3.IStreamingApplianceSnapshotConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StreamingApplianceSnapshotConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StreamingApplianceSnapshotConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.dataflow.v1beta3.StreamingApplianceSnapshotConfig; + + /** + * Decodes a StreamingApplianceSnapshotConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StreamingApplianceSnapshotConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.dataflow.v1beta3.StreamingApplianceSnapshotConfig; + + /** + * Verifies a StreamingApplianceSnapshotConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StreamingApplianceSnapshotConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StreamingApplianceSnapshotConfig + */ + public static fromObject(object: { [k: string]: any }): google.dataflow.v1beta3.StreamingApplianceSnapshotConfig; + + /** + * Creates a plain object from a StreamingApplianceSnapshotConfig message. Also converts values to other types if specified. + * @param message StreamingApplianceSnapshotConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.dataflow.v1beta3.StreamingApplianceSnapshotConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StreamingApplianceSnapshotConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StreamingApplianceSnapshotConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents a TemplatesService */ + class TemplatesService extends $protobuf.rpc.Service { + + /** + * Constructs a new TemplatesService 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 TemplatesService 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): TemplatesService; + + /** + * Calls CreateJobFromTemplate. + * @param request CreateJobFromTemplateRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Job + */ + public createJobFromTemplate(request: google.dataflow.v1beta3.ICreateJobFromTemplateRequest, callback: google.dataflow.v1beta3.TemplatesService.CreateJobFromTemplateCallback): void; + + /** + * Calls CreateJobFromTemplate. + * @param request CreateJobFromTemplateRequest message or plain object + * @returns Promise + */ + public createJobFromTemplate(request: google.dataflow.v1beta3.ICreateJobFromTemplateRequest): Promise; + + /** + * Calls LaunchTemplate. + * @param request LaunchTemplateRequest message or plain object + * @param callback Node-style callback called with the error, if any, and LaunchTemplateResponse + */ + public launchTemplate(request: google.dataflow.v1beta3.ILaunchTemplateRequest, callback: google.dataflow.v1beta3.TemplatesService.LaunchTemplateCallback): void; + + /** + * Calls LaunchTemplate. + * @param request LaunchTemplateRequest message or plain object + * @returns Promise + */ + public launchTemplate(request: google.dataflow.v1beta3.ILaunchTemplateRequest): Promise; + + /** + * Calls GetTemplate. + * @param request GetTemplateRequest message or plain object + * @param callback Node-style callback called with the error, if any, and GetTemplateResponse + */ + public getTemplate(request: google.dataflow.v1beta3.IGetTemplateRequest, callback: google.dataflow.v1beta3.TemplatesService.GetTemplateCallback): void; + + /** + * Calls GetTemplate. + * @param request GetTemplateRequest message or plain object + * @returns Promise + */ + public getTemplate(request: google.dataflow.v1beta3.IGetTemplateRequest): Promise; + } + + namespace TemplatesService { + + /** + * Callback as used by {@link google.dataflow.v1beta3.TemplatesService|createJobFromTemplate}. + * @param error Error, if any + * @param [response] Job + */ + type CreateJobFromTemplateCallback = (error: (Error|null), response?: google.dataflow.v1beta3.Job) => void; + + /** + * Callback as used by {@link google.dataflow.v1beta3.TemplatesService|launchTemplate}. + * @param error Error, if any + * @param [response] LaunchTemplateResponse + */ + type LaunchTemplateCallback = (error: (Error|null), response?: google.dataflow.v1beta3.LaunchTemplateResponse) => void; + + /** + * Callback as used by {@link google.dataflow.v1beta3.TemplatesService|getTemplate}. + * @param error Error, if any + * @param [response] GetTemplateResponse + */ + type GetTemplateCallback = (error: (Error|null), response?: google.dataflow.v1beta3.GetTemplateResponse) => void; + } + + /** Represents a FlexTemplatesService */ + class FlexTemplatesService extends $protobuf.rpc.Service { + + /** + * Constructs a new FlexTemplatesService 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 FlexTemplatesService 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): FlexTemplatesService; + + /** + * Calls LaunchFlexTemplate. + * @param request LaunchFlexTemplateRequest message or plain object + * @param callback Node-style callback called with the error, if any, and LaunchFlexTemplateResponse + */ + public launchFlexTemplate(request: google.dataflow.v1beta3.ILaunchFlexTemplateRequest, callback: google.dataflow.v1beta3.FlexTemplatesService.LaunchFlexTemplateCallback): void; + + /** + * Calls LaunchFlexTemplate. + * @param request LaunchFlexTemplateRequest message or plain object + * @returns Promise + */ + public launchFlexTemplate(request: google.dataflow.v1beta3.ILaunchFlexTemplateRequest): Promise; + } + + namespace FlexTemplatesService { + + /** + * Callback as used by {@link google.dataflow.v1beta3.FlexTemplatesService|launchFlexTemplate}. + * @param error Error, if any + * @param [response] LaunchFlexTemplateResponse + */ + type LaunchFlexTemplateCallback = (error: (Error|null), response?: google.dataflow.v1beta3.LaunchFlexTemplateResponse) => void; + } + + /** Properties of a LaunchFlexTemplateResponse. */ + interface ILaunchFlexTemplateResponse { + + /** LaunchFlexTemplateResponse job */ + job?: (google.dataflow.v1beta3.IJob|null); + } + + /** Represents a LaunchFlexTemplateResponse. */ + class LaunchFlexTemplateResponse implements ILaunchFlexTemplateResponse { + + /** + * Constructs a new LaunchFlexTemplateResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.dataflow.v1beta3.ILaunchFlexTemplateResponse); + + /** LaunchFlexTemplateResponse job. */ + public job?: (google.dataflow.v1beta3.IJob|null); + + /** + * Creates a new LaunchFlexTemplateResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns LaunchFlexTemplateResponse instance + */ + public static create(properties?: google.dataflow.v1beta3.ILaunchFlexTemplateResponse): google.dataflow.v1beta3.LaunchFlexTemplateResponse; + + /** + * Encodes the specified LaunchFlexTemplateResponse message. Does not implicitly {@link google.dataflow.v1beta3.LaunchFlexTemplateResponse.verify|verify} messages. + * @param message LaunchFlexTemplateResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.dataflow.v1beta3.ILaunchFlexTemplateResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LaunchFlexTemplateResponse message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.LaunchFlexTemplateResponse.verify|verify} messages. + * @param message LaunchFlexTemplateResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.dataflow.v1beta3.ILaunchFlexTemplateResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LaunchFlexTemplateResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LaunchFlexTemplateResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.dataflow.v1beta3.LaunchFlexTemplateResponse; + + /** + * Decodes a LaunchFlexTemplateResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LaunchFlexTemplateResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.dataflow.v1beta3.LaunchFlexTemplateResponse; + + /** + * Verifies a LaunchFlexTemplateResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LaunchFlexTemplateResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LaunchFlexTemplateResponse + */ + public static fromObject(object: { [k: string]: any }): google.dataflow.v1beta3.LaunchFlexTemplateResponse; + + /** + * Creates a plain object from a LaunchFlexTemplateResponse message. Also converts values to other types if specified. + * @param message LaunchFlexTemplateResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.dataflow.v1beta3.LaunchFlexTemplateResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LaunchFlexTemplateResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LaunchFlexTemplateResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ContainerSpec. */ + interface IContainerSpec { + + /** ContainerSpec image */ + image?: (string|null); + + /** ContainerSpec metadata */ + metadata?: (google.dataflow.v1beta3.ITemplateMetadata|null); + + /** ContainerSpec sdkInfo */ + sdkInfo?: (google.dataflow.v1beta3.ISDKInfo|null); + + /** ContainerSpec defaultEnvironment */ + defaultEnvironment?: (google.dataflow.v1beta3.IFlexTemplateRuntimeEnvironment|null); + } + + /** Represents a ContainerSpec. */ + class ContainerSpec implements IContainerSpec { + + /** + * Constructs a new ContainerSpec. + * @param [properties] Properties to set + */ + constructor(properties?: google.dataflow.v1beta3.IContainerSpec); + + /** ContainerSpec image. */ + public image: string; + + /** ContainerSpec metadata. */ + public metadata?: (google.dataflow.v1beta3.ITemplateMetadata|null); + + /** ContainerSpec sdkInfo. */ + public sdkInfo?: (google.dataflow.v1beta3.ISDKInfo|null); + + /** ContainerSpec defaultEnvironment. */ + public defaultEnvironment?: (google.dataflow.v1beta3.IFlexTemplateRuntimeEnvironment|null); + + /** + * Creates a new ContainerSpec instance using the specified properties. + * @param [properties] Properties to set + * @returns ContainerSpec instance + */ + public static create(properties?: google.dataflow.v1beta3.IContainerSpec): google.dataflow.v1beta3.ContainerSpec; + + /** + * Encodes the specified ContainerSpec message. Does not implicitly {@link google.dataflow.v1beta3.ContainerSpec.verify|verify} messages. + * @param message ContainerSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.dataflow.v1beta3.IContainerSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ContainerSpec message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.ContainerSpec.verify|verify} messages. + * @param message ContainerSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.dataflow.v1beta3.IContainerSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ContainerSpec message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ContainerSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.dataflow.v1beta3.ContainerSpec; + + /** + * Decodes a ContainerSpec message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ContainerSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.dataflow.v1beta3.ContainerSpec; + + /** + * Verifies a ContainerSpec message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ContainerSpec message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ContainerSpec + */ + public static fromObject(object: { [k: string]: any }): google.dataflow.v1beta3.ContainerSpec; + + /** + * Creates a plain object from a ContainerSpec message. Also converts values to other types if specified. + * @param message ContainerSpec + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.dataflow.v1beta3.ContainerSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ContainerSpec to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ContainerSpec + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a LaunchFlexTemplateParameter. */ + interface ILaunchFlexTemplateParameter { + + /** LaunchFlexTemplateParameter jobName */ + jobName?: (string|null); + + /** LaunchFlexTemplateParameter containerSpec */ + containerSpec?: (google.dataflow.v1beta3.IContainerSpec|null); + + /** LaunchFlexTemplateParameter containerSpecGcsPath */ + containerSpecGcsPath?: (string|null); + + /** LaunchFlexTemplateParameter parameters */ + parameters?: ({ [k: string]: string }|null); + + /** LaunchFlexTemplateParameter launchOptions */ + launchOptions?: ({ [k: string]: string }|null); + + /** LaunchFlexTemplateParameter environment */ + environment?: (google.dataflow.v1beta3.IFlexTemplateRuntimeEnvironment|null); + + /** LaunchFlexTemplateParameter update */ + update?: (boolean|null); + + /** LaunchFlexTemplateParameter transformNameMappings */ + transformNameMappings?: ({ [k: string]: string }|null); + } + + /** Represents a LaunchFlexTemplateParameter. */ + class LaunchFlexTemplateParameter implements ILaunchFlexTemplateParameter { + + /** + * Constructs a new LaunchFlexTemplateParameter. + * @param [properties] Properties to set + */ + constructor(properties?: google.dataflow.v1beta3.ILaunchFlexTemplateParameter); + + /** LaunchFlexTemplateParameter jobName. */ + public jobName: string; + + /** LaunchFlexTemplateParameter containerSpec. */ + public containerSpec?: (google.dataflow.v1beta3.IContainerSpec|null); + + /** LaunchFlexTemplateParameter containerSpecGcsPath. */ + public containerSpecGcsPath?: (string|null); + + /** LaunchFlexTemplateParameter parameters. */ + public parameters: { [k: string]: string }; + + /** LaunchFlexTemplateParameter launchOptions. */ + public launchOptions: { [k: string]: string }; + + /** LaunchFlexTemplateParameter environment. */ + public environment?: (google.dataflow.v1beta3.IFlexTemplateRuntimeEnvironment|null); + + /** LaunchFlexTemplateParameter update. */ + public update: boolean; + + /** LaunchFlexTemplateParameter transformNameMappings. */ + public transformNameMappings: { [k: string]: string }; + + /** LaunchFlexTemplateParameter template. */ + public template?: ("containerSpec"|"containerSpecGcsPath"); + + /** + * Creates a new LaunchFlexTemplateParameter instance using the specified properties. + * @param [properties] Properties to set + * @returns LaunchFlexTemplateParameter instance + */ + public static create(properties?: google.dataflow.v1beta3.ILaunchFlexTemplateParameter): google.dataflow.v1beta3.LaunchFlexTemplateParameter; + + /** + * Encodes the specified LaunchFlexTemplateParameter message. Does not implicitly {@link google.dataflow.v1beta3.LaunchFlexTemplateParameter.verify|verify} messages. + * @param message LaunchFlexTemplateParameter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.dataflow.v1beta3.ILaunchFlexTemplateParameter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LaunchFlexTemplateParameter message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.LaunchFlexTemplateParameter.verify|verify} messages. + * @param message LaunchFlexTemplateParameter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.dataflow.v1beta3.ILaunchFlexTemplateParameter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LaunchFlexTemplateParameter message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LaunchFlexTemplateParameter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.dataflow.v1beta3.LaunchFlexTemplateParameter; + + /** + * Decodes a LaunchFlexTemplateParameter message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LaunchFlexTemplateParameter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.dataflow.v1beta3.LaunchFlexTemplateParameter; + + /** + * Verifies a LaunchFlexTemplateParameter message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LaunchFlexTemplateParameter message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LaunchFlexTemplateParameter + */ + public static fromObject(object: { [k: string]: any }): google.dataflow.v1beta3.LaunchFlexTemplateParameter; + + /** + * Creates a plain object from a LaunchFlexTemplateParameter message. Also converts values to other types if specified. + * @param message LaunchFlexTemplateParameter + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.dataflow.v1beta3.LaunchFlexTemplateParameter, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LaunchFlexTemplateParameter to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LaunchFlexTemplateParameter + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FlexTemplateRuntimeEnvironment. */ + interface IFlexTemplateRuntimeEnvironment { + + /** FlexTemplateRuntimeEnvironment numWorkers */ + numWorkers?: (number|null); + + /** FlexTemplateRuntimeEnvironment maxWorkers */ + maxWorkers?: (number|null); + + /** FlexTemplateRuntimeEnvironment zone */ + zone?: (string|null); + + /** FlexTemplateRuntimeEnvironment serviceAccountEmail */ + serviceAccountEmail?: (string|null); + + /** FlexTemplateRuntimeEnvironment tempLocation */ + tempLocation?: (string|null); + + /** FlexTemplateRuntimeEnvironment machineType */ + machineType?: (string|null); + + /** FlexTemplateRuntimeEnvironment additionalExperiments */ + additionalExperiments?: (string[]|null); + + /** FlexTemplateRuntimeEnvironment network */ + network?: (string|null); + + /** FlexTemplateRuntimeEnvironment subnetwork */ + subnetwork?: (string|null); + + /** FlexTemplateRuntimeEnvironment additionalUserLabels */ + additionalUserLabels?: ({ [k: string]: string }|null); + + /** FlexTemplateRuntimeEnvironment kmsKeyName */ + kmsKeyName?: (string|null); + + /** FlexTemplateRuntimeEnvironment ipConfiguration */ + ipConfiguration?: (google.dataflow.v1beta3.WorkerIPAddressConfiguration|keyof typeof google.dataflow.v1beta3.WorkerIPAddressConfiguration|null); + + /** FlexTemplateRuntimeEnvironment workerRegion */ + workerRegion?: (string|null); + + /** FlexTemplateRuntimeEnvironment workerZone */ + workerZone?: (string|null); + + /** FlexTemplateRuntimeEnvironment enableStreamingEngine */ + enableStreamingEngine?: (boolean|null); + + /** FlexTemplateRuntimeEnvironment flexrsGoal */ + flexrsGoal?: (google.dataflow.v1beta3.FlexResourceSchedulingGoal|keyof typeof google.dataflow.v1beta3.FlexResourceSchedulingGoal|null); + + /** FlexTemplateRuntimeEnvironment stagingLocation */ + stagingLocation?: (string|null); + + /** FlexTemplateRuntimeEnvironment sdkContainerImage */ + sdkContainerImage?: (string|null); + + /** FlexTemplateRuntimeEnvironment diskSizeGb */ + diskSizeGb?: (number|null); + + /** FlexTemplateRuntimeEnvironment autoscalingAlgorithm */ + autoscalingAlgorithm?: (google.dataflow.v1beta3.AutoscalingAlgorithm|keyof typeof google.dataflow.v1beta3.AutoscalingAlgorithm|null); + + /** FlexTemplateRuntimeEnvironment dumpHeapOnOom */ + dumpHeapOnOom?: (boolean|null); + + /** FlexTemplateRuntimeEnvironment saveHeapDumpsToGcsPath */ + saveHeapDumpsToGcsPath?: (string|null); + + /** FlexTemplateRuntimeEnvironment launcherMachineType */ + launcherMachineType?: (string|null); + } + + /** Represents a FlexTemplateRuntimeEnvironment. */ + class FlexTemplateRuntimeEnvironment implements IFlexTemplateRuntimeEnvironment { + + /** + * Constructs a new FlexTemplateRuntimeEnvironment. + * @param [properties] Properties to set + */ + constructor(properties?: google.dataflow.v1beta3.IFlexTemplateRuntimeEnvironment); + + /** FlexTemplateRuntimeEnvironment numWorkers. */ + public numWorkers: number; + + /** FlexTemplateRuntimeEnvironment maxWorkers. */ + public maxWorkers: number; + + /** FlexTemplateRuntimeEnvironment zone. */ + public zone: string; + + /** FlexTemplateRuntimeEnvironment serviceAccountEmail. */ + public serviceAccountEmail: string; + + /** FlexTemplateRuntimeEnvironment tempLocation. */ + public tempLocation: string; + + /** FlexTemplateRuntimeEnvironment machineType. */ + public machineType: string; + + /** FlexTemplateRuntimeEnvironment additionalExperiments. */ + public additionalExperiments: string[]; + + /** FlexTemplateRuntimeEnvironment network. */ + public network: string; + + /** FlexTemplateRuntimeEnvironment subnetwork. */ + public subnetwork: string; + + /** FlexTemplateRuntimeEnvironment additionalUserLabels. */ + public additionalUserLabels: { [k: string]: string }; + + /** FlexTemplateRuntimeEnvironment kmsKeyName. */ + public kmsKeyName: string; + + /** FlexTemplateRuntimeEnvironment ipConfiguration. */ + public ipConfiguration: (google.dataflow.v1beta3.WorkerIPAddressConfiguration|keyof typeof google.dataflow.v1beta3.WorkerIPAddressConfiguration); + + /** FlexTemplateRuntimeEnvironment workerRegion. */ + public workerRegion: string; + + /** FlexTemplateRuntimeEnvironment workerZone. */ + public workerZone: string; + + /** FlexTemplateRuntimeEnvironment enableStreamingEngine. */ + public enableStreamingEngine: boolean; + + /** FlexTemplateRuntimeEnvironment flexrsGoal. */ + public flexrsGoal: (google.dataflow.v1beta3.FlexResourceSchedulingGoal|keyof typeof google.dataflow.v1beta3.FlexResourceSchedulingGoal); + + /** FlexTemplateRuntimeEnvironment stagingLocation. */ + public stagingLocation: string; + + /** FlexTemplateRuntimeEnvironment sdkContainerImage. */ + public sdkContainerImage: string; + + /** FlexTemplateRuntimeEnvironment diskSizeGb. */ + public diskSizeGb: number; + + /** FlexTemplateRuntimeEnvironment autoscalingAlgorithm. */ + public autoscalingAlgorithm: (google.dataflow.v1beta3.AutoscalingAlgorithm|keyof typeof google.dataflow.v1beta3.AutoscalingAlgorithm); + + /** FlexTemplateRuntimeEnvironment dumpHeapOnOom. */ + public dumpHeapOnOom: boolean; + + /** FlexTemplateRuntimeEnvironment saveHeapDumpsToGcsPath. */ + public saveHeapDumpsToGcsPath: string; + + /** FlexTemplateRuntimeEnvironment launcherMachineType. */ + public launcherMachineType: string; + + /** + * Creates a new FlexTemplateRuntimeEnvironment instance using the specified properties. + * @param [properties] Properties to set + * @returns FlexTemplateRuntimeEnvironment instance + */ + public static create(properties?: google.dataflow.v1beta3.IFlexTemplateRuntimeEnvironment): google.dataflow.v1beta3.FlexTemplateRuntimeEnvironment; + + /** + * Encodes the specified FlexTemplateRuntimeEnvironment message. Does not implicitly {@link google.dataflow.v1beta3.FlexTemplateRuntimeEnvironment.verify|verify} messages. + * @param message FlexTemplateRuntimeEnvironment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.dataflow.v1beta3.IFlexTemplateRuntimeEnvironment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FlexTemplateRuntimeEnvironment message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.FlexTemplateRuntimeEnvironment.verify|verify} messages. + * @param message FlexTemplateRuntimeEnvironment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.dataflow.v1beta3.IFlexTemplateRuntimeEnvironment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FlexTemplateRuntimeEnvironment message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FlexTemplateRuntimeEnvironment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.dataflow.v1beta3.FlexTemplateRuntimeEnvironment; + + /** + * Decodes a FlexTemplateRuntimeEnvironment message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FlexTemplateRuntimeEnvironment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.dataflow.v1beta3.FlexTemplateRuntimeEnvironment; + + /** + * Verifies a FlexTemplateRuntimeEnvironment message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FlexTemplateRuntimeEnvironment message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FlexTemplateRuntimeEnvironment + */ + public static fromObject(object: { [k: string]: any }): google.dataflow.v1beta3.FlexTemplateRuntimeEnvironment; + + /** + * Creates a plain object from a FlexTemplateRuntimeEnvironment message. Also converts values to other types if specified. + * @param message FlexTemplateRuntimeEnvironment + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.dataflow.v1beta3.FlexTemplateRuntimeEnvironment, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FlexTemplateRuntimeEnvironment to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FlexTemplateRuntimeEnvironment + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a LaunchFlexTemplateRequest. */ + interface ILaunchFlexTemplateRequest { + + /** LaunchFlexTemplateRequest projectId */ + projectId?: (string|null); + + /** LaunchFlexTemplateRequest launchParameter */ + launchParameter?: (google.dataflow.v1beta3.ILaunchFlexTemplateParameter|null); + + /** LaunchFlexTemplateRequest location */ + location?: (string|null); + + /** LaunchFlexTemplateRequest validateOnly */ + validateOnly?: (boolean|null); + } + + /** Represents a LaunchFlexTemplateRequest. */ + class LaunchFlexTemplateRequest implements ILaunchFlexTemplateRequest { + + /** + * Constructs a new LaunchFlexTemplateRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.dataflow.v1beta3.ILaunchFlexTemplateRequest); + + /** LaunchFlexTemplateRequest projectId. */ + public projectId: string; + + /** LaunchFlexTemplateRequest launchParameter. */ + public launchParameter?: (google.dataflow.v1beta3.ILaunchFlexTemplateParameter|null); + + /** LaunchFlexTemplateRequest location. */ + public location: string; + + /** LaunchFlexTemplateRequest validateOnly. */ + public validateOnly: boolean; + + /** + * Creates a new LaunchFlexTemplateRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns LaunchFlexTemplateRequest instance + */ + public static create(properties?: google.dataflow.v1beta3.ILaunchFlexTemplateRequest): google.dataflow.v1beta3.LaunchFlexTemplateRequest; + + /** + * Encodes the specified LaunchFlexTemplateRequest message. Does not implicitly {@link google.dataflow.v1beta3.LaunchFlexTemplateRequest.verify|verify} messages. + * @param message LaunchFlexTemplateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.dataflow.v1beta3.ILaunchFlexTemplateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LaunchFlexTemplateRequest message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.LaunchFlexTemplateRequest.verify|verify} messages. + * @param message LaunchFlexTemplateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.dataflow.v1beta3.ILaunchFlexTemplateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LaunchFlexTemplateRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LaunchFlexTemplateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.dataflow.v1beta3.LaunchFlexTemplateRequest; + + /** + * Decodes a LaunchFlexTemplateRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LaunchFlexTemplateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.dataflow.v1beta3.LaunchFlexTemplateRequest; + + /** + * Verifies a LaunchFlexTemplateRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LaunchFlexTemplateRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LaunchFlexTemplateRequest + */ + public static fromObject(object: { [k: string]: any }): google.dataflow.v1beta3.LaunchFlexTemplateRequest; + + /** + * Creates a plain object from a LaunchFlexTemplateRequest message. Also converts values to other types if specified. + * @param message LaunchFlexTemplateRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.dataflow.v1beta3.LaunchFlexTemplateRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LaunchFlexTemplateRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LaunchFlexTemplateRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RuntimeEnvironment. */ + interface IRuntimeEnvironment { + + /** RuntimeEnvironment numWorkers */ + numWorkers?: (number|null); + + /** RuntimeEnvironment maxWorkers */ + maxWorkers?: (number|null); + + /** RuntimeEnvironment zone */ + zone?: (string|null); + + /** RuntimeEnvironment serviceAccountEmail */ + serviceAccountEmail?: (string|null); + + /** RuntimeEnvironment tempLocation */ + tempLocation?: (string|null); + + /** RuntimeEnvironment bypassTempDirValidation */ + bypassTempDirValidation?: (boolean|null); + + /** RuntimeEnvironment machineType */ + machineType?: (string|null); + + /** RuntimeEnvironment additionalExperiments */ + additionalExperiments?: (string[]|null); + + /** RuntimeEnvironment network */ + network?: (string|null); + + /** RuntimeEnvironment subnetwork */ + subnetwork?: (string|null); + + /** RuntimeEnvironment additionalUserLabels */ + additionalUserLabels?: ({ [k: string]: string }|null); + + /** RuntimeEnvironment kmsKeyName */ + kmsKeyName?: (string|null); + + /** RuntimeEnvironment ipConfiguration */ + ipConfiguration?: (google.dataflow.v1beta3.WorkerIPAddressConfiguration|keyof typeof google.dataflow.v1beta3.WorkerIPAddressConfiguration|null); + + /** RuntimeEnvironment workerRegion */ + workerRegion?: (string|null); + + /** RuntimeEnvironment workerZone */ + workerZone?: (string|null); + + /** RuntimeEnvironment enableStreamingEngine */ + enableStreamingEngine?: (boolean|null); + } + + /** Represents a RuntimeEnvironment. */ + class RuntimeEnvironment implements IRuntimeEnvironment { + + /** + * Constructs a new RuntimeEnvironment. + * @param [properties] Properties to set + */ + constructor(properties?: google.dataflow.v1beta3.IRuntimeEnvironment); + + /** RuntimeEnvironment numWorkers. */ + public numWorkers: number; + + /** RuntimeEnvironment maxWorkers. */ + public maxWorkers: number; + + /** RuntimeEnvironment zone. */ + public zone: string; + + /** RuntimeEnvironment serviceAccountEmail. */ + public serviceAccountEmail: string; + + /** RuntimeEnvironment tempLocation. */ + public tempLocation: string; + + /** RuntimeEnvironment bypassTempDirValidation. */ + public bypassTempDirValidation: boolean; + + /** RuntimeEnvironment machineType. */ + public machineType: string; + + /** RuntimeEnvironment additionalExperiments. */ + public additionalExperiments: string[]; + + /** RuntimeEnvironment network. */ + public network: string; + + /** RuntimeEnvironment subnetwork. */ + public subnetwork: string; + + /** RuntimeEnvironment additionalUserLabels. */ + public additionalUserLabels: { [k: string]: string }; + + /** RuntimeEnvironment kmsKeyName. */ + public kmsKeyName: string; + + /** RuntimeEnvironment ipConfiguration. */ + public ipConfiguration: (google.dataflow.v1beta3.WorkerIPAddressConfiguration|keyof typeof google.dataflow.v1beta3.WorkerIPAddressConfiguration); + + /** RuntimeEnvironment workerRegion. */ + public workerRegion: string; + + /** RuntimeEnvironment workerZone. */ + public workerZone: string; + + /** RuntimeEnvironment enableStreamingEngine. */ + public enableStreamingEngine: boolean; + + /** + * Creates a new RuntimeEnvironment instance using the specified properties. + * @param [properties] Properties to set + * @returns RuntimeEnvironment instance + */ + public static create(properties?: google.dataflow.v1beta3.IRuntimeEnvironment): google.dataflow.v1beta3.RuntimeEnvironment; + + /** + * Encodes the specified RuntimeEnvironment message. Does not implicitly {@link google.dataflow.v1beta3.RuntimeEnvironment.verify|verify} messages. + * @param message RuntimeEnvironment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.dataflow.v1beta3.IRuntimeEnvironment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RuntimeEnvironment message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.RuntimeEnvironment.verify|verify} messages. + * @param message RuntimeEnvironment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.dataflow.v1beta3.IRuntimeEnvironment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RuntimeEnvironment message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RuntimeEnvironment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.dataflow.v1beta3.RuntimeEnvironment; + + /** + * Decodes a RuntimeEnvironment message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RuntimeEnvironment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.dataflow.v1beta3.RuntimeEnvironment; + + /** + * Verifies a RuntimeEnvironment message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RuntimeEnvironment message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RuntimeEnvironment + */ + public static fromObject(object: { [k: string]: any }): google.dataflow.v1beta3.RuntimeEnvironment; + + /** + * Creates a plain object from a RuntimeEnvironment message. Also converts values to other types if specified. + * @param message RuntimeEnvironment + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.dataflow.v1beta3.RuntimeEnvironment, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RuntimeEnvironment to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RuntimeEnvironment + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ParameterMetadata. */ + interface IParameterMetadata { + + /** ParameterMetadata name */ + name?: (string|null); + + /** ParameterMetadata label */ + label?: (string|null); + + /** ParameterMetadata helpText */ + helpText?: (string|null); + + /** ParameterMetadata isOptional */ + isOptional?: (boolean|null); + + /** ParameterMetadata regexes */ + regexes?: (string[]|null); + + /** ParameterMetadata paramType */ + paramType?: (google.dataflow.v1beta3.ParameterType|keyof typeof google.dataflow.v1beta3.ParameterType|null); + + /** ParameterMetadata customMetadata */ + customMetadata?: ({ [k: string]: string }|null); + } + + /** Represents a ParameterMetadata. */ + class ParameterMetadata implements IParameterMetadata { + + /** + * Constructs a new ParameterMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.dataflow.v1beta3.IParameterMetadata); + + /** ParameterMetadata name. */ + public name: string; + + /** ParameterMetadata label. */ + public label: string; + + /** ParameterMetadata helpText. */ + public helpText: string; + + /** ParameterMetadata isOptional. */ + public isOptional: boolean; + + /** ParameterMetadata regexes. */ + public regexes: string[]; + + /** ParameterMetadata paramType. */ + public paramType: (google.dataflow.v1beta3.ParameterType|keyof typeof google.dataflow.v1beta3.ParameterType); + + /** ParameterMetadata customMetadata. */ + public customMetadata: { [k: string]: string }; + + /** + * Creates a new ParameterMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns ParameterMetadata instance + */ + public static create(properties?: google.dataflow.v1beta3.IParameterMetadata): google.dataflow.v1beta3.ParameterMetadata; + + /** + * Encodes the specified ParameterMetadata message. Does not implicitly {@link google.dataflow.v1beta3.ParameterMetadata.verify|verify} messages. + * @param message ParameterMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.dataflow.v1beta3.IParameterMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ParameterMetadata message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.ParameterMetadata.verify|verify} messages. + * @param message ParameterMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.dataflow.v1beta3.IParameterMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ParameterMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ParameterMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.dataflow.v1beta3.ParameterMetadata; + + /** + * Decodes a ParameterMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ParameterMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.dataflow.v1beta3.ParameterMetadata; + + /** + * Verifies a ParameterMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ParameterMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ParameterMetadata + */ + public static fromObject(object: { [k: string]: any }): google.dataflow.v1beta3.ParameterMetadata; + + /** + * Creates a plain object from a ParameterMetadata message. Also converts values to other types if specified. + * @param message ParameterMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.dataflow.v1beta3.ParameterMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ParameterMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ParameterMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** ParameterType enum. */ + enum ParameterType { + DEFAULT = 0, + TEXT = 1, + GCS_READ_BUCKET = 2, + GCS_WRITE_BUCKET = 3, + GCS_READ_FILE = 4, + GCS_WRITE_FILE = 5, + GCS_READ_FOLDER = 6, + GCS_WRITE_FOLDER = 7, + PUBSUB_TOPIC = 8, + PUBSUB_SUBSCRIPTION = 9 + } + + /** Properties of a TemplateMetadata. */ + interface ITemplateMetadata { + + /** TemplateMetadata name */ + name?: (string|null); + + /** TemplateMetadata description */ + description?: (string|null); + + /** TemplateMetadata parameters */ + parameters?: (google.dataflow.v1beta3.IParameterMetadata[]|null); + } + + /** Represents a TemplateMetadata. */ + class TemplateMetadata implements ITemplateMetadata { + + /** + * Constructs a new TemplateMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.dataflow.v1beta3.ITemplateMetadata); + + /** TemplateMetadata name. */ + public name: string; + + /** TemplateMetadata description. */ + public description: string; + + /** TemplateMetadata parameters. */ + public parameters: google.dataflow.v1beta3.IParameterMetadata[]; + + /** + * Creates a new TemplateMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns TemplateMetadata instance + */ + public static create(properties?: google.dataflow.v1beta3.ITemplateMetadata): google.dataflow.v1beta3.TemplateMetadata; + + /** + * Encodes the specified TemplateMetadata message. Does not implicitly {@link google.dataflow.v1beta3.TemplateMetadata.verify|verify} messages. + * @param message TemplateMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.dataflow.v1beta3.ITemplateMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TemplateMetadata message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.TemplateMetadata.verify|verify} messages. + * @param message TemplateMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.dataflow.v1beta3.ITemplateMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TemplateMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TemplateMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.dataflow.v1beta3.TemplateMetadata; + + /** + * Decodes a TemplateMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TemplateMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.dataflow.v1beta3.TemplateMetadata; + + /** + * Verifies a TemplateMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TemplateMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TemplateMetadata + */ + public static fromObject(object: { [k: string]: any }): google.dataflow.v1beta3.TemplateMetadata; + + /** + * Creates a plain object from a TemplateMetadata message. Also converts values to other types if specified. + * @param message TemplateMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.dataflow.v1beta3.TemplateMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TemplateMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TemplateMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SDKInfo. */ + interface ISDKInfo { + + /** SDKInfo language */ + language?: (google.dataflow.v1beta3.SDKInfo.Language|keyof typeof google.dataflow.v1beta3.SDKInfo.Language|null); + + /** SDKInfo version */ + version?: (string|null); + } + + /** Represents a SDKInfo. */ + class SDKInfo implements ISDKInfo { + + /** + * Constructs a new SDKInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.dataflow.v1beta3.ISDKInfo); + + /** SDKInfo language. */ + public language: (google.dataflow.v1beta3.SDKInfo.Language|keyof typeof google.dataflow.v1beta3.SDKInfo.Language); + + /** SDKInfo version. */ + public version: string; + + /** + * Creates a new SDKInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns SDKInfo instance + */ + public static create(properties?: google.dataflow.v1beta3.ISDKInfo): google.dataflow.v1beta3.SDKInfo; + + /** + * Encodes the specified SDKInfo message. Does not implicitly {@link google.dataflow.v1beta3.SDKInfo.verify|verify} messages. + * @param message SDKInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.dataflow.v1beta3.ISDKInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SDKInfo message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.SDKInfo.verify|verify} messages. + * @param message SDKInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.dataflow.v1beta3.ISDKInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SDKInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SDKInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.dataflow.v1beta3.SDKInfo; + + /** + * Decodes a SDKInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SDKInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.dataflow.v1beta3.SDKInfo; + + /** + * Verifies a SDKInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SDKInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SDKInfo + */ + public static fromObject(object: { [k: string]: any }): google.dataflow.v1beta3.SDKInfo; + + /** + * Creates a plain object from a SDKInfo message. Also converts values to other types if specified. + * @param message SDKInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.dataflow.v1beta3.SDKInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SDKInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SDKInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SDKInfo { + + /** Language enum. */ + enum Language { + UNKNOWN = 0, + JAVA = 1, + PYTHON = 2 + } + } + + /** Properties of a RuntimeMetadata. */ + interface IRuntimeMetadata { + + /** RuntimeMetadata sdkInfo */ + sdkInfo?: (google.dataflow.v1beta3.ISDKInfo|null); + + /** RuntimeMetadata parameters */ + parameters?: (google.dataflow.v1beta3.IParameterMetadata[]|null); + } + + /** Represents a RuntimeMetadata. */ + class RuntimeMetadata implements IRuntimeMetadata { + + /** + * Constructs a new RuntimeMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.dataflow.v1beta3.IRuntimeMetadata); + + /** RuntimeMetadata sdkInfo. */ + public sdkInfo?: (google.dataflow.v1beta3.ISDKInfo|null); + + /** RuntimeMetadata parameters. */ + public parameters: google.dataflow.v1beta3.IParameterMetadata[]; + + /** + * Creates a new RuntimeMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns RuntimeMetadata instance + */ + public static create(properties?: google.dataflow.v1beta3.IRuntimeMetadata): google.dataflow.v1beta3.RuntimeMetadata; + + /** + * Encodes the specified RuntimeMetadata message. Does not implicitly {@link google.dataflow.v1beta3.RuntimeMetadata.verify|verify} messages. + * @param message RuntimeMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.dataflow.v1beta3.IRuntimeMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RuntimeMetadata message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.RuntimeMetadata.verify|verify} messages. + * @param message RuntimeMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.dataflow.v1beta3.IRuntimeMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RuntimeMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RuntimeMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.dataflow.v1beta3.RuntimeMetadata; + + /** + * Decodes a RuntimeMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RuntimeMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.dataflow.v1beta3.RuntimeMetadata; + + /** + * Verifies a RuntimeMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RuntimeMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RuntimeMetadata + */ + public static fromObject(object: { [k: string]: any }): google.dataflow.v1beta3.RuntimeMetadata; + + /** + * Creates a plain object from a RuntimeMetadata message. Also converts values to other types if specified. + * @param message RuntimeMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.dataflow.v1beta3.RuntimeMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RuntimeMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RuntimeMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateJobFromTemplateRequest. */ + interface ICreateJobFromTemplateRequest { + + /** CreateJobFromTemplateRequest projectId */ + projectId?: (string|null); + + /** CreateJobFromTemplateRequest jobName */ + jobName?: (string|null); + + /** CreateJobFromTemplateRequest gcsPath */ + gcsPath?: (string|null); + + /** CreateJobFromTemplateRequest parameters */ + parameters?: ({ [k: string]: string }|null); + + /** CreateJobFromTemplateRequest environment */ + environment?: (google.dataflow.v1beta3.IRuntimeEnvironment|null); + + /** CreateJobFromTemplateRequest location */ + location?: (string|null); + } + + /** Represents a CreateJobFromTemplateRequest. */ + class CreateJobFromTemplateRequest implements ICreateJobFromTemplateRequest { + + /** + * Constructs a new CreateJobFromTemplateRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.dataflow.v1beta3.ICreateJobFromTemplateRequest); + + /** CreateJobFromTemplateRequest projectId. */ + public projectId: string; + + /** CreateJobFromTemplateRequest jobName. */ + public jobName: string; + + /** CreateJobFromTemplateRequest gcsPath. */ + public gcsPath?: (string|null); + + /** CreateJobFromTemplateRequest parameters. */ + public parameters: { [k: string]: string }; + + /** CreateJobFromTemplateRequest environment. */ + public environment?: (google.dataflow.v1beta3.IRuntimeEnvironment|null); + + /** CreateJobFromTemplateRequest location. */ + public location: string; + + /** CreateJobFromTemplateRequest template. */ + public template?: "gcsPath"; + + /** + * Creates a new CreateJobFromTemplateRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateJobFromTemplateRequest instance + */ + public static create(properties?: google.dataflow.v1beta3.ICreateJobFromTemplateRequest): google.dataflow.v1beta3.CreateJobFromTemplateRequest; + + /** + * Encodes the specified CreateJobFromTemplateRequest message. Does not implicitly {@link google.dataflow.v1beta3.CreateJobFromTemplateRequest.verify|verify} messages. + * @param message CreateJobFromTemplateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.dataflow.v1beta3.ICreateJobFromTemplateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateJobFromTemplateRequest message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.CreateJobFromTemplateRequest.verify|verify} messages. + * @param message CreateJobFromTemplateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.dataflow.v1beta3.ICreateJobFromTemplateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateJobFromTemplateRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateJobFromTemplateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.dataflow.v1beta3.CreateJobFromTemplateRequest; + + /** + * Decodes a CreateJobFromTemplateRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateJobFromTemplateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.dataflow.v1beta3.CreateJobFromTemplateRequest; + + /** + * Verifies a CreateJobFromTemplateRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateJobFromTemplateRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateJobFromTemplateRequest + */ + public static fromObject(object: { [k: string]: any }): google.dataflow.v1beta3.CreateJobFromTemplateRequest; + + /** + * Creates a plain object from a CreateJobFromTemplateRequest message. Also converts values to other types if specified. + * @param message CreateJobFromTemplateRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.dataflow.v1beta3.CreateJobFromTemplateRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateJobFromTemplateRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateJobFromTemplateRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetTemplateRequest. */ + interface IGetTemplateRequest { + + /** GetTemplateRequest projectId */ + projectId?: (string|null); + + /** GetTemplateRequest gcsPath */ + gcsPath?: (string|null); + + /** GetTemplateRequest view */ + view?: (google.dataflow.v1beta3.GetTemplateRequest.TemplateView|keyof typeof google.dataflow.v1beta3.GetTemplateRequest.TemplateView|null); + + /** GetTemplateRequest location */ + location?: (string|null); + } + + /** Represents a GetTemplateRequest. */ + class GetTemplateRequest implements IGetTemplateRequest { + + /** + * Constructs a new GetTemplateRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.dataflow.v1beta3.IGetTemplateRequest); + + /** GetTemplateRequest projectId. */ + public projectId: string; + + /** GetTemplateRequest gcsPath. */ + public gcsPath?: (string|null); + + /** GetTemplateRequest view. */ + public view: (google.dataflow.v1beta3.GetTemplateRequest.TemplateView|keyof typeof google.dataflow.v1beta3.GetTemplateRequest.TemplateView); + + /** GetTemplateRequest location. */ + public location: string; + + /** GetTemplateRequest template. */ + public template?: "gcsPath"; + + /** + * Creates a new GetTemplateRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetTemplateRequest instance + */ + public static create(properties?: google.dataflow.v1beta3.IGetTemplateRequest): google.dataflow.v1beta3.GetTemplateRequest; + + /** + * Encodes the specified GetTemplateRequest message. Does not implicitly {@link google.dataflow.v1beta3.GetTemplateRequest.verify|verify} messages. + * @param message GetTemplateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.dataflow.v1beta3.IGetTemplateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetTemplateRequest message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.GetTemplateRequest.verify|verify} messages. + * @param message GetTemplateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.dataflow.v1beta3.IGetTemplateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetTemplateRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetTemplateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.dataflow.v1beta3.GetTemplateRequest; + + /** + * Decodes a GetTemplateRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetTemplateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.dataflow.v1beta3.GetTemplateRequest; + + /** + * Verifies a GetTemplateRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetTemplateRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetTemplateRequest + */ + public static fromObject(object: { [k: string]: any }): google.dataflow.v1beta3.GetTemplateRequest; + + /** + * Creates a plain object from a GetTemplateRequest message. Also converts values to other types if specified. + * @param message GetTemplateRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.dataflow.v1beta3.GetTemplateRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetTemplateRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetTemplateRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace GetTemplateRequest { + + /** TemplateView enum. */ + enum TemplateView { + METADATA_ONLY = 0 + } + } + + /** Properties of a GetTemplateResponse. */ + interface IGetTemplateResponse { + + /** GetTemplateResponse status */ + status?: (google.rpc.IStatus|null); + + /** GetTemplateResponse metadata */ + metadata?: (google.dataflow.v1beta3.ITemplateMetadata|null); + + /** GetTemplateResponse templateType */ + templateType?: (google.dataflow.v1beta3.GetTemplateResponse.TemplateType|keyof typeof google.dataflow.v1beta3.GetTemplateResponse.TemplateType|null); + + /** GetTemplateResponse runtimeMetadata */ + runtimeMetadata?: (google.dataflow.v1beta3.IRuntimeMetadata|null); + } + + /** Represents a GetTemplateResponse. */ + class GetTemplateResponse implements IGetTemplateResponse { + + /** + * Constructs a new GetTemplateResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.dataflow.v1beta3.IGetTemplateResponse); + + /** GetTemplateResponse status. */ + public status?: (google.rpc.IStatus|null); + + /** GetTemplateResponse metadata. */ + public metadata?: (google.dataflow.v1beta3.ITemplateMetadata|null); + + /** GetTemplateResponse templateType. */ + public templateType: (google.dataflow.v1beta3.GetTemplateResponse.TemplateType|keyof typeof google.dataflow.v1beta3.GetTemplateResponse.TemplateType); + + /** GetTemplateResponse runtimeMetadata. */ + public runtimeMetadata?: (google.dataflow.v1beta3.IRuntimeMetadata|null); + + /** + * Creates a new GetTemplateResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns GetTemplateResponse instance + */ + public static create(properties?: google.dataflow.v1beta3.IGetTemplateResponse): google.dataflow.v1beta3.GetTemplateResponse; + + /** + * Encodes the specified GetTemplateResponse message. Does not implicitly {@link google.dataflow.v1beta3.GetTemplateResponse.verify|verify} messages. + * @param message GetTemplateResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.dataflow.v1beta3.IGetTemplateResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetTemplateResponse message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.GetTemplateResponse.verify|verify} messages. + * @param message GetTemplateResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.dataflow.v1beta3.IGetTemplateResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetTemplateResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetTemplateResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.dataflow.v1beta3.GetTemplateResponse; + + /** + * Decodes a GetTemplateResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetTemplateResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.dataflow.v1beta3.GetTemplateResponse; + + /** + * Verifies a GetTemplateResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetTemplateResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetTemplateResponse + */ + public static fromObject(object: { [k: string]: any }): google.dataflow.v1beta3.GetTemplateResponse; + + /** + * Creates a plain object from a GetTemplateResponse message. Also converts values to other types if specified. + * @param message GetTemplateResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.dataflow.v1beta3.GetTemplateResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetTemplateResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetTemplateResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace GetTemplateResponse { + + /** TemplateType enum. */ + enum TemplateType { + UNKNOWN = 0, + LEGACY = 1, + FLEX = 2 + } + } + + /** Properties of a LaunchTemplateParameters. */ + interface ILaunchTemplateParameters { + + /** LaunchTemplateParameters jobName */ + jobName?: (string|null); + + /** LaunchTemplateParameters parameters */ + parameters?: ({ [k: string]: string }|null); + + /** LaunchTemplateParameters environment */ + environment?: (google.dataflow.v1beta3.IRuntimeEnvironment|null); + + /** LaunchTemplateParameters update */ + update?: (boolean|null); + + /** LaunchTemplateParameters transformNameMapping */ + transformNameMapping?: ({ [k: string]: string }|null); + } + + /** Represents a LaunchTemplateParameters. */ + class LaunchTemplateParameters implements ILaunchTemplateParameters { + + /** + * Constructs a new LaunchTemplateParameters. + * @param [properties] Properties to set + */ + constructor(properties?: google.dataflow.v1beta3.ILaunchTemplateParameters); + + /** LaunchTemplateParameters jobName. */ + public jobName: string; + + /** LaunchTemplateParameters parameters. */ + public parameters: { [k: string]: string }; + + /** LaunchTemplateParameters environment. */ + public environment?: (google.dataflow.v1beta3.IRuntimeEnvironment|null); + + /** LaunchTemplateParameters update. */ + public update: boolean; + + /** LaunchTemplateParameters transformNameMapping. */ + public transformNameMapping: { [k: string]: string }; + + /** + * Creates a new LaunchTemplateParameters instance using the specified properties. + * @param [properties] Properties to set + * @returns LaunchTemplateParameters instance + */ + public static create(properties?: google.dataflow.v1beta3.ILaunchTemplateParameters): google.dataflow.v1beta3.LaunchTemplateParameters; + + /** + * Encodes the specified LaunchTemplateParameters message. Does not implicitly {@link google.dataflow.v1beta3.LaunchTemplateParameters.verify|verify} messages. + * @param message LaunchTemplateParameters message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.dataflow.v1beta3.ILaunchTemplateParameters, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LaunchTemplateParameters message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.LaunchTemplateParameters.verify|verify} messages. + * @param message LaunchTemplateParameters message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.dataflow.v1beta3.ILaunchTemplateParameters, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LaunchTemplateParameters message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LaunchTemplateParameters + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.dataflow.v1beta3.LaunchTemplateParameters; + + /** + * Decodes a LaunchTemplateParameters message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LaunchTemplateParameters + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.dataflow.v1beta3.LaunchTemplateParameters; + + /** + * Verifies a LaunchTemplateParameters message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LaunchTemplateParameters message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LaunchTemplateParameters + */ + public static fromObject(object: { [k: string]: any }): google.dataflow.v1beta3.LaunchTemplateParameters; + + /** + * Creates a plain object from a LaunchTemplateParameters message. Also converts values to other types if specified. + * @param message LaunchTemplateParameters + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.dataflow.v1beta3.LaunchTemplateParameters, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LaunchTemplateParameters to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LaunchTemplateParameters + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a LaunchTemplateRequest. */ + interface ILaunchTemplateRequest { + + /** LaunchTemplateRequest projectId */ + projectId?: (string|null); + + /** LaunchTemplateRequest validateOnly */ + validateOnly?: (boolean|null); + + /** LaunchTemplateRequest gcsPath */ + gcsPath?: (string|null); + + /** LaunchTemplateRequest dynamicTemplate */ + dynamicTemplate?: (google.dataflow.v1beta3.IDynamicTemplateLaunchParams|null); + + /** LaunchTemplateRequest launchParameters */ + launchParameters?: (google.dataflow.v1beta3.ILaunchTemplateParameters|null); + + /** LaunchTemplateRequest location */ + location?: (string|null); + } + + /** Represents a LaunchTemplateRequest. */ + class LaunchTemplateRequest implements ILaunchTemplateRequest { + + /** + * Constructs a new LaunchTemplateRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.dataflow.v1beta3.ILaunchTemplateRequest); + + /** LaunchTemplateRequest projectId. */ + public projectId: string; + + /** LaunchTemplateRequest validateOnly. */ + public validateOnly: boolean; + + /** LaunchTemplateRequest gcsPath. */ + public gcsPath?: (string|null); + + /** LaunchTemplateRequest dynamicTemplate. */ + public dynamicTemplate?: (google.dataflow.v1beta3.IDynamicTemplateLaunchParams|null); + + /** LaunchTemplateRequest launchParameters. */ + public launchParameters?: (google.dataflow.v1beta3.ILaunchTemplateParameters|null); + + /** LaunchTemplateRequest location. */ + public location: string; + + /** LaunchTemplateRequest template. */ + public template?: ("gcsPath"|"dynamicTemplate"); + + /** + * Creates a new LaunchTemplateRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns LaunchTemplateRequest instance + */ + public static create(properties?: google.dataflow.v1beta3.ILaunchTemplateRequest): google.dataflow.v1beta3.LaunchTemplateRequest; + + /** + * Encodes the specified LaunchTemplateRequest message. Does not implicitly {@link google.dataflow.v1beta3.LaunchTemplateRequest.verify|verify} messages. + * @param message LaunchTemplateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.dataflow.v1beta3.ILaunchTemplateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LaunchTemplateRequest message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.LaunchTemplateRequest.verify|verify} messages. + * @param message LaunchTemplateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.dataflow.v1beta3.ILaunchTemplateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LaunchTemplateRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LaunchTemplateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.dataflow.v1beta3.LaunchTemplateRequest; + + /** + * Decodes a LaunchTemplateRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LaunchTemplateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.dataflow.v1beta3.LaunchTemplateRequest; + + /** + * Verifies a LaunchTemplateRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LaunchTemplateRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LaunchTemplateRequest + */ + public static fromObject(object: { [k: string]: any }): google.dataflow.v1beta3.LaunchTemplateRequest; + + /** + * Creates a plain object from a LaunchTemplateRequest message. Also converts values to other types if specified. + * @param message LaunchTemplateRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.dataflow.v1beta3.LaunchTemplateRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LaunchTemplateRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LaunchTemplateRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a LaunchTemplateResponse. */ + interface ILaunchTemplateResponse { + + /** LaunchTemplateResponse job */ + job?: (google.dataflow.v1beta3.IJob|null); + } + + /** Represents a LaunchTemplateResponse. */ + class LaunchTemplateResponse implements ILaunchTemplateResponse { + + /** + * Constructs a new LaunchTemplateResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.dataflow.v1beta3.ILaunchTemplateResponse); + + /** LaunchTemplateResponse job. */ + public job?: (google.dataflow.v1beta3.IJob|null); + + /** + * Creates a new LaunchTemplateResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns LaunchTemplateResponse instance + */ + public static create(properties?: google.dataflow.v1beta3.ILaunchTemplateResponse): google.dataflow.v1beta3.LaunchTemplateResponse; + + /** + * Encodes the specified LaunchTemplateResponse message. Does not implicitly {@link google.dataflow.v1beta3.LaunchTemplateResponse.verify|verify} messages. + * @param message LaunchTemplateResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.dataflow.v1beta3.ILaunchTemplateResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LaunchTemplateResponse message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.LaunchTemplateResponse.verify|verify} messages. + * @param message LaunchTemplateResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.dataflow.v1beta3.ILaunchTemplateResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LaunchTemplateResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LaunchTemplateResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.dataflow.v1beta3.LaunchTemplateResponse; + + /** + * Decodes a LaunchTemplateResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LaunchTemplateResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.dataflow.v1beta3.LaunchTemplateResponse; + + /** + * Verifies a LaunchTemplateResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LaunchTemplateResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LaunchTemplateResponse + */ + public static fromObject(object: { [k: string]: any }): google.dataflow.v1beta3.LaunchTemplateResponse; + + /** + * Creates a plain object from a LaunchTemplateResponse message. Also converts values to other types if specified. + * @param message LaunchTemplateResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.dataflow.v1beta3.LaunchTemplateResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LaunchTemplateResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LaunchTemplateResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an InvalidTemplateParameters. */ + interface IInvalidTemplateParameters { + + /** InvalidTemplateParameters parameterViolations */ + parameterViolations?: (google.dataflow.v1beta3.InvalidTemplateParameters.IParameterViolation[]|null); + } + + /** Represents an InvalidTemplateParameters. */ + class InvalidTemplateParameters implements IInvalidTemplateParameters { + + /** + * Constructs a new InvalidTemplateParameters. + * @param [properties] Properties to set + */ + constructor(properties?: google.dataflow.v1beta3.IInvalidTemplateParameters); + + /** InvalidTemplateParameters parameterViolations. */ + public parameterViolations: google.dataflow.v1beta3.InvalidTemplateParameters.IParameterViolation[]; + + /** + * Creates a new InvalidTemplateParameters instance using the specified properties. + * @param [properties] Properties to set + * @returns InvalidTemplateParameters instance + */ + public static create(properties?: google.dataflow.v1beta3.IInvalidTemplateParameters): google.dataflow.v1beta3.InvalidTemplateParameters; + + /** + * Encodes the specified InvalidTemplateParameters message. Does not implicitly {@link google.dataflow.v1beta3.InvalidTemplateParameters.verify|verify} messages. + * @param message InvalidTemplateParameters message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.dataflow.v1beta3.IInvalidTemplateParameters, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InvalidTemplateParameters message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.InvalidTemplateParameters.verify|verify} messages. + * @param message InvalidTemplateParameters message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.dataflow.v1beta3.IInvalidTemplateParameters, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InvalidTemplateParameters message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InvalidTemplateParameters + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.dataflow.v1beta3.InvalidTemplateParameters; + + /** + * Decodes an InvalidTemplateParameters message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InvalidTemplateParameters + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.dataflow.v1beta3.InvalidTemplateParameters; + + /** + * Verifies an InvalidTemplateParameters message. + * @param message Plain 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 InvalidTemplateParameters message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InvalidTemplateParameters + */ + public static fromObject(object: { [k: string]: any }): google.dataflow.v1beta3.InvalidTemplateParameters; + + /** + * Creates a plain object from an InvalidTemplateParameters message. Also converts values to other types if specified. + * @param message InvalidTemplateParameters + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.dataflow.v1beta3.InvalidTemplateParameters, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InvalidTemplateParameters to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for InvalidTemplateParameters + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace InvalidTemplateParameters { + + /** Properties of a ParameterViolation. */ + interface IParameterViolation { + + /** ParameterViolation parameter */ + parameter?: (string|null); + + /** ParameterViolation description */ + description?: (string|null); + } + + /** Represents a ParameterViolation. */ + class ParameterViolation implements IParameterViolation { + + /** + * Constructs a new ParameterViolation. + * @param [properties] Properties to set + */ + constructor(properties?: google.dataflow.v1beta3.InvalidTemplateParameters.IParameterViolation); + + /** ParameterViolation parameter. */ + public parameter: string; + + /** ParameterViolation description. */ + public description: string; + + /** + * Creates a new ParameterViolation instance using the specified properties. + * @param [properties] Properties to set + * @returns ParameterViolation instance + */ + public static create(properties?: google.dataflow.v1beta3.InvalidTemplateParameters.IParameterViolation): google.dataflow.v1beta3.InvalidTemplateParameters.ParameterViolation; + + /** + * Encodes the specified ParameterViolation message. Does not implicitly {@link google.dataflow.v1beta3.InvalidTemplateParameters.ParameterViolation.verify|verify} messages. + * @param message ParameterViolation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.dataflow.v1beta3.InvalidTemplateParameters.IParameterViolation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ParameterViolation message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.InvalidTemplateParameters.ParameterViolation.verify|verify} messages. + * @param message ParameterViolation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.dataflow.v1beta3.InvalidTemplateParameters.IParameterViolation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ParameterViolation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ParameterViolation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.dataflow.v1beta3.InvalidTemplateParameters.ParameterViolation; + + /** + * Decodes a ParameterViolation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ParameterViolation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.dataflow.v1beta3.InvalidTemplateParameters.ParameterViolation; + + /** + * Verifies a ParameterViolation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ParameterViolation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ParameterViolation + */ + public static fromObject(object: { [k: string]: any }): google.dataflow.v1beta3.InvalidTemplateParameters.ParameterViolation; + + /** + * Creates a plain object from a ParameterViolation message. Also converts values to other types if specified. + * @param message ParameterViolation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.dataflow.v1beta3.InvalidTemplateParameters.ParameterViolation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ParameterViolation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ParameterViolation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a DynamicTemplateLaunchParams. */ + interface IDynamicTemplateLaunchParams { + + /** DynamicTemplateLaunchParams gcsPath */ + gcsPath?: (string|null); + + /** DynamicTemplateLaunchParams stagingLocation */ + stagingLocation?: (string|null); + } + + /** Represents a DynamicTemplateLaunchParams. */ + class DynamicTemplateLaunchParams implements IDynamicTemplateLaunchParams { + + /** + * Constructs a new DynamicTemplateLaunchParams. + * @param [properties] Properties to set + */ + constructor(properties?: google.dataflow.v1beta3.IDynamicTemplateLaunchParams); + + /** DynamicTemplateLaunchParams gcsPath. */ + public gcsPath: string; + + /** DynamicTemplateLaunchParams stagingLocation. */ + public stagingLocation: string; + + /** + * Creates a new DynamicTemplateLaunchParams instance using the specified properties. + * @param [properties] Properties to set + * @returns DynamicTemplateLaunchParams instance + */ + public static create(properties?: google.dataflow.v1beta3.IDynamicTemplateLaunchParams): google.dataflow.v1beta3.DynamicTemplateLaunchParams; + + /** + * Encodes the specified DynamicTemplateLaunchParams message. Does not implicitly {@link google.dataflow.v1beta3.DynamicTemplateLaunchParams.verify|verify} messages. + * @param message DynamicTemplateLaunchParams message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.dataflow.v1beta3.IDynamicTemplateLaunchParams, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DynamicTemplateLaunchParams message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.DynamicTemplateLaunchParams.verify|verify} messages. + * @param message DynamicTemplateLaunchParams message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.dataflow.v1beta3.IDynamicTemplateLaunchParams, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DynamicTemplateLaunchParams message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DynamicTemplateLaunchParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.dataflow.v1beta3.DynamicTemplateLaunchParams; + + /** + * Decodes a DynamicTemplateLaunchParams message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DynamicTemplateLaunchParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.dataflow.v1beta3.DynamicTemplateLaunchParams; + + /** + * Verifies a DynamicTemplateLaunchParams message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DynamicTemplateLaunchParams message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DynamicTemplateLaunchParams + */ + public static fromObject(object: { [k: string]: any }): google.dataflow.v1beta3.DynamicTemplateLaunchParams; + + /** + * Creates a plain object from a DynamicTemplateLaunchParams message. Also converts values to other types if specified. + * @param message DynamicTemplateLaunchParams + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.dataflow.v1beta3.DynamicTemplateLaunchParams, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DynamicTemplateLaunchParams to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DynamicTemplateLaunchParams + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + + /** Namespace api. */ + namespace api { + + /** FieldBehavior enum. */ + enum FieldBehavior { + FIELD_BEHAVIOR_UNSPECIFIED = 0, + OPTIONAL = 1, + REQUIRED = 2, + OUTPUT_ONLY = 3, + INPUT_ONLY = 4, + IMMUTABLE = 5, + UNORDERED_LIST = 6, + NON_EMPTY_DEFAULT = 7 + } + + /** Properties of a Http. */ + interface IHttp { + + /** Http rules */ + rules?: (google.api.IHttpRule[]|null); + + /** Http fullyDecodeReservedExpansion */ + fullyDecodeReservedExpansion?: (boolean|null); + } + + /** Represents a Http. */ + class Http implements IHttp { + + /** + * Constructs a new Http. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IHttp); + + /** Http rules. */ + public rules: google.api.IHttpRule[]; + + /** Http fullyDecodeReservedExpansion. */ + public fullyDecodeReservedExpansion: boolean; + + /** + * Creates a new Http instance using the specified properties. + * @param [properties] Properties to set + * @returns Http instance + */ + public static create(properties?: google.api.IHttp): google.api.Http; + + /** + * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @param message Http message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @param message Http message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Http message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.Http; + + /** + * Decodes a Http message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.Http; + + /** + * Verifies a Http message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Http message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Http + */ + public static fromObject(object: { [k: string]: any }): google.api.Http; + + /** + * Creates a plain object from a Http message. Also converts values to other types if specified. + * @param message Http + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.Http, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Http to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Http + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a HttpRule. */ + interface IHttpRule { + + /** HttpRule selector */ + selector?: (string|null); + + /** HttpRule get */ + get?: (string|null); + + /** HttpRule put */ + put?: (string|null); + + /** HttpRule post */ + post?: (string|null); + + /** HttpRule delete */ + "delete"?: (string|null); + + /** HttpRule patch */ + patch?: (string|null); + + /** HttpRule custom */ + custom?: (google.api.ICustomHttpPattern|null); + + /** HttpRule body */ + body?: (string|null); + + /** HttpRule responseBody */ + responseBody?: (string|null); + + /** HttpRule additionalBindings */ + additionalBindings?: (google.api.IHttpRule[]|null); + } + + /** Represents a HttpRule. */ + class HttpRule implements IHttpRule { + + /** + * Constructs a new HttpRule. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IHttpRule); + + /** HttpRule selector. */ + public selector: string; + + /** HttpRule get. */ + public get?: (string|null); + + /** HttpRule put. */ + public put?: (string|null); + + /** HttpRule post. */ + public post?: (string|null); + + /** HttpRule delete. */ + public delete?: (string|null); + + /** HttpRule patch. */ + public patch?: (string|null); + + /** HttpRule custom. */ + public custom?: (google.api.ICustomHttpPattern|null); + + /** HttpRule body. */ + public body: string; + + /** HttpRule responseBody. */ + public responseBody: string; + + /** HttpRule additionalBindings. */ + public additionalBindings: google.api.IHttpRule[]; + + /** HttpRule pattern. */ + public pattern?: ("get"|"put"|"post"|"delete"|"patch"|"custom"); + + /** + * Creates a new HttpRule instance using the specified properties. + * @param [properties] Properties to set + * @returns HttpRule instance + */ + public static create(properties?: google.api.IHttpRule): google.api.HttpRule; + + /** + * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @param message HttpRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @param message HttpRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HttpRule message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.HttpRule; + + /** + * Decodes a HttpRule message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.HttpRule; + + /** + * Verifies a HttpRule message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HttpRule + */ + public static fromObject(object: { [k: string]: any }): google.api.HttpRule; + + /** + * Creates a plain object from a HttpRule message. Also converts values to other types if specified. + * @param message HttpRule + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.HttpRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HttpRule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for HttpRule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomHttpPattern. */ + interface ICustomHttpPattern { + + /** CustomHttpPattern kind */ + kind?: (string|null); + + /** CustomHttpPattern path */ + path?: (string|null); + } + + /** Represents a CustomHttpPattern. */ + class CustomHttpPattern implements ICustomHttpPattern { + + /** + * Constructs a new CustomHttpPattern. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ICustomHttpPattern); + + /** CustomHttpPattern kind. */ + public kind: string; + + /** CustomHttpPattern path. */ + public path: string; + + /** + * Creates a new CustomHttpPattern instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomHttpPattern instance + */ + public static create(properties?: google.api.ICustomHttpPattern): google.api.CustomHttpPattern; + + /** + * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @param message CustomHttpPattern message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @param message CustomHttpPattern message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CustomHttpPattern; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CustomHttpPattern; + + /** + * Verifies a CustomHttpPattern message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CustomHttpPattern + */ + public static fromObject(object: { [k: string]: any }): google.api.CustomHttpPattern; + + /** + * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. + * @param message CustomHttpPattern + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.CustomHttpPattern, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CustomHttpPattern to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CustomHttpPattern + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace protobuf. */ + namespace protobuf { + + /** Properties of a FileDescriptorSet. */ + interface IFileDescriptorSet { + + /** FileDescriptorSet file */ + file?: (google.protobuf.IFileDescriptorProto[]|null); + } + + /** Represents a FileDescriptorSet. */ + class FileDescriptorSet implements IFileDescriptorSet { + + /** + * Constructs a new FileDescriptorSet. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileDescriptorSet); + + /** FileDescriptorSet file. */ + public file: google.protobuf.IFileDescriptorProto[]; + + /** + * Creates a new FileDescriptorSet instance using the specified properties. + * @param [properties] Properties to set + * @returns FileDescriptorSet instance + */ + public static create(properties?: google.protobuf.IFileDescriptorSet): google.protobuf.FileDescriptorSet; + + /** + * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @param message FileDescriptorSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @param message FileDescriptorSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileDescriptorSet; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileDescriptorSet; + + /** + * Verifies a FileDescriptorSet message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileDescriptorSet + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorSet; + + /** + * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. + * @param message FileDescriptorSet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileDescriptorSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileDescriptorSet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FileDescriptorSet + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FileDescriptorProto. */ + interface IFileDescriptorProto { + + /** FileDescriptorProto name */ + name?: (string|null); + + /** FileDescriptorProto package */ + "package"?: (string|null); + + /** FileDescriptorProto dependency */ + dependency?: (string[]|null); + + /** FileDescriptorProto publicDependency */ + publicDependency?: (number[]|null); + + /** FileDescriptorProto weakDependency */ + weakDependency?: (number[]|null); + + /** FileDescriptorProto messageType */ + messageType?: (google.protobuf.IDescriptorProto[]|null); + + /** FileDescriptorProto enumType */ + enumType?: (google.protobuf.IEnumDescriptorProto[]|null); + + /** FileDescriptorProto service */ + service?: (google.protobuf.IServiceDescriptorProto[]|null); + + /** FileDescriptorProto extension */ + extension?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** FileDescriptorProto options */ + options?: (google.protobuf.IFileOptions|null); + + /** FileDescriptorProto sourceCodeInfo */ + sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); + + /** FileDescriptorProto syntax */ + syntax?: (string|null); + + /** FileDescriptorProto edition */ + edition?: (string|null); + } + + /** Represents a FileDescriptorProto. */ + class FileDescriptorProto implements IFileDescriptorProto { + + /** + * Constructs a new FileDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileDescriptorProto); + + /** FileDescriptorProto name. */ + public name: string; + + /** FileDescriptorProto package. */ + public package: string; + + /** FileDescriptorProto dependency. */ + public dependency: string[]; + + /** FileDescriptorProto publicDependency. */ + public publicDependency: number[]; + + /** FileDescriptorProto weakDependency. */ + public weakDependency: number[]; + + /** FileDescriptorProto messageType. */ + public messageType: google.protobuf.IDescriptorProto[]; + + /** FileDescriptorProto enumType. */ + public enumType: google.protobuf.IEnumDescriptorProto[]; + + /** FileDescriptorProto service. */ + public service: google.protobuf.IServiceDescriptorProto[]; + + /** FileDescriptorProto extension. */ + public extension: google.protobuf.IFieldDescriptorProto[]; + + /** FileDescriptorProto options. */ + public options?: (google.protobuf.IFileOptions|null); + + /** FileDescriptorProto sourceCodeInfo. */ + public sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); + + /** FileDescriptorProto syntax. */ + public syntax: string; + + /** FileDescriptorProto edition. */ + public edition: string; + + /** + * Creates a new FileDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns FileDescriptorProto instance + */ + public static create(properties?: google.protobuf.IFileDescriptorProto): google.protobuf.FileDescriptorProto; + + /** + * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @param message FileDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @param message FileDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileDescriptorProto; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileDescriptorProto; + + /** + * Verifies a FileDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorProto; + + /** + * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. + * @param message FileDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FileDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DescriptorProto. */ + interface IDescriptorProto { + + /** DescriptorProto name */ + name?: (string|null); + + /** DescriptorProto field */ + field?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** DescriptorProto extension */ + extension?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** DescriptorProto nestedType */ + nestedType?: (google.protobuf.IDescriptorProto[]|null); + + /** DescriptorProto enumType */ + enumType?: (google.protobuf.IEnumDescriptorProto[]|null); + + /** DescriptorProto extensionRange */ + extensionRange?: (google.protobuf.DescriptorProto.IExtensionRange[]|null); + + /** DescriptorProto oneofDecl */ + oneofDecl?: (google.protobuf.IOneofDescriptorProto[]|null); + + /** DescriptorProto options */ + options?: (google.protobuf.IMessageOptions|null); + + /** DescriptorProto reservedRange */ + reservedRange?: (google.protobuf.DescriptorProto.IReservedRange[]|null); + + /** DescriptorProto reservedName */ + reservedName?: (string[]|null); + } + + /** Represents a DescriptorProto. */ + class DescriptorProto implements IDescriptorProto { + + /** + * Constructs a new DescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IDescriptorProto); + + /** DescriptorProto name. */ + public name: string; + + /** DescriptorProto field. */ + public field: google.protobuf.IFieldDescriptorProto[]; + + /** DescriptorProto extension. */ + public extension: google.protobuf.IFieldDescriptorProto[]; + + /** DescriptorProto nestedType. */ + public nestedType: google.protobuf.IDescriptorProto[]; + + /** DescriptorProto enumType. */ + public enumType: google.protobuf.IEnumDescriptorProto[]; + + /** DescriptorProto extensionRange. */ + public extensionRange: google.protobuf.DescriptorProto.IExtensionRange[]; + + /** DescriptorProto oneofDecl. */ + public oneofDecl: google.protobuf.IOneofDescriptorProto[]; + + /** DescriptorProto options. */ + public options?: (google.protobuf.IMessageOptions|null); + + /** DescriptorProto reservedRange. */ + public reservedRange: google.protobuf.DescriptorProto.IReservedRange[]; + + /** DescriptorProto reservedName. */ + public reservedName: string[]; + + /** + * Creates a new DescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns DescriptorProto instance + */ + public static create(properties?: google.protobuf.IDescriptorProto): google.protobuf.DescriptorProto; + + /** + * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @param message DescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @param message DescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto; + + /** + * Verifies a DescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto; + + /** + * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. + * @param message DescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace DescriptorProto { + + /** Properties of an ExtensionRange. */ + interface IExtensionRange { + + /** ExtensionRange start */ + start?: (number|null); + + /** ExtensionRange end */ + end?: (number|null); + + /** ExtensionRange options */ + options?: (google.protobuf.IExtensionRangeOptions|null); + } + + /** Represents an ExtensionRange. */ + class ExtensionRange implements IExtensionRange { + + /** + * Constructs a new ExtensionRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.DescriptorProto.IExtensionRange); + + /** ExtensionRange start. */ + public start: number; + + /** ExtensionRange end. */ + public end: number; + + /** ExtensionRange options. */ + public options?: (google.protobuf.IExtensionRangeOptions|null); + + /** + * Creates a new ExtensionRange instance using the specified properties. + * @param [properties] Properties to set + * @returns ExtensionRange instance + */ + public static create(properties?: google.protobuf.DescriptorProto.IExtensionRange): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @param message ExtensionRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @param message ExtensionRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Verifies an ExtensionRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExtensionRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. + * @param message ExtensionRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto.ExtensionRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExtensionRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExtensionRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ReservedRange. */ + interface IReservedRange { + + /** ReservedRange start */ + start?: (number|null); + + /** ReservedRange end */ + end?: (number|null); + } + + /** Represents a ReservedRange. */ + class ReservedRange implements IReservedRange { + + /** + * Constructs a new ReservedRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.DescriptorProto.IReservedRange); + + /** ReservedRange start. */ + public start: number; + + /** ReservedRange end. */ + public end: number; + + /** + * Creates a new ReservedRange instance using the specified properties. + * @param [properties] Properties to set + * @returns ReservedRange instance + */ + public static create(properties?: google.protobuf.DescriptorProto.IReservedRange): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @param message ReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @param message ReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReservedRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Decodes a ReservedRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Verifies a ReservedRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReservedRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. + * @param message ReservedRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto.ReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReservedRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReservedRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an ExtensionRangeOptions. */ + interface IExtensionRangeOptions { + + /** ExtensionRangeOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an ExtensionRangeOptions. */ + class ExtensionRangeOptions implements IExtensionRangeOptions { + + /** + * Constructs a new ExtensionRangeOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IExtensionRangeOptions); + + /** ExtensionRangeOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new ExtensionRangeOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns ExtensionRangeOptions instance + */ + public static create(properties?: google.protobuf.IExtensionRangeOptions): google.protobuf.ExtensionRangeOptions; + + /** + * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @param message ExtensionRangeOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @param message ExtensionRangeOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ExtensionRangeOptions; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ExtensionRangeOptions; + + /** + * Verifies an ExtensionRangeOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExtensionRangeOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ExtensionRangeOptions; + + /** + * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. + * @param message ExtensionRangeOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ExtensionRangeOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExtensionRangeOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExtensionRangeOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FieldDescriptorProto. */ + interface IFieldDescriptorProto { + + /** FieldDescriptorProto name */ + name?: (string|null); + + /** FieldDescriptorProto number */ + number?: (number|null); + + /** FieldDescriptorProto label */ + label?: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label|null); + + /** FieldDescriptorProto type */ + type?: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type|null); + + /** FieldDescriptorProto typeName */ + typeName?: (string|null); + + /** FieldDescriptorProto extendee */ + extendee?: (string|null); + + /** FieldDescriptorProto defaultValue */ + defaultValue?: (string|null); + + /** FieldDescriptorProto oneofIndex */ + oneofIndex?: (number|null); + + /** FieldDescriptorProto jsonName */ + jsonName?: (string|null); + + /** FieldDescriptorProto options */ + options?: (google.protobuf.IFieldOptions|null); + + /** FieldDescriptorProto proto3Optional */ + proto3Optional?: (boolean|null); + } + + /** Represents a FieldDescriptorProto. */ + class FieldDescriptorProto implements IFieldDescriptorProto { + + /** + * Constructs a new FieldDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldDescriptorProto); + + /** FieldDescriptorProto name. */ + public name: string; + + /** FieldDescriptorProto number. */ + public number: number; + + /** FieldDescriptorProto label. */ + public label: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label); + + /** FieldDescriptorProto type. */ + public type: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type); + + /** FieldDescriptorProto typeName. */ + public typeName: string; + + /** FieldDescriptorProto extendee. */ + public extendee: string; + + /** FieldDescriptorProto defaultValue. */ + public defaultValue: string; + + /** FieldDescriptorProto oneofIndex. */ + public oneofIndex: number; + + /** FieldDescriptorProto jsonName. */ + public jsonName: string; + + /** FieldDescriptorProto options. */ + public options?: (google.protobuf.IFieldOptions|null); + + /** FieldDescriptorProto proto3Optional. */ + public proto3Optional: boolean; + + /** + * Creates a new FieldDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldDescriptorProto instance + */ + public static create(properties?: google.protobuf.IFieldDescriptorProto): google.protobuf.FieldDescriptorProto; + + /** + * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @param message FieldDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @param message FieldDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldDescriptorProto; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldDescriptorProto; + + /** + * Verifies a FieldDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldDescriptorProto; + + /** + * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. + * @param message FieldDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FieldDescriptorProto { + + /** Type enum. */ + enum Type { + TYPE_DOUBLE = 1, + TYPE_FLOAT = 2, + TYPE_INT64 = 3, + TYPE_UINT64 = 4, + TYPE_INT32 = 5, + TYPE_FIXED64 = 6, + TYPE_FIXED32 = 7, + TYPE_BOOL = 8, + TYPE_STRING = 9, + TYPE_GROUP = 10, + TYPE_MESSAGE = 11, + TYPE_BYTES = 12, + TYPE_UINT32 = 13, + TYPE_ENUM = 14, + TYPE_SFIXED32 = 15, + TYPE_SFIXED64 = 16, + TYPE_SINT32 = 17, + TYPE_SINT64 = 18 + } + + /** Label enum. */ + enum Label { + LABEL_OPTIONAL = 1, + LABEL_REQUIRED = 2, + LABEL_REPEATED = 3 + } + } + + /** Properties of an OneofDescriptorProto. */ + interface IOneofDescriptorProto { + + /** OneofDescriptorProto name */ + name?: (string|null); + + /** OneofDescriptorProto options */ + options?: (google.protobuf.IOneofOptions|null); + } + + /** Represents an OneofDescriptorProto. */ + class OneofDescriptorProto implements IOneofDescriptorProto { + + /** + * Constructs a new OneofDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IOneofDescriptorProto); + + /** OneofDescriptorProto name. */ + public name: string; + + /** OneofDescriptorProto options. */ + public options?: (google.protobuf.IOneofOptions|null); + + /** + * Creates a new OneofDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns OneofDescriptorProto instance + */ + public static create(properties?: google.protobuf.IOneofDescriptorProto): google.protobuf.OneofDescriptorProto; + + /** + * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @param message OneofDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @param message OneofDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofDescriptorProto; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofDescriptorProto; + + /** + * Verifies an OneofDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OneofDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.OneofDescriptorProto; + + /** + * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. + * @param message OneofDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.OneofDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OneofDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OneofDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnumDescriptorProto. */ + interface IEnumDescriptorProto { + + /** EnumDescriptorProto name */ + name?: (string|null); + + /** EnumDescriptorProto value */ + value?: (google.protobuf.IEnumValueDescriptorProto[]|null); + + /** EnumDescriptorProto options */ + options?: (google.protobuf.IEnumOptions|null); + + /** EnumDescriptorProto reservedRange */ + reservedRange?: (google.protobuf.EnumDescriptorProto.IEnumReservedRange[]|null); + + /** EnumDescriptorProto reservedName */ + reservedName?: (string[]|null); + } + + /** Represents an EnumDescriptorProto. */ + class EnumDescriptorProto implements IEnumDescriptorProto { + + /** + * Constructs a new EnumDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumDescriptorProto); + + /** EnumDescriptorProto name. */ + public name: string; + + /** EnumDescriptorProto value. */ + public value: google.protobuf.IEnumValueDescriptorProto[]; + + /** EnumDescriptorProto options. */ + public options?: (google.protobuf.IEnumOptions|null); + + /** EnumDescriptorProto reservedRange. */ + public reservedRange: google.protobuf.EnumDescriptorProto.IEnumReservedRange[]; + + /** EnumDescriptorProto reservedName. */ + public reservedName: string[]; + + /** + * Creates a new EnumDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumDescriptorProto instance + */ + public static create(properties?: google.protobuf.IEnumDescriptorProto): google.protobuf.EnumDescriptorProto; + + /** + * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @param message EnumDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @param message EnumDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto; + + /** + * Verifies an EnumDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto; + + /** + * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. + * @param message EnumDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace EnumDescriptorProto { + + /** Properties of an EnumReservedRange. */ + interface IEnumReservedRange { + + /** EnumReservedRange start */ + start?: (number|null); + + /** EnumReservedRange end */ + end?: (number|null); + } + + /** Represents an EnumReservedRange. */ + class EnumReservedRange implements IEnumReservedRange { + + /** + * Constructs a new EnumReservedRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange); + + /** EnumReservedRange start. */ + public start: number; + + /** EnumReservedRange end. */ + public end: number; + + /** + * Creates a new EnumReservedRange instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumReservedRange instance + */ + public static create(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @param message EnumReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @param message EnumReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Verifies an EnumReservedRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumReservedRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. + * @param message EnumReservedRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumDescriptorProto.EnumReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumReservedRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumReservedRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an EnumValueDescriptorProto. */ + interface IEnumValueDescriptorProto { + + /** EnumValueDescriptorProto name */ + name?: (string|null); + + /** EnumValueDescriptorProto number */ + number?: (number|null); + + /** EnumValueDescriptorProto options */ + options?: (google.protobuf.IEnumValueOptions|null); + } + + /** Represents an EnumValueDescriptorProto. */ + class EnumValueDescriptorProto implements IEnumValueDescriptorProto { + + /** + * Constructs a new EnumValueDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumValueDescriptorProto); + + /** EnumValueDescriptorProto name. */ + public name: string; + + /** EnumValueDescriptorProto number. */ + public number: number; + + /** EnumValueDescriptorProto options. */ + public options?: (google.protobuf.IEnumValueOptions|null); + + /** + * Creates a new EnumValueDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumValueDescriptorProto instance + */ + public static create(properties?: google.protobuf.IEnumValueDescriptorProto): google.protobuf.EnumValueDescriptorProto; + + /** + * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @param message EnumValueDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @param message EnumValueDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueDescriptorProto; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueDescriptorProto; + + /** + * Verifies an EnumValueDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumValueDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueDescriptorProto; + + /** + * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. + * @param message EnumValueDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumValueDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumValueDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumValueDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceDescriptorProto. */ + interface IServiceDescriptorProto { + + /** ServiceDescriptorProto name */ + name?: (string|null); + + /** ServiceDescriptorProto method */ + method?: (google.protobuf.IMethodDescriptorProto[]|null); + + /** ServiceDescriptorProto options */ + options?: (google.protobuf.IServiceOptions|null); + } + + /** Represents a ServiceDescriptorProto. */ + class ServiceDescriptorProto implements IServiceDescriptorProto { + + /** + * Constructs a new ServiceDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceDescriptorProto); + + /** ServiceDescriptorProto name. */ + public name: string; + + /** ServiceDescriptorProto method. */ + public method: google.protobuf.IMethodDescriptorProto[]; + + /** ServiceDescriptorProto options. */ + public options?: (google.protobuf.IServiceOptions|null); + + /** + * Creates a new ServiceDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceDescriptorProto instance + */ + public static create(properties?: google.protobuf.IServiceDescriptorProto): google.protobuf.ServiceDescriptorProto; + + /** + * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @param message ServiceDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @param message ServiceDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceDescriptorProto; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceDescriptorProto; + + /** + * Verifies a ServiceDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceDescriptorProto; + + /** + * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. + * @param message ServiceDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ServiceDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ServiceDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MethodDescriptorProto. */ + interface IMethodDescriptorProto { + + /** MethodDescriptorProto name */ + name?: (string|null); + + /** MethodDescriptorProto inputType */ + inputType?: (string|null); + + /** MethodDescriptorProto outputType */ + outputType?: (string|null); + + /** MethodDescriptorProto options */ + options?: (google.protobuf.IMethodOptions|null); + + /** MethodDescriptorProto clientStreaming */ + clientStreaming?: (boolean|null); + + /** MethodDescriptorProto serverStreaming */ + serverStreaming?: (boolean|null); + } + + /** Represents a MethodDescriptorProto. */ + class MethodDescriptorProto implements IMethodDescriptorProto { + + /** + * Constructs a new MethodDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMethodDescriptorProto); + + /** MethodDescriptorProto name. */ + public name: string; + + /** MethodDescriptorProto inputType. */ + public inputType: string; + + /** MethodDescriptorProto outputType. */ + public outputType: string; + + /** MethodDescriptorProto options. */ + public options?: (google.protobuf.IMethodOptions|null); + + /** MethodDescriptorProto clientStreaming. */ + public clientStreaming: boolean; + + /** MethodDescriptorProto serverStreaming. */ + public serverStreaming: boolean; + + /** + * Creates a new MethodDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodDescriptorProto instance + */ + public static create(properties?: google.protobuf.IMethodDescriptorProto): google.protobuf.MethodDescriptorProto; + + /** + * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @param message MethodDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @param message MethodDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodDescriptorProto; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodDescriptorProto; + + /** + * Verifies a MethodDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MethodDescriptorProto; + + /** + * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. + * @param message MethodDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MethodDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MethodDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FileOptions. */ + interface IFileOptions { + + /** FileOptions javaPackage */ + javaPackage?: (string|null); + + /** FileOptions javaOuterClassname */ + javaOuterClassname?: (string|null); + + /** FileOptions javaMultipleFiles */ + javaMultipleFiles?: (boolean|null); + + /** FileOptions javaGenerateEqualsAndHash */ + javaGenerateEqualsAndHash?: (boolean|null); + + /** FileOptions javaStringCheckUtf8 */ + javaStringCheckUtf8?: (boolean|null); + + /** FileOptions optimizeFor */ + optimizeFor?: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode|null); + + /** FileOptions goPackage */ + goPackage?: (string|null); + + /** FileOptions ccGenericServices */ + ccGenericServices?: (boolean|null); + + /** FileOptions javaGenericServices */ + javaGenericServices?: (boolean|null); + + /** FileOptions pyGenericServices */ + pyGenericServices?: (boolean|null); + + /** FileOptions phpGenericServices */ + phpGenericServices?: (boolean|null); + + /** FileOptions deprecated */ + deprecated?: (boolean|null); + + /** FileOptions ccEnableArenas */ + ccEnableArenas?: (boolean|null); + + /** FileOptions objcClassPrefix */ + objcClassPrefix?: (string|null); + + /** FileOptions csharpNamespace */ + csharpNamespace?: (string|null); + + /** FileOptions swiftPrefix */ + swiftPrefix?: (string|null); + + /** FileOptions phpClassPrefix */ + phpClassPrefix?: (string|null); + + /** FileOptions phpNamespace */ + phpNamespace?: (string|null); + + /** FileOptions phpMetadataNamespace */ + phpMetadataNamespace?: (string|null); + + /** FileOptions rubyPackage */ + rubyPackage?: (string|null); + + /** FileOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** 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); + } + + /** 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); + } + + /** Represents a FieldOptions. */ + class FieldOptions implements IFieldOptions { + + /** + * Constructs a new FieldOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldOptions); + + /** FieldOptions ctype. */ + public ctype: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType); + + /** FieldOptions packed. */ + public packed: boolean; + + /** FieldOptions jstype. */ + public jstype: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType); + + /** FieldOptions lazy. */ + public lazy: boolean; + + /** FieldOptions unverifiedLazy. */ + public unverifiedLazy: boolean; + + /** FieldOptions deprecated. */ + public deprecated: boolean; + + /** FieldOptions weak. */ + public weak: boolean; + + /** FieldOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new FieldOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldOptions instance + */ + public static create(properties?: google.protobuf.IFieldOptions): google.protobuf.FieldOptions; + + /** + * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @param message FieldOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @param message FieldOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldOptions; + + /** + * Decodes a FieldOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldOptions; + + /** + * Verifies a FieldOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions; + + /** + * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. + * @param message FieldOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FieldOptions { + + /** CType enum. */ + enum CType { + STRING = 0, + CORD = 1, + STRING_PIECE = 2 + } + + /** JSType enum. */ + enum JSType { + JS_NORMAL = 0, + JS_STRING = 1, + JS_NUMBER = 2 + } + } + + /** Properties of an OneofOptions. */ + interface IOneofOptions { + + /** OneofOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an OneofOptions. */ + class OneofOptions implements IOneofOptions { + + /** + * Constructs a new OneofOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IOneofOptions); + + /** OneofOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new OneofOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns OneofOptions instance + */ + public static create(properties?: google.protobuf.IOneofOptions): google.protobuf.OneofOptions; + + /** + * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @param message OneofOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @param message OneofOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OneofOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofOptions; + + /** + * Decodes an OneofOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofOptions; + + /** + * Verifies an OneofOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OneofOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.OneofOptions; + + /** + * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. + * @param message OneofOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.OneofOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OneofOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OneofOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnumOptions. */ + interface IEnumOptions { + + /** EnumOptions allowAlias */ + allowAlias?: (boolean|null); + + /** EnumOptions deprecated */ + deprecated?: (boolean|null); + + /** EnumOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an EnumOptions. */ + class EnumOptions implements IEnumOptions { + + /** + * Constructs a new EnumOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumOptions); + + /** EnumOptions allowAlias. */ + public allowAlias: boolean; + + /** EnumOptions deprecated. */ + public deprecated: boolean; + + /** EnumOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new EnumOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumOptions instance + */ + public static create(properties?: google.protobuf.IEnumOptions): google.protobuf.EnumOptions; + + /** + * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @param message EnumOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @param message EnumOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumOptions; + + /** + * Decodes an EnumOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumOptions; + + /** + * Verifies an EnumOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumOptions; + + /** + * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. + * @param message EnumOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnumValueOptions. */ + interface IEnumValueOptions { + + /** EnumValueOptions deprecated */ + deprecated?: (boolean|null); + + /** EnumValueOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an EnumValueOptions. */ + class EnumValueOptions implements IEnumValueOptions { + + /** + * Constructs a new EnumValueOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumValueOptions); + + /** EnumValueOptions deprecated. */ + public deprecated: boolean; + + /** EnumValueOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new EnumValueOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumValueOptions instance + */ + public static create(properties?: google.protobuf.IEnumValueOptions): google.protobuf.EnumValueOptions; + + /** + * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @param message EnumValueOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @param message EnumValueOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueOptions; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueOptions; + + /** + * Verifies an EnumValueOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumValueOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueOptions; + + /** + * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. + * @param message EnumValueOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumValueOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumValueOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumValueOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceOptions. */ + interface IServiceOptions { + + /** ServiceOptions deprecated */ + deprecated?: (boolean|null); + + /** ServiceOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** ServiceOptions .google.api.defaultHost */ + ".google.api.defaultHost"?: (string|null); + + /** ServiceOptions .google.api.oauthScopes */ + ".google.api.oauthScopes"?: (string|null); + } + + /** Represents a ServiceOptions. */ + class ServiceOptions implements IServiceOptions { + + /** + * Constructs a new ServiceOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceOptions); + + /** ServiceOptions deprecated. */ + public deprecated: boolean; + + /** ServiceOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new ServiceOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceOptions instance + */ + public static create(properties?: google.protobuf.IServiceOptions): google.protobuf.ServiceOptions; + + /** + * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @param message ServiceOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @param message ServiceOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceOptions; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceOptions; + + /** + * Verifies a ServiceOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceOptions; + + /** + * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. + * @param message ServiceOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ServiceOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ServiceOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MethodOptions. */ + interface IMethodOptions { + + /** MethodOptions deprecated */ + deprecated?: (boolean|null); + + /** MethodOptions idempotencyLevel */ + idempotencyLevel?: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel|null); + + /** MethodOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** MethodOptions .google.api.http */ + ".google.api.http"?: (google.api.IHttpRule|null); + + /** MethodOptions .google.api.methodSignature */ + ".google.api.methodSignature"?: (string[]|null); + } + + /** Represents a MethodOptions. */ + class MethodOptions implements IMethodOptions { + + /** + * Constructs a new MethodOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMethodOptions); + + /** MethodOptions deprecated. */ + public deprecated: boolean; + + /** MethodOptions idempotencyLevel. */ + public idempotencyLevel: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel); + + /** MethodOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new MethodOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodOptions instance + */ + public static create(properties?: google.protobuf.IMethodOptions): google.protobuf.MethodOptions; + + /** + * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @param message MethodOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @param message MethodOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodOptions; + + /** + * Decodes a MethodOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodOptions; + + /** + * Verifies a MethodOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MethodOptions; + + /** + * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. + * @param message MethodOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MethodOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MethodOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace MethodOptions { + + /** IdempotencyLevel enum. */ + enum IdempotencyLevel { + IDEMPOTENCY_UNKNOWN = 0, + NO_SIDE_EFFECTS = 1, + IDEMPOTENT = 2 + } + } + + /** Properties of an UninterpretedOption. */ + interface IUninterpretedOption { + + /** UninterpretedOption name */ + name?: (google.protobuf.UninterpretedOption.INamePart[]|null); + + /** UninterpretedOption identifierValue */ + identifierValue?: (string|null); + + /** UninterpretedOption positiveIntValue */ + positiveIntValue?: (number|Long|string|null); + + /** UninterpretedOption negativeIntValue */ + negativeIntValue?: (number|Long|string|null); + + /** UninterpretedOption doubleValue */ + doubleValue?: (number|null); + + /** UninterpretedOption stringValue */ + stringValue?: (Uint8Array|string|null); + + /** UninterpretedOption aggregateValue */ + aggregateValue?: (string|null); + } + + /** Represents an UninterpretedOption. */ + class UninterpretedOption implements IUninterpretedOption { + + /** + * Constructs a new UninterpretedOption. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IUninterpretedOption); + + /** UninterpretedOption name. */ + public name: google.protobuf.UninterpretedOption.INamePart[]; + + /** UninterpretedOption identifierValue. */ + public identifierValue: string; + + /** UninterpretedOption positiveIntValue. */ + public positiveIntValue: (number|Long|string); + + /** UninterpretedOption negativeIntValue. */ + public negativeIntValue: (number|Long|string); + + /** UninterpretedOption doubleValue. */ + public doubleValue: number; + + /** UninterpretedOption stringValue. */ + public stringValue: (Uint8Array|string); + + /** UninterpretedOption aggregateValue. */ + public aggregateValue: string; + + /** + * Creates a new UninterpretedOption instance using the specified properties. + * @param [properties] Properties to set + * @returns UninterpretedOption instance + */ + public static create(properties?: google.protobuf.IUninterpretedOption): google.protobuf.UninterpretedOption; + + /** + * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @param message UninterpretedOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @param message UninterpretedOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption; + + /** + * Verifies an UninterpretedOption message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UninterpretedOption + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption; + + /** + * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. + * @param message UninterpretedOption + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UninterpretedOption, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UninterpretedOption to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UninterpretedOption + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace UninterpretedOption { + + /** Properties of a NamePart. */ + interface INamePart { + + /** NamePart namePart */ + namePart: string; + + /** NamePart isExtension */ + isExtension: boolean; + } + + /** Represents a NamePart. */ + class NamePart implements INamePart { + + /** + * Constructs a new NamePart. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.UninterpretedOption.INamePart); + + /** NamePart namePart. */ + public namePart: string; + + /** NamePart isExtension. */ + public isExtension: boolean; + + /** + * Creates a new NamePart instance using the specified properties. + * @param [properties] Properties to set + * @returns NamePart instance + */ + public static create(properties?: google.protobuf.UninterpretedOption.INamePart): google.protobuf.UninterpretedOption.NamePart; + + /** + * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @param message NamePart message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @param message NamePart message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NamePart message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption.NamePart; + + /** + * Decodes a NamePart message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption.NamePart; + + /** + * Verifies a NamePart message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NamePart message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NamePart + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption.NamePart; + + /** + * Creates a plain object from a NamePart message. Also converts values to other types if specified. + * @param message NamePart + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UninterpretedOption.NamePart, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NamePart to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NamePart + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a SourceCodeInfo. */ + interface ISourceCodeInfo { + + /** SourceCodeInfo location */ + location?: (google.protobuf.SourceCodeInfo.ILocation[]|null); + } + + /** Represents a SourceCodeInfo. */ + class SourceCodeInfo implements ISourceCodeInfo { + + /** + * Constructs a new SourceCodeInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ISourceCodeInfo); + + /** SourceCodeInfo location. */ + public location: google.protobuf.SourceCodeInfo.ILocation[]; + + /** + * Creates a new SourceCodeInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns SourceCodeInfo instance + */ + public static create(properties?: google.protobuf.ISourceCodeInfo): google.protobuf.SourceCodeInfo; + + /** + * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @param message SourceCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @param message SourceCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo; + + /** + * Verifies a SourceCodeInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SourceCodeInfo + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo; + + /** + * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. + * @param message SourceCodeInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.SourceCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SourceCodeInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SourceCodeInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SourceCodeInfo { + + /** Properties of a Location. */ + interface ILocation { + + /** Location path */ + path?: (number[]|null); + + /** Location span */ + span?: (number[]|null); + + /** Location leadingComments */ + leadingComments?: (string|null); + + /** Location trailingComments */ + trailingComments?: (string|null); + + /** Location leadingDetachedComments */ + leadingDetachedComments?: (string[]|null); + } + + /** Represents a Location. */ + class Location implements ILocation { + + /** + * Constructs a new Location. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.SourceCodeInfo.ILocation); + + /** Location path. */ + public path: number[]; + + /** Location span. */ + public span: number[]; + + /** Location leadingComments. */ + public leadingComments: string; + + /** Location trailingComments. */ + public trailingComments: string; + + /** Location leadingDetachedComments. */ + public leadingDetachedComments: string[]; + + /** + * Creates a new Location instance using the specified properties. + * @param [properties] Properties to set + * @returns Location instance + */ + public static create(properties?: google.protobuf.SourceCodeInfo.ILocation): google.protobuf.SourceCodeInfo.Location; + + /** + * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @param message Location message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @param message Location message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Location message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo.Location; + + /** + * Decodes a Location message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo.Location; + + /** + * Verifies a Location message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Location message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Location + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo.Location; + + /** + * Creates a plain object from a Location message. Also converts values to other types if specified. + * @param message Location + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.SourceCodeInfo.Location, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Location to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Location + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a GeneratedCodeInfo. */ + interface IGeneratedCodeInfo { + + /** GeneratedCodeInfo annotation */ + annotation?: (google.protobuf.GeneratedCodeInfo.IAnnotation[]|null); + } + + /** Represents a GeneratedCodeInfo. */ + class GeneratedCodeInfo implements IGeneratedCodeInfo { + + /** + * Constructs a new GeneratedCodeInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IGeneratedCodeInfo); + + /** GeneratedCodeInfo annotation. */ + public annotation: google.protobuf.GeneratedCodeInfo.IAnnotation[]; + + /** + * Creates a new GeneratedCodeInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns GeneratedCodeInfo instance + */ + public static create(properties?: google.protobuf.IGeneratedCodeInfo): google.protobuf.GeneratedCodeInfo; + + /** + * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @param message GeneratedCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @param message GeneratedCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo; + + /** + * Verifies a GeneratedCodeInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GeneratedCodeInfo + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo; + + /** + * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. + * @param message GeneratedCodeInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.GeneratedCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GeneratedCodeInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GeneratedCodeInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace GeneratedCodeInfo { + + /** Properties of an Annotation. */ + interface IAnnotation { + + /** Annotation path */ + path?: (number[]|null); + + /** Annotation sourceFile */ + sourceFile?: (string|null); + + /** Annotation begin */ + begin?: (number|null); + + /** Annotation end */ + end?: (number|null); + + /** Annotation semantic */ + semantic?: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null); + } + + /** Represents an Annotation. */ + class Annotation implements IAnnotation { + + /** + * Constructs a new Annotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation); + + /** Annotation path. */ + public path: number[]; + + /** Annotation sourceFile. */ + public sourceFile: string; + + /** Annotation begin. */ + public begin: number; + + /** Annotation end. */ + public end: number; + + /** Annotation semantic. */ + public semantic: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic); + + /** + * Creates a new Annotation instance using the specified properties. + * @param [properties] Properties to set + * @returns Annotation instance + */ + public static create(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @param message Annotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @param message Annotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Annotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Decodes an Annotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Verifies an Annotation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Annotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Annotation + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Creates a plain object from an Annotation message. Also converts values to other types if specified. + * @param message Annotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.GeneratedCodeInfo.Annotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Annotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Annotation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Annotation { + + /** Semantic enum. */ + enum Semantic { + NONE = 0, + SET = 1, + ALIAS = 2 + } + } + } + + /** Properties of 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 Struct. */ + interface IStruct { + + /** Struct fields */ + fields?: ({ [k: string]: google.protobuf.IValue }|null); + } + + /** Represents a Struct. */ + class Struct implements IStruct { + + /** + * Constructs a new Struct. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IStruct); + + /** Struct fields. */ + public fields: { [k: string]: google.protobuf.IValue }; + + /** + * Creates a new Struct instance using the specified properties. + * @param [properties] Properties to set + * @returns Struct instance + */ + public static create(properties?: google.protobuf.IStruct): google.protobuf.Struct; + + /** + * Encodes the specified Struct message. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. + * @param message Struct message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IStruct, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Struct message, length delimited. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. + * @param message Struct message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IStruct, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Struct message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Struct + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Struct; + + /** + * Decodes a Struct message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Struct + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Struct; + + /** + * Verifies a Struct message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Struct message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Struct + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Struct; + + /** + * Creates a plain object from a Struct message. Also converts values to other types if specified. + * @param message Struct + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Struct, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Struct to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Struct + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Value. */ + interface IValue { + + /** Value nullValue */ + nullValue?: (google.protobuf.NullValue|keyof typeof google.protobuf.NullValue|null); + + /** Value numberValue */ + numberValue?: (number|null); + + /** Value stringValue */ + stringValue?: (string|null); + + /** Value boolValue */ + boolValue?: (boolean|null); + + /** Value structValue */ + structValue?: (google.protobuf.IStruct|null); + + /** Value listValue */ + listValue?: (google.protobuf.IListValue|null); + } + + /** Represents a Value. */ + class Value implements IValue { + + /** + * Constructs a new Value. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IValue); + + /** Value nullValue. */ + public nullValue?: (google.protobuf.NullValue|keyof typeof google.protobuf.NullValue|null); + + /** Value numberValue. */ + public numberValue?: (number|null); + + /** Value stringValue. */ + public stringValue?: (string|null); + + /** Value boolValue. */ + public boolValue?: (boolean|null); + + /** Value structValue. */ + public structValue?: (google.protobuf.IStruct|null); + + /** Value listValue. */ + public listValue?: (google.protobuf.IListValue|null); + + /** Value kind. */ + public kind?: ("nullValue"|"numberValue"|"stringValue"|"boolValue"|"structValue"|"listValue"); + + /** + * Creates a new Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Value instance + */ + public static create(properties?: google.protobuf.IValue): google.protobuf.Value; + + /** + * Encodes the specified Value message. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. + * @param message Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Value message, length delimited. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. + * @param message Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Value message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Value; + + /** + * Decodes a Value message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Value; + + /** + * Verifies a Value message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Value message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Value + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Value; + + /** + * Creates a plain object from a Value message. Also converts values to other types if specified. + * @param message Value + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Value to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** NullValue enum. */ + enum NullValue { + NULL_VALUE = 0 + } + + /** Properties of a ListValue. */ + interface IListValue { + + /** ListValue values */ + values?: (google.protobuf.IValue[]|null); + } + + /** Represents a ListValue. */ + class ListValue implements IListValue { + + /** + * Constructs a new ListValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IListValue); + + /** ListValue values. */ + public values: google.protobuf.IValue[]; + + /** + * Creates a new ListValue instance using the specified properties. + * @param [properties] Properties to set + * @returns ListValue instance + */ + public static create(properties?: google.protobuf.IListValue): google.protobuf.ListValue; + + /** + * Encodes the specified ListValue message. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. + * @param message ListValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IListValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListValue message, length delimited. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. + * @param message ListValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IListValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ListValue; + + /** + * Decodes a ListValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ListValue; + + /** + * Verifies a ListValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ListValue; + + /** + * Creates a plain object from a ListValue message. Also converts values to other types if specified. + * @param message ListValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ListValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Duration. */ + interface IDuration { + + /** Duration seconds */ + seconds?: (number|Long|string|null); + + /** Duration nanos */ + nanos?: (number|null); + } + + /** Represents a Duration. */ + class Duration implements IDuration { + + /** + * Constructs a new Duration. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IDuration); + + /** Duration seconds. */ + public seconds: (number|Long|string); + + /** Duration nanos. */ + public nanos: number; + + /** + * Creates a new Duration instance using the specified properties. + * @param [properties] Properties to set + * @returns Duration instance + */ + public static create(properties?: google.protobuf.IDuration): google.protobuf.Duration; + + /** + * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @param message Duration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @param message Duration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Duration; + + /** + * Decodes a Duration message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Duration; + + /** + * Verifies a Duration message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Duration message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Duration + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Duration; + + /** + * Creates a plain object from a Duration message. Also converts values to other types if specified. + * @param message Duration + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Duration, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Duration to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Duration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Timestamp. */ + interface ITimestamp { + + /** Timestamp seconds */ + seconds?: (number|Long|string|null); + + /** Timestamp nanos */ + nanos?: (number|null); + } + + /** Represents a Timestamp. */ + class Timestamp implements ITimestamp { + + /** + * Constructs a new Timestamp. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ITimestamp); + + /** Timestamp seconds. */ + public seconds: (number|Long|string); + + /** Timestamp nanos. */ + public nanos: number; + + /** + * Creates a new Timestamp instance using the specified properties. + * @param [properties] Properties to set + * @returns Timestamp instance + */ + public static create(properties?: google.protobuf.ITimestamp): google.protobuf.Timestamp; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @param message Timestamp message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @param message Timestamp message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Timestamp; + + /** + * Decodes a Timestamp message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Timestamp; + + /** + * Verifies a Timestamp message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Timestamp + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Timestamp; + + /** + * Creates a plain object from a Timestamp message. Also converts values to other types if specified. + * @param message Timestamp + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Timestamp, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Timestamp to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Timestamp + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace rpc. */ + namespace rpc { + + /** Properties of a Status. */ + interface IStatus { + + /** Status code */ + code?: (number|null); + + /** Status message */ + message?: (string|null); + + /** Status details */ + details?: (google.protobuf.IAny[]|null); + } + + /** Represents a Status. */ + class Status implements IStatus { + + /** + * Constructs a new Status. + * @param [properties] Properties to set + */ + constructor(properties?: google.rpc.IStatus); + + /** Status code. */ + public code: number; + + /** Status message. */ + public message: string; + + /** Status details. */ + public details: google.protobuf.IAny[]; + + /** + * Creates a new Status instance using the specified properties. + * @param [properties] Properties to set + * @returns Status instance + */ + public static create(properties?: google.rpc.IStatus): google.rpc.Status; + + /** + * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @param message Status message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @param message Status message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Status message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.rpc.Status; + + /** + * Decodes a Status message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.rpc.Status; + + /** + * Verifies a Status message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Status message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Status + */ + public static fromObject(object: { [k: string]: any }): google.rpc.Status; + + /** + * Creates a plain object from a Status message. Also converts values to other types if specified. + * @param message Status + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.rpc.Status, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Status to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Status + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } +} diff --git a/packages/google-dataflow/protos/protos.js b/packages/google-dataflow/protos/protos.js new file mode 100644 index 00000000000..214e46739d1 --- /dev/null +++ b/packages/google-dataflow/protos/protos.js @@ -0,0 +1,44806 @@ +// 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_dataflow_protos || ($protobuf.roots._google_cloud_dataflow_protos = {}); + + $root.google = (function() { + + /** + * Namespace google. + * @exports google + * @namespace + */ + var google = {}; + + google.dataflow = (function() { + + /** + * Namespace dataflow. + * @memberof google + * @namespace + */ + var dataflow = {}; + + dataflow.v1beta3 = (function() { + + /** + * Namespace v1beta3. + * @memberof google.dataflow + * @namespace + */ + var v1beta3 = {}; + + v1beta3.Environment = (function() { + + /** + * Properties of an Environment. + * @memberof google.dataflow.v1beta3 + * @interface IEnvironment + * @property {string|null} [tempStoragePrefix] Environment tempStoragePrefix + * @property {string|null} [clusterManagerApiService] Environment clusterManagerApiService + * @property {Array.|null} [experiments] Environment experiments + * @property {Array.|null} [serviceOptions] Environment serviceOptions + * @property {string|null} [serviceKmsKeyName] Environment serviceKmsKeyName + * @property {Array.|null} [workerPools] Environment workerPools + * @property {google.protobuf.IStruct|null} [userAgent] Environment userAgent + * @property {google.protobuf.IStruct|null} [version] Environment version + * @property {string|null} [dataset] Environment dataset + * @property {google.protobuf.IStruct|null} [sdkPipelineOptions] Environment sdkPipelineOptions + * @property {google.protobuf.IAny|null} [internalExperiments] Environment internalExperiments + * @property {string|null} [serviceAccountEmail] Environment serviceAccountEmail + * @property {google.dataflow.v1beta3.FlexResourceSchedulingGoal|null} [flexResourceSchedulingGoal] Environment flexResourceSchedulingGoal + * @property {string|null} [workerRegion] Environment workerRegion + * @property {string|null} [workerZone] Environment workerZone + * @property {google.dataflow.v1beta3.ShuffleMode|null} [shuffleMode] Environment shuffleMode + * @property {google.dataflow.v1beta3.IDebugOptions|null} [debugOptions] Environment debugOptions + */ + + /** + * Constructs a new Environment. + * @memberof google.dataflow.v1beta3 + * @classdesc Represents an Environment. + * @implements IEnvironment + * @constructor + * @param {google.dataflow.v1beta3.IEnvironment=} [properties] Properties to set + */ + function Environment(properties) { + this.experiments = []; + this.serviceOptions = []; + this.workerPools = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Environment tempStoragePrefix. + * @member {string} tempStoragePrefix + * @memberof google.dataflow.v1beta3.Environment + * @instance + */ + Environment.prototype.tempStoragePrefix = ""; + + /** + * Environment clusterManagerApiService. + * @member {string} clusterManagerApiService + * @memberof google.dataflow.v1beta3.Environment + * @instance + */ + Environment.prototype.clusterManagerApiService = ""; + + /** + * Environment experiments. + * @member {Array.} experiments + * @memberof google.dataflow.v1beta3.Environment + * @instance + */ + Environment.prototype.experiments = $util.emptyArray; + + /** + * Environment serviceOptions. + * @member {Array.} serviceOptions + * @memberof google.dataflow.v1beta3.Environment + * @instance + */ + Environment.prototype.serviceOptions = $util.emptyArray; + + /** + * Environment serviceKmsKeyName. + * @member {string} serviceKmsKeyName + * @memberof google.dataflow.v1beta3.Environment + * @instance + */ + Environment.prototype.serviceKmsKeyName = ""; + + /** + * Environment workerPools. + * @member {Array.} workerPools + * @memberof google.dataflow.v1beta3.Environment + * @instance + */ + Environment.prototype.workerPools = $util.emptyArray; + + /** + * Environment userAgent. + * @member {google.protobuf.IStruct|null|undefined} userAgent + * @memberof google.dataflow.v1beta3.Environment + * @instance + */ + Environment.prototype.userAgent = null; + + /** + * Environment version. + * @member {google.protobuf.IStruct|null|undefined} version + * @memberof google.dataflow.v1beta3.Environment + * @instance + */ + Environment.prototype.version = null; + + /** + * Environment dataset. + * @member {string} dataset + * @memberof google.dataflow.v1beta3.Environment + * @instance + */ + Environment.prototype.dataset = ""; + + /** + * Environment sdkPipelineOptions. + * @member {google.protobuf.IStruct|null|undefined} sdkPipelineOptions + * @memberof google.dataflow.v1beta3.Environment + * @instance + */ + Environment.prototype.sdkPipelineOptions = null; + + /** + * Environment internalExperiments. + * @member {google.protobuf.IAny|null|undefined} internalExperiments + * @memberof google.dataflow.v1beta3.Environment + * @instance + */ + Environment.prototype.internalExperiments = null; + + /** + * Environment serviceAccountEmail. + * @member {string} serviceAccountEmail + * @memberof google.dataflow.v1beta3.Environment + * @instance + */ + Environment.prototype.serviceAccountEmail = ""; + + /** + * Environment flexResourceSchedulingGoal. + * @member {google.dataflow.v1beta3.FlexResourceSchedulingGoal} flexResourceSchedulingGoal + * @memberof google.dataflow.v1beta3.Environment + * @instance + */ + Environment.prototype.flexResourceSchedulingGoal = 0; + + /** + * Environment workerRegion. + * @member {string} workerRegion + * @memberof google.dataflow.v1beta3.Environment + * @instance + */ + Environment.prototype.workerRegion = ""; + + /** + * Environment workerZone. + * @member {string} workerZone + * @memberof google.dataflow.v1beta3.Environment + * @instance + */ + Environment.prototype.workerZone = ""; + + /** + * Environment shuffleMode. + * @member {google.dataflow.v1beta3.ShuffleMode} shuffleMode + * @memberof google.dataflow.v1beta3.Environment + * @instance + */ + Environment.prototype.shuffleMode = 0; + + /** + * Environment debugOptions. + * @member {google.dataflow.v1beta3.IDebugOptions|null|undefined} debugOptions + * @memberof google.dataflow.v1beta3.Environment + * @instance + */ + Environment.prototype.debugOptions = null; + + /** + * Creates a new Environment instance using the specified properties. + * @function create + * @memberof google.dataflow.v1beta3.Environment + * @static + * @param {google.dataflow.v1beta3.IEnvironment=} [properties] Properties to set + * @returns {google.dataflow.v1beta3.Environment} Environment instance + */ + Environment.create = function create(properties) { + return new Environment(properties); + }; + + /** + * Encodes the specified Environment message. Does not implicitly {@link google.dataflow.v1beta3.Environment.verify|verify} messages. + * @function encode + * @memberof google.dataflow.v1beta3.Environment + * @static + * @param {google.dataflow.v1beta3.IEnvironment} message Environment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Environment.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tempStoragePrefix != null && Object.hasOwnProperty.call(message, "tempStoragePrefix")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.tempStoragePrefix); + if (message.clusterManagerApiService != null && Object.hasOwnProperty.call(message, "clusterManagerApiService")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.clusterManagerApiService); + if (message.experiments != null && message.experiments.length) + for (var i = 0; i < message.experiments.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.experiments[i]); + if (message.workerPools != null && message.workerPools.length) + for (var i = 0; i < message.workerPools.length; ++i) + $root.google.dataflow.v1beta3.WorkerPool.encode(message.workerPools[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.userAgent != null && Object.hasOwnProperty.call(message, "userAgent")) + $root.google.protobuf.Struct.encode(message.userAgent, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + $root.google.protobuf.Struct.encode(message.version, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.dataset != null && Object.hasOwnProperty.call(message, "dataset")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.dataset); + if (message.sdkPipelineOptions != null && Object.hasOwnProperty.call(message, "sdkPipelineOptions")) + $root.google.protobuf.Struct.encode(message.sdkPipelineOptions, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.internalExperiments != null && Object.hasOwnProperty.call(message, "internalExperiments")) + $root.google.protobuf.Any.encode(message.internalExperiments, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.serviceAccountEmail != null && Object.hasOwnProperty.call(message, "serviceAccountEmail")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.serviceAccountEmail); + if (message.flexResourceSchedulingGoal != null && Object.hasOwnProperty.call(message, "flexResourceSchedulingGoal")) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.flexResourceSchedulingGoal); + if (message.serviceKmsKeyName != null && Object.hasOwnProperty.call(message, "serviceKmsKeyName")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.serviceKmsKeyName); + if (message.workerRegion != null && Object.hasOwnProperty.call(message, "workerRegion")) + writer.uint32(/* id 13, wireType 2 =*/106).string(message.workerRegion); + if (message.workerZone != null && Object.hasOwnProperty.call(message, "workerZone")) + writer.uint32(/* id 14, wireType 2 =*/114).string(message.workerZone); + if (message.shuffleMode != null && Object.hasOwnProperty.call(message, "shuffleMode")) + writer.uint32(/* id 15, wireType 0 =*/120).int32(message.shuffleMode); + if (message.serviceOptions != null && message.serviceOptions.length) + for (var i = 0; i < message.serviceOptions.length; ++i) + writer.uint32(/* id 16, wireType 2 =*/130).string(message.serviceOptions[i]); + if (message.debugOptions != null && Object.hasOwnProperty.call(message, "debugOptions")) + $root.google.dataflow.v1beta3.DebugOptions.encode(message.debugOptions, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Environment message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.Environment.verify|verify} messages. + * @function encodeDelimited + * @memberof google.dataflow.v1beta3.Environment + * @static + * @param {google.dataflow.v1beta3.IEnvironment} message Environment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Environment.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Environment message from the specified reader or buffer. + * @function decode + * @memberof google.dataflow.v1beta3.Environment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.dataflow.v1beta3.Environment} Environment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Environment.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.dataflow.v1beta3.Environment(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.tempStoragePrefix = reader.string(); + break; + } + case 2: { + message.clusterManagerApiService = reader.string(); + break; + } + case 3: { + if (!(message.experiments && message.experiments.length)) + message.experiments = []; + message.experiments.push(reader.string()); + break; + } + case 16: { + if (!(message.serviceOptions && message.serviceOptions.length)) + message.serviceOptions = []; + message.serviceOptions.push(reader.string()); + break; + } + case 12: { + message.serviceKmsKeyName = reader.string(); + break; + } + case 4: { + if (!(message.workerPools && message.workerPools.length)) + message.workerPools = []; + message.workerPools.push($root.google.dataflow.v1beta3.WorkerPool.decode(reader, reader.uint32())); + break; + } + case 5: { + message.userAgent = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + } + case 6: { + message.version = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + } + case 7: { + message.dataset = reader.string(); + break; + } + case 8: { + message.sdkPipelineOptions = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + } + case 9: { + message.internalExperiments = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + } + case 10: { + message.serviceAccountEmail = reader.string(); + break; + } + case 11: { + message.flexResourceSchedulingGoal = reader.int32(); + break; + } + case 13: { + message.workerRegion = reader.string(); + break; + } + case 14: { + message.workerZone = reader.string(); + break; + } + case 15: { + message.shuffleMode = reader.int32(); + break; + } + case 17: { + message.debugOptions = $root.google.dataflow.v1beta3.DebugOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Environment message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.dataflow.v1beta3.Environment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.dataflow.v1beta3.Environment} Environment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Environment.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Environment message. + * @function verify + * @memberof google.dataflow.v1beta3.Environment + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Environment.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tempStoragePrefix != null && message.hasOwnProperty("tempStoragePrefix")) + if (!$util.isString(message.tempStoragePrefix)) + return "tempStoragePrefix: string expected"; + if (message.clusterManagerApiService != null && message.hasOwnProperty("clusterManagerApiService")) + if (!$util.isString(message.clusterManagerApiService)) + return "clusterManagerApiService: string expected"; + if (message.experiments != null && message.hasOwnProperty("experiments")) { + if (!Array.isArray(message.experiments)) + return "experiments: array expected"; + for (var i = 0; i < message.experiments.length; ++i) + if (!$util.isString(message.experiments[i])) + return "experiments: string[] expected"; + } + if (message.serviceOptions != null && message.hasOwnProperty("serviceOptions")) { + if (!Array.isArray(message.serviceOptions)) + return "serviceOptions: array expected"; + for (var i = 0; i < message.serviceOptions.length; ++i) + if (!$util.isString(message.serviceOptions[i])) + return "serviceOptions: string[] expected"; + } + if (message.serviceKmsKeyName != null && message.hasOwnProperty("serviceKmsKeyName")) + if (!$util.isString(message.serviceKmsKeyName)) + return "serviceKmsKeyName: string expected"; + if (message.workerPools != null && message.hasOwnProperty("workerPools")) { + if (!Array.isArray(message.workerPools)) + return "workerPools: array expected"; + for (var i = 0; i < message.workerPools.length; ++i) { + var error = $root.google.dataflow.v1beta3.WorkerPool.verify(message.workerPools[i]); + if (error) + return "workerPools." + error; + } + } + if (message.userAgent != null && message.hasOwnProperty("userAgent")) { + var error = $root.google.protobuf.Struct.verify(message.userAgent); + if (error) + return "userAgent." + error; + } + if (message.version != null && message.hasOwnProperty("version")) { + var error = $root.google.protobuf.Struct.verify(message.version); + if (error) + return "version." + error; + } + if (message.dataset != null && message.hasOwnProperty("dataset")) + if (!$util.isString(message.dataset)) + return "dataset: string expected"; + if (message.sdkPipelineOptions != null && message.hasOwnProperty("sdkPipelineOptions")) { + var error = $root.google.protobuf.Struct.verify(message.sdkPipelineOptions); + if (error) + return "sdkPipelineOptions." + error; + } + if (message.internalExperiments != null && message.hasOwnProperty("internalExperiments")) { + var error = $root.google.protobuf.Any.verify(message.internalExperiments); + if (error) + return "internalExperiments." + error; + } + if (message.serviceAccountEmail != null && message.hasOwnProperty("serviceAccountEmail")) + if (!$util.isString(message.serviceAccountEmail)) + return "serviceAccountEmail: string expected"; + if (message.flexResourceSchedulingGoal != null && message.hasOwnProperty("flexResourceSchedulingGoal")) + switch (message.flexResourceSchedulingGoal) { + default: + return "flexResourceSchedulingGoal: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.workerRegion != null && message.hasOwnProperty("workerRegion")) + if (!$util.isString(message.workerRegion)) + return "workerRegion: string expected"; + if (message.workerZone != null && message.hasOwnProperty("workerZone")) + if (!$util.isString(message.workerZone)) + return "workerZone: string expected"; + if (message.shuffleMode != null && message.hasOwnProperty("shuffleMode")) + switch (message.shuffleMode) { + default: + return "shuffleMode: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.debugOptions != null && message.hasOwnProperty("debugOptions")) { + var error = $root.google.dataflow.v1beta3.DebugOptions.verify(message.debugOptions); + if (error) + return "debugOptions." + error; + } + return null; + }; + + /** + * Creates an Environment message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.dataflow.v1beta3.Environment + * @static + * @param {Object.} object Plain object + * @returns {google.dataflow.v1beta3.Environment} Environment + */ + Environment.fromObject = function fromObject(object) { + if (object instanceof $root.google.dataflow.v1beta3.Environment) + return object; + var message = new $root.google.dataflow.v1beta3.Environment(); + if (object.tempStoragePrefix != null) + message.tempStoragePrefix = String(object.tempStoragePrefix); + if (object.clusterManagerApiService != null) + message.clusterManagerApiService = String(object.clusterManagerApiService); + if (object.experiments) { + if (!Array.isArray(object.experiments)) + throw TypeError(".google.dataflow.v1beta3.Environment.experiments: array expected"); + message.experiments = []; + for (var i = 0; i < object.experiments.length; ++i) + message.experiments[i] = String(object.experiments[i]); + } + if (object.serviceOptions) { + if (!Array.isArray(object.serviceOptions)) + throw TypeError(".google.dataflow.v1beta3.Environment.serviceOptions: array expected"); + message.serviceOptions = []; + for (var i = 0; i < object.serviceOptions.length; ++i) + message.serviceOptions[i] = String(object.serviceOptions[i]); + } + if (object.serviceKmsKeyName != null) + message.serviceKmsKeyName = String(object.serviceKmsKeyName); + if (object.workerPools) { + if (!Array.isArray(object.workerPools)) + throw TypeError(".google.dataflow.v1beta3.Environment.workerPools: array expected"); + message.workerPools = []; + for (var i = 0; i < object.workerPools.length; ++i) { + if (typeof object.workerPools[i] !== "object") + throw TypeError(".google.dataflow.v1beta3.Environment.workerPools: object expected"); + message.workerPools[i] = $root.google.dataflow.v1beta3.WorkerPool.fromObject(object.workerPools[i]); + } + } + if (object.userAgent != null) { + if (typeof object.userAgent !== "object") + throw TypeError(".google.dataflow.v1beta3.Environment.userAgent: object expected"); + message.userAgent = $root.google.protobuf.Struct.fromObject(object.userAgent); + } + if (object.version != null) { + if (typeof object.version !== "object") + throw TypeError(".google.dataflow.v1beta3.Environment.version: object expected"); + message.version = $root.google.protobuf.Struct.fromObject(object.version); + } + if (object.dataset != null) + message.dataset = String(object.dataset); + if (object.sdkPipelineOptions != null) { + if (typeof object.sdkPipelineOptions !== "object") + throw TypeError(".google.dataflow.v1beta3.Environment.sdkPipelineOptions: object expected"); + message.sdkPipelineOptions = $root.google.protobuf.Struct.fromObject(object.sdkPipelineOptions); + } + if (object.internalExperiments != null) { + if (typeof object.internalExperiments !== "object") + throw TypeError(".google.dataflow.v1beta3.Environment.internalExperiments: object expected"); + message.internalExperiments = $root.google.protobuf.Any.fromObject(object.internalExperiments); + } + if (object.serviceAccountEmail != null) + message.serviceAccountEmail = String(object.serviceAccountEmail); + switch (object.flexResourceSchedulingGoal) { + default: + if (typeof object.flexResourceSchedulingGoal === "number") { + message.flexResourceSchedulingGoal = object.flexResourceSchedulingGoal; + break; + } + break; + case "FLEXRS_UNSPECIFIED": + case 0: + message.flexResourceSchedulingGoal = 0; + break; + case "FLEXRS_SPEED_OPTIMIZED": + case 1: + message.flexResourceSchedulingGoal = 1; + break; + case "FLEXRS_COST_OPTIMIZED": + case 2: + message.flexResourceSchedulingGoal = 2; + break; + } + if (object.workerRegion != null) + message.workerRegion = String(object.workerRegion); + if (object.workerZone != null) + message.workerZone = String(object.workerZone); + switch (object.shuffleMode) { + default: + if (typeof object.shuffleMode === "number") { + message.shuffleMode = object.shuffleMode; + break; + } + break; + case "SHUFFLE_MODE_UNSPECIFIED": + case 0: + message.shuffleMode = 0; + break; + case "VM_BASED": + case 1: + message.shuffleMode = 1; + break; + case "SERVICE_BASED": + case 2: + message.shuffleMode = 2; + break; + } + if (object.debugOptions != null) { + if (typeof object.debugOptions !== "object") + throw TypeError(".google.dataflow.v1beta3.Environment.debugOptions: object expected"); + message.debugOptions = $root.google.dataflow.v1beta3.DebugOptions.fromObject(object.debugOptions); + } + return message; + }; + + /** + * Creates a plain object from an Environment message. Also converts values to other types if specified. + * @function toObject + * @memberof google.dataflow.v1beta3.Environment + * @static + * @param {google.dataflow.v1beta3.Environment} message Environment + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Environment.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.experiments = []; + object.workerPools = []; + object.serviceOptions = []; + } + if (options.defaults) { + object.tempStoragePrefix = ""; + object.clusterManagerApiService = ""; + object.userAgent = null; + object.version = null; + object.dataset = ""; + object.sdkPipelineOptions = null; + object.internalExperiments = null; + object.serviceAccountEmail = ""; + object.flexResourceSchedulingGoal = options.enums === String ? "FLEXRS_UNSPECIFIED" : 0; + object.serviceKmsKeyName = ""; + object.workerRegion = ""; + object.workerZone = ""; + object.shuffleMode = options.enums === String ? "SHUFFLE_MODE_UNSPECIFIED" : 0; + object.debugOptions = null; + } + if (message.tempStoragePrefix != null && message.hasOwnProperty("tempStoragePrefix")) + object.tempStoragePrefix = message.tempStoragePrefix; + if (message.clusterManagerApiService != null && message.hasOwnProperty("clusterManagerApiService")) + object.clusterManagerApiService = message.clusterManagerApiService; + if (message.experiments && message.experiments.length) { + object.experiments = []; + for (var j = 0; j < message.experiments.length; ++j) + object.experiments[j] = message.experiments[j]; + } + if (message.workerPools && message.workerPools.length) { + object.workerPools = []; + for (var j = 0; j < message.workerPools.length; ++j) + object.workerPools[j] = $root.google.dataflow.v1beta3.WorkerPool.toObject(message.workerPools[j], options); + } + if (message.userAgent != null && message.hasOwnProperty("userAgent")) + object.userAgent = $root.google.protobuf.Struct.toObject(message.userAgent, options); + if (message.version != null && message.hasOwnProperty("version")) + object.version = $root.google.protobuf.Struct.toObject(message.version, options); + if (message.dataset != null && message.hasOwnProperty("dataset")) + object.dataset = message.dataset; + if (message.sdkPipelineOptions != null && message.hasOwnProperty("sdkPipelineOptions")) + object.sdkPipelineOptions = $root.google.protobuf.Struct.toObject(message.sdkPipelineOptions, options); + if (message.internalExperiments != null && message.hasOwnProperty("internalExperiments")) + object.internalExperiments = $root.google.protobuf.Any.toObject(message.internalExperiments, options); + if (message.serviceAccountEmail != null && message.hasOwnProperty("serviceAccountEmail")) + object.serviceAccountEmail = message.serviceAccountEmail; + if (message.flexResourceSchedulingGoal != null && message.hasOwnProperty("flexResourceSchedulingGoal")) + object.flexResourceSchedulingGoal = options.enums === String ? $root.google.dataflow.v1beta3.FlexResourceSchedulingGoal[message.flexResourceSchedulingGoal] === undefined ? message.flexResourceSchedulingGoal : $root.google.dataflow.v1beta3.FlexResourceSchedulingGoal[message.flexResourceSchedulingGoal] : message.flexResourceSchedulingGoal; + if (message.serviceKmsKeyName != null && message.hasOwnProperty("serviceKmsKeyName")) + object.serviceKmsKeyName = message.serviceKmsKeyName; + if (message.workerRegion != null && message.hasOwnProperty("workerRegion")) + object.workerRegion = message.workerRegion; + if (message.workerZone != null && message.hasOwnProperty("workerZone")) + object.workerZone = message.workerZone; + if (message.shuffleMode != null && message.hasOwnProperty("shuffleMode")) + object.shuffleMode = options.enums === String ? $root.google.dataflow.v1beta3.ShuffleMode[message.shuffleMode] === undefined ? message.shuffleMode : $root.google.dataflow.v1beta3.ShuffleMode[message.shuffleMode] : message.shuffleMode; + if (message.serviceOptions && message.serviceOptions.length) { + object.serviceOptions = []; + for (var j = 0; j < message.serviceOptions.length; ++j) + object.serviceOptions[j] = message.serviceOptions[j]; + } + if (message.debugOptions != null && message.hasOwnProperty("debugOptions")) + object.debugOptions = $root.google.dataflow.v1beta3.DebugOptions.toObject(message.debugOptions, options); + return object; + }; + + /** + * Converts this Environment to JSON. + * @function toJSON + * @memberof google.dataflow.v1beta3.Environment + * @instance + * @returns {Object.} JSON object + */ + Environment.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Environment + * @function getTypeUrl + * @memberof google.dataflow.v1beta3.Environment + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Environment.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.dataflow.v1beta3.Environment"; + }; + + return Environment; + })(); + + v1beta3.Package = (function() { + + /** + * Properties of a Package. + * @memberof google.dataflow.v1beta3 + * @interface IPackage + * @property {string|null} [name] Package name + * @property {string|null} [location] Package location + */ + + /** + * Constructs a new Package. + * @memberof google.dataflow.v1beta3 + * @classdesc Represents a Package. + * @implements IPackage + * @constructor + * @param {google.dataflow.v1beta3.IPackage=} [properties] Properties to set + */ + function Package(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Package name. + * @member {string} name + * @memberof google.dataflow.v1beta3.Package + * @instance + */ + Package.prototype.name = ""; + + /** + * Package location. + * @member {string} location + * @memberof google.dataflow.v1beta3.Package + * @instance + */ + Package.prototype.location = ""; + + /** + * Creates a new Package instance using the specified properties. + * @function create + * @memberof google.dataflow.v1beta3.Package + * @static + * @param {google.dataflow.v1beta3.IPackage=} [properties] Properties to set + * @returns {google.dataflow.v1beta3.Package} Package instance + */ + Package.create = function create(properties) { + return new Package(properties); + }; + + /** + * Encodes the specified Package message. Does not implicitly {@link google.dataflow.v1beta3.Package.verify|verify} messages. + * @function encode + * @memberof google.dataflow.v1beta3.Package + * @static + * @param {google.dataflow.v1beta3.IPackage} message Package message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Package.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.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.location); + return writer; + }; + + /** + * Encodes the specified Package message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.Package.verify|verify} messages. + * @function encodeDelimited + * @memberof google.dataflow.v1beta3.Package + * @static + * @param {google.dataflow.v1beta3.IPackage} message Package message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Package.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Package message from the specified reader or buffer. + * @function decode + * @memberof google.dataflow.v1beta3.Package + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.dataflow.v1beta3.Package} Package + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Package.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.dataflow.v1beta3.Package(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.location = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Package message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.dataflow.v1beta3.Package + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.dataflow.v1beta3.Package} Package + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Package.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Package message. + * @function verify + * @memberof google.dataflow.v1beta3.Package + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Package.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.location != null && message.hasOwnProperty("location")) + if (!$util.isString(message.location)) + return "location: string expected"; + return null; + }; + + /** + * Creates a Package message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.dataflow.v1beta3.Package + * @static + * @param {Object.} object Plain object + * @returns {google.dataflow.v1beta3.Package} Package + */ + Package.fromObject = function fromObject(object) { + if (object instanceof $root.google.dataflow.v1beta3.Package) + return object; + var message = new $root.google.dataflow.v1beta3.Package(); + if (object.name != null) + message.name = String(object.name); + if (object.location != null) + message.location = String(object.location); + return message; + }; + + /** + * Creates a plain object from a Package message. Also converts values to other types if specified. + * @function toObject + * @memberof google.dataflow.v1beta3.Package + * @static + * @param {google.dataflow.v1beta3.Package} message Package + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Package.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.location = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + return object; + }; + + /** + * Converts this Package to JSON. + * @function toJSON + * @memberof google.dataflow.v1beta3.Package + * @instance + * @returns {Object.} JSON object + */ + Package.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Package + * @function getTypeUrl + * @memberof google.dataflow.v1beta3.Package + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Package.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.dataflow.v1beta3.Package"; + }; + + return Package; + })(); + + /** + * JobType enum. + * @name google.dataflow.v1beta3.JobType + * @enum {number} + * @property {number} JOB_TYPE_UNKNOWN=0 JOB_TYPE_UNKNOWN value + * @property {number} JOB_TYPE_BATCH=1 JOB_TYPE_BATCH value + * @property {number} JOB_TYPE_STREAMING=2 JOB_TYPE_STREAMING value + */ + v1beta3.JobType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "JOB_TYPE_UNKNOWN"] = 0; + values[valuesById[1] = "JOB_TYPE_BATCH"] = 1; + values[valuesById[2] = "JOB_TYPE_STREAMING"] = 2; + return values; + })(); + + /** + * FlexResourceSchedulingGoal enum. + * @name google.dataflow.v1beta3.FlexResourceSchedulingGoal + * @enum {number} + * @property {number} FLEXRS_UNSPECIFIED=0 FLEXRS_UNSPECIFIED value + * @property {number} FLEXRS_SPEED_OPTIMIZED=1 FLEXRS_SPEED_OPTIMIZED value + * @property {number} FLEXRS_COST_OPTIMIZED=2 FLEXRS_COST_OPTIMIZED value + */ + v1beta3.FlexResourceSchedulingGoal = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FLEXRS_UNSPECIFIED"] = 0; + values[valuesById[1] = "FLEXRS_SPEED_OPTIMIZED"] = 1; + values[valuesById[2] = "FLEXRS_COST_OPTIMIZED"] = 2; + return values; + })(); + + v1beta3.Disk = (function() { + + /** + * Properties of a Disk. + * @memberof google.dataflow.v1beta3 + * @interface IDisk + * @property {number|null} [sizeGb] Disk sizeGb + * @property {string|null} [diskType] Disk diskType + * @property {string|null} [mountPoint] Disk mountPoint + */ + + /** + * Constructs a new Disk. + * @memberof google.dataflow.v1beta3 + * @classdesc Represents a Disk. + * @implements IDisk + * @constructor + * @param {google.dataflow.v1beta3.IDisk=} [properties] Properties to set + */ + function Disk(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Disk sizeGb. + * @member {number} sizeGb + * @memberof google.dataflow.v1beta3.Disk + * @instance + */ + Disk.prototype.sizeGb = 0; + + /** + * Disk diskType. + * @member {string} diskType + * @memberof google.dataflow.v1beta3.Disk + * @instance + */ + Disk.prototype.diskType = ""; + + /** + * Disk mountPoint. + * @member {string} mountPoint + * @memberof google.dataflow.v1beta3.Disk + * @instance + */ + Disk.prototype.mountPoint = ""; + + /** + * Creates a new Disk instance using the specified properties. + * @function create + * @memberof google.dataflow.v1beta3.Disk + * @static + * @param {google.dataflow.v1beta3.IDisk=} [properties] Properties to set + * @returns {google.dataflow.v1beta3.Disk} Disk instance + */ + Disk.create = function create(properties) { + return new Disk(properties); + }; + + /** + * Encodes the specified Disk message. Does not implicitly {@link google.dataflow.v1beta3.Disk.verify|verify} messages. + * @function encode + * @memberof google.dataflow.v1beta3.Disk + * @static + * @param {google.dataflow.v1beta3.IDisk} message Disk message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Disk.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sizeGb != null && Object.hasOwnProperty.call(message, "sizeGb")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.sizeGb); + if (message.diskType != null && Object.hasOwnProperty.call(message, "diskType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.diskType); + if (message.mountPoint != null && Object.hasOwnProperty.call(message, "mountPoint")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.mountPoint); + return writer; + }; + + /** + * Encodes the specified Disk message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.Disk.verify|verify} messages. + * @function encodeDelimited + * @memberof google.dataflow.v1beta3.Disk + * @static + * @param {google.dataflow.v1beta3.IDisk} message Disk message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Disk.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Disk message from the specified reader or buffer. + * @function decode + * @memberof google.dataflow.v1beta3.Disk + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.dataflow.v1beta3.Disk} Disk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Disk.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.dataflow.v1beta3.Disk(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.sizeGb = reader.int32(); + break; + } + case 2: { + message.diskType = reader.string(); + break; + } + case 3: { + message.mountPoint = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Disk message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.dataflow.v1beta3.Disk + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.dataflow.v1beta3.Disk} Disk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Disk.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Disk message. + * @function verify + * @memberof google.dataflow.v1beta3.Disk + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Disk.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.sizeGb != null && message.hasOwnProperty("sizeGb")) + if (!$util.isInteger(message.sizeGb)) + return "sizeGb: integer expected"; + if (message.diskType != null && message.hasOwnProperty("diskType")) + if (!$util.isString(message.diskType)) + return "diskType: string expected"; + if (message.mountPoint != null && message.hasOwnProperty("mountPoint")) + if (!$util.isString(message.mountPoint)) + return "mountPoint: string expected"; + return null; + }; + + /** + * Creates a Disk message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.dataflow.v1beta3.Disk + * @static + * @param {Object.} object Plain object + * @returns {google.dataflow.v1beta3.Disk} Disk + */ + Disk.fromObject = function fromObject(object) { + if (object instanceof $root.google.dataflow.v1beta3.Disk) + return object; + var message = new $root.google.dataflow.v1beta3.Disk(); + if (object.sizeGb != null) + message.sizeGb = object.sizeGb | 0; + if (object.diskType != null) + message.diskType = String(object.diskType); + if (object.mountPoint != null) + message.mountPoint = String(object.mountPoint); + return message; + }; + + /** + * Creates a plain object from a Disk message. Also converts values to other types if specified. + * @function toObject + * @memberof google.dataflow.v1beta3.Disk + * @static + * @param {google.dataflow.v1beta3.Disk} message Disk + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Disk.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.sizeGb = 0; + object.diskType = ""; + object.mountPoint = ""; + } + if (message.sizeGb != null && message.hasOwnProperty("sizeGb")) + object.sizeGb = message.sizeGb; + if (message.diskType != null && message.hasOwnProperty("diskType")) + object.diskType = message.diskType; + if (message.mountPoint != null && message.hasOwnProperty("mountPoint")) + object.mountPoint = message.mountPoint; + return object; + }; + + /** + * Converts this Disk to JSON. + * @function toJSON + * @memberof google.dataflow.v1beta3.Disk + * @instance + * @returns {Object.} JSON object + */ + Disk.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Disk + * @function getTypeUrl + * @memberof google.dataflow.v1beta3.Disk + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Disk.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.dataflow.v1beta3.Disk"; + }; + + return Disk; + })(); + + v1beta3.WorkerSettings = (function() { + + /** + * Properties of a WorkerSettings. + * @memberof google.dataflow.v1beta3 + * @interface IWorkerSettings + * @property {string|null} [baseUrl] WorkerSettings baseUrl + * @property {boolean|null} [reportingEnabled] WorkerSettings reportingEnabled + * @property {string|null} [servicePath] WorkerSettings servicePath + * @property {string|null} [shuffleServicePath] WorkerSettings shuffleServicePath + * @property {string|null} [workerId] WorkerSettings workerId + * @property {string|null} [tempStoragePrefix] WorkerSettings tempStoragePrefix + */ + + /** + * Constructs a new WorkerSettings. + * @memberof google.dataflow.v1beta3 + * @classdesc Represents a WorkerSettings. + * @implements IWorkerSettings + * @constructor + * @param {google.dataflow.v1beta3.IWorkerSettings=} [properties] Properties to set + */ + function WorkerSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * WorkerSettings baseUrl. + * @member {string} baseUrl + * @memberof google.dataflow.v1beta3.WorkerSettings + * @instance + */ + WorkerSettings.prototype.baseUrl = ""; + + /** + * WorkerSettings reportingEnabled. + * @member {boolean} reportingEnabled + * @memberof google.dataflow.v1beta3.WorkerSettings + * @instance + */ + WorkerSettings.prototype.reportingEnabled = false; + + /** + * WorkerSettings servicePath. + * @member {string} servicePath + * @memberof google.dataflow.v1beta3.WorkerSettings + * @instance + */ + WorkerSettings.prototype.servicePath = ""; + + /** + * WorkerSettings shuffleServicePath. + * @member {string} shuffleServicePath + * @memberof google.dataflow.v1beta3.WorkerSettings + * @instance + */ + WorkerSettings.prototype.shuffleServicePath = ""; + + /** + * WorkerSettings workerId. + * @member {string} workerId + * @memberof google.dataflow.v1beta3.WorkerSettings + * @instance + */ + WorkerSettings.prototype.workerId = ""; + + /** + * WorkerSettings tempStoragePrefix. + * @member {string} tempStoragePrefix + * @memberof google.dataflow.v1beta3.WorkerSettings + * @instance + */ + WorkerSettings.prototype.tempStoragePrefix = ""; + + /** + * Creates a new WorkerSettings instance using the specified properties. + * @function create + * @memberof google.dataflow.v1beta3.WorkerSettings + * @static + * @param {google.dataflow.v1beta3.IWorkerSettings=} [properties] Properties to set + * @returns {google.dataflow.v1beta3.WorkerSettings} WorkerSettings instance + */ + WorkerSettings.create = function create(properties) { + return new WorkerSettings(properties); + }; + + /** + * Encodes the specified WorkerSettings message. Does not implicitly {@link google.dataflow.v1beta3.WorkerSettings.verify|verify} messages. + * @function encode + * @memberof google.dataflow.v1beta3.WorkerSettings + * @static + * @param {google.dataflow.v1beta3.IWorkerSettings} message WorkerSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WorkerSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.baseUrl != null && Object.hasOwnProperty.call(message, "baseUrl")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.baseUrl); + if (message.reportingEnabled != null && Object.hasOwnProperty.call(message, "reportingEnabled")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.reportingEnabled); + if (message.servicePath != null && Object.hasOwnProperty.call(message, "servicePath")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.servicePath); + if (message.shuffleServicePath != null && Object.hasOwnProperty.call(message, "shuffleServicePath")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.shuffleServicePath); + if (message.workerId != null && Object.hasOwnProperty.call(message, "workerId")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.workerId); + if (message.tempStoragePrefix != null && Object.hasOwnProperty.call(message, "tempStoragePrefix")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.tempStoragePrefix); + return writer; + }; + + /** + * Encodes the specified WorkerSettings message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.WorkerSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.dataflow.v1beta3.WorkerSettings + * @static + * @param {google.dataflow.v1beta3.IWorkerSettings} message WorkerSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WorkerSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WorkerSettings message from the specified reader or buffer. + * @function decode + * @memberof google.dataflow.v1beta3.WorkerSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.dataflow.v1beta3.WorkerSettings} WorkerSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WorkerSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.dataflow.v1beta3.WorkerSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.baseUrl = reader.string(); + break; + } + case 2: { + message.reportingEnabled = reader.bool(); + break; + } + case 3: { + message.servicePath = reader.string(); + break; + } + case 4: { + message.shuffleServicePath = reader.string(); + break; + } + case 5: { + message.workerId = reader.string(); + break; + } + case 6: { + message.tempStoragePrefix = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WorkerSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.dataflow.v1beta3.WorkerSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.dataflow.v1beta3.WorkerSettings} WorkerSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WorkerSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WorkerSettings message. + * @function verify + * @memberof google.dataflow.v1beta3.WorkerSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WorkerSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.baseUrl != null && message.hasOwnProperty("baseUrl")) + if (!$util.isString(message.baseUrl)) + return "baseUrl: string expected"; + if (message.reportingEnabled != null && message.hasOwnProperty("reportingEnabled")) + if (typeof message.reportingEnabled !== "boolean") + return "reportingEnabled: boolean expected"; + if (message.servicePath != null && message.hasOwnProperty("servicePath")) + if (!$util.isString(message.servicePath)) + return "servicePath: string expected"; + if (message.shuffleServicePath != null && message.hasOwnProperty("shuffleServicePath")) + if (!$util.isString(message.shuffleServicePath)) + return "shuffleServicePath: string expected"; + if (message.workerId != null && message.hasOwnProperty("workerId")) + if (!$util.isString(message.workerId)) + return "workerId: string expected"; + if (message.tempStoragePrefix != null && message.hasOwnProperty("tempStoragePrefix")) + if (!$util.isString(message.tempStoragePrefix)) + return "tempStoragePrefix: string expected"; + return null; + }; + + /** + * Creates a WorkerSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.dataflow.v1beta3.WorkerSettings + * @static + * @param {Object.} object Plain object + * @returns {google.dataflow.v1beta3.WorkerSettings} WorkerSettings + */ + WorkerSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.dataflow.v1beta3.WorkerSettings) + return object; + var message = new $root.google.dataflow.v1beta3.WorkerSettings(); + if (object.baseUrl != null) + message.baseUrl = String(object.baseUrl); + if (object.reportingEnabled != null) + message.reportingEnabled = Boolean(object.reportingEnabled); + if (object.servicePath != null) + message.servicePath = String(object.servicePath); + if (object.shuffleServicePath != null) + message.shuffleServicePath = String(object.shuffleServicePath); + if (object.workerId != null) + message.workerId = String(object.workerId); + if (object.tempStoragePrefix != null) + message.tempStoragePrefix = String(object.tempStoragePrefix); + return message; + }; + + /** + * Creates a plain object from a WorkerSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.dataflow.v1beta3.WorkerSettings + * @static + * @param {google.dataflow.v1beta3.WorkerSettings} message WorkerSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WorkerSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.baseUrl = ""; + object.reportingEnabled = false; + object.servicePath = ""; + object.shuffleServicePath = ""; + object.workerId = ""; + object.tempStoragePrefix = ""; + } + if (message.baseUrl != null && message.hasOwnProperty("baseUrl")) + object.baseUrl = message.baseUrl; + if (message.reportingEnabled != null && message.hasOwnProperty("reportingEnabled")) + object.reportingEnabled = message.reportingEnabled; + if (message.servicePath != null && message.hasOwnProperty("servicePath")) + object.servicePath = message.servicePath; + if (message.shuffleServicePath != null && message.hasOwnProperty("shuffleServicePath")) + object.shuffleServicePath = message.shuffleServicePath; + if (message.workerId != null && message.hasOwnProperty("workerId")) + object.workerId = message.workerId; + if (message.tempStoragePrefix != null && message.hasOwnProperty("tempStoragePrefix")) + object.tempStoragePrefix = message.tempStoragePrefix; + return object; + }; + + /** + * Converts this WorkerSettings to JSON. + * @function toJSON + * @memberof google.dataflow.v1beta3.WorkerSettings + * @instance + * @returns {Object.} JSON object + */ + WorkerSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for WorkerSettings + * @function getTypeUrl + * @memberof google.dataflow.v1beta3.WorkerSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WorkerSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.dataflow.v1beta3.WorkerSettings"; + }; + + return WorkerSettings; + })(); + + v1beta3.TaskRunnerSettings = (function() { + + /** + * Properties of a TaskRunnerSettings. + * @memberof google.dataflow.v1beta3 + * @interface ITaskRunnerSettings + * @property {string|null} [taskUser] TaskRunnerSettings taskUser + * @property {string|null} [taskGroup] TaskRunnerSettings taskGroup + * @property {Array.|null} [oauthScopes] TaskRunnerSettings oauthScopes + * @property {string|null} [baseUrl] TaskRunnerSettings baseUrl + * @property {string|null} [dataflowApiVersion] TaskRunnerSettings dataflowApiVersion + * @property {google.dataflow.v1beta3.IWorkerSettings|null} [parallelWorkerSettings] TaskRunnerSettings parallelWorkerSettings + * @property {string|null} [baseTaskDir] TaskRunnerSettings baseTaskDir + * @property {boolean|null} [continueOnException] TaskRunnerSettings continueOnException + * @property {boolean|null} [logToSerialconsole] TaskRunnerSettings logToSerialconsole + * @property {boolean|null} [alsologtostderr] TaskRunnerSettings alsologtostderr + * @property {string|null} [logUploadLocation] TaskRunnerSettings logUploadLocation + * @property {string|null} [logDir] TaskRunnerSettings logDir + * @property {string|null} [tempStoragePrefix] TaskRunnerSettings tempStoragePrefix + * @property {string|null} [harnessCommand] TaskRunnerSettings harnessCommand + * @property {string|null} [workflowFileName] TaskRunnerSettings workflowFileName + * @property {string|null} [commandlinesFileName] TaskRunnerSettings commandlinesFileName + * @property {string|null} [vmId] TaskRunnerSettings vmId + * @property {string|null} [languageHint] TaskRunnerSettings languageHint + * @property {string|null} [streamingWorkerMainClass] TaskRunnerSettings streamingWorkerMainClass + */ + + /** + * Constructs a new TaskRunnerSettings. + * @memberof google.dataflow.v1beta3 + * @classdesc Represents a TaskRunnerSettings. + * @implements ITaskRunnerSettings + * @constructor + * @param {google.dataflow.v1beta3.ITaskRunnerSettings=} [properties] Properties to set + */ + function TaskRunnerSettings(properties) { + this.oauthScopes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TaskRunnerSettings taskUser. + * @member {string} taskUser + * @memberof google.dataflow.v1beta3.TaskRunnerSettings + * @instance + */ + TaskRunnerSettings.prototype.taskUser = ""; + + /** + * TaskRunnerSettings taskGroup. + * @member {string} taskGroup + * @memberof google.dataflow.v1beta3.TaskRunnerSettings + * @instance + */ + TaskRunnerSettings.prototype.taskGroup = ""; + + /** + * TaskRunnerSettings oauthScopes. + * @member {Array.} oauthScopes + * @memberof google.dataflow.v1beta3.TaskRunnerSettings + * @instance + */ + TaskRunnerSettings.prototype.oauthScopes = $util.emptyArray; + + /** + * TaskRunnerSettings baseUrl. + * @member {string} baseUrl + * @memberof google.dataflow.v1beta3.TaskRunnerSettings + * @instance + */ + TaskRunnerSettings.prototype.baseUrl = ""; + + /** + * TaskRunnerSettings dataflowApiVersion. + * @member {string} dataflowApiVersion + * @memberof google.dataflow.v1beta3.TaskRunnerSettings + * @instance + */ + TaskRunnerSettings.prototype.dataflowApiVersion = ""; + + /** + * TaskRunnerSettings parallelWorkerSettings. + * @member {google.dataflow.v1beta3.IWorkerSettings|null|undefined} parallelWorkerSettings + * @memberof google.dataflow.v1beta3.TaskRunnerSettings + * @instance + */ + TaskRunnerSettings.prototype.parallelWorkerSettings = null; + + /** + * TaskRunnerSettings baseTaskDir. + * @member {string} baseTaskDir + * @memberof google.dataflow.v1beta3.TaskRunnerSettings + * @instance + */ + TaskRunnerSettings.prototype.baseTaskDir = ""; + + /** + * TaskRunnerSettings continueOnException. + * @member {boolean} continueOnException + * @memberof google.dataflow.v1beta3.TaskRunnerSettings + * @instance + */ + TaskRunnerSettings.prototype.continueOnException = false; + + /** + * TaskRunnerSettings logToSerialconsole. + * @member {boolean} logToSerialconsole + * @memberof google.dataflow.v1beta3.TaskRunnerSettings + * @instance + */ + TaskRunnerSettings.prototype.logToSerialconsole = false; + + /** + * TaskRunnerSettings alsologtostderr. + * @member {boolean} alsologtostderr + * @memberof google.dataflow.v1beta3.TaskRunnerSettings + * @instance + */ + TaskRunnerSettings.prototype.alsologtostderr = false; + + /** + * TaskRunnerSettings logUploadLocation. + * @member {string} logUploadLocation + * @memberof google.dataflow.v1beta3.TaskRunnerSettings + * @instance + */ + TaskRunnerSettings.prototype.logUploadLocation = ""; + + /** + * TaskRunnerSettings logDir. + * @member {string} logDir + * @memberof google.dataflow.v1beta3.TaskRunnerSettings + * @instance + */ + TaskRunnerSettings.prototype.logDir = ""; + + /** + * TaskRunnerSettings tempStoragePrefix. + * @member {string} tempStoragePrefix + * @memberof google.dataflow.v1beta3.TaskRunnerSettings + * @instance + */ + TaskRunnerSettings.prototype.tempStoragePrefix = ""; + + /** + * TaskRunnerSettings harnessCommand. + * @member {string} harnessCommand + * @memberof google.dataflow.v1beta3.TaskRunnerSettings + * @instance + */ + TaskRunnerSettings.prototype.harnessCommand = ""; + + /** + * TaskRunnerSettings workflowFileName. + * @member {string} workflowFileName + * @memberof google.dataflow.v1beta3.TaskRunnerSettings + * @instance + */ + TaskRunnerSettings.prototype.workflowFileName = ""; + + /** + * TaskRunnerSettings commandlinesFileName. + * @member {string} commandlinesFileName + * @memberof google.dataflow.v1beta3.TaskRunnerSettings + * @instance + */ + TaskRunnerSettings.prototype.commandlinesFileName = ""; + + /** + * TaskRunnerSettings vmId. + * @member {string} vmId + * @memberof google.dataflow.v1beta3.TaskRunnerSettings + * @instance + */ + TaskRunnerSettings.prototype.vmId = ""; + + /** + * TaskRunnerSettings languageHint. + * @member {string} languageHint + * @memberof google.dataflow.v1beta3.TaskRunnerSettings + * @instance + */ + TaskRunnerSettings.prototype.languageHint = ""; + + /** + * TaskRunnerSettings streamingWorkerMainClass. + * @member {string} streamingWorkerMainClass + * @memberof google.dataflow.v1beta3.TaskRunnerSettings + * @instance + */ + TaskRunnerSettings.prototype.streamingWorkerMainClass = ""; + + /** + * Creates a new TaskRunnerSettings instance using the specified properties. + * @function create + * @memberof google.dataflow.v1beta3.TaskRunnerSettings + * @static + * @param {google.dataflow.v1beta3.ITaskRunnerSettings=} [properties] Properties to set + * @returns {google.dataflow.v1beta3.TaskRunnerSettings} TaskRunnerSettings instance + */ + TaskRunnerSettings.create = function create(properties) { + return new TaskRunnerSettings(properties); + }; + + /** + * Encodes the specified TaskRunnerSettings message. Does not implicitly {@link google.dataflow.v1beta3.TaskRunnerSettings.verify|verify} messages. + * @function encode + * @memberof google.dataflow.v1beta3.TaskRunnerSettings + * @static + * @param {google.dataflow.v1beta3.ITaskRunnerSettings} message TaskRunnerSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TaskRunnerSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.taskUser != null && Object.hasOwnProperty.call(message, "taskUser")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.taskUser); + if (message.taskGroup != null && Object.hasOwnProperty.call(message, "taskGroup")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.taskGroup); + if (message.oauthScopes != null && message.oauthScopes.length) + for (var i = 0; i < message.oauthScopes.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.oauthScopes[i]); + if (message.baseUrl != null && Object.hasOwnProperty.call(message, "baseUrl")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.baseUrl); + if (message.dataflowApiVersion != null && Object.hasOwnProperty.call(message, "dataflowApiVersion")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.dataflowApiVersion); + if (message.parallelWorkerSettings != null && Object.hasOwnProperty.call(message, "parallelWorkerSettings")) + $root.google.dataflow.v1beta3.WorkerSettings.encode(message.parallelWorkerSettings, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.baseTaskDir != null && Object.hasOwnProperty.call(message, "baseTaskDir")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.baseTaskDir); + if (message.continueOnException != null && Object.hasOwnProperty.call(message, "continueOnException")) + writer.uint32(/* id 8, wireType 0 =*/64).bool(message.continueOnException); + if (message.logToSerialconsole != null && Object.hasOwnProperty.call(message, "logToSerialconsole")) + writer.uint32(/* id 9, wireType 0 =*/72).bool(message.logToSerialconsole); + if (message.alsologtostderr != null && Object.hasOwnProperty.call(message, "alsologtostderr")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.alsologtostderr); + if (message.logUploadLocation != null && Object.hasOwnProperty.call(message, "logUploadLocation")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.logUploadLocation); + if (message.logDir != null && Object.hasOwnProperty.call(message, "logDir")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.logDir); + if (message.tempStoragePrefix != null && Object.hasOwnProperty.call(message, "tempStoragePrefix")) + writer.uint32(/* id 13, wireType 2 =*/106).string(message.tempStoragePrefix); + if (message.harnessCommand != null && Object.hasOwnProperty.call(message, "harnessCommand")) + writer.uint32(/* id 14, wireType 2 =*/114).string(message.harnessCommand); + if (message.workflowFileName != null && Object.hasOwnProperty.call(message, "workflowFileName")) + writer.uint32(/* id 15, wireType 2 =*/122).string(message.workflowFileName); + if (message.commandlinesFileName != null && Object.hasOwnProperty.call(message, "commandlinesFileName")) + writer.uint32(/* id 16, wireType 2 =*/130).string(message.commandlinesFileName); + if (message.vmId != null && Object.hasOwnProperty.call(message, "vmId")) + writer.uint32(/* id 17, wireType 2 =*/138).string(message.vmId); + if (message.languageHint != null && Object.hasOwnProperty.call(message, "languageHint")) + writer.uint32(/* id 18, wireType 2 =*/146).string(message.languageHint); + if (message.streamingWorkerMainClass != null && Object.hasOwnProperty.call(message, "streamingWorkerMainClass")) + writer.uint32(/* id 19, wireType 2 =*/154).string(message.streamingWorkerMainClass); + return writer; + }; + + /** + * Encodes the specified TaskRunnerSettings message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.TaskRunnerSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.dataflow.v1beta3.TaskRunnerSettings + * @static + * @param {google.dataflow.v1beta3.ITaskRunnerSettings} message TaskRunnerSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TaskRunnerSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TaskRunnerSettings message from the specified reader or buffer. + * @function decode + * @memberof google.dataflow.v1beta3.TaskRunnerSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.dataflow.v1beta3.TaskRunnerSettings} TaskRunnerSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TaskRunnerSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.dataflow.v1beta3.TaskRunnerSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.taskUser = reader.string(); + break; + } + case 2: { + message.taskGroup = reader.string(); + break; + } + case 3: { + if (!(message.oauthScopes && message.oauthScopes.length)) + message.oauthScopes = []; + message.oauthScopes.push(reader.string()); + break; + } + case 4: { + message.baseUrl = reader.string(); + break; + } + case 5: { + message.dataflowApiVersion = reader.string(); + break; + } + case 6: { + message.parallelWorkerSettings = $root.google.dataflow.v1beta3.WorkerSettings.decode(reader, reader.uint32()); + break; + } + case 7: { + message.baseTaskDir = reader.string(); + break; + } + case 8: { + message.continueOnException = reader.bool(); + break; + } + case 9: { + message.logToSerialconsole = reader.bool(); + break; + } + case 10: { + message.alsologtostderr = reader.bool(); + break; + } + case 11: { + message.logUploadLocation = reader.string(); + break; + } + case 12: { + message.logDir = reader.string(); + break; + } + case 13: { + message.tempStoragePrefix = reader.string(); + break; + } + case 14: { + message.harnessCommand = reader.string(); + break; + } + case 15: { + message.workflowFileName = reader.string(); + break; + } + case 16: { + message.commandlinesFileName = reader.string(); + break; + } + case 17: { + message.vmId = reader.string(); + break; + } + case 18: { + message.languageHint = reader.string(); + break; + } + case 19: { + message.streamingWorkerMainClass = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TaskRunnerSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.dataflow.v1beta3.TaskRunnerSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.dataflow.v1beta3.TaskRunnerSettings} TaskRunnerSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TaskRunnerSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TaskRunnerSettings message. + * @function verify + * @memberof google.dataflow.v1beta3.TaskRunnerSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TaskRunnerSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.taskUser != null && message.hasOwnProperty("taskUser")) + if (!$util.isString(message.taskUser)) + return "taskUser: string expected"; + if (message.taskGroup != null && message.hasOwnProperty("taskGroup")) + if (!$util.isString(message.taskGroup)) + return "taskGroup: string expected"; + if (message.oauthScopes != null && message.hasOwnProperty("oauthScopes")) { + if (!Array.isArray(message.oauthScopes)) + return "oauthScopes: array expected"; + for (var i = 0; i < message.oauthScopes.length; ++i) + if (!$util.isString(message.oauthScopes[i])) + return "oauthScopes: string[] expected"; + } + if (message.baseUrl != null && message.hasOwnProperty("baseUrl")) + if (!$util.isString(message.baseUrl)) + return "baseUrl: string expected"; + if (message.dataflowApiVersion != null && message.hasOwnProperty("dataflowApiVersion")) + if (!$util.isString(message.dataflowApiVersion)) + return "dataflowApiVersion: string expected"; + if (message.parallelWorkerSettings != null && message.hasOwnProperty("parallelWorkerSettings")) { + var error = $root.google.dataflow.v1beta3.WorkerSettings.verify(message.parallelWorkerSettings); + if (error) + return "parallelWorkerSettings." + error; + } + if (message.baseTaskDir != null && message.hasOwnProperty("baseTaskDir")) + if (!$util.isString(message.baseTaskDir)) + return "baseTaskDir: string expected"; + if (message.continueOnException != null && message.hasOwnProperty("continueOnException")) + if (typeof message.continueOnException !== "boolean") + return "continueOnException: boolean expected"; + if (message.logToSerialconsole != null && message.hasOwnProperty("logToSerialconsole")) + if (typeof message.logToSerialconsole !== "boolean") + return "logToSerialconsole: boolean expected"; + if (message.alsologtostderr != null && message.hasOwnProperty("alsologtostderr")) + if (typeof message.alsologtostderr !== "boolean") + return "alsologtostderr: boolean expected"; + if (message.logUploadLocation != null && message.hasOwnProperty("logUploadLocation")) + if (!$util.isString(message.logUploadLocation)) + return "logUploadLocation: string expected"; + if (message.logDir != null && message.hasOwnProperty("logDir")) + if (!$util.isString(message.logDir)) + return "logDir: string expected"; + if (message.tempStoragePrefix != null && message.hasOwnProperty("tempStoragePrefix")) + if (!$util.isString(message.tempStoragePrefix)) + return "tempStoragePrefix: string expected"; + if (message.harnessCommand != null && message.hasOwnProperty("harnessCommand")) + if (!$util.isString(message.harnessCommand)) + return "harnessCommand: string expected"; + if (message.workflowFileName != null && message.hasOwnProperty("workflowFileName")) + if (!$util.isString(message.workflowFileName)) + return "workflowFileName: string expected"; + if (message.commandlinesFileName != null && message.hasOwnProperty("commandlinesFileName")) + if (!$util.isString(message.commandlinesFileName)) + return "commandlinesFileName: string expected"; + if (message.vmId != null && message.hasOwnProperty("vmId")) + if (!$util.isString(message.vmId)) + return "vmId: string expected"; + if (message.languageHint != null && message.hasOwnProperty("languageHint")) + if (!$util.isString(message.languageHint)) + return "languageHint: string expected"; + if (message.streamingWorkerMainClass != null && message.hasOwnProperty("streamingWorkerMainClass")) + if (!$util.isString(message.streamingWorkerMainClass)) + return "streamingWorkerMainClass: string expected"; + return null; + }; + + /** + * Creates a TaskRunnerSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.dataflow.v1beta3.TaskRunnerSettings + * @static + * @param {Object.} object Plain object + * @returns {google.dataflow.v1beta3.TaskRunnerSettings} TaskRunnerSettings + */ + TaskRunnerSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.dataflow.v1beta3.TaskRunnerSettings) + return object; + var message = new $root.google.dataflow.v1beta3.TaskRunnerSettings(); + if (object.taskUser != null) + message.taskUser = String(object.taskUser); + if (object.taskGroup != null) + message.taskGroup = String(object.taskGroup); + if (object.oauthScopes) { + if (!Array.isArray(object.oauthScopes)) + throw TypeError(".google.dataflow.v1beta3.TaskRunnerSettings.oauthScopes: array expected"); + message.oauthScopes = []; + for (var i = 0; i < object.oauthScopes.length; ++i) + message.oauthScopes[i] = String(object.oauthScopes[i]); + } + if (object.baseUrl != null) + message.baseUrl = String(object.baseUrl); + if (object.dataflowApiVersion != null) + message.dataflowApiVersion = String(object.dataflowApiVersion); + if (object.parallelWorkerSettings != null) { + if (typeof object.parallelWorkerSettings !== "object") + throw TypeError(".google.dataflow.v1beta3.TaskRunnerSettings.parallelWorkerSettings: object expected"); + message.parallelWorkerSettings = $root.google.dataflow.v1beta3.WorkerSettings.fromObject(object.parallelWorkerSettings); + } + if (object.baseTaskDir != null) + message.baseTaskDir = String(object.baseTaskDir); + if (object.continueOnException != null) + message.continueOnException = Boolean(object.continueOnException); + if (object.logToSerialconsole != null) + message.logToSerialconsole = Boolean(object.logToSerialconsole); + if (object.alsologtostderr != null) + message.alsologtostderr = Boolean(object.alsologtostderr); + if (object.logUploadLocation != null) + message.logUploadLocation = String(object.logUploadLocation); + if (object.logDir != null) + message.logDir = String(object.logDir); + if (object.tempStoragePrefix != null) + message.tempStoragePrefix = String(object.tempStoragePrefix); + if (object.harnessCommand != null) + message.harnessCommand = String(object.harnessCommand); + if (object.workflowFileName != null) + message.workflowFileName = String(object.workflowFileName); + if (object.commandlinesFileName != null) + message.commandlinesFileName = String(object.commandlinesFileName); + if (object.vmId != null) + message.vmId = String(object.vmId); + if (object.languageHint != null) + message.languageHint = String(object.languageHint); + if (object.streamingWorkerMainClass != null) + message.streamingWorkerMainClass = String(object.streamingWorkerMainClass); + return message; + }; + + /** + * Creates a plain object from a TaskRunnerSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.dataflow.v1beta3.TaskRunnerSettings + * @static + * @param {google.dataflow.v1beta3.TaskRunnerSettings} message TaskRunnerSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TaskRunnerSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.oauthScopes = []; + if (options.defaults) { + object.taskUser = ""; + object.taskGroup = ""; + object.baseUrl = ""; + object.dataflowApiVersion = ""; + object.parallelWorkerSettings = null; + object.baseTaskDir = ""; + object.continueOnException = false; + object.logToSerialconsole = false; + object.alsologtostderr = false; + object.logUploadLocation = ""; + object.logDir = ""; + object.tempStoragePrefix = ""; + object.harnessCommand = ""; + object.workflowFileName = ""; + object.commandlinesFileName = ""; + object.vmId = ""; + object.languageHint = ""; + object.streamingWorkerMainClass = ""; + } + if (message.taskUser != null && message.hasOwnProperty("taskUser")) + object.taskUser = message.taskUser; + if (message.taskGroup != null && message.hasOwnProperty("taskGroup")) + object.taskGroup = message.taskGroup; + if (message.oauthScopes && message.oauthScopes.length) { + object.oauthScopes = []; + for (var j = 0; j < message.oauthScopes.length; ++j) + object.oauthScopes[j] = message.oauthScopes[j]; + } + if (message.baseUrl != null && message.hasOwnProperty("baseUrl")) + object.baseUrl = message.baseUrl; + if (message.dataflowApiVersion != null && message.hasOwnProperty("dataflowApiVersion")) + object.dataflowApiVersion = message.dataflowApiVersion; + if (message.parallelWorkerSettings != null && message.hasOwnProperty("parallelWorkerSettings")) + object.parallelWorkerSettings = $root.google.dataflow.v1beta3.WorkerSettings.toObject(message.parallelWorkerSettings, options); + if (message.baseTaskDir != null && message.hasOwnProperty("baseTaskDir")) + object.baseTaskDir = message.baseTaskDir; + if (message.continueOnException != null && message.hasOwnProperty("continueOnException")) + object.continueOnException = message.continueOnException; + if (message.logToSerialconsole != null && message.hasOwnProperty("logToSerialconsole")) + object.logToSerialconsole = message.logToSerialconsole; + if (message.alsologtostderr != null && message.hasOwnProperty("alsologtostderr")) + object.alsologtostderr = message.alsologtostderr; + if (message.logUploadLocation != null && message.hasOwnProperty("logUploadLocation")) + object.logUploadLocation = message.logUploadLocation; + if (message.logDir != null && message.hasOwnProperty("logDir")) + object.logDir = message.logDir; + if (message.tempStoragePrefix != null && message.hasOwnProperty("tempStoragePrefix")) + object.tempStoragePrefix = message.tempStoragePrefix; + if (message.harnessCommand != null && message.hasOwnProperty("harnessCommand")) + object.harnessCommand = message.harnessCommand; + if (message.workflowFileName != null && message.hasOwnProperty("workflowFileName")) + object.workflowFileName = message.workflowFileName; + if (message.commandlinesFileName != null && message.hasOwnProperty("commandlinesFileName")) + object.commandlinesFileName = message.commandlinesFileName; + if (message.vmId != null && message.hasOwnProperty("vmId")) + object.vmId = message.vmId; + if (message.languageHint != null && message.hasOwnProperty("languageHint")) + object.languageHint = message.languageHint; + if (message.streamingWorkerMainClass != null && message.hasOwnProperty("streamingWorkerMainClass")) + object.streamingWorkerMainClass = message.streamingWorkerMainClass; + return object; + }; + + /** + * Converts this TaskRunnerSettings to JSON. + * @function toJSON + * @memberof google.dataflow.v1beta3.TaskRunnerSettings + * @instance + * @returns {Object.} JSON object + */ + TaskRunnerSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TaskRunnerSettings + * @function getTypeUrl + * @memberof google.dataflow.v1beta3.TaskRunnerSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TaskRunnerSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.dataflow.v1beta3.TaskRunnerSettings"; + }; + + return TaskRunnerSettings; + })(); + + /** + * TeardownPolicy enum. + * @name google.dataflow.v1beta3.TeardownPolicy + * @enum {number} + * @property {number} TEARDOWN_POLICY_UNKNOWN=0 TEARDOWN_POLICY_UNKNOWN value + * @property {number} TEARDOWN_ALWAYS=1 TEARDOWN_ALWAYS value + * @property {number} TEARDOWN_ON_SUCCESS=2 TEARDOWN_ON_SUCCESS value + * @property {number} TEARDOWN_NEVER=3 TEARDOWN_NEVER value + */ + v1beta3.TeardownPolicy = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TEARDOWN_POLICY_UNKNOWN"] = 0; + values[valuesById[1] = "TEARDOWN_ALWAYS"] = 1; + values[valuesById[2] = "TEARDOWN_ON_SUCCESS"] = 2; + values[valuesById[3] = "TEARDOWN_NEVER"] = 3; + return values; + })(); + + /** + * DefaultPackageSet enum. + * @name google.dataflow.v1beta3.DefaultPackageSet + * @enum {number} + * @property {number} DEFAULT_PACKAGE_SET_UNKNOWN=0 DEFAULT_PACKAGE_SET_UNKNOWN value + * @property {number} DEFAULT_PACKAGE_SET_NONE=1 DEFAULT_PACKAGE_SET_NONE value + * @property {number} DEFAULT_PACKAGE_SET_JAVA=2 DEFAULT_PACKAGE_SET_JAVA value + * @property {number} DEFAULT_PACKAGE_SET_PYTHON=3 DEFAULT_PACKAGE_SET_PYTHON value + */ + v1beta3.DefaultPackageSet = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DEFAULT_PACKAGE_SET_UNKNOWN"] = 0; + values[valuesById[1] = "DEFAULT_PACKAGE_SET_NONE"] = 1; + values[valuesById[2] = "DEFAULT_PACKAGE_SET_JAVA"] = 2; + values[valuesById[3] = "DEFAULT_PACKAGE_SET_PYTHON"] = 3; + return values; + })(); + + /** + * AutoscalingAlgorithm enum. + * @name google.dataflow.v1beta3.AutoscalingAlgorithm + * @enum {number} + * @property {number} AUTOSCALING_ALGORITHM_UNKNOWN=0 AUTOSCALING_ALGORITHM_UNKNOWN value + * @property {number} AUTOSCALING_ALGORITHM_NONE=1 AUTOSCALING_ALGORITHM_NONE value + * @property {number} AUTOSCALING_ALGORITHM_BASIC=2 AUTOSCALING_ALGORITHM_BASIC value + */ + v1beta3.AutoscalingAlgorithm = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "AUTOSCALING_ALGORITHM_UNKNOWN"] = 0; + values[valuesById[1] = "AUTOSCALING_ALGORITHM_NONE"] = 1; + values[valuesById[2] = "AUTOSCALING_ALGORITHM_BASIC"] = 2; + return values; + })(); + + v1beta3.AutoscalingSettings = (function() { + + /** + * Properties of an AutoscalingSettings. + * @memberof google.dataflow.v1beta3 + * @interface IAutoscalingSettings + * @property {google.dataflow.v1beta3.AutoscalingAlgorithm|null} [algorithm] AutoscalingSettings algorithm + * @property {number|null} [maxNumWorkers] AutoscalingSettings maxNumWorkers + */ + + /** + * Constructs a new AutoscalingSettings. + * @memberof google.dataflow.v1beta3 + * @classdesc Represents an AutoscalingSettings. + * @implements IAutoscalingSettings + * @constructor + * @param {google.dataflow.v1beta3.IAutoscalingSettings=} [properties] Properties to set + */ + function AutoscalingSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AutoscalingSettings algorithm. + * @member {google.dataflow.v1beta3.AutoscalingAlgorithm} algorithm + * @memberof google.dataflow.v1beta3.AutoscalingSettings + * @instance + */ + AutoscalingSettings.prototype.algorithm = 0; + + /** + * AutoscalingSettings maxNumWorkers. + * @member {number} maxNumWorkers + * @memberof google.dataflow.v1beta3.AutoscalingSettings + * @instance + */ + AutoscalingSettings.prototype.maxNumWorkers = 0; + + /** + * Creates a new AutoscalingSettings instance using the specified properties. + * @function create + * @memberof google.dataflow.v1beta3.AutoscalingSettings + * @static + * @param {google.dataflow.v1beta3.IAutoscalingSettings=} [properties] Properties to set + * @returns {google.dataflow.v1beta3.AutoscalingSettings} AutoscalingSettings instance + */ + AutoscalingSettings.create = function create(properties) { + return new AutoscalingSettings(properties); + }; + + /** + * Encodes the specified AutoscalingSettings message. Does not implicitly {@link google.dataflow.v1beta3.AutoscalingSettings.verify|verify} messages. + * @function encode + * @memberof google.dataflow.v1beta3.AutoscalingSettings + * @static + * @param {google.dataflow.v1beta3.IAutoscalingSettings} message AutoscalingSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AutoscalingSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.algorithm != null && Object.hasOwnProperty.call(message, "algorithm")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.algorithm); + if (message.maxNumWorkers != null && Object.hasOwnProperty.call(message, "maxNumWorkers")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.maxNumWorkers); + return writer; + }; + + /** + * Encodes the specified AutoscalingSettings message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.AutoscalingSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.dataflow.v1beta3.AutoscalingSettings + * @static + * @param {google.dataflow.v1beta3.IAutoscalingSettings} message AutoscalingSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AutoscalingSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AutoscalingSettings message from the specified reader or buffer. + * @function decode + * @memberof google.dataflow.v1beta3.AutoscalingSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.dataflow.v1beta3.AutoscalingSettings} AutoscalingSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AutoscalingSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.dataflow.v1beta3.AutoscalingSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.algorithm = reader.int32(); + break; + } + case 2: { + message.maxNumWorkers = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AutoscalingSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.dataflow.v1beta3.AutoscalingSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.dataflow.v1beta3.AutoscalingSettings} AutoscalingSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AutoscalingSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AutoscalingSettings message. + * @function verify + * @memberof google.dataflow.v1beta3.AutoscalingSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AutoscalingSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.algorithm != null && message.hasOwnProperty("algorithm")) + switch (message.algorithm) { + default: + return "algorithm: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.maxNumWorkers != null && message.hasOwnProperty("maxNumWorkers")) + if (!$util.isInteger(message.maxNumWorkers)) + return "maxNumWorkers: integer expected"; + return null; + }; + + /** + * Creates an AutoscalingSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.dataflow.v1beta3.AutoscalingSettings + * @static + * @param {Object.} object Plain object + * @returns {google.dataflow.v1beta3.AutoscalingSettings} AutoscalingSettings + */ + AutoscalingSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.dataflow.v1beta3.AutoscalingSettings) + return object; + var message = new $root.google.dataflow.v1beta3.AutoscalingSettings(); + switch (object.algorithm) { + default: + if (typeof object.algorithm === "number") { + message.algorithm = object.algorithm; + break; + } + break; + case "AUTOSCALING_ALGORITHM_UNKNOWN": + case 0: + message.algorithm = 0; + break; + case "AUTOSCALING_ALGORITHM_NONE": + case 1: + message.algorithm = 1; + break; + case "AUTOSCALING_ALGORITHM_BASIC": + case 2: + message.algorithm = 2; + break; + } + if (object.maxNumWorkers != null) + message.maxNumWorkers = object.maxNumWorkers | 0; + return message; + }; + + /** + * Creates a plain object from an AutoscalingSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.dataflow.v1beta3.AutoscalingSettings + * @static + * @param {google.dataflow.v1beta3.AutoscalingSettings} message AutoscalingSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AutoscalingSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.algorithm = options.enums === String ? "AUTOSCALING_ALGORITHM_UNKNOWN" : 0; + object.maxNumWorkers = 0; + } + if (message.algorithm != null && message.hasOwnProperty("algorithm")) + object.algorithm = options.enums === String ? $root.google.dataflow.v1beta3.AutoscalingAlgorithm[message.algorithm] === undefined ? message.algorithm : $root.google.dataflow.v1beta3.AutoscalingAlgorithm[message.algorithm] : message.algorithm; + if (message.maxNumWorkers != null && message.hasOwnProperty("maxNumWorkers")) + object.maxNumWorkers = message.maxNumWorkers; + return object; + }; + + /** + * Converts this AutoscalingSettings to JSON. + * @function toJSON + * @memberof google.dataflow.v1beta3.AutoscalingSettings + * @instance + * @returns {Object.} JSON object + */ + AutoscalingSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AutoscalingSettings + * @function getTypeUrl + * @memberof google.dataflow.v1beta3.AutoscalingSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AutoscalingSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.dataflow.v1beta3.AutoscalingSettings"; + }; + + return AutoscalingSettings; + })(); + + /** + * WorkerIPAddressConfiguration enum. + * @name google.dataflow.v1beta3.WorkerIPAddressConfiguration + * @enum {number} + * @property {number} WORKER_IP_UNSPECIFIED=0 WORKER_IP_UNSPECIFIED value + * @property {number} WORKER_IP_PUBLIC=1 WORKER_IP_PUBLIC value + * @property {number} WORKER_IP_PRIVATE=2 WORKER_IP_PRIVATE value + */ + v1beta3.WorkerIPAddressConfiguration = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "WORKER_IP_UNSPECIFIED"] = 0; + values[valuesById[1] = "WORKER_IP_PUBLIC"] = 1; + values[valuesById[2] = "WORKER_IP_PRIVATE"] = 2; + return values; + })(); + + v1beta3.SdkHarnessContainerImage = (function() { + + /** + * Properties of a SdkHarnessContainerImage. + * @memberof google.dataflow.v1beta3 + * @interface ISdkHarnessContainerImage + * @property {string|null} [containerImage] SdkHarnessContainerImage containerImage + * @property {boolean|null} [useSingleCorePerContainer] SdkHarnessContainerImage useSingleCorePerContainer + * @property {string|null} [environmentId] SdkHarnessContainerImage environmentId + * @property {Array.|null} [capabilities] SdkHarnessContainerImage capabilities + */ + + /** + * Constructs a new SdkHarnessContainerImage. + * @memberof google.dataflow.v1beta3 + * @classdesc Represents a SdkHarnessContainerImage. + * @implements ISdkHarnessContainerImage + * @constructor + * @param {google.dataflow.v1beta3.ISdkHarnessContainerImage=} [properties] Properties to set + */ + function SdkHarnessContainerImage(properties) { + this.capabilities = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SdkHarnessContainerImage containerImage. + * @member {string} containerImage + * @memberof google.dataflow.v1beta3.SdkHarnessContainerImage + * @instance + */ + SdkHarnessContainerImage.prototype.containerImage = ""; + + /** + * SdkHarnessContainerImage useSingleCorePerContainer. + * @member {boolean} useSingleCorePerContainer + * @memberof google.dataflow.v1beta3.SdkHarnessContainerImage + * @instance + */ + SdkHarnessContainerImage.prototype.useSingleCorePerContainer = false; + + /** + * SdkHarnessContainerImage environmentId. + * @member {string} environmentId + * @memberof google.dataflow.v1beta3.SdkHarnessContainerImage + * @instance + */ + SdkHarnessContainerImage.prototype.environmentId = ""; + + /** + * SdkHarnessContainerImage capabilities. + * @member {Array.} capabilities + * @memberof google.dataflow.v1beta3.SdkHarnessContainerImage + * @instance + */ + SdkHarnessContainerImage.prototype.capabilities = $util.emptyArray; + + /** + * Creates a new SdkHarnessContainerImage instance using the specified properties. + * @function create + * @memberof google.dataflow.v1beta3.SdkHarnessContainerImage + * @static + * @param {google.dataflow.v1beta3.ISdkHarnessContainerImage=} [properties] Properties to set + * @returns {google.dataflow.v1beta3.SdkHarnessContainerImage} SdkHarnessContainerImage instance + */ + SdkHarnessContainerImage.create = function create(properties) { + return new SdkHarnessContainerImage(properties); + }; + + /** + * Encodes the specified SdkHarnessContainerImage message. Does not implicitly {@link google.dataflow.v1beta3.SdkHarnessContainerImage.verify|verify} messages. + * @function encode + * @memberof google.dataflow.v1beta3.SdkHarnessContainerImage + * @static + * @param {google.dataflow.v1beta3.ISdkHarnessContainerImage} message SdkHarnessContainerImage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SdkHarnessContainerImage.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.containerImage != null && Object.hasOwnProperty.call(message, "containerImage")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.containerImage); + if (message.useSingleCorePerContainer != null && Object.hasOwnProperty.call(message, "useSingleCorePerContainer")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.useSingleCorePerContainer); + if (message.environmentId != null && Object.hasOwnProperty.call(message, "environmentId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.environmentId); + if (message.capabilities != null && message.capabilities.length) + for (var i = 0; i < message.capabilities.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.capabilities[i]); + return writer; + }; + + /** + * Encodes the specified SdkHarnessContainerImage message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.SdkHarnessContainerImage.verify|verify} messages. + * @function encodeDelimited + * @memberof google.dataflow.v1beta3.SdkHarnessContainerImage + * @static + * @param {google.dataflow.v1beta3.ISdkHarnessContainerImage} message SdkHarnessContainerImage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SdkHarnessContainerImage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SdkHarnessContainerImage message from the specified reader or buffer. + * @function decode + * @memberof google.dataflow.v1beta3.SdkHarnessContainerImage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.dataflow.v1beta3.SdkHarnessContainerImage} SdkHarnessContainerImage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SdkHarnessContainerImage.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.dataflow.v1beta3.SdkHarnessContainerImage(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.containerImage = reader.string(); + break; + } + case 2: { + message.useSingleCorePerContainer = reader.bool(); + break; + } + case 3: { + message.environmentId = reader.string(); + break; + } + case 4: { + if (!(message.capabilities && message.capabilities.length)) + message.capabilities = []; + message.capabilities.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SdkHarnessContainerImage message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.dataflow.v1beta3.SdkHarnessContainerImage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.dataflow.v1beta3.SdkHarnessContainerImage} SdkHarnessContainerImage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SdkHarnessContainerImage.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SdkHarnessContainerImage message. + * @function verify + * @memberof google.dataflow.v1beta3.SdkHarnessContainerImage + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SdkHarnessContainerImage.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.containerImage != null && message.hasOwnProperty("containerImage")) + if (!$util.isString(message.containerImage)) + return "containerImage: string expected"; + if (message.useSingleCorePerContainer != null && message.hasOwnProperty("useSingleCorePerContainer")) + if (typeof message.useSingleCorePerContainer !== "boolean") + return "useSingleCorePerContainer: boolean expected"; + if (message.environmentId != null && message.hasOwnProperty("environmentId")) + if (!$util.isString(message.environmentId)) + return "environmentId: string expected"; + if (message.capabilities != null && message.hasOwnProperty("capabilities")) { + if (!Array.isArray(message.capabilities)) + return "capabilities: array expected"; + for (var i = 0; i < message.capabilities.length; ++i) + if (!$util.isString(message.capabilities[i])) + return "capabilities: string[] expected"; + } + return null; + }; + + /** + * Creates a SdkHarnessContainerImage message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.dataflow.v1beta3.SdkHarnessContainerImage + * @static + * @param {Object.} object Plain object + * @returns {google.dataflow.v1beta3.SdkHarnessContainerImage} SdkHarnessContainerImage + */ + SdkHarnessContainerImage.fromObject = function fromObject(object) { + if (object instanceof $root.google.dataflow.v1beta3.SdkHarnessContainerImage) + return object; + var message = new $root.google.dataflow.v1beta3.SdkHarnessContainerImage(); + if (object.containerImage != null) + message.containerImage = String(object.containerImage); + if (object.useSingleCorePerContainer != null) + message.useSingleCorePerContainer = Boolean(object.useSingleCorePerContainer); + if (object.environmentId != null) + message.environmentId = String(object.environmentId); + if (object.capabilities) { + if (!Array.isArray(object.capabilities)) + throw TypeError(".google.dataflow.v1beta3.SdkHarnessContainerImage.capabilities: array expected"); + message.capabilities = []; + for (var i = 0; i < object.capabilities.length; ++i) + message.capabilities[i] = String(object.capabilities[i]); + } + return message; + }; + + /** + * Creates a plain object from a SdkHarnessContainerImage message. Also converts values to other types if specified. + * @function toObject + * @memberof google.dataflow.v1beta3.SdkHarnessContainerImage + * @static + * @param {google.dataflow.v1beta3.SdkHarnessContainerImage} message SdkHarnessContainerImage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SdkHarnessContainerImage.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.capabilities = []; + if (options.defaults) { + object.containerImage = ""; + object.useSingleCorePerContainer = false; + object.environmentId = ""; + } + if (message.containerImage != null && message.hasOwnProperty("containerImage")) + object.containerImage = message.containerImage; + if (message.useSingleCorePerContainer != null && message.hasOwnProperty("useSingleCorePerContainer")) + object.useSingleCorePerContainer = message.useSingleCorePerContainer; + if (message.environmentId != null && message.hasOwnProperty("environmentId")) + object.environmentId = message.environmentId; + if (message.capabilities && message.capabilities.length) { + object.capabilities = []; + for (var j = 0; j < message.capabilities.length; ++j) + object.capabilities[j] = message.capabilities[j]; + } + return object; + }; + + /** + * Converts this SdkHarnessContainerImage to JSON. + * @function toJSON + * @memberof google.dataflow.v1beta3.SdkHarnessContainerImage + * @instance + * @returns {Object.} JSON object + */ + SdkHarnessContainerImage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SdkHarnessContainerImage + * @function getTypeUrl + * @memberof google.dataflow.v1beta3.SdkHarnessContainerImage + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SdkHarnessContainerImage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.dataflow.v1beta3.SdkHarnessContainerImage"; + }; + + return SdkHarnessContainerImage; + })(); + + v1beta3.WorkerPool = (function() { + + /** + * Properties of a WorkerPool. + * @memberof google.dataflow.v1beta3 + * @interface IWorkerPool + * @property {string|null} [kind] WorkerPool kind + * @property {number|null} [numWorkers] WorkerPool numWorkers + * @property {Array.|null} [packages] WorkerPool packages + * @property {google.dataflow.v1beta3.DefaultPackageSet|null} [defaultPackageSet] WorkerPool defaultPackageSet + * @property {string|null} [machineType] WorkerPool machineType + * @property {google.dataflow.v1beta3.TeardownPolicy|null} [teardownPolicy] WorkerPool teardownPolicy + * @property {number|null} [diskSizeGb] WorkerPool diskSizeGb + * @property {string|null} [diskType] WorkerPool diskType + * @property {string|null} [diskSourceImage] WorkerPool diskSourceImage + * @property {string|null} [zone] WorkerPool zone + * @property {google.dataflow.v1beta3.ITaskRunnerSettings|null} [taskrunnerSettings] WorkerPool taskrunnerSettings + * @property {string|null} [onHostMaintenance] WorkerPool onHostMaintenance + * @property {Array.|null} [dataDisks] WorkerPool dataDisks + * @property {Object.|null} [metadata] WorkerPool metadata + * @property {google.dataflow.v1beta3.IAutoscalingSettings|null} [autoscalingSettings] WorkerPool autoscalingSettings + * @property {google.protobuf.IAny|null} [poolArgs] WorkerPool poolArgs + * @property {string|null} [network] WorkerPool network + * @property {string|null} [subnetwork] WorkerPool subnetwork + * @property {string|null} [workerHarnessContainerImage] WorkerPool workerHarnessContainerImage + * @property {number|null} [numThreadsPerWorker] WorkerPool numThreadsPerWorker + * @property {google.dataflow.v1beta3.WorkerIPAddressConfiguration|null} [ipConfiguration] WorkerPool ipConfiguration + * @property {Array.|null} [sdkHarnessContainerImages] WorkerPool sdkHarnessContainerImages + */ + + /** + * Constructs a new WorkerPool. + * @memberof google.dataflow.v1beta3 + * @classdesc Represents a WorkerPool. + * @implements IWorkerPool + * @constructor + * @param {google.dataflow.v1beta3.IWorkerPool=} [properties] Properties to set + */ + function WorkerPool(properties) { + this.packages = []; + this.dataDisks = []; + this.metadata = {}; + this.sdkHarnessContainerImages = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * WorkerPool kind. + * @member {string} kind + * @memberof google.dataflow.v1beta3.WorkerPool + * @instance + */ + WorkerPool.prototype.kind = ""; + + /** + * WorkerPool numWorkers. + * @member {number} numWorkers + * @memberof google.dataflow.v1beta3.WorkerPool + * @instance + */ + WorkerPool.prototype.numWorkers = 0; + + /** + * WorkerPool packages. + * @member {Array.} packages + * @memberof google.dataflow.v1beta3.WorkerPool + * @instance + */ + WorkerPool.prototype.packages = $util.emptyArray; + + /** + * WorkerPool defaultPackageSet. + * @member {google.dataflow.v1beta3.DefaultPackageSet} defaultPackageSet + * @memberof google.dataflow.v1beta3.WorkerPool + * @instance + */ + WorkerPool.prototype.defaultPackageSet = 0; + + /** + * WorkerPool machineType. + * @member {string} machineType + * @memberof google.dataflow.v1beta3.WorkerPool + * @instance + */ + WorkerPool.prototype.machineType = ""; + + /** + * WorkerPool teardownPolicy. + * @member {google.dataflow.v1beta3.TeardownPolicy} teardownPolicy + * @memberof google.dataflow.v1beta3.WorkerPool + * @instance + */ + WorkerPool.prototype.teardownPolicy = 0; + + /** + * WorkerPool diskSizeGb. + * @member {number} diskSizeGb + * @memberof google.dataflow.v1beta3.WorkerPool + * @instance + */ + WorkerPool.prototype.diskSizeGb = 0; + + /** + * WorkerPool diskType. + * @member {string} diskType + * @memberof google.dataflow.v1beta3.WorkerPool + * @instance + */ + WorkerPool.prototype.diskType = ""; + + /** + * WorkerPool diskSourceImage. + * @member {string} diskSourceImage + * @memberof google.dataflow.v1beta3.WorkerPool + * @instance + */ + WorkerPool.prototype.diskSourceImage = ""; + + /** + * WorkerPool zone. + * @member {string} zone + * @memberof google.dataflow.v1beta3.WorkerPool + * @instance + */ + WorkerPool.prototype.zone = ""; + + /** + * WorkerPool taskrunnerSettings. + * @member {google.dataflow.v1beta3.ITaskRunnerSettings|null|undefined} taskrunnerSettings + * @memberof google.dataflow.v1beta3.WorkerPool + * @instance + */ + WorkerPool.prototype.taskrunnerSettings = null; + + /** + * WorkerPool onHostMaintenance. + * @member {string} onHostMaintenance + * @memberof google.dataflow.v1beta3.WorkerPool + * @instance + */ + WorkerPool.prototype.onHostMaintenance = ""; + + /** + * WorkerPool dataDisks. + * @member {Array.} dataDisks + * @memberof google.dataflow.v1beta3.WorkerPool + * @instance + */ + WorkerPool.prototype.dataDisks = $util.emptyArray; + + /** + * WorkerPool metadata. + * @member {Object.} metadata + * @memberof google.dataflow.v1beta3.WorkerPool + * @instance + */ + WorkerPool.prototype.metadata = $util.emptyObject; + + /** + * WorkerPool autoscalingSettings. + * @member {google.dataflow.v1beta3.IAutoscalingSettings|null|undefined} autoscalingSettings + * @memberof google.dataflow.v1beta3.WorkerPool + * @instance + */ + WorkerPool.prototype.autoscalingSettings = null; + + /** + * WorkerPool poolArgs. + * @member {google.protobuf.IAny|null|undefined} poolArgs + * @memberof google.dataflow.v1beta3.WorkerPool + * @instance + */ + WorkerPool.prototype.poolArgs = null; + + /** + * WorkerPool network. + * @member {string} network + * @memberof google.dataflow.v1beta3.WorkerPool + * @instance + */ + WorkerPool.prototype.network = ""; + + /** + * WorkerPool subnetwork. + * @member {string} subnetwork + * @memberof google.dataflow.v1beta3.WorkerPool + * @instance + */ + WorkerPool.prototype.subnetwork = ""; + + /** + * WorkerPool workerHarnessContainerImage. + * @member {string} workerHarnessContainerImage + * @memberof google.dataflow.v1beta3.WorkerPool + * @instance + */ + WorkerPool.prototype.workerHarnessContainerImage = ""; + + /** + * WorkerPool numThreadsPerWorker. + * @member {number} numThreadsPerWorker + * @memberof google.dataflow.v1beta3.WorkerPool + * @instance + */ + WorkerPool.prototype.numThreadsPerWorker = 0; + + /** + * WorkerPool ipConfiguration. + * @member {google.dataflow.v1beta3.WorkerIPAddressConfiguration} ipConfiguration + * @memberof google.dataflow.v1beta3.WorkerPool + * @instance + */ + WorkerPool.prototype.ipConfiguration = 0; + + /** + * WorkerPool sdkHarnessContainerImages. + * @member {Array.} sdkHarnessContainerImages + * @memberof google.dataflow.v1beta3.WorkerPool + * @instance + */ + WorkerPool.prototype.sdkHarnessContainerImages = $util.emptyArray; + + /** + * Creates a new WorkerPool instance using the specified properties. + * @function create + * @memberof google.dataflow.v1beta3.WorkerPool + * @static + * @param {google.dataflow.v1beta3.IWorkerPool=} [properties] Properties to set + * @returns {google.dataflow.v1beta3.WorkerPool} WorkerPool instance + */ + WorkerPool.create = function create(properties) { + return new WorkerPool(properties); + }; + + /** + * Encodes the specified WorkerPool message. Does not implicitly {@link google.dataflow.v1beta3.WorkerPool.verify|verify} messages. + * @function encode + * @memberof google.dataflow.v1beta3.WorkerPool + * @static + * @param {google.dataflow.v1beta3.IWorkerPool} message WorkerPool message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WorkerPool.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.kind); + if (message.numWorkers != null && Object.hasOwnProperty.call(message, "numWorkers")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.numWorkers); + if (message.packages != null && message.packages.length) + for (var i = 0; i < message.packages.length; ++i) + $root.google.dataflow.v1beta3.Package.encode(message.packages[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.defaultPackageSet != null && Object.hasOwnProperty.call(message, "defaultPackageSet")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.defaultPackageSet); + if (message.machineType != null && Object.hasOwnProperty.call(message, "machineType")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.machineType); + if (message.teardownPolicy != null && Object.hasOwnProperty.call(message, "teardownPolicy")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.teardownPolicy); + if (message.diskSizeGb != null && Object.hasOwnProperty.call(message, "diskSizeGb")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.diskSizeGb); + if (message.diskSourceImage != null && Object.hasOwnProperty.call(message, "diskSourceImage")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.diskSourceImage); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.zone); + if (message.taskrunnerSettings != null && Object.hasOwnProperty.call(message, "taskrunnerSettings")) + $root.google.dataflow.v1beta3.TaskRunnerSettings.encode(message.taskrunnerSettings, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.onHostMaintenance != null && Object.hasOwnProperty.call(message, "onHostMaintenance")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.onHostMaintenance); + if (message.dataDisks != null && message.dataDisks.length) + for (var i = 0; i < message.dataDisks.length; ++i) + $root.google.dataflow.v1beta3.Disk.encode(message.dataDisks[i], writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + for (var keys = Object.keys(message.metadata), i = 0; i < keys.length; ++i) + writer.uint32(/* id 13, wireType 2 =*/106).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.metadata[keys[i]]).ldelim(); + if (message.autoscalingSettings != null && Object.hasOwnProperty.call(message, "autoscalingSettings")) + $root.google.dataflow.v1beta3.AutoscalingSettings.encode(message.autoscalingSettings, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + if (message.poolArgs != null && Object.hasOwnProperty.call(message, "poolArgs")) + $root.google.protobuf.Any.encode(message.poolArgs, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); + if (message.diskType != null && Object.hasOwnProperty.call(message, "diskType")) + writer.uint32(/* id 16, wireType 2 =*/130).string(message.diskType); + if (message.network != null && Object.hasOwnProperty.call(message, "network")) + writer.uint32(/* id 17, wireType 2 =*/138).string(message.network); + if (message.workerHarnessContainerImage != null && Object.hasOwnProperty.call(message, "workerHarnessContainerImage")) + writer.uint32(/* id 18, wireType 2 =*/146).string(message.workerHarnessContainerImage); + if (message.subnetwork != null && Object.hasOwnProperty.call(message, "subnetwork")) + writer.uint32(/* id 19, wireType 2 =*/154).string(message.subnetwork); + if (message.numThreadsPerWorker != null && Object.hasOwnProperty.call(message, "numThreadsPerWorker")) + writer.uint32(/* id 20, wireType 0 =*/160).int32(message.numThreadsPerWorker); + if (message.ipConfiguration != null && Object.hasOwnProperty.call(message, "ipConfiguration")) + writer.uint32(/* id 21, wireType 0 =*/168).int32(message.ipConfiguration); + if (message.sdkHarnessContainerImages != null && message.sdkHarnessContainerImages.length) + for (var i = 0; i < message.sdkHarnessContainerImages.length; ++i) + $root.google.dataflow.v1beta3.SdkHarnessContainerImage.encode(message.sdkHarnessContainerImages[i], writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified WorkerPool message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.WorkerPool.verify|verify} messages. + * @function encodeDelimited + * @memberof google.dataflow.v1beta3.WorkerPool + * @static + * @param {google.dataflow.v1beta3.IWorkerPool} message WorkerPool message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WorkerPool.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WorkerPool message from the specified reader or buffer. + * @function decode + * @memberof google.dataflow.v1beta3.WorkerPool + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.dataflow.v1beta3.WorkerPool} WorkerPool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WorkerPool.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.dataflow.v1beta3.WorkerPool(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.kind = reader.string(); + break; + } + case 2: { + message.numWorkers = reader.int32(); + break; + } + case 3: { + if (!(message.packages && message.packages.length)) + message.packages = []; + message.packages.push($root.google.dataflow.v1beta3.Package.decode(reader, reader.uint32())); + break; + } + case 4: { + message.defaultPackageSet = reader.int32(); + break; + } + case 5: { + message.machineType = reader.string(); + break; + } + case 6: { + message.teardownPolicy = reader.int32(); + break; + } + case 7: { + message.diskSizeGb = reader.int32(); + break; + } + case 16: { + message.diskType = reader.string(); + break; + } + case 8: { + message.diskSourceImage = reader.string(); + break; + } + case 9: { + message.zone = reader.string(); + break; + } + case 10: { + message.taskrunnerSettings = $root.google.dataflow.v1beta3.TaskRunnerSettings.decode(reader, reader.uint32()); + break; + } + case 11: { + message.onHostMaintenance = reader.string(); + break; + } + case 12: { + if (!(message.dataDisks && message.dataDisks.length)) + message.dataDisks = []; + message.dataDisks.push($root.google.dataflow.v1beta3.Disk.decode(reader, reader.uint32())); + break; + } + case 13: { + if (message.metadata === $util.emptyObject) + message.metadata = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.metadata[key] = value; + break; + } + case 14: { + message.autoscalingSettings = $root.google.dataflow.v1beta3.AutoscalingSettings.decode(reader, reader.uint32()); + break; + } + case 15: { + message.poolArgs = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + } + case 17: { + message.network = reader.string(); + break; + } + case 19: { + message.subnetwork = reader.string(); + break; + } + case 18: { + message.workerHarnessContainerImage = reader.string(); + break; + } + case 20: { + message.numThreadsPerWorker = reader.int32(); + break; + } + case 21: { + message.ipConfiguration = reader.int32(); + break; + } + case 22: { + if (!(message.sdkHarnessContainerImages && message.sdkHarnessContainerImages.length)) + message.sdkHarnessContainerImages = []; + message.sdkHarnessContainerImages.push($root.google.dataflow.v1beta3.SdkHarnessContainerImage.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WorkerPool message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.dataflow.v1beta3.WorkerPool + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.dataflow.v1beta3.WorkerPool} WorkerPool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WorkerPool.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WorkerPool message. + * @function verify + * @memberof google.dataflow.v1beta3.WorkerPool + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WorkerPool.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.kind != null && message.hasOwnProperty("kind")) + if (!$util.isString(message.kind)) + return "kind: string expected"; + if (message.numWorkers != null && message.hasOwnProperty("numWorkers")) + if (!$util.isInteger(message.numWorkers)) + return "numWorkers: integer expected"; + if (message.packages != null && message.hasOwnProperty("packages")) { + if (!Array.isArray(message.packages)) + return "packages: array expected"; + for (var i = 0; i < message.packages.length; ++i) { + var error = $root.google.dataflow.v1beta3.Package.verify(message.packages[i]); + if (error) + return "packages." + error; + } + } + if (message.defaultPackageSet != null && message.hasOwnProperty("defaultPackageSet")) + switch (message.defaultPackageSet) { + default: + return "defaultPackageSet: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.machineType != null && message.hasOwnProperty("machineType")) + if (!$util.isString(message.machineType)) + return "machineType: string expected"; + if (message.teardownPolicy != null && message.hasOwnProperty("teardownPolicy")) + switch (message.teardownPolicy) { + default: + return "teardownPolicy: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.diskSizeGb != null && message.hasOwnProperty("diskSizeGb")) + if (!$util.isInteger(message.diskSizeGb)) + return "diskSizeGb: integer expected"; + if (message.diskType != null && message.hasOwnProperty("diskType")) + if (!$util.isString(message.diskType)) + return "diskType: string expected"; + if (message.diskSourceImage != null && message.hasOwnProperty("diskSourceImage")) + if (!$util.isString(message.diskSourceImage)) + return "diskSourceImage: string expected"; + if (message.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: string expected"; + if (message.taskrunnerSettings != null && message.hasOwnProperty("taskrunnerSettings")) { + var error = $root.google.dataflow.v1beta3.TaskRunnerSettings.verify(message.taskrunnerSettings); + if (error) + return "taskrunnerSettings." + error; + } + if (message.onHostMaintenance != null && message.hasOwnProperty("onHostMaintenance")) + if (!$util.isString(message.onHostMaintenance)) + return "onHostMaintenance: string expected"; + if (message.dataDisks != null && message.hasOwnProperty("dataDisks")) { + if (!Array.isArray(message.dataDisks)) + return "dataDisks: array expected"; + for (var i = 0; i < message.dataDisks.length; ++i) { + var error = $root.google.dataflow.v1beta3.Disk.verify(message.dataDisks[i]); + if (error) + return "dataDisks." + error; + } + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + if (!$util.isObject(message.metadata)) + return "metadata: object expected"; + var key = Object.keys(message.metadata); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.metadata[key[i]])) + return "metadata: string{k:string} expected"; + } + if (message.autoscalingSettings != null && message.hasOwnProperty("autoscalingSettings")) { + var error = $root.google.dataflow.v1beta3.AutoscalingSettings.verify(message.autoscalingSettings); + if (error) + return "autoscalingSettings." + error; + } + if (message.poolArgs != null && message.hasOwnProperty("poolArgs")) { + var error = $root.google.protobuf.Any.verify(message.poolArgs); + if (error) + return "poolArgs." + error; + } + if (message.network != null && message.hasOwnProperty("network")) + if (!$util.isString(message.network)) + return "network: string expected"; + if (message.subnetwork != null && message.hasOwnProperty("subnetwork")) + if (!$util.isString(message.subnetwork)) + return "subnetwork: string expected"; + if (message.workerHarnessContainerImage != null && message.hasOwnProperty("workerHarnessContainerImage")) + if (!$util.isString(message.workerHarnessContainerImage)) + return "workerHarnessContainerImage: string expected"; + if (message.numThreadsPerWorker != null && message.hasOwnProperty("numThreadsPerWorker")) + if (!$util.isInteger(message.numThreadsPerWorker)) + return "numThreadsPerWorker: integer expected"; + if (message.ipConfiguration != null && message.hasOwnProperty("ipConfiguration")) + switch (message.ipConfiguration) { + default: + return "ipConfiguration: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.sdkHarnessContainerImages != null && message.hasOwnProperty("sdkHarnessContainerImages")) { + if (!Array.isArray(message.sdkHarnessContainerImages)) + return "sdkHarnessContainerImages: array expected"; + for (var i = 0; i < message.sdkHarnessContainerImages.length; ++i) { + var error = $root.google.dataflow.v1beta3.SdkHarnessContainerImage.verify(message.sdkHarnessContainerImages[i]); + if (error) + return "sdkHarnessContainerImages." + error; + } + } + return null; + }; + + /** + * Creates a WorkerPool message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.dataflow.v1beta3.WorkerPool + * @static + * @param {Object.} object Plain object + * @returns {google.dataflow.v1beta3.WorkerPool} WorkerPool + */ + WorkerPool.fromObject = function fromObject(object) { + if (object instanceof $root.google.dataflow.v1beta3.WorkerPool) + return object; + var message = new $root.google.dataflow.v1beta3.WorkerPool(); + if (object.kind != null) + message.kind = String(object.kind); + if (object.numWorkers != null) + message.numWorkers = object.numWorkers | 0; + if (object.packages) { + if (!Array.isArray(object.packages)) + throw TypeError(".google.dataflow.v1beta3.WorkerPool.packages: array expected"); + message.packages = []; + for (var i = 0; i < object.packages.length; ++i) { + if (typeof object.packages[i] !== "object") + throw TypeError(".google.dataflow.v1beta3.WorkerPool.packages: object expected"); + message.packages[i] = $root.google.dataflow.v1beta3.Package.fromObject(object.packages[i]); + } + } + switch (object.defaultPackageSet) { + default: + if (typeof object.defaultPackageSet === "number") { + message.defaultPackageSet = object.defaultPackageSet; + break; + } + break; + case "DEFAULT_PACKAGE_SET_UNKNOWN": + case 0: + message.defaultPackageSet = 0; + break; + case "DEFAULT_PACKAGE_SET_NONE": + case 1: + message.defaultPackageSet = 1; + break; + case "DEFAULT_PACKAGE_SET_JAVA": + case 2: + message.defaultPackageSet = 2; + break; + case "DEFAULT_PACKAGE_SET_PYTHON": + case 3: + message.defaultPackageSet = 3; + break; + } + if (object.machineType != null) + message.machineType = String(object.machineType); + switch (object.teardownPolicy) { + default: + if (typeof object.teardownPolicy === "number") { + message.teardownPolicy = object.teardownPolicy; + break; + } + break; + case "TEARDOWN_POLICY_UNKNOWN": + case 0: + message.teardownPolicy = 0; + break; + case "TEARDOWN_ALWAYS": + case 1: + message.teardownPolicy = 1; + break; + case "TEARDOWN_ON_SUCCESS": + case 2: + message.teardownPolicy = 2; + break; + case "TEARDOWN_NEVER": + case 3: + message.teardownPolicy = 3; + break; + } + if (object.diskSizeGb != null) + message.diskSizeGb = object.diskSizeGb | 0; + if (object.diskType != null) + message.diskType = String(object.diskType); + if (object.diskSourceImage != null) + message.diskSourceImage = String(object.diskSourceImage); + if (object.zone != null) + message.zone = String(object.zone); + if (object.taskrunnerSettings != null) { + if (typeof object.taskrunnerSettings !== "object") + throw TypeError(".google.dataflow.v1beta3.WorkerPool.taskrunnerSettings: object expected"); + message.taskrunnerSettings = $root.google.dataflow.v1beta3.TaskRunnerSettings.fromObject(object.taskrunnerSettings); + } + if (object.onHostMaintenance != null) + message.onHostMaintenance = String(object.onHostMaintenance); + if (object.dataDisks) { + if (!Array.isArray(object.dataDisks)) + throw TypeError(".google.dataflow.v1beta3.WorkerPool.dataDisks: array expected"); + message.dataDisks = []; + for (var i = 0; i < object.dataDisks.length; ++i) { + if (typeof object.dataDisks[i] !== "object") + throw TypeError(".google.dataflow.v1beta3.WorkerPool.dataDisks: object expected"); + message.dataDisks[i] = $root.google.dataflow.v1beta3.Disk.fromObject(object.dataDisks[i]); + } + } + if (object.metadata) { + if (typeof object.metadata !== "object") + throw TypeError(".google.dataflow.v1beta3.WorkerPool.metadata: object expected"); + message.metadata = {}; + for (var keys = Object.keys(object.metadata), i = 0; i < keys.length; ++i) + message.metadata[keys[i]] = String(object.metadata[keys[i]]); + } + if (object.autoscalingSettings != null) { + if (typeof object.autoscalingSettings !== "object") + throw TypeError(".google.dataflow.v1beta3.WorkerPool.autoscalingSettings: object expected"); + message.autoscalingSettings = $root.google.dataflow.v1beta3.AutoscalingSettings.fromObject(object.autoscalingSettings); + } + if (object.poolArgs != null) { + if (typeof object.poolArgs !== "object") + throw TypeError(".google.dataflow.v1beta3.WorkerPool.poolArgs: object expected"); + message.poolArgs = $root.google.protobuf.Any.fromObject(object.poolArgs); + } + if (object.network != null) + message.network = String(object.network); + if (object.subnetwork != null) + message.subnetwork = String(object.subnetwork); + if (object.workerHarnessContainerImage != null) + message.workerHarnessContainerImage = String(object.workerHarnessContainerImage); + if (object.numThreadsPerWorker != null) + message.numThreadsPerWorker = object.numThreadsPerWorker | 0; + switch (object.ipConfiguration) { + default: + if (typeof object.ipConfiguration === "number") { + message.ipConfiguration = object.ipConfiguration; + break; + } + break; + case "WORKER_IP_UNSPECIFIED": + case 0: + message.ipConfiguration = 0; + break; + case "WORKER_IP_PUBLIC": + case 1: + message.ipConfiguration = 1; + break; + case "WORKER_IP_PRIVATE": + case 2: + message.ipConfiguration = 2; + break; + } + if (object.sdkHarnessContainerImages) { + if (!Array.isArray(object.sdkHarnessContainerImages)) + throw TypeError(".google.dataflow.v1beta3.WorkerPool.sdkHarnessContainerImages: array expected"); + message.sdkHarnessContainerImages = []; + for (var i = 0; i < object.sdkHarnessContainerImages.length; ++i) { + if (typeof object.sdkHarnessContainerImages[i] !== "object") + throw TypeError(".google.dataflow.v1beta3.WorkerPool.sdkHarnessContainerImages: object expected"); + message.sdkHarnessContainerImages[i] = $root.google.dataflow.v1beta3.SdkHarnessContainerImage.fromObject(object.sdkHarnessContainerImages[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a WorkerPool message. Also converts values to other types if specified. + * @function toObject + * @memberof google.dataflow.v1beta3.WorkerPool + * @static + * @param {google.dataflow.v1beta3.WorkerPool} message WorkerPool + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WorkerPool.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.packages = []; + object.dataDisks = []; + object.sdkHarnessContainerImages = []; + } + if (options.objects || options.defaults) + object.metadata = {}; + if (options.defaults) { + object.kind = ""; + object.numWorkers = 0; + object.defaultPackageSet = options.enums === String ? "DEFAULT_PACKAGE_SET_UNKNOWN" : 0; + object.machineType = ""; + object.teardownPolicy = options.enums === String ? "TEARDOWN_POLICY_UNKNOWN" : 0; + object.diskSizeGb = 0; + object.diskSourceImage = ""; + object.zone = ""; + object.taskrunnerSettings = null; + object.onHostMaintenance = ""; + object.autoscalingSettings = null; + object.poolArgs = null; + object.diskType = ""; + object.network = ""; + object.workerHarnessContainerImage = ""; + object.subnetwork = ""; + object.numThreadsPerWorker = 0; + object.ipConfiguration = options.enums === String ? "WORKER_IP_UNSPECIFIED" : 0; + } + if (message.kind != null && message.hasOwnProperty("kind")) + object.kind = message.kind; + if (message.numWorkers != null && message.hasOwnProperty("numWorkers")) + object.numWorkers = message.numWorkers; + if (message.packages && message.packages.length) { + object.packages = []; + for (var j = 0; j < message.packages.length; ++j) + object.packages[j] = $root.google.dataflow.v1beta3.Package.toObject(message.packages[j], options); + } + if (message.defaultPackageSet != null && message.hasOwnProperty("defaultPackageSet")) + object.defaultPackageSet = options.enums === String ? $root.google.dataflow.v1beta3.DefaultPackageSet[message.defaultPackageSet] === undefined ? message.defaultPackageSet : $root.google.dataflow.v1beta3.DefaultPackageSet[message.defaultPackageSet] : message.defaultPackageSet; + if (message.machineType != null && message.hasOwnProperty("machineType")) + object.machineType = message.machineType; + if (message.teardownPolicy != null && message.hasOwnProperty("teardownPolicy")) + object.teardownPolicy = options.enums === String ? $root.google.dataflow.v1beta3.TeardownPolicy[message.teardownPolicy] === undefined ? message.teardownPolicy : $root.google.dataflow.v1beta3.TeardownPolicy[message.teardownPolicy] : message.teardownPolicy; + if (message.diskSizeGb != null && message.hasOwnProperty("diskSizeGb")) + object.diskSizeGb = message.diskSizeGb; + if (message.diskSourceImage != null && message.hasOwnProperty("diskSourceImage")) + object.diskSourceImage = message.diskSourceImage; + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + if (message.taskrunnerSettings != null && message.hasOwnProperty("taskrunnerSettings")) + object.taskrunnerSettings = $root.google.dataflow.v1beta3.TaskRunnerSettings.toObject(message.taskrunnerSettings, options); + if (message.onHostMaintenance != null && message.hasOwnProperty("onHostMaintenance")) + object.onHostMaintenance = message.onHostMaintenance; + if (message.dataDisks && message.dataDisks.length) { + object.dataDisks = []; + for (var j = 0; j < message.dataDisks.length; ++j) + object.dataDisks[j] = $root.google.dataflow.v1beta3.Disk.toObject(message.dataDisks[j], options); + } + var keys2; + if (message.metadata && (keys2 = Object.keys(message.metadata)).length) { + object.metadata = {}; + for (var j = 0; j < keys2.length; ++j) + object.metadata[keys2[j]] = message.metadata[keys2[j]]; + } + if (message.autoscalingSettings != null && message.hasOwnProperty("autoscalingSettings")) + object.autoscalingSettings = $root.google.dataflow.v1beta3.AutoscalingSettings.toObject(message.autoscalingSettings, options); + if (message.poolArgs != null && message.hasOwnProperty("poolArgs")) + object.poolArgs = $root.google.protobuf.Any.toObject(message.poolArgs, options); + if (message.diskType != null && message.hasOwnProperty("diskType")) + object.diskType = message.diskType; + if (message.network != null && message.hasOwnProperty("network")) + object.network = message.network; + if (message.workerHarnessContainerImage != null && message.hasOwnProperty("workerHarnessContainerImage")) + object.workerHarnessContainerImage = message.workerHarnessContainerImage; + if (message.subnetwork != null && message.hasOwnProperty("subnetwork")) + object.subnetwork = message.subnetwork; + if (message.numThreadsPerWorker != null && message.hasOwnProperty("numThreadsPerWorker")) + object.numThreadsPerWorker = message.numThreadsPerWorker; + if (message.ipConfiguration != null && message.hasOwnProperty("ipConfiguration")) + object.ipConfiguration = options.enums === String ? $root.google.dataflow.v1beta3.WorkerIPAddressConfiguration[message.ipConfiguration] === undefined ? message.ipConfiguration : $root.google.dataflow.v1beta3.WorkerIPAddressConfiguration[message.ipConfiguration] : message.ipConfiguration; + if (message.sdkHarnessContainerImages && message.sdkHarnessContainerImages.length) { + object.sdkHarnessContainerImages = []; + for (var j = 0; j < message.sdkHarnessContainerImages.length; ++j) + object.sdkHarnessContainerImages[j] = $root.google.dataflow.v1beta3.SdkHarnessContainerImage.toObject(message.sdkHarnessContainerImages[j], options); + } + return object; + }; + + /** + * Converts this WorkerPool to JSON. + * @function toJSON + * @memberof google.dataflow.v1beta3.WorkerPool + * @instance + * @returns {Object.} JSON object + */ + WorkerPool.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for WorkerPool + * @function getTypeUrl + * @memberof google.dataflow.v1beta3.WorkerPool + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WorkerPool.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.dataflow.v1beta3.WorkerPool"; + }; + + return WorkerPool; + })(); + + /** + * ShuffleMode enum. + * @name google.dataflow.v1beta3.ShuffleMode + * @enum {number} + * @property {number} SHUFFLE_MODE_UNSPECIFIED=0 SHUFFLE_MODE_UNSPECIFIED value + * @property {number} VM_BASED=1 VM_BASED value + * @property {number} SERVICE_BASED=2 SERVICE_BASED value + */ + v1beta3.ShuffleMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SHUFFLE_MODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "VM_BASED"] = 1; + values[valuesById[2] = "SERVICE_BASED"] = 2; + return values; + })(); + + v1beta3.DebugOptions = (function() { + + /** + * Properties of a DebugOptions. + * @memberof google.dataflow.v1beta3 + * @interface IDebugOptions + * @property {boolean|null} [enableHotKeyLogging] DebugOptions enableHotKeyLogging + */ + + /** + * Constructs a new DebugOptions. + * @memberof google.dataflow.v1beta3 + * @classdesc Represents a DebugOptions. + * @implements IDebugOptions + * @constructor + * @param {google.dataflow.v1beta3.IDebugOptions=} [properties] Properties to set + */ + function DebugOptions(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DebugOptions enableHotKeyLogging. + * @member {boolean} enableHotKeyLogging + * @memberof google.dataflow.v1beta3.DebugOptions + * @instance + */ + DebugOptions.prototype.enableHotKeyLogging = false; + + /** + * Creates a new DebugOptions instance using the specified properties. + * @function create + * @memberof google.dataflow.v1beta3.DebugOptions + * @static + * @param {google.dataflow.v1beta3.IDebugOptions=} [properties] Properties to set + * @returns {google.dataflow.v1beta3.DebugOptions} DebugOptions instance + */ + DebugOptions.create = function create(properties) { + return new DebugOptions(properties); + }; + + /** + * Encodes the specified DebugOptions message. Does not implicitly {@link google.dataflow.v1beta3.DebugOptions.verify|verify} messages. + * @function encode + * @memberof google.dataflow.v1beta3.DebugOptions + * @static + * @param {google.dataflow.v1beta3.IDebugOptions} message DebugOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DebugOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.enableHotKeyLogging != null && Object.hasOwnProperty.call(message, "enableHotKeyLogging")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enableHotKeyLogging); + return writer; + }; + + /** + * Encodes the specified DebugOptions message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.DebugOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.dataflow.v1beta3.DebugOptions + * @static + * @param {google.dataflow.v1beta3.IDebugOptions} message DebugOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DebugOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DebugOptions message from the specified reader or buffer. + * @function decode + * @memberof google.dataflow.v1beta3.DebugOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.dataflow.v1beta3.DebugOptions} DebugOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DebugOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.dataflow.v1beta3.DebugOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.enableHotKeyLogging = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DebugOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.dataflow.v1beta3.DebugOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.dataflow.v1beta3.DebugOptions} DebugOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DebugOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DebugOptions message. + * @function verify + * @memberof google.dataflow.v1beta3.DebugOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DebugOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.enableHotKeyLogging != null && message.hasOwnProperty("enableHotKeyLogging")) + if (typeof message.enableHotKeyLogging !== "boolean") + return "enableHotKeyLogging: boolean expected"; + return null; + }; + + /** + * Creates a DebugOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.dataflow.v1beta3.DebugOptions + * @static + * @param {Object.} object Plain object + * @returns {google.dataflow.v1beta3.DebugOptions} DebugOptions + */ + DebugOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.dataflow.v1beta3.DebugOptions) + return object; + var message = new $root.google.dataflow.v1beta3.DebugOptions(); + if (object.enableHotKeyLogging != null) + message.enableHotKeyLogging = Boolean(object.enableHotKeyLogging); + return message; + }; + + /** + * Creates a plain object from a DebugOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.dataflow.v1beta3.DebugOptions + * @static + * @param {google.dataflow.v1beta3.DebugOptions} message DebugOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DebugOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.enableHotKeyLogging = false; + if (message.enableHotKeyLogging != null && message.hasOwnProperty("enableHotKeyLogging")) + object.enableHotKeyLogging = message.enableHotKeyLogging; + return object; + }; + + /** + * Converts this DebugOptions to JSON. + * @function toJSON + * @memberof google.dataflow.v1beta3.DebugOptions + * @instance + * @returns {Object.} JSON object + */ + DebugOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DebugOptions + * @function getTypeUrl + * @memberof google.dataflow.v1beta3.DebugOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DebugOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.dataflow.v1beta3.DebugOptions"; + }; + + return DebugOptions; + })(); + + v1beta3.JobsV1Beta3 = (function() { + + /** + * Constructs a new JobsV1Beta3 service. + * @memberof google.dataflow.v1beta3 + * @classdesc Represents a JobsV1Beta3 + * @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 JobsV1Beta3(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (JobsV1Beta3.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = JobsV1Beta3; + + /** + * Creates new JobsV1Beta3 service using the specified rpc implementation. + * @function create + * @memberof google.dataflow.v1beta3.JobsV1Beta3 + * @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 {JobsV1Beta3} RPC service. Useful where requests and/or responses are streamed. + */ + JobsV1Beta3.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.dataflow.v1beta3.JobsV1Beta3|createJob}. + * @memberof google.dataflow.v1beta3.JobsV1Beta3 + * @typedef CreateJobCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.dataflow.v1beta3.Job} [response] Job + */ + + /** + * Calls CreateJob. + * @function createJob + * @memberof google.dataflow.v1beta3.JobsV1Beta3 + * @instance + * @param {google.dataflow.v1beta3.ICreateJobRequest} request CreateJobRequest message or plain object + * @param {google.dataflow.v1beta3.JobsV1Beta3.CreateJobCallback} callback Node-style callback called with the error, if any, and Job + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(JobsV1Beta3.prototype.createJob = function createJob(request, callback) { + return this.rpcCall(createJob, $root.google.dataflow.v1beta3.CreateJobRequest, $root.google.dataflow.v1beta3.Job, request, callback); + }, "name", { value: "CreateJob" }); + + /** + * Calls CreateJob. + * @function createJob + * @memberof google.dataflow.v1beta3.JobsV1Beta3 + * @instance + * @param {google.dataflow.v1beta3.ICreateJobRequest} request CreateJobRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.dataflow.v1beta3.JobsV1Beta3|getJob}. + * @memberof google.dataflow.v1beta3.JobsV1Beta3 + * @typedef GetJobCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.dataflow.v1beta3.Job} [response] Job + */ + + /** + * Calls GetJob. + * @function getJob + * @memberof google.dataflow.v1beta3.JobsV1Beta3 + * @instance + * @param {google.dataflow.v1beta3.IGetJobRequest} request GetJobRequest message or plain object + * @param {google.dataflow.v1beta3.JobsV1Beta3.GetJobCallback} callback Node-style callback called with the error, if any, and Job + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(JobsV1Beta3.prototype.getJob = function getJob(request, callback) { + return this.rpcCall(getJob, $root.google.dataflow.v1beta3.GetJobRequest, $root.google.dataflow.v1beta3.Job, request, callback); + }, "name", { value: "GetJob" }); + + /** + * Calls GetJob. + * @function getJob + * @memberof google.dataflow.v1beta3.JobsV1Beta3 + * @instance + * @param {google.dataflow.v1beta3.IGetJobRequest} request GetJobRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.dataflow.v1beta3.JobsV1Beta3|updateJob}. + * @memberof google.dataflow.v1beta3.JobsV1Beta3 + * @typedef UpdateJobCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.dataflow.v1beta3.Job} [response] Job + */ + + /** + * Calls UpdateJob. + * @function updateJob + * @memberof google.dataflow.v1beta3.JobsV1Beta3 + * @instance + * @param {google.dataflow.v1beta3.IUpdateJobRequest} request UpdateJobRequest message or plain object + * @param {google.dataflow.v1beta3.JobsV1Beta3.UpdateJobCallback} callback Node-style callback called with the error, if any, and Job + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(JobsV1Beta3.prototype.updateJob = function updateJob(request, callback) { + return this.rpcCall(updateJob, $root.google.dataflow.v1beta3.UpdateJobRequest, $root.google.dataflow.v1beta3.Job, request, callback); + }, "name", { value: "UpdateJob" }); + + /** + * Calls UpdateJob. + * @function updateJob + * @memberof google.dataflow.v1beta3.JobsV1Beta3 + * @instance + * @param {google.dataflow.v1beta3.IUpdateJobRequest} request UpdateJobRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.dataflow.v1beta3.JobsV1Beta3|listJobs}. + * @memberof google.dataflow.v1beta3.JobsV1Beta3 + * @typedef ListJobsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.dataflow.v1beta3.ListJobsResponse} [response] ListJobsResponse + */ + + /** + * Calls ListJobs. + * @function listJobs + * @memberof google.dataflow.v1beta3.JobsV1Beta3 + * @instance + * @param {google.dataflow.v1beta3.IListJobsRequest} request ListJobsRequest message or plain object + * @param {google.dataflow.v1beta3.JobsV1Beta3.ListJobsCallback} callback Node-style callback called with the error, if any, and ListJobsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(JobsV1Beta3.prototype.listJobs = function listJobs(request, callback) { + return this.rpcCall(listJobs, $root.google.dataflow.v1beta3.ListJobsRequest, $root.google.dataflow.v1beta3.ListJobsResponse, request, callback); + }, "name", { value: "ListJobs" }); + + /** + * Calls ListJobs. + * @function listJobs + * @memberof google.dataflow.v1beta3.JobsV1Beta3 + * @instance + * @param {google.dataflow.v1beta3.IListJobsRequest} request ListJobsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.dataflow.v1beta3.JobsV1Beta3|aggregatedListJobs}. + * @memberof google.dataflow.v1beta3.JobsV1Beta3 + * @typedef AggregatedListJobsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.dataflow.v1beta3.ListJobsResponse} [response] ListJobsResponse + */ + + /** + * Calls AggregatedListJobs. + * @function aggregatedListJobs + * @memberof google.dataflow.v1beta3.JobsV1Beta3 + * @instance + * @param {google.dataflow.v1beta3.IListJobsRequest} request ListJobsRequest message or plain object + * @param {google.dataflow.v1beta3.JobsV1Beta3.AggregatedListJobsCallback} callback Node-style callback called with the error, if any, and ListJobsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(JobsV1Beta3.prototype.aggregatedListJobs = function aggregatedListJobs(request, callback) { + return this.rpcCall(aggregatedListJobs, $root.google.dataflow.v1beta3.ListJobsRequest, $root.google.dataflow.v1beta3.ListJobsResponse, request, callback); + }, "name", { value: "AggregatedListJobs" }); + + /** + * Calls AggregatedListJobs. + * @function aggregatedListJobs + * @memberof google.dataflow.v1beta3.JobsV1Beta3 + * @instance + * @param {google.dataflow.v1beta3.IListJobsRequest} request ListJobsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.dataflow.v1beta3.JobsV1Beta3|checkActiveJobs}. + * @memberof google.dataflow.v1beta3.JobsV1Beta3 + * @typedef CheckActiveJobsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.dataflow.v1beta3.CheckActiveJobsResponse} [response] CheckActiveJobsResponse + */ + + /** + * Calls CheckActiveJobs. + * @function checkActiveJobs + * @memberof google.dataflow.v1beta3.JobsV1Beta3 + * @instance + * @param {google.dataflow.v1beta3.ICheckActiveJobsRequest} request CheckActiveJobsRequest message or plain object + * @param {google.dataflow.v1beta3.JobsV1Beta3.CheckActiveJobsCallback} callback Node-style callback called with the error, if any, and CheckActiveJobsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(JobsV1Beta3.prototype.checkActiveJobs = function checkActiveJobs(request, callback) { + return this.rpcCall(checkActiveJobs, $root.google.dataflow.v1beta3.CheckActiveJobsRequest, $root.google.dataflow.v1beta3.CheckActiveJobsResponse, request, callback); + }, "name", { value: "CheckActiveJobs" }); + + /** + * Calls CheckActiveJobs. + * @function checkActiveJobs + * @memberof google.dataflow.v1beta3.JobsV1Beta3 + * @instance + * @param {google.dataflow.v1beta3.ICheckActiveJobsRequest} request CheckActiveJobsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.dataflow.v1beta3.JobsV1Beta3|snapshotJob}. + * @memberof google.dataflow.v1beta3.JobsV1Beta3 + * @typedef SnapshotJobCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.dataflow.v1beta3.Snapshot} [response] Snapshot + */ + + /** + * Calls SnapshotJob. + * @function snapshotJob + * @memberof google.dataflow.v1beta3.JobsV1Beta3 + * @instance + * @param {google.dataflow.v1beta3.ISnapshotJobRequest} request SnapshotJobRequest message or plain object + * @param {google.dataflow.v1beta3.JobsV1Beta3.SnapshotJobCallback} callback Node-style callback called with the error, if any, and Snapshot + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(JobsV1Beta3.prototype.snapshotJob = function snapshotJob(request, callback) { + return this.rpcCall(snapshotJob, $root.google.dataflow.v1beta3.SnapshotJobRequest, $root.google.dataflow.v1beta3.Snapshot, request, callback); + }, "name", { value: "SnapshotJob" }); + + /** + * Calls SnapshotJob. + * @function snapshotJob + * @memberof google.dataflow.v1beta3.JobsV1Beta3 + * @instance + * @param {google.dataflow.v1beta3.ISnapshotJobRequest} request SnapshotJobRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return JobsV1Beta3; + })(); + + v1beta3.Job = (function() { + + /** + * Properties of a Job. + * @memberof google.dataflow.v1beta3 + * @interface IJob + * @property {string|null} [id] Job id + * @property {string|null} [projectId] Job projectId + * @property {string|null} [name] Job name + * @property {google.dataflow.v1beta3.JobType|null} [type] Job type + * @property {google.dataflow.v1beta3.IEnvironment|null} [environment] Job environment + * @property {Array.|null} [steps] Job steps + * @property {string|null} [stepsLocation] Job stepsLocation + * @property {google.dataflow.v1beta3.JobState|null} [currentState] Job currentState + * @property {google.protobuf.ITimestamp|null} [currentStateTime] Job currentStateTime + * @property {google.dataflow.v1beta3.JobState|null} [requestedState] Job requestedState + * @property {google.dataflow.v1beta3.IJobExecutionInfo|null} [executionInfo] Job executionInfo + * @property {google.protobuf.ITimestamp|null} [createTime] Job createTime + * @property {string|null} [replaceJobId] Job replaceJobId + * @property {Object.|null} [transformNameMapping] Job transformNameMapping + * @property {string|null} [clientRequestId] Job clientRequestId + * @property {string|null} [replacedByJobId] Job replacedByJobId + * @property {Array.|null} [tempFiles] Job tempFiles + * @property {Object.|null} [labels] Job labels + * @property {string|null} [location] Job location + * @property {google.dataflow.v1beta3.IPipelineDescription|null} [pipelineDescription] Job pipelineDescription + * @property {Array.|null} [stageStates] Job stageStates + * @property {google.dataflow.v1beta3.IJobMetadata|null} [jobMetadata] Job jobMetadata + * @property {google.protobuf.ITimestamp|null} [startTime] Job startTime + * @property {string|null} [createdFromSnapshotId] Job createdFromSnapshotId + * @property {boolean|null} [satisfiesPzs] Job satisfiesPzs + */ + + /** + * Constructs a new Job. + * @memberof google.dataflow.v1beta3 + * @classdesc Represents a Job. + * @implements IJob + * @constructor + * @param {google.dataflow.v1beta3.IJob=} [properties] Properties to set + */ + function Job(properties) { + this.steps = []; + this.transformNameMapping = {}; + this.tempFiles = []; + this.labels = {}; + this.stageStates = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Job id. + * @member {string} id + * @memberof google.dataflow.v1beta3.Job + * @instance + */ + Job.prototype.id = ""; + + /** + * Job projectId. + * @member {string} projectId + * @memberof google.dataflow.v1beta3.Job + * @instance + */ + Job.prototype.projectId = ""; + + /** + * Job name. + * @member {string} name + * @memberof google.dataflow.v1beta3.Job + * @instance + */ + Job.prototype.name = ""; + + /** + * Job type. + * @member {google.dataflow.v1beta3.JobType} type + * @memberof google.dataflow.v1beta3.Job + * @instance + */ + Job.prototype.type = 0; + + /** + * Job environment. + * @member {google.dataflow.v1beta3.IEnvironment|null|undefined} environment + * @memberof google.dataflow.v1beta3.Job + * @instance + */ + Job.prototype.environment = null; + + /** + * Job steps. + * @member {Array.} steps + * @memberof google.dataflow.v1beta3.Job + * @instance + */ + Job.prototype.steps = $util.emptyArray; + + /** + * Job stepsLocation. + * @member {string} stepsLocation + * @memberof google.dataflow.v1beta3.Job + * @instance + */ + Job.prototype.stepsLocation = ""; + + /** + * Job currentState. + * @member {google.dataflow.v1beta3.JobState} currentState + * @memberof google.dataflow.v1beta3.Job + * @instance + */ + Job.prototype.currentState = 0; + + /** + * Job currentStateTime. + * @member {google.protobuf.ITimestamp|null|undefined} currentStateTime + * @memberof google.dataflow.v1beta3.Job + * @instance + */ + Job.prototype.currentStateTime = null; + + /** + * Job requestedState. + * @member {google.dataflow.v1beta3.JobState} requestedState + * @memberof google.dataflow.v1beta3.Job + * @instance + */ + Job.prototype.requestedState = 0; + + /** + * Job executionInfo. + * @member {google.dataflow.v1beta3.IJobExecutionInfo|null|undefined} executionInfo + * @memberof google.dataflow.v1beta3.Job + * @instance + */ + Job.prototype.executionInfo = null; + + /** + * Job createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.dataflow.v1beta3.Job + * @instance + */ + Job.prototype.createTime = null; + + /** + * Job replaceJobId. + * @member {string} replaceJobId + * @memberof google.dataflow.v1beta3.Job + * @instance + */ + Job.prototype.replaceJobId = ""; + + /** + * Job transformNameMapping. + * @member {Object.} transformNameMapping + * @memberof google.dataflow.v1beta3.Job + * @instance + */ + Job.prototype.transformNameMapping = $util.emptyObject; + + /** + * Job clientRequestId. + * @member {string} clientRequestId + * @memberof google.dataflow.v1beta3.Job + * @instance + */ + Job.prototype.clientRequestId = ""; + + /** + * Job replacedByJobId. + * @member {string} replacedByJobId + * @memberof google.dataflow.v1beta3.Job + * @instance + */ + Job.prototype.replacedByJobId = ""; + + /** + * Job tempFiles. + * @member {Array.} tempFiles + * @memberof google.dataflow.v1beta3.Job + * @instance + */ + Job.prototype.tempFiles = $util.emptyArray; + + /** + * Job labels. + * @member {Object.} labels + * @memberof google.dataflow.v1beta3.Job + * @instance + */ + Job.prototype.labels = $util.emptyObject; + + /** + * Job location. + * @member {string} location + * @memberof google.dataflow.v1beta3.Job + * @instance + */ + Job.prototype.location = ""; + + /** + * Job pipelineDescription. + * @member {google.dataflow.v1beta3.IPipelineDescription|null|undefined} pipelineDescription + * @memberof google.dataflow.v1beta3.Job + * @instance + */ + Job.prototype.pipelineDescription = null; + + /** + * Job stageStates. + * @member {Array.} stageStates + * @memberof google.dataflow.v1beta3.Job + * @instance + */ + Job.prototype.stageStates = $util.emptyArray; + + /** + * Job jobMetadata. + * @member {google.dataflow.v1beta3.IJobMetadata|null|undefined} jobMetadata + * @memberof google.dataflow.v1beta3.Job + * @instance + */ + Job.prototype.jobMetadata = null; + + /** + * Job startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.dataflow.v1beta3.Job + * @instance + */ + Job.prototype.startTime = null; + + /** + * Job createdFromSnapshotId. + * @member {string} createdFromSnapshotId + * @memberof google.dataflow.v1beta3.Job + * @instance + */ + Job.prototype.createdFromSnapshotId = ""; + + /** + * Job satisfiesPzs. + * @member {boolean} satisfiesPzs + * @memberof google.dataflow.v1beta3.Job + * @instance + */ + Job.prototype.satisfiesPzs = false; + + /** + * Creates a new Job instance using the specified properties. + * @function create + * @memberof google.dataflow.v1beta3.Job + * @static + * @param {google.dataflow.v1beta3.IJob=} [properties] Properties to set + * @returns {google.dataflow.v1beta3.Job} Job instance + */ + Job.create = function create(properties) { + return new Job(properties); + }; + + /** + * Encodes the specified Job message. Does not implicitly {@link google.dataflow.v1beta3.Job.verify|verify} messages. + * @function encode + * @memberof google.dataflow.v1beta3.Job + * @static + * @param {google.dataflow.v1beta3.IJob} message Job message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Job.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.id); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.projectId); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.name); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.type); + if (message.environment != null && Object.hasOwnProperty.call(message, "environment")) + $root.google.dataflow.v1beta3.Environment.encode(message.environment, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.steps != null && message.steps.length) + for (var i = 0; i < message.steps.length; ++i) + $root.google.dataflow.v1beta3.Step.encode(message.steps[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.currentState != null && Object.hasOwnProperty.call(message, "currentState")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.currentState); + if (message.currentStateTime != null && Object.hasOwnProperty.call(message, "currentStateTime")) + $root.google.protobuf.Timestamp.encode(message.currentStateTime, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.requestedState != null && Object.hasOwnProperty.call(message, "requestedState")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.requestedState); + if (message.executionInfo != null && Object.hasOwnProperty.call(message, "executionInfo")) + $root.google.dataflow.v1beta3.JobExecutionInfo.encode(message.executionInfo, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.replaceJobId != null && Object.hasOwnProperty.call(message, "replaceJobId")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.replaceJobId); + if (message.transformNameMapping != null && Object.hasOwnProperty.call(message, "transformNameMapping")) + for (var keys = Object.keys(message.transformNameMapping), i = 0; i < keys.length; ++i) + writer.uint32(/* id 13, wireType 2 =*/106).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.transformNameMapping[keys[i]]).ldelim(); + if (message.clientRequestId != null && Object.hasOwnProperty.call(message, "clientRequestId")) + writer.uint32(/* id 14, wireType 2 =*/114).string(message.clientRequestId); + if (message.replacedByJobId != null && Object.hasOwnProperty.call(message, "replacedByJobId")) + writer.uint32(/* id 15, wireType 2 =*/122).string(message.replacedByJobId); + if (message.tempFiles != null && message.tempFiles.length) + for (var i = 0; i < message.tempFiles.length; ++i) + writer.uint32(/* id 16, wireType 2 =*/130).string(message.tempFiles[i]); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 17, wireType 2 =*/138).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 18, wireType 2 =*/146).string(message.location); + if (message.pipelineDescription != null && Object.hasOwnProperty.call(message, "pipelineDescription")) + $root.google.dataflow.v1beta3.PipelineDescription.encode(message.pipelineDescription, writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); + if (message.stageStates != null && message.stageStates.length) + for (var i = 0; i < message.stageStates.length; ++i) + $root.google.dataflow.v1beta3.ExecutionStageState.encode(message.stageStates[i], writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); + if (message.jobMetadata != null && Object.hasOwnProperty.call(message, "jobMetadata")) + $root.google.dataflow.v1beta3.JobMetadata.encode(message.jobMetadata, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); + if (message.createdFromSnapshotId != null && Object.hasOwnProperty.call(message, "createdFromSnapshotId")) + writer.uint32(/* id 23, wireType 2 =*/186).string(message.createdFromSnapshotId); + if (message.stepsLocation != null && Object.hasOwnProperty.call(message, "stepsLocation")) + writer.uint32(/* id 24, wireType 2 =*/194).string(message.stepsLocation); + if (message.satisfiesPzs != null && Object.hasOwnProperty.call(message, "satisfiesPzs")) + writer.uint32(/* id 25, wireType 0 =*/200).bool(message.satisfiesPzs); + return writer; + }; + + /** + * Encodes the specified Job message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.Job.verify|verify} messages. + * @function encodeDelimited + * @memberof google.dataflow.v1beta3.Job + * @static + * @param {google.dataflow.v1beta3.IJob} message Job message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Job.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Job message from the specified reader or buffer. + * @function decode + * @memberof google.dataflow.v1beta3.Job + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.dataflow.v1beta3.Job} Job + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Job.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.dataflow.v1beta3.Job(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.id = reader.string(); + break; + } + case 2: { + message.projectId = reader.string(); + break; + } + case 3: { + message.name = reader.string(); + break; + } + case 4: { + message.type = reader.int32(); + break; + } + case 5: { + message.environment = $root.google.dataflow.v1beta3.Environment.decode(reader, reader.uint32()); + break; + } + case 6: { + if (!(message.steps && message.steps.length)) + message.steps = []; + message.steps.push($root.google.dataflow.v1beta3.Step.decode(reader, reader.uint32())); + break; + } + case 24: { + message.stepsLocation = reader.string(); + break; + } + case 7: { + message.currentState = reader.int32(); + break; + } + case 8: { + message.currentStateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 9: { + message.requestedState = reader.int32(); + break; + } + case 10: { + message.executionInfo = $root.google.dataflow.v1beta3.JobExecutionInfo.decode(reader, reader.uint32()); + break; + } + case 11: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 12: { + message.replaceJobId = reader.string(); + break; + } + case 13: { + if (message.transformNameMapping === $util.emptyObject) + message.transformNameMapping = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.transformNameMapping[key] = value; + break; + } + case 14: { + message.clientRequestId = reader.string(); + break; + } + case 15: { + message.replacedByJobId = reader.string(); + break; + } + case 16: { + if (!(message.tempFiles && message.tempFiles.length)) + message.tempFiles = []; + message.tempFiles.push(reader.string()); + break; + } + case 17: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + case 18: { + message.location = reader.string(); + break; + } + case 19: { + message.pipelineDescription = $root.google.dataflow.v1beta3.PipelineDescription.decode(reader, reader.uint32()); + break; + } + case 20: { + if (!(message.stageStates && message.stageStates.length)) + message.stageStates = []; + message.stageStates.push($root.google.dataflow.v1beta3.ExecutionStageState.decode(reader, reader.uint32())); + break; + } + case 21: { + message.jobMetadata = $root.google.dataflow.v1beta3.JobMetadata.decode(reader, reader.uint32()); + break; + } + case 22: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 23: { + message.createdFromSnapshotId = reader.string(); + break; + } + case 25: { + message.satisfiesPzs = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Job message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.dataflow.v1beta3.Job + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.dataflow.v1beta3.Job} Job + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Job.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Job message. + * @function verify + * @memberof google.dataflow.v1beta3.Job + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Job.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string expected"; + if (message.projectId != null && message.hasOwnProperty("projectId")) + if (!$util.isString(message.projectId)) + return "projectId: string expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.environment != null && message.hasOwnProperty("environment")) { + var error = $root.google.dataflow.v1beta3.Environment.verify(message.environment); + if (error) + return "environment." + error; + } + if (message.steps != null && message.hasOwnProperty("steps")) { + if (!Array.isArray(message.steps)) + return "steps: array expected"; + for (var i = 0; i < message.steps.length; ++i) { + var error = $root.google.dataflow.v1beta3.Step.verify(message.steps[i]); + if (error) + return "steps." + error; + } + } + if (message.stepsLocation != null && message.hasOwnProperty("stepsLocation")) + if (!$util.isString(message.stepsLocation)) + return "stepsLocation: string expected"; + if (message.currentState != null && message.hasOwnProperty("currentState")) + switch (message.currentState) { + default: + return "currentState: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + break; + } + if (message.currentStateTime != null && message.hasOwnProperty("currentStateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.currentStateTime); + if (error) + return "currentStateTime." + error; + } + if (message.requestedState != null && message.hasOwnProperty("requestedState")) + switch (message.requestedState) { + default: + return "requestedState: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + break; + } + if (message.executionInfo != null && message.hasOwnProperty("executionInfo")) { + var error = $root.google.dataflow.v1beta3.JobExecutionInfo.verify(message.executionInfo); + if (error) + return "executionInfo." + error; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.replaceJobId != null && message.hasOwnProperty("replaceJobId")) + if (!$util.isString(message.replaceJobId)) + return "replaceJobId: string expected"; + if (message.transformNameMapping != null && message.hasOwnProperty("transformNameMapping")) { + if (!$util.isObject(message.transformNameMapping)) + return "transformNameMapping: object expected"; + var key = Object.keys(message.transformNameMapping); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.transformNameMapping[key[i]])) + return "transformNameMapping: string{k:string} expected"; + } + if (message.clientRequestId != null && message.hasOwnProperty("clientRequestId")) + if (!$util.isString(message.clientRequestId)) + return "clientRequestId: string expected"; + if (message.replacedByJobId != null && message.hasOwnProperty("replacedByJobId")) + if (!$util.isString(message.replacedByJobId)) + return "replacedByJobId: string expected"; + if (message.tempFiles != null && message.hasOwnProperty("tempFiles")) { + if (!Array.isArray(message.tempFiles)) + return "tempFiles: array expected"; + for (var i = 0; i < message.tempFiles.length; ++i) + if (!$util.isString(message.tempFiles[i])) + return "tempFiles: string[] expected"; + } + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isString(message.location)) + return "location: string expected"; + if (message.pipelineDescription != null && message.hasOwnProperty("pipelineDescription")) { + var error = $root.google.dataflow.v1beta3.PipelineDescription.verify(message.pipelineDescription); + if (error) + return "pipelineDescription." + error; + } + if (message.stageStates != null && message.hasOwnProperty("stageStates")) { + if (!Array.isArray(message.stageStates)) + return "stageStates: array expected"; + for (var i = 0; i < message.stageStates.length; ++i) { + var error = $root.google.dataflow.v1beta3.ExecutionStageState.verify(message.stageStates[i]); + if (error) + return "stageStates." + error; + } + } + if (message.jobMetadata != null && message.hasOwnProperty("jobMetadata")) { + var error = $root.google.dataflow.v1beta3.JobMetadata.verify(message.jobMetadata); + if (error) + return "jobMetadata." + error; + } + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (error) + return "startTime." + error; + } + if (message.createdFromSnapshotId != null && message.hasOwnProperty("createdFromSnapshotId")) + if (!$util.isString(message.createdFromSnapshotId)) + return "createdFromSnapshotId: string expected"; + if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) + if (typeof message.satisfiesPzs !== "boolean") + return "satisfiesPzs: boolean expected"; + return null; + }; + + /** + * Creates a Job message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.dataflow.v1beta3.Job + * @static + * @param {Object.} object Plain object + * @returns {google.dataflow.v1beta3.Job} Job + */ + Job.fromObject = function fromObject(object) { + if (object instanceof $root.google.dataflow.v1beta3.Job) + return object; + var message = new $root.google.dataflow.v1beta3.Job(); + if (object.id != null) + message.id = String(object.id); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.name != null) + message.name = String(object.name); + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "JOB_TYPE_UNKNOWN": + case 0: + message.type = 0; + break; + case "JOB_TYPE_BATCH": + case 1: + message.type = 1; + break; + case "JOB_TYPE_STREAMING": + case 2: + message.type = 2; + break; + } + if (object.environment != null) { + if (typeof object.environment !== "object") + throw TypeError(".google.dataflow.v1beta3.Job.environment: object expected"); + message.environment = $root.google.dataflow.v1beta3.Environment.fromObject(object.environment); + } + if (object.steps) { + if (!Array.isArray(object.steps)) + throw TypeError(".google.dataflow.v1beta3.Job.steps: array expected"); + message.steps = []; + for (var i = 0; i < object.steps.length; ++i) { + if (typeof object.steps[i] !== "object") + throw TypeError(".google.dataflow.v1beta3.Job.steps: object expected"); + message.steps[i] = $root.google.dataflow.v1beta3.Step.fromObject(object.steps[i]); + } + } + if (object.stepsLocation != null) + message.stepsLocation = String(object.stepsLocation); + switch (object.currentState) { + default: + if (typeof object.currentState === "number") { + message.currentState = object.currentState; + break; + } + break; + case "JOB_STATE_UNKNOWN": + case 0: + message.currentState = 0; + break; + case "JOB_STATE_STOPPED": + case 1: + message.currentState = 1; + break; + case "JOB_STATE_RUNNING": + case 2: + message.currentState = 2; + break; + case "JOB_STATE_DONE": + case 3: + message.currentState = 3; + break; + case "JOB_STATE_FAILED": + case 4: + message.currentState = 4; + break; + case "JOB_STATE_CANCELLED": + case 5: + message.currentState = 5; + break; + case "JOB_STATE_UPDATED": + case 6: + message.currentState = 6; + break; + case "JOB_STATE_DRAINING": + case 7: + message.currentState = 7; + break; + case "JOB_STATE_DRAINED": + case 8: + message.currentState = 8; + break; + case "JOB_STATE_PENDING": + case 9: + message.currentState = 9; + break; + case "JOB_STATE_CANCELLING": + case 10: + message.currentState = 10; + break; + case "JOB_STATE_QUEUED": + case 11: + message.currentState = 11; + break; + case "JOB_STATE_RESOURCE_CLEANING_UP": + case 12: + message.currentState = 12; + break; + } + if (object.currentStateTime != null) { + if (typeof object.currentStateTime !== "object") + throw TypeError(".google.dataflow.v1beta3.Job.currentStateTime: object expected"); + message.currentStateTime = $root.google.protobuf.Timestamp.fromObject(object.currentStateTime); + } + switch (object.requestedState) { + default: + if (typeof object.requestedState === "number") { + message.requestedState = object.requestedState; + break; + } + break; + case "JOB_STATE_UNKNOWN": + case 0: + message.requestedState = 0; + break; + case "JOB_STATE_STOPPED": + case 1: + message.requestedState = 1; + break; + case "JOB_STATE_RUNNING": + case 2: + message.requestedState = 2; + break; + case "JOB_STATE_DONE": + case 3: + message.requestedState = 3; + break; + case "JOB_STATE_FAILED": + case 4: + message.requestedState = 4; + break; + case "JOB_STATE_CANCELLED": + case 5: + message.requestedState = 5; + break; + case "JOB_STATE_UPDATED": + case 6: + message.requestedState = 6; + break; + case "JOB_STATE_DRAINING": + case 7: + message.requestedState = 7; + break; + case "JOB_STATE_DRAINED": + case 8: + message.requestedState = 8; + break; + case "JOB_STATE_PENDING": + case 9: + message.requestedState = 9; + break; + case "JOB_STATE_CANCELLING": + case 10: + message.requestedState = 10; + break; + case "JOB_STATE_QUEUED": + case 11: + message.requestedState = 11; + break; + case "JOB_STATE_RESOURCE_CLEANING_UP": + case 12: + message.requestedState = 12; + break; + } + if (object.executionInfo != null) { + if (typeof object.executionInfo !== "object") + throw TypeError(".google.dataflow.v1beta3.Job.executionInfo: object expected"); + message.executionInfo = $root.google.dataflow.v1beta3.JobExecutionInfo.fromObject(object.executionInfo); + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.dataflow.v1beta3.Job.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.replaceJobId != null) + message.replaceJobId = String(object.replaceJobId); + if (object.transformNameMapping) { + if (typeof object.transformNameMapping !== "object") + throw TypeError(".google.dataflow.v1beta3.Job.transformNameMapping: object expected"); + message.transformNameMapping = {}; + for (var keys = Object.keys(object.transformNameMapping), i = 0; i < keys.length; ++i) + message.transformNameMapping[keys[i]] = String(object.transformNameMapping[keys[i]]); + } + if (object.clientRequestId != null) + message.clientRequestId = String(object.clientRequestId); + if (object.replacedByJobId != null) + message.replacedByJobId = String(object.replacedByJobId); + if (object.tempFiles) { + if (!Array.isArray(object.tempFiles)) + throw TypeError(".google.dataflow.v1beta3.Job.tempFiles: array expected"); + message.tempFiles = []; + for (var i = 0; i < object.tempFiles.length; ++i) + message.tempFiles[i] = String(object.tempFiles[i]); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.dataflow.v1beta3.Job.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + if (object.location != null) + message.location = String(object.location); + if (object.pipelineDescription != null) { + if (typeof object.pipelineDescription !== "object") + throw TypeError(".google.dataflow.v1beta3.Job.pipelineDescription: object expected"); + message.pipelineDescription = $root.google.dataflow.v1beta3.PipelineDescription.fromObject(object.pipelineDescription); + } + if (object.stageStates) { + if (!Array.isArray(object.stageStates)) + throw TypeError(".google.dataflow.v1beta3.Job.stageStates: array expected"); + message.stageStates = []; + for (var i = 0; i < object.stageStates.length; ++i) { + if (typeof object.stageStates[i] !== "object") + throw TypeError(".google.dataflow.v1beta3.Job.stageStates: object expected"); + message.stageStates[i] = $root.google.dataflow.v1beta3.ExecutionStageState.fromObject(object.stageStates[i]); + } + } + if (object.jobMetadata != null) { + if (typeof object.jobMetadata !== "object") + throw TypeError(".google.dataflow.v1beta3.Job.jobMetadata: object expected"); + message.jobMetadata = $root.google.dataflow.v1beta3.JobMetadata.fromObject(object.jobMetadata); + } + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.dataflow.v1beta3.Job.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + if (object.createdFromSnapshotId != null) + message.createdFromSnapshotId = String(object.createdFromSnapshotId); + if (object.satisfiesPzs != null) + message.satisfiesPzs = Boolean(object.satisfiesPzs); + return message; + }; + + /** + * Creates a plain object from a Job message. Also converts values to other types if specified. + * @function toObject + * @memberof google.dataflow.v1beta3.Job + * @static + * @param {google.dataflow.v1beta3.Job} message Job + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Job.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.steps = []; + object.tempFiles = []; + object.stageStates = []; + } + if (options.objects || options.defaults) { + object.transformNameMapping = {}; + object.labels = {}; + } + if (options.defaults) { + object.id = ""; + object.projectId = ""; + object.name = ""; + object.type = options.enums === String ? "JOB_TYPE_UNKNOWN" : 0; + object.environment = null; + object.currentState = options.enums === String ? "JOB_STATE_UNKNOWN" : 0; + object.currentStateTime = null; + object.requestedState = options.enums === String ? "JOB_STATE_UNKNOWN" : 0; + object.executionInfo = null; + object.createTime = null; + object.replaceJobId = ""; + object.clientRequestId = ""; + object.replacedByJobId = ""; + object.location = ""; + object.pipelineDescription = null; + object.jobMetadata = null; + object.startTime = null; + object.createdFromSnapshotId = ""; + object.stepsLocation = ""; + object.satisfiesPzs = false; + } + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + if (message.projectId != null && message.hasOwnProperty("projectId")) + object.projectId = message.projectId; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.dataflow.v1beta3.JobType[message.type] === undefined ? message.type : $root.google.dataflow.v1beta3.JobType[message.type] : message.type; + if (message.environment != null && message.hasOwnProperty("environment")) + object.environment = $root.google.dataflow.v1beta3.Environment.toObject(message.environment, options); + if (message.steps && message.steps.length) { + object.steps = []; + for (var j = 0; j < message.steps.length; ++j) + object.steps[j] = $root.google.dataflow.v1beta3.Step.toObject(message.steps[j], options); + } + if (message.currentState != null && message.hasOwnProperty("currentState")) + object.currentState = options.enums === String ? $root.google.dataflow.v1beta3.JobState[message.currentState] === undefined ? message.currentState : $root.google.dataflow.v1beta3.JobState[message.currentState] : message.currentState; + if (message.currentStateTime != null && message.hasOwnProperty("currentStateTime")) + object.currentStateTime = $root.google.protobuf.Timestamp.toObject(message.currentStateTime, options); + if (message.requestedState != null && message.hasOwnProperty("requestedState")) + object.requestedState = options.enums === String ? $root.google.dataflow.v1beta3.JobState[message.requestedState] === undefined ? message.requestedState : $root.google.dataflow.v1beta3.JobState[message.requestedState] : message.requestedState; + if (message.executionInfo != null && message.hasOwnProperty("executionInfo")) + object.executionInfo = $root.google.dataflow.v1beta3.JobExecutionInfo.toObject(message.executionInfo, options); + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.replaceJobId != null && message.hasOwnProperty("replaceJobId")) + object.replaceJobId = message.replaceJobId; + var keys2; + if (message.transformNameMapping && (keys2 = Object.keys(message.transformNameMapping)).length) { + object.transformNameMapping = {}; + for (var j = 0; j < keys2.length; ++j) + object.transformNameMapping[keys2[j]] = message.transformNameMapping[keys2[j]]; + } + if (message.clientRequestId != null && message.hasOwnProperty("clientRequestId")) + object.clientRequestId = message.clientRequestId; + if (message.replacedByJobId != null && message.hasOwnProperty("replacedByJobId")) + object.replacedByJobId = message.replacedByJobId; + if (message.tempFiles && message.tempFiles.length) { + object.tempFiles = []; + for (var j = 0; j < message.tempFiles.length; ++j) + object.tempFiles[j] = message.tempFiles[j]; + } + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + if (message.pipelineDescription != null && message.hasOwnProperty("pipelineDescription")) + object.pipelineDescription = $root.google.dataflow.v1beta3.PipelineDescription.toObject(message.pipelineDescription, options); + if (message.stageStates && message.stageStates.length) { + object.stageStates = []; + for (var j = 0; j < message.stageStates.length; ++j) + object.stageStates[j] = $root.google.dataflow.v1beta3.ExecutionStageState.toObject(message.stageStates[j], options); + } + if (message.jobMetadata != null && message.hasOwnProperty("jobMetadata")) + object.jobMetadata = $root.google.dataflow.v1beta3.JobMetadata.toObject(message.jobMetadata, options); + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + if (message.createdFromSnapshotId != null && message.hasOwnProperty("createdFromSnapshotId")) + object.createdFromSnapshotId = message.createdFromSnapshotId; + if (message.stepsLocation != null && message.hasOwnProperty("stepsLocation")) + object.stepsLocation = message.stepsLocation; + if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) + object.satisfiesPzs = message.satisfiesPzs; + return object; + }; + + /** + * Converts this Job to JSON. + * @function toJSON + * @memberof google.dataflow.v1beta3.Job + * @instance + * @returns {Object.} JSON object + */ + Job.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Job + * @function getTypeUrl + * @memberof google.dataflow.v1beta3.Job + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Job.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.dataflow.v1beta3.Job"; + }; + + return Job; + })(); + + v1beta3.DatastoreIODetails = (function() { + + /** + * Properties of a DatastoreIODetails. + * @memberof google.dataflow.v1beta3 + * @interface IDatastoreIODetails + * @property {string|null} [namespace] DatastoreIODetails namespace + * @property {string|null} [projectId] DatastoreIODetails projectId + */ + + /** + * Constructs a new DatastoreIODetails. + * @memberof google.dataflow.v1beta3 + * @classdesc Represents a DatastoreIODetails. + * @implements IDatastoreIODetails + * @constructor + * @param {google.dataflow.v1beta3.IDatastoreIODetails=} [properties] Properties to set + */ + function DatastoreIODetails(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DatastoreIODetails namespace. + * @member {string} namespace + * @memberof google.dataflow.v1beta3.DatastoreIODetails + * @instance + */ + DatastoreIODetails.prototype.namespace = ""; + + /** + * DatastoreIODetails projectId. + * @member {string} projectId + * @memberof google.dataflow.v1beta3.DatastoreIODetails + * @instance + */ + DatastoreIODetails.prototype.projectId = ""; + + /** + * Creates a new DatastoreIODetails instance using the specified properties. + * @function create + * @memberof google.dataflow.v1beta3.DatastoreIODetails + * @static + * @param {google.dataflow.v1beta3.IDatastoreIODetails=} [properties] Properties to set + * @returns {google.dataflow.v1beta3.DatastoreIODetails} DatastoreIODetails instance + */ + DatastoreIODetails.create = function create(properties) { + return new DatastoreIODetails(properties); + }; + + /** + * Encodes the specified DatastoreIODetails message. Does not implicitly {@link google.dataflow.v1beta3.DatastoreIODetails.verify|verify} messages. + * @function encode + * @memberof google.dataflow.v1beta3.DatastoreIODetails + * @static + * @param {google.dataflow.v1beta3.IDatastoreIODetails} message DatastoreIODetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DatastoreIODetails.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.namespace != null && Object.hasOwnProperty.call(message, "namespace")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.namespace); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.projectId); + return writer; + }; + + /** + * Encodes the specified DatastoreIODetails message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.DatastoreIODetails.verify|verify} messages. + * @function encodeDelimited + * @memberof google.dataflow.v1beta3.DatastoreIODetails + * @static + * @param {google.dataflow.v1beta3.IDatastoreIODetails} message DatastoreIODetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DatastoreIODetails.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DatastoreIODetails message from the specified reader or buffer. + * @function decode + * @memberof google.dataflow.v1beta3.DatastoreIODetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.dataflow.v1beta3.DatastoreIODetails} DatastoreIODetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DatastoreIODetails.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.dataflow.v1beta3.DatastoreIODetails(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.namespace = reader.string(); + break; + } + case 2: { + message.projectId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DatastoreIODetails message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.dataflow.v1beta3.DatastoreIODetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.dataflow.v1beta3.DatastoreIODetails} DatastoreIODetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DatastoreIODetails.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DatastoreIODetails message. + * @function verify + * @memberof google.dataflow.v1beta3.DatastoreIODetails + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DatastoreIODetails.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.namespace != null && message.hasOwnProperty("namespace")) + if (!$util.isString(message.namespace)) + return "namespace: string expected"; + if (message.projectId != null && message.hasOwnProperty("projectId")) + if (!$util.isString(message.projectId)) + return "projectId: string expected"; + return null; + }; + + /** + * Creates a DatastoreIODetails message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.dataflow.v1beta3.DatastoreIODetails + * @static + * @param {Object.} object Plain object + * @returns {google.dataflow.v1beta3.DatastoreIODetails} DatastoreIODetails + */ + DatastoreIODetails.fromObject = function fromObject(object) { + if (object instanceof $root.google.dataflow.v1beta3.DatastoreIODetails) + return object; + var message = new $root.google.dataflow.v1beta3.DatastoreIODetails(); + if (object.namespace != null) + message.namespace = String(object.namespace); + if (object.projectId != null) + message.projectId = String(object.projectId); + return message; + }; + + /** + * Creates a plain object from a DatastoreIODetails message. Also converts values to other types if specified. + * @function toObject + * @memberof google.dataflow.v1beta3.DatastoreIODetails + * @static + * @param {google.dataflow.v1beta3.DatastoreIODetails} message DatastoreIODetails + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DatastoreIODetails.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.namespace = ""; + object.projectId = ""; + } + if (message.namespace != null && message.hasOwnProperty("namespace")) + object.namespace = message.namespace; + if (message.projectId != null && message.hasOwnProperty("projectId")) + object.projectId = message.projectId; + return object; + }; + + /** + * Converts this DatastoreIODetails to JSON. + * @function toJSON + * @memberof google.dataflow.v1beta3.DatastoreIODetails + * @instance + * @returns {Object.} JSON object + */ + DatastoreIODetails.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DatastoreIODetails + * @function getTypeUrl + * @memberof google.dataflow.v1beta3.DatastoreIODetails + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DatastoreIODetails.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.dataflow.v1beta3.DatastoreIODetails"; + }; + + return DatastoreIODetails; + })(); + + v1beta3.PubSubIODetails = (function() { + + /** + * Properties of a PubSubIODetails. + * @memberof google.dataflow.v1beta3 + * @interface IPubSubIODetails + * @property {string|null} [topic] PubSubIODetails topic + * @property {string|null} [subscription] PubSubIODetails subscription + */ + + /** + * Constructs a new PubSubIODetails. + * @memberof google.dataflow.v1beta3 + * @classdesc Represents a PubSubIODetails. + * @implements IPubSubIODetails + * @constructor + * @param {google.dataflow.v1beta3.IPubSubIODetails=} [properties] Properties to set + */ + function PubSubIODetails(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PubSubIODetails topic. + * @member {string} topic + * @memberof google.dataflow.v1beta3.PubSubIODetails + * @instance + */ + PubSubIODetails.prototype.topic = ""; + + /** + * PubSubIODetails subscription. + * @member {string} subscription + * @memberof google.dataflow.v1beta3.PubSubIODetails + * @instance + */ + PubSubIODetails.prototype.subscription = ""; + + /** + * Creates a new PubSubIODetails instance using the specified properties. + * @function create + * @memberof google.dataflow.v1beta3.PubSubIODetails + * @static + * @param {google.dataflow.v1beta3.IPubSubIODetails=} [properties] Properties to set + * @returns {google.dataflow.v1beta3.PubSubIODetails} PubSubIODetails instance + */ + PubSubIODetails.create = function create(properties) { + return new PubSubIODetails(properties); + }; + + /** + * Encodes the specified PubSubIODetails message. Does not implicitly {@link google.dataflow.v1beta3.PubSubIODetails.verify|verify} messages. + * @function encode + * @memberof google.dataflow.v1beta3.PubSubIODetails + * @static + * @param {google.dataflow.v1beta3.IPubSubIODetails} message PubSubIODetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PubSubIODetails.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.topic != null && Object.hasOwnProperty.call(message, "topic")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.topic); + if (message.subscription != null && Object.hasOwnProperty.call(message, "subscription")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.subscription); + return writer; + }; + + /** + * Encodes the specified PubSubIODetails message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.PubSubIODetails.verify|verify} messages. + * @function encodeDelimited + * @memberof google.dataflow.v1beta3.PubSubIODetails + * @static + * @param {google.dataflow.v1beta3.IPubSubIODetails} message PubSubIODetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PubSubIODetails.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PubSubIODetails message from the specified reader or buffer. + * @function decode + * @memberof google.dataflow.v1beta3.PubSubIODetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.dataflow.v1beta3.PubSubIODetails} PubSubIODetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PubSubIODetails.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.dataflow.v1beta3.PubSubIODetails(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.topic = reader.string(); + break; + } + case 2: { + message.subscription = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PubSubIODetails message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.dataflow.v1beta3.PubSubIODetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.dataflow.v1beta3.PubSubIODetails} PubSubIODetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PubSubIODetails.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PubSubIODetails message. + * @function verify + * @memberof google.dataflow.v1beta3.PubSubIODetails + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PubSubIODetails.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.topic != null && message.hasOwnProperty("topic")) + if (!$util.isString(message.topic)) + return "topic: string expected"; + if (message.subscription != null && message.hasOwnProperty("subscription")) + if (!$util.isString(message.subscription)) + return "subscription: string expected"; + return null; + }; + + /** + * Creates a PubSubIODetails message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.dataflow.v1beta3.PubSubIODetails + * @static + * @param {Object.} object Plain object + * @returns {google.dataflow.v1beta3.PubSubIODetails} PubSubIODetails + */ + PubSubIODetails.fromObject = function fromObject(object) { + if (object instanceof $root.google.dataflow.v1beta3.PubSubIODetails) + return object; + var message = new $root.google.dataflow.v1beta3.PubSubIODetails(); + if (object.topic != null) + message.topic = String(object.topic); + if (object.subscription != null) + message.subscription = String(object.subscription); + return message; + }; + + /** + * Creates a plain object from a PubSubIODetails message. Also converts values to other types if specified. + * @function toObject + * @memberof google.dataflow.v1beta3.PubSubIODetails + * @static + * @param {google.dataflow.v1beta3.PubSubIODetails} message PubSubIODetails + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PubSubIODetails.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.topic = ""; + object.subscription = ""; + } + if (message.topic != null && message.hasOwnProperty("topic")) + object.topic = message.topic; + if (message.subscription != null && message.hasOwnProperty("subscription")) + object.subscription = message.subscription; + return object; + }; + + /** + * Converts this PubSubIODetails to JSON. + * @function toJSON + * @memberof google.dataflow.v1beta3.PubSubIODetails + * @instance + * @returns {Object.} JSON object + */ + PubSubIODetails.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PubSubIODetails + * @function getTypeUrl + * @memberof google.dataflow.v1beta3.PubSubIODetails + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PubSubIODetails.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.dataflow.v1beta3.PubSubIODetails"; + }; + + return PubSubIODetails; + })(); + + v1beta3.FileIODetails = (function() { + + /** + * Properties of a FileIODetails. + * @memberof google.dataflow.v1beta3 + * @interface IFileIODetails + * @property {string|null} [filePattern] FileIODetails filePattern + */ + + /** + * Constructs a new FileIODetails. + * @memberof google.dataflow.v1beta3 + * @classdesc Represents a FileIODetails. + * @implements IFileIODetails + * @constructor + * @param {google.dataflow.v1beta3.IFileIODetails=} [properties] Properties to set + */ + function FileIODetails(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileIODetails filePattern. + * @member {string} filePattern + * @memberof google.dataflow.v1beta3.FileIODetails + * @instance + */ + FileIODetails.prototype.filePattern = ""; + + /** + * Creates a new FileIODetails instance using the specified properties. + * @function create + * @memberof google.dataflow.v1beta3.FileIODetails + * @static + * @param {google.dataflow.v1beta3.IFileIODetails=} [properties] Properties to set + * @returns {google.dataflow.v1beta3.FileIODetails} FileIODetails instance + */ + FileIODetails.create = function create(properties) { + return new FileIODetails(properties); + }; + + /** + * Encodes the specified FileIODetails message. Does not implicitly {@link google.dataflow.v1beta3.FileIODetails.verify|verify} messages. + * @function encode + * @memberof google.dataflow.v1beta3.FileIODetails + * @static + * @param {google.dataflow.v1beta3.IFileIODetails} message FileIODetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileIODetails.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.filePattern != null && Object.hasOwnProperty.call(message, "filePattern")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.filePattern); + return writer; + }; + + /** + * Encodes the specified FileIODetails message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.FileIODetails.verify|verify} messages. + * @function encodeDelimited + * @memberof google.dataflow.v1beta3.FileIODetails + * @static + * @param {google.dataflow.v1beta3.IFileIODetails} message FileIODetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileIODetails.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileIODetails message from the specified reader or buffer. + * @function decode + * @memberof google.dataflow.v1beta3.FileIODetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.dataflow.v1beta3.FileIODetails} FileIODetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileIODetails.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.dataflow.v1beta3.FileIODetails(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.filePattern = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileIODetails message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.dataflow.v1beta3.FileIODetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.dataflow.v1beta3.FileIODetails} FileIODetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileIODetails.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileIODetails message. + * @function verify + * @memberof google.dataflow.v1beta3.FileIODetails + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileIODetails.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.filePattern != null && message.hasOwnProperty("filePattern")) + if (!$util.isString(message.filePattern)) + return "filePattern: string expected"; + return null; + }; + + /** + * Creates a FileIODetails message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.dataflow.v1beta3.FileIODetails + * @static + * @param {Object.} object Plain object + * @returns {google.dataflow.v1beta3.FileIODetails} FileIODetails + */ + FileIODetails.fromObject = function fromObject(object) { + if (object instanceof $root.google.dataflow.v1beta3.FileIODetails) + return object; + var message = new $root.google.dataflow.v1beta3.FileIODetails(); + if (object.filePattern != null) + message.filePattern = String(object.filePattern); + return message; + }; + + /** + * Creates a plain object from a FileIODetails message. Also converts values to other types if specified. + * @function toObject + * @memberof google.dataflow.v1beta3.FileIODetails + * @static + * @param {google.dataflow.v1beta3.FileIODetails} message FileIODetails + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileIODetails.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.filePattern = ""; + if (message.filePattern != null && message.hasOwnProperty("filePattern")) + object.filePattern = message.filePattern; + return object; + }; + + /** + * Converts this FileIODetails to JSON. + * @function toJSON + * @memberof google.dataflow.v1beta3.FileIODetails + * @instance + * @returns {Object.} JSON object + */ + FileIODetails.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FileIODetails + * @function getTypeUrl + * @memberof google.dataflow.v1beta3.FileIODetails + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileIODetails.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.dataflow.v1beta3.FileIODetails"; + }; + + return FileIODetails; + })(); + + v1beta3.BigTableIODetails = (function() { + + /** + * Properties of a BigTableIODetails. + * @memberof google.dataflow.v1beta3 + * @interface IBigTableIODetails + * @property {string|null} [projectId] BigTableIODetails projectId + * @property {string|null} [instanceId] BigTableIODetails instanceId + * @property {string|null} [tableId] BigTableIODetails tableId + */ + + /** + * Constructs a new BigTableIODetails. + * @memberof google.dataflow.v1beta3 + * @classdesc Represents a BigTableIODetails. + * @implements IBigTableIODetails + * @constructor + * @param {google.dataflow.v1beta3.IBigTableIODetails=} [properties] Properties to set + */ + function BigTableIODetails(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BigTableIODetails projectId. + * @member {string} projectId + * @memberof google.dataflow.v1beta3.BigTableIODetails + * @instance + */ + BigTableIODetails.prototype.projectId = ""; + + /** + * BigTableIODetails instanceId. + * @member {string} instanceId + * @memberof google.dataflow.v1beta3.BigTableIODetails + * @instance + */ + BigTableIODetails.prototype.instanceId = ""; + + /** + * BigTableIODetails tableId. + * @member {string} tableId + * @memberof google.dataflow.v1beta3.BigTableIODetails + * @instance + */ + BigTableIODetails.prototype.tableId = ""; + + /** + * Creates a new BigTableIODetails instance using the specified properties. + * @function create + * @memberof google.dataflow.v1beta3.BigTableIODetails + * @static + * @param {google.dataflow.v1beta3.IBigTableIODetails=} [properties] Properties to set + * @returns {google.dataflow.v1beta3.BigTableIODetails} BigTableIODetails instance + */ + BigTableIODetails.create = function create(properties) { + return new BigTableIODetails(properties); + }; + + /** + * Encodes the specified BigTableIODetails message. Does not implicitly {@link google.dataflow.v1beta3.BigTableIODetails.verify|verify} messages. + * @function encode + * @memberof google.dataflow.v1beta3.BigTableIODetails + * @static + * @param {google.dataflow.v1beta3.IBigTableIODetails} message BigTableIODetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BigTableIODetails.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.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.instanceId); + if (message.tableId != null && Object.hasOwnProperty.call(message, "tableId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.tableId); + return writer; + }; + + /** + * Encodes the specified BigTableIODetails message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.BigTableIODetails.verify|verify} messages. + * @function encodeDelimited + * @memberof google.dataflow.v1beta3.BigTableIODetails + * @static + * @param {google.dataflow.v1beta3.IBigTableIODetails} message BigTableIODetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BigTableIODetails.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BigTableIODetails message from the specified reader or buffer. + * @function decode + * @memberof google.dataflow.v1beta3.BigTableIODetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.dataflow.v1beta3.BigTableIODetails} BigTableIODetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BigTableIODetails.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.dataflow.v1beta3.BigTableIODetails(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.projectId = reader.string(); + break; + } + case 2: { + message.instanceId = reader.string(); + break; + } + case 3: { + message.tableId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BigTableIODetails message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.dataflow.v1beta3.BigTableIODetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.dataflow.v1beta3.BigTableIODetails} BigTableIODetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BigTableIODetails.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BigTableIODetails message. + * @function verify + * @memberof google.dataflow.v1beta3.BigTableIODetails + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BigTableIODetails.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.instanceId != null && message.hasOwnProperty("instanceId")) + if (!$util.isString(message.instanceId)) + return "instanceId: string expected"; + if (message.tableId != null && message.hasOwnProperty("tableId")) + if (!$util.isString(message.tableId)) + return "tableId: string expected"; + return null; + }; + + /** + * Creates a BigTableIODetails message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.dataflow.v1beta3.BigTableIODetails + * @static + * @param {Object.} object Plain object + * @returns {google.dataflow.v1beta3.BigTableIODetails} BigTableIODetails + */ + BigTableIODetails.fromObject = function fromObject(object) { + if (object instanceof $root.google.dataflow.v1beta3.BigTableIODetails) + return object; + var message = new $root.google.dataflow.v1beta3.BigTableIODetails(); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.instanceId != null) + message.instanceId = String(object.instanceId); + if (object.tableId != null) + message.tableId = String(object.tableId); + return message; + }; + + /** + * Creates a plain object from a BigTableIODetails message. Also converts values to other types if specified. + * @function toObject + * @memberof google.dataflow.v1beta3.BigTableIODetails + * @static + * @param {google.dataflow.v1beta3.BigTableIODetails} message BigTableIODetails + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BigTableIODetails.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.projectId = ""; + object.instanceId = ""; + object.tableId = ""; + } + if (message.projectId != null && message.hasOwnProperty("projectId")) + object.projectId = message.projectId; + if (message.instanceId != null && message.hasOwnProperty("instanceId")) + object.instanceId = message.instanceId; + if (message.tableId != null && message.hasOwnProperty("tableId")) + object.tableId = message.tableId; + return object; + }; + + /** + * Converts this BigTableIODetails to JSON. + * @function toJSON + * @memberof google.dataflow.v1beta3.BigTableIODetails + * @instance + * @returns {Object.} JSON object + */ + BigTableIODetails.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BigTableIODetails + * @function getTypeUrl + * @memberof google.dataflow.v1beta3.BigTableIODetails + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BigTableIODetails.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.dataflow.v1beta3.BigTableIODetails"; + }; + + return BigTableIODetails; + })(); + + v1beta3.BigQueryIODetails = (function() { + + /** + * Properties of a BigQueryIODetails. + * @memberof google.dataflow.v1beta3 + * @interface IBigQueryIODetails + * @property {string|null} [table] BigQueryIODetails table + * @property {string|null} [dataset] BigQueryIODetails dataset + * @property {string|null} [projectId] BigQueryIODetails projectId + * @property {string|null} [query] BigQueryIODetails query + */ + + /** + * Constructs a new BigQueryIODetails. + * @memberof google.dataflow.v1beta3 + * @classdesc Represents a BigQueryIODetails. + * @implements IBigQueryIODetails + * @constructor + * @param {google.dataflow.v1beta3.IBigQueryIODetails=} [properties] Properties to set + */ + function BigQueryIODetails(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BigQueryIODetails table. + * @member {string} table + * @memberof google.dataflow.v1beta3.BigQueryIODetails + * @instance + */ + BigQueryIODetails.prototype.table = ""; + + /** + * BigQueryIODetails dataset. + * @member {string} dataset + * @memberof google.dataflow.v1beta3.BigQueryIODetails + * @instance + */ + BigQueryIODetails.prototype.dataset = ""; + + /** + * BigQueryIODetails projectId. + * @member {string} projectId + * @memberof google.dataflow.v1beta3.BigQueryIODetails + * @instance + */ + BigQueryIODetails.prototype.projectId = ""; + + /** + * BigQueryIODetails query. + * @member {string} query + * @memberof google.dataflow.v1beta3.BigQueryIODetails + * @instance + */ + BigQueryIODetails.prototype.query = ""; + + /** + * Creates a new BigQueryIODetails instance using the specified properties. + * @function create + * @memberof google.dataflow.v1beta3.BigQueryIODetails + * @static + * @param {google.dataflow.v1beta3.IBigQueryIODetails=} [properties] Properties to set + * @returns {google.dataflow.v1beta3.BigQueryIODetails} BigQueryIODetails instance + */ + BigQueryIODetails.create = function create(properties) { + return new BigQueryIODetails(properties); + }; + + /** + * Encodes the specified BigQueryIODetails message. Does not implicitly {@link google.dataflow.v1beta3.BigQueryIODetails.verify|verify} messages. + * @function encode + * @memberof google.dataflow.v1beta3.BigQueryIODetails + * @static + * @param {google.dataflow.v1beta3.IBigQueryIODetails} message BigQueryIODetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BigQueryIODetails.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.table != null && Object.hasOwnProperty.call(message, "table")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.table); + if (message.dataset != null && Object.hasOwnProperty.call(message, "dataset")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.dataset); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.projectId); + if (message.query != null && Object.hasOwnProperty.call(message, "query")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.query); + return writer; + }; + + /** + * Encodes the specified BigQueryIODetails message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.BigQueryIODetails.verify|verify} messages. + * @function encodeDelimited + * @memberof google.dataflow.v1beta3.BigQueryIODetails + * @static + * @param {google.dataflow.v1beta3.IBigQueryIODetails} message BigQueryIODetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BigQueryIODetails.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BigQueryIODetails message from the specified reader or buffer. + * @function decode + * @memberof google.dataflow.v1beta3.BigQueryIODetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.dataflow.v1beta3.BigQueryIODetails} BigQueryIODetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BigQueryIODetails.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.dataflow.v1beta3.BigQueryIODetails(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.table = reader.string(); + break; + } + case 2: { + message.dataset = reader.string(); + break; + } + case 3: { + message.projectId = reader.string(); + break; + } + case 4: { + message.query = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BigQueryIODetails message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.dataflow.v1beta3.BigQueryIODetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.dataflow.v1beta3.BigQueryIODetails} BigQueryIODetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BigQueryIODetails.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BigQueryIODetails message. + * @function verify + * @memberof google.dataflow.v1beta3.BigQueryIODetails + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BigQueryIODetails.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.table != null && message.hasOwnProperty("table")) + if (!$util.isString(message.table)) + return "table: string expected"; + if (message.dataset != null && message.hasOwnProperty("dataset")) + if (!$util.isString(message.dataset)) + return "dataset: string expected"; + if (message.projectId != null && message.hasOwnProperty("projectId")) + if (!$util.isString(message.projectId)) + return "projectId: string expected"; + if (message.query != null && message.hasOwnProperty("query")) + if (!$util.isString(message.query)) + return "query: string expected"; + return null; + }; + + /** + * Creates a BigQueryIODetails message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.dataflow.v1beta3.BigQueryIODetails + * @static + * @param {Object.} object Plain object + * @returns {google.dataflow.v1beta3.BigQueryIODetails} BigQueryIODetails + */ + BigQueryIODetails.fromObject = function fromObject(object) { + if (object instanceof $root.google.dataflow.v1beta3.BigQueryIODetails) + return object; + var message = new $root.google.dataflow.v1beta3.BigQueryIODetails(); + if (object.table != null) + message.table = String(object.table); + if (object.dataset != null) + message.dataset = String(object.dataset); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.query != null) + message.query = String(object.query); + return message; + }; + + /** + * Creates a plain object from a BigQueryIODetails message. Also converts values to other types if specified. + * @function toObject + * @memberof google.dataflow.v1beta3.BigQueryIODetails + * @static + * @param {google.dataflow.v1beta3.BigQueryIODetails} message BigQueryIODetails + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BigQueryIODetails.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.table = ""; + object.dataset = ""; + object.projectId = ""; + object.query = ""; + } + if (message.table != null && message.hasOwnProperty("table")) + object.table = message.table; + if (message.dataset != null && message.hasOwnProperty("dataset")) + object.dataset = message.dataset; + if (message.projectId != null && message.hasOwnProperty("projectId")) + object.projectId = message.projectId; + if (message.query != null && message.hasOwnProperty("query")) + object.query = message.query; + return object; + }; + + /** + * Converts this BigQueryIODetails to JSON. + * @function toJSON + * @memberof google.dataflow.v1beta3.BigQueryIODetails + * @instance + * @returns {Object.} JSON object + */ + BigQueryIODetails.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BigQueryIODetails + * @function getTypeUrl + * @memberof google.dataflow.v1beta3.BigQueryIODetails + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BigQueryIODetails.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.dataflow.v1beta3.BigQueryIODetails"; + }; + + return BigQueryIODetails; + })(); + + v1beta3.SpannerIODetails = (function() { + + /** + * Properties of a SpannerIODetails. + * @memberof google.dataflow.v1beta3 + * @interface ISpannerIODetails + * @property {string|null} [projectId] SpannerIODetails projectId + * @property {string|null} [instanceId] SpannerIODetails instanceId + * @property {string|null} [databaseId] SpannerIODetails databaseId + */ + + /** + * Constructs a new SpannerIODetails. + * @memberof google.dataflow.v1beta3 + * @classdesc Represents a SpannerIODetails. + * @implements ISpannerIODetails + * @constructor + * @param {google.dataflow.v1beta3.ISpannerIODetails=} [properties] Properties to set + */ + function SpannerIODetails(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SpannerIODetails projectId. + * @member {string} projectId + * @memberof google.dataflow.v1beta3.SpannerIODetails + * @instance + */ + SpannerIODetails.prototype.projectId = ""; + + /** + * SpannerIODetails instanceId. + * @member {string} instanceId + * @memberof google.dataflow.v1beta3.SpannerIODetails + * @instance + */ + SpannerIODetails.prototype.instanceId = ""; + + /** + * SpannerIODetails databaseId. + * @member {string} databaseId + * @memberof google.dataflow.v1beta3.SpannerIODetails + * @instance + */ + SpannerIODetails.prototype.databaseId = ""; + + /** + * Creates a new SpannerIODetails instance using the specified properties. + * @function create + * @memberof google.dataflow.v1beta3.SpannerIODetails + * @static + * @param {google.dataflow.v1beta3.ISpannerIODetails=} [properties] Properties to set + * @returns {google.dataflow.v1beta3.SpannerIODetails} SpannerIODetails instance + */ + SpannerIODetails.create = function create(properties) { + return new SpannerIODetails(properties); + }; + + /** + * Encodes the specified SpannerIODetails message. Does not implicitly {@link google.dataflow.v1beta3.SpannerIODetails.verify|verify} messages. + * @function encode + * @memberof google.dataflow.v1beta3.SpannerIODetails + * @static + * @param {google.dataflow.v1beta3.ISpannerIODetails} message SpannerIODetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpannerIODetails.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.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.instanceId); + if (message.databaseId != null && Object.hasOwnProperty.call(message, "databaseId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.databaseId); + return writer; + }; + + /** + * Encodes the specified SpannerIODetails message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.SpannerIODetails.verify|verify} messages. + * @function encodeDelimited + * @memberof google.dataflow.v1beta3.SpannerIODetails + * @static + * @param {google.dataflow.v1beta3.ISpannerIODetails} message SpannerIODetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpannerIODetails.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SpannerIODetails message from the specified reader or buffer. + * @function decode + * @memberof google.dataflow.v1beta3.SpannerIODetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.dataflow.v1beta3.SpannerIODetails} SpannerIODetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpannerIODetails.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.dataflow.v1beta3.SpannerIODetails(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.projectId = reader.string(); + break; + } + case 2: { + message.instanceId = reader.string(); + break; + } + case 3: { + message.databaseId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SpannerIODetails message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.dataflow.v1beta3.SpannerIODetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.dataflow.v1beta3.SpannerIODetails} SpannerIODetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpannerIODetails.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SpannerIODetails message. + * @function verify + * @memberof google.dataflow.v1beta3.SpannerIODetails + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SpannerIODetails.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.instanceId != null && message.hasOwnProperty("instanceId")) + if (!$util.isString(message.instanceId)) + return "instanceId: string expected"; + if (message.databaseId != null && message.hasOwnProperty("databaseId")) + if (!$util.isString(message.databaseId)) + return "databaseId: string expected"; + return null; + }; + + /** + * Creates a SpannerIODetails message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.dataflow.v1beta3.SpannerIODetails + * @static + * @param {Object.} object Plain object + * @returns {google.dataflow.v1beta3.SpannerIODetails} SpannerIODetails + */ + SpannerIODetails.fromObject = function fromObject(object) { + if (object instanceof $root.google.dataflow.v1beta3.SpannerIODetails) + return object; + var message = new $root.google.dataflow.v1beta3.SpannerIODetails(); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.instanceId != null) + message.instanceId = String(object.instanceId); + if (object.databaseId != null) + message.databaseId = String(object.databaseId); + return message; + }; + + /** + * Creates a plain object from a SpannerIODetails message. Also converts values to other types if specified. + * @function toObject + * @memberof google.dataflow.v1beta3.SpannerIODetails + * @static + * @param {google.dataflow.v1beta3.SpannerIODetails} message SpannerIODetails + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SpannerIODetails.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.projectId = ""; + object.instanceId = ""; + object.databaseId = ""; + } + if (message.projectId != null && message.hasOwnProperty("projectId")) + object.projectId = message.projectId; + if (message.instanceId != null && message.hasOwnProperty("instanceId")) + object.instanceId = message.instanceId; + if (message.databaseId != null && message.hasOwnProperty("databaseId")) + object.databaseId = message.databaseId; + return object; + }; + + /** + * Converts this SpannerIODetails to JSON. + * @function toJSON + * @memberof google.dataflow.v1beta3.SpannerIODetails + * @instance + * @returns {Object.} JSON object + */ + SpannerIODetails.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SpannerIODetails + * @function getTypeUrl + * @memberof google.dataflow.v1beta3.SpannerIODetails + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SpannerIODetails.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.dataflow.v1beta3.SpannerIODetails"; + }; + + return SpannerIODetails; + })(); + + v1beta3.SdkVersion = (function() { + + /** + * Properties of a SdkVersion. + * @memberof google.dataflow.v1beta3 + * @interface ISdkVersion + * @property {string|null} [version] SdkVersion version + * @property {string|null} [versionDisplayName] SdkVersion versionDisplayName + * @property {google.dataflow.v1beta3.SdkVersion.SdkSupportStatus|null} [sdkSupportStatus] SdkVersion sdkSupportStatus + */ + + /** + * Constructs a new SdkVersion. + * @memberof google.dataflow.v1beta3 + * @classdesc Represents a SdkVersion. + * @implements ISdkVersion + * @constructor + * @param {google.dataflow.v1beta3.ISdkVersion=} [properties] Properties to set + */ + function SdkVersion(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SdkVersion version. + * @member {string} version + * @memberof google.dataflow.v1beta3.SdkVersion + * @instance + */ + SdkVersion.prototype.version = ""; + + /** + * SdkVersion versionDisplayName. + * @member {string} versionDisplayName + * @memberof google.dataflow.v1beta3.SdkVersion + * @instance + */ + SdkVersion.prototype.versionDisplayName = ""; + + /** + * SdkVersion sdkSupportStatus. + * @member {google.dataflow.v1beta3.SdkVersion.SdkSupportStatus} sdkSupportStatus + * @memberof google.dataflow.v1beta3.SdkVersion + * @instance + */ + SdkVersion.prototype.sdkSupportStatus = 0; + + /** + * Creates a new SdkVersion instance using the specified properties. + * @function create + * @memberof google.dataflow.v1beta3.SdkVersion + * @static + * @param {google.dataflow.v1beta3.ISdkVersion=} [properties] Properties to set + * @returns {google.dataflow.v1beta3.SdkVersion} SdkVersion instance + */ + SdkVersion.create = function create(properties) { + return new SdkVersion(properties); + }; + + /** + * Encodes the specified SdkVersion message. Does not implicitly {@link google.dataflow.v1beta3.SdkVersion.verify|verify} messages. + * @function encode + * @memberof google.dataflow.v1beta3.SdkVersion + * @static + * @param {google.dataflow.v1beta3.ISdkVersion} message SdkVersion message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SdkVersion.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.version); + if (message.versionDisplayName != null && Object.hasOwnProperty.call(message, "versionDisplayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.versionDisplayName); + if (message.sdkSupportStatus != null && Object.hasOwnProperty.call(message, "sdkSupportStatus")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.sdkSupportStatus); + return writer; + }; + + /** + * Encodes the specified SdkVersion message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.SdkVersion.verify|verify} messages. + * @function encodeDelimited + * @memberof google.dataflow.v1beta3.SdkVersion + * @static + * @param {google.dataflow.v1beta3.ISdkVersion} message SdkVersion message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SdkVersion.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SdkVersion message from the specified reader or buffer. + * @function decode + * @memberof google.dataflow.v1beta3.SdkVersion + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.dataflow.v1beta3.SdkVersion} SdkVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SdkVersion.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.dataflow.v1beta3.SdkVersion(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.version = reader.string(); + break; + } + case 2: { + message.versionDisplayName = reader.string(); + break; + } + case 3: { + message.sdkSupportStatus = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SdkVersion message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.dataflow.v1beta3.SdkVersion + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.dataflow.v1beta3.SdkVersion} SdkVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SdkVersion.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SdkVersion message. + * @function verify + * @memberof google.dataflow.v1beta3.SdkVersion + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SdkVersion.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isString(message.version)) + return "version: string expected"; + if (message.versionDisplayName != null && message.hasOwnProperty("versionDisplayName")) + if (!$util.isString(message.versionDisplayName)) + return "versionDisplayName: string expected"; + if (message.sdkSupportStatus != null && message.hasOwnProperty("sdkSupportStatus")) + switch (message.sdkSupportStatus) { + default: + return "sdkSupportStatus: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + return null; + }; + + /** + * Creates a SdkVersion message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.dataflow.v1beta3.SdkVersion + * @static + * @param {Object.} object Plain object + * @returns {google.dataflow.v1beta3.SdkVersion} SdkVersion + */ + SdkVersion.fromObject = function fromObject(object) { + if (object instanceof $root.google.dataflow.v1beta3.SdkVersion) + return object; + var message = new $root.google.dataflow.v1beta3.SdkVersion(); + if (object.version != null) + message.version = String(object.version); + if (object.versionDisplayName != null) + message.versionDisplayName = String(object.versionDisplayName); + switch (object.sdkSupportStatus) { + default: + if (typeof object.sdkSupportStatus === "number") { + message.sdkSupportStatus = object.sdkSupportStatus; + break; + } + break; + case "UNKNOWN": + case 0: + message.sdkSupportStatus = 0; + break; + case "SUPPORTED": + case 1: + message.sdkSupportStatus = 1; + break; + case "STALE": + case 2: + message.sdkSupportStatus = 2; + break; + case "DEPRECATED": + case 3: + message.sdkSupportStatus = 3; + break; + case "UNSUPPORTED": + case 4: + message.sdkSupportStatus = 4; + break; + } + return message; + }; + + /** + * Creates a plain object from a SdkVersion message. Also converts values to other types if specified. + * @function toObject + * @memberof google.dataflow.v1beta3.SdkVersion + * @static + * @param {google.dataflow.v1beta3.SdkVersion} message SdkVersion + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SdkVersion.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.version = ""; + object.versionDisplayName = ""; + object.sdkSupportStatus = options.enums === String ? "UNKNOWN" : 0; + } + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + if (message.versionDisplayName != null && message.hasOwnProperty("versionDisplayName")) + object.versionDisplayName = message.versionDisplayName; + if (message.sdkSupportStatus != null && message.hasOwnProperty("sdkSupportStatus")) + object.sdkSupportStatus = options.enums === String ? $root.google.dataflow.v1beta3.SdkVersion.SdkSupportStatus[message.sdkSupportStatus] === undefined ? message.sdkSupportStatus : $root.google.dataflow.v1beta3.SdkVersion.SdkSupportStatus[message.sdkSupportStatus] : message.sdkSupportStatus; + return object; + }; + + /** + * Converts this SdkVersion to JSON. + * @function toJSON + * @memberof google.dataflow.v1beta3.SdkVersion + * @instance + * @returns {Object.} JSON object + */ + SdkVersion.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SdkVersion + * @function getTypeUrl + * @memberof google.dataflow.v1beta3.SdkVersion + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SdkVersion.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.dataflow.v1beta3.SdkVersion"; + }; + + /** + * SdkSupportStatus enum. + * @name google.dataflow.v1beta3.SdkVersion.SdkSupportStatus + * @enum {number} + * @property {number} UNKNOWN=0 UNKNOWN value + * @property {number} SUPPORTED=1 SUPPORTED value + * @property {number} STALE=2 STALE value + * @property {number} DEPRECATED=3 DEPRECATED value + * @property {number} UNSUPPORTED=4 UNSUPPORTED value + */ + SdkVersion.SdkSupportStatus = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNKNOWN"] = 0; + values[valuesById[1] = "SUPPORTED"] = 1; + values[valuesById[2] = "STALE"] = 2; + values[valuesById[3] = "DEPRECATED"] = 3; + values[valuesById[4] = "UNSUPPORTED"] = 4; + return values; + })(); + + return SdkVersion; + })(); + + v1beta3.JobMetadata = (function() { + + /** + * Properties of a JobMetadata. + * @memberof google.dataflow.v1beta3 + * @interface IJobMetadata + * @property {google.dataflow.v1beta3.ISdkVersion|null} [sdkVersion] JobMetadata sdkVersion + * @property {Array.|null} [spannerDetails] JobMetadata spannerDetails + * @property {Array.|null} [bigqueryDetails] JobMetadata bigqueryDetails + * @property {Array.|null} [bigTableDetails] JobMetadata bigTableDetails + * @property {Array.|null} [pubsubDetails] JobMetadata pubsubDetails + * @property {Array.|null} [fileDetails] JobMetadata fileDetails + * @property {Array.|null} [datastoreDetails] JobMetadata datastoreDetails + */ + + /** + * Constructs a new JobMetadata. + * @memberof google.dataflow.v1beta3 + * @classdesc Represents a JobMetadata. + * @implements IJobMetadata + * @constructor + * @param {google.dataflow.v1beta3.IJobMetadata=} [properties] Properties to set + */ + function JobMetadata(properties) { + this.spannerDetails = []; + this.bigqueryDetails = []; + this.bigTableDetails = []; + this.pubsubDetails = []; + this.fileDetails = []; + this.datastoreDetails = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * JobMetadata sdkVersion. + * @member {google.dataflow.v1beta3.ISdkVersion|null|undefined} sdkVersion + * @memberof google.dataflow.v1beta3.JobMetadata + * @instance + */ + JobMetadata.prototype.sdkVersion = null; + + /** + * JobMetadata spannerDetails. + * @member {Array.} spannerDetails + * @memberof google.dataflow.v1beta3.JobMetadata + * @instance + */ + JobMetadata.prototype.spannerDetails = $util.emptyArray; + + /** + * JobMetadata bigqueryDetails. + * @member {Array.} bigqueryDetails + * @memberof google.dataflow.v1beta3.JobMetadata + * @instance + */ + JobMetadata.prototype.bigqueryDetails = $util.emptyArray; + + /** + * JobMetadata bigTableDetails. + * @member {Array.} bigTableDetails + * @memberof google.dataflow.v1beta3.JobMetadata + * @instance + */ + JobMetadata.prototype.bigTableDetails = $util.emptyArray; + + /** + * JobMetadata pubsubDetails. + * @member {Array.} pubsubDetails + * @memberof google.dataflow.v1beta3.JobMetadata + * @instance + */ + JobMetadata.prototype.pubsubDetails = $util.emptyArray; + + /** + * JobMetadata fileDetails. + * @member {Array.} fileDetails + * @memberof google.dataflow.v1beta3.JobMetadata + * @instance + */ + JobMetadata.prototype.fileDetails = $util.emptyArray; + + /** + * JobMetadata datastoreDetails. + * @member {Array.} datastoreDetails + * @memberof google.dataflow.v1beta3.JobMetadata + * @instance + */ + JobMetadata.prototype.datastoreDetails = $util.emptyArray; + + /** + * Creates a new JobMetadata instance using the specified properties. + * @function create + * @memberof google.dataflow.v1beta3.JobMetadata + * @static + * @param {google.dataflow.v1beta3.IJobMetadata=} [properties] Properties to set + * @returns {google.dataflow.v1beta3.JobMetadata} JobMetadata instance + */ + JobMetadata.create = function create(properties) { + return new JobMetadata(properties); + }; + + /** + * Encodes the specified JobMetadata message. Does not implicitly {@link google.dataflow.v1beta3.JobMetadata.verify|verify} messages. + * @function encode + * @memberof google.dataflow.v1beta3.JobMetadata + * @static + * @param {google.dataflow.v1beta3.IJobMetadata} message JobMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JobMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sdkVersion != null && Object.hasOwnProperty.call(message, "sdkVersion")) + $root.google.dataflow.v1beta3.SdkVersion.encode(message.sdkVersion, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.spannerDetails != null && message.spannerDetails.length) + for (var i = 0; i < message.spannerDetails.length; ++i) + $root.google.dataflow.v1beta3.SpannerIODetails.encode(message.spannerDetails[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.bigqueryDetails != null && message.bigqueryDetails.length) + for (var i = 0; i < message.bigqueryDetails.length; ++i) + $root.google.dataflow.v1beta3.BigQueryIODetails.encode(message.bigqueryDetails[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.bigTableDetails != null && message.bigTableDetails.length) + for (var i = 0; i < message.bigTableDetails.length; ++i) + $root.google.dataflow.v1beta3.BigTableIODetails.encode(message.bigTableDetails[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.pubsubDetails != null && message.pubsubDetails.length) + for (var i = 0; i < message.pubsubDetails.length; ++i) + $root.google.dataflow.v1beta3.PubSubIODetails.encode(message.pubsubDetails[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.fileDetails != null && message.fileDetails.length) + for (var i = 0; i < message.fileDetails.length; ++i) + $root.google.dataflow.v1beta3.FileIODetails.encode(message.fileDetails[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.datastoreDetails != null && message.datastoreDetails.length) + for (var i = 0; i < message.datastoreDetails.length; ++i) + $root.google.dataflow.v1beta3.DatastoreIODetails.encode(message.datastoreDetails[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified JobMetadata message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.JobMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.dataflow.v1beta3.JobMetadata + * @static + * @param {google.dataflow.v1beta3.IJobMetadata} message JobMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JobMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a JobMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.dataflow.v1beta3.JobMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.dataflow.v1beta3.JobMetadata} JobMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JobMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.dataflow.v1beta3.JobMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.sdkVersion = $root.google.dataflow.v1beta3.SdkVersion.decode(reader, reader.uint32()); + break; + } + case 2: { + if (!(message.spannerDetails && message.spannerDetails.length)) + message.spannerDetails = []; + message.spannerDetails.push($root.google.dataflow.v1beta3.SpannerIODetails.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.bigqueryDetails && message.bigqueryDetails.length)) + message.bigqueryDetails = []; + message.bigqueryDetails.push($root.google.dataflow.v1beta3.BigQueryIODetails.decode(reader, reader.uint32())); + break; + } + case 4: { + if (!(message.bigTableDetails && message.bigTableDetails.length)) + message.bigTableDetails = []; + message.bigTableDetails.push($root.google.dataflow.v1beta3.BigTableIODetails.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.pubsubDetails && message.pubsubDetails.length)) + message.pubsubDetails = []; + message.pubsubDetails.push($root.google.dataflow.v1beta3.PubSubIODetails.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.fileDetails && message.fileDetails.length)) + message.fileDetails = []; + message.fileDetails.push($root.google.dataflow.v1beta3.FileIODetails.decode(reader, reader.uint32())); + break; + } + case 7: { + if (!(message.datastoreDetails && message.datastoreDetails.length)) + message.datastoreDetails = []; + message.datastoreDetails.push($root.google.dataflow.v1beta3.DatastoreIODetails.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a JobMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.dataflow.v1beta3.JobMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.dataflow.v1beta3.JobMetadata} JobMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JobMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a JobMetadata message. + * @function verify + * @memberof google.dataflow.v1beta3.JobMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + JobMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.sdkVersion != null && message.hasOwnProperty("sdkVersion")) { + var error = $root.google.dataflow.v1beta3.SdkVersion.verify(message.sdkVersion); + if (error) + return "sdkVersion." + error; + } + if (message.spannerDetails != null && message.hasOwnProperty("spannerDetails")) { + if (!Array.isArray(message.spannerDetails)) + return "spannerDetails: array expected"; + for (var i = 0; i < message.spannerDetails.length; ++i) { + var error = $root.google.dataflow.v1beta3.SpannerIODetails.verify(message.spannerDetails[i]); + if (error) + return "spannerDetails." + error; + } + } + if (message.bigqueryDetails != null && message.hasOwnProperty("bigqueryDetails")) { + if (!Array.isArray(message.bigqueryDetails)) + return "bigqueryDetails: array expected"; + for (var i = 0; i < message.bigqueryDetails.length; ++i) { + var error = $root.google.dataflow.v1beta3.BigQueryIODetails.verify(message.bigqueryDetails[i]); + if (error) + return "bigqueryDetails." + error; + } + } + if (message.bigTableDetails != null && message.hasOwnProperty("bigTableDetails")) { + if (!Array.isArray(message.bigTableDetails)) + return "bigTableDetails: array expected"; + for (var i = 0; i < message.bigTableDetails.length; ++i) { + var error = $root.google.dataflow.v1beta3.BigTableIODetails.verify(message.bigTableDetails[i]); + if (error) + return "bigTableDetails." + error; + } + } + if (message.pubsubDetails != null && message.hasOwnProperty("pubsubDetails")) { + if (!Array.isArray(message.pubsubDetails)) + return "pubsubDetails: array expected"; + for (var i = 0; i < message.pubsubDetails.length; ++i) { + var error = $root.google.dataflow.v1beta3.PubSubIODetails.verify(message.pubsubDetails[i]); + if (error) + return "pubsubDetails." + error; + } + } + if (message.fileDetails != null && message.hasOwnProperty("fileDetails")) { + if (!Array.isArray(message.fileDetails)) + return "fileDetails: array expected"; + for (var i = 0; i < message.fileDetails.length; ++i) { + var error = $root.google.dataflow.v1beta3.FileIODetails.verify(message.fileDetails[i]); + if (error) + return "fileDetails." + error; + } + } + if (message.datastoreDetails != null && message.hasOwnProperty("datastoreDetails")) { + if (!Array.isArray(message.datastoreDetails)) + return "datastoreDetails: array expected"; + for (var i = 0; i < message.datastoreDetails.length; ++i) { + var error = $root.google.dataflow.v1beta3.DatastoreIODetails.verify(message.datastoreDetails[i]); + if (error) + return "datastoreDetails." + error; + } + } + return null; + }; + + /** + * Creates a JobMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.dataflow.v1beta3.JobMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.dataflow.v1beta3.JobMetadata} JobMetadata + */ + JobMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.dataflow.v1beta3.JobMetadata) + return object; + var message = new $root.google.dataflow.v1beta3.JobMetadata(); + if (object.sdkVersion != null) { + if (typeof object.sdkVersion !== "object") + throw TypeError(".google.dataflow.v1beta3.JobMetadata.sdkVersion: object expected"); + message.sdkVersion = $root.google.dataflow.v1beta3.SdkVersion.fromObject(object.sdkVersion); + } + if (object.spannerDetails) { + if (!Array.isArray(object.spannerDetails)) + throw TypeError(".google.dataflow.v1beta3.JobMetadata.spannerDetails: array expected"); + message.spannerDetails = []; + for (var i = 0; i < object.spannerDetails.length; ++i) { + if (typeof object.spannerDetails[i] !== "object") + throw TypeError(".google.dataflow.v1beta3.JobMetadata.spannerDetails: object expected"); + message.spannerDetails[i] = $root.google.dataflow.v1beta3.SpannerIODetails.fromObject(object.spannerDetails[i]); + } + } + if (object.bigqueryDetails) { + if (!Array.isArray(object.bigqueryDetails)) + throw TypeError(".google.dataflow.v1beta3.JobMetadata.bigqueryDetails: array expected"); + message.bigqueryDetails = []; + for (var i = 0; i < object.bigqueryDetails.length; ++i) { + if (typeof object.bigqueryDetails[i] !== "object") + throw TypeError(".google.dataflow.v1beta3.JobMetadata.bigqueryDetails: object expected"); + message.bigqueryDetails[i] = $root.google.dataflow.v1beta3.BigQueryIODetails.fromObject(object.bigqueryDetails[i]); + } + } + if (object.bigTableDetails) { + if (!Array.isArray(object.bigTableDetails)) + throw TypeError(".google.dataflow.v1beta3.JobMetadata.bigTableDetails: array expected"); + message.bigTableDetails = []; + for (var i = 0; i < object.bigTableDetails.length; ++i) { + if (typeof object.bigTableDetails[i] !== "object") + throw TypeError(".google.dataflow.v1beta3.JobMetadata.bigTableDetails: object expected"); + message.bigTableDetails[i] = $root.google.dataflow.v1beta3.BigTableIODetails.fromObject(object.bigTableDetails[i]); + } + } + if (object.pubsubDetails) { + if (!Array.isArray(object.pubsubDetails)) + throw TypeError(".google.dataflow.v1beta3.JobMetadata.pubsubDetails: array expected"); + message.pubsubDetails = []; + for (var i = 0; i < object.pubsubDetails.length; ++i) { + if (typeof object.pubsubDetails[i] !== "object") + throw TypeError(".google.dataflow.v1beta3.JobMetadata.pubsubDetails: object expected"); + message.pubsubDetails[i] = $root.google.dataflow.v1beta3.PubSubIODetails.fromObject(object.pubsubDetails[i]); + } + } + if (object.fileDetails) { + if (!Array.isArray(object.fileDetails)) + throw TypeError(".google.dataflow.v1beta3.JobMetadata.fileDetails: array expected"); + message.fileDetails = []; + for (var i = 0; i < object.fileDetails.length; ++i) { + if (typeof object.fileDetails[i] !== "object") + throw TypeError(".google.dataflow.v1beta3.JobMetadata.fileDetails: object expected"); + message.fileDetails[i] = $root.google.dataflow.v1beta3.FileIODetails.fromObject(object.fileDetails[i]); + } + } + if (object.datastoreDetails) { + if (!Array.isArray(object.datastoreDetails)) + throw TypeError(".google.dataflow.v1beta3.JobMetadata.datastoreDetails: array expected"); + message.datastoreDetails = []; + for (var i = 0; i < object.datastoreDetails.length; ++i) { + if (typeof object.datastoreDetails[i] !== "object") + throw TypeError(".google.dataflow.v1beta3.JobMetadata.datastoreDetails: object expected"); + message.datastoreDetails[i] = $root.google.dataflow.v1beta3.DatastoreIODetails.fromObject(object.datastoreDetails[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a JobMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.dataflow.v1beta3.JobMetadata + * @static + * @param {google.dataflow.v1beta3.JobMetadata} message JobMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + JobMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.spannerDetails = []; + object.bigqueryDetails = []; + object.bigTableDetails = []; + object.pubsubDetails = []; + object.fileDetails = []; + object.datastoreDetails = []; + } + if (options.defaults) + object.sdkVersion = null; + if (message.sdkVersion != null && message.hasOwnProperty("sdkVersion")) + object.sdkVersion = $root.google.dataflow.v1beta3.SdkVersion.toObject(message.sdkVersion, options); + if (message.spannerDetails && message.spannerDetails.length) { + object.spannerDetails = []; + for (var j = 0; j < message.spannerDetails.length; ++j) + object.spannerDetails[j] = $root.google.dataflow.v1beta3.SpannerIODetails.toObject(message.spannerDetails[j], options); + } + if (message.bigqueryDetails && message.bigqueryDetails.length) { + object.bigqueryDetails = []; + for (var j = 0; j < message.bigqueryDetails.length; ++j) + object.bigqueryDetails[j] = $root.google.dataflow.v1beta3.BigQueryIODetails.toObject(message.bigqueryDetails[j], options); + } + if (message.bigTableDetails && message.bigTableDetails.length) { + object.bigTableDetails = []; + for (var j = 0; j < message.bigTableDetails.length; ++j) + object.bigTableDetails[j] = $root.google.dataflow.v1beta3.BigTableIODetails.toObject(message.bigTableDetails[j], options); + } + if (message.pubsubDetails && message.pubsubDetails.length) { + object.pubsubDetails = []; + for (var j = 0; j < message.pubsubDetails.length; ++j) + object.pubsubDetails[j] = $root.google.dataflow.v1beta3.PubSubIODetails.toObject(message.pubsubDetails[j], options); + } + if (message.fileDetails && message.fileDetails.length) { + object.fileDetails = []; + for (var j = 0; j < message.fileDetails.length; ++j) + object.fileDetails[j] = $root.google.dataflow.v1beta3.FileIODetails.toObject(message.fileDetails[j], options); + } + if (message.datastoreDetails && message.datastoreDetails.length) { + object.datastoreDetails = []; + for (var j = 0; j < message.datastoreDetails.length; ++j) + object.datastoreDetails[j] = $root.google.dataflow.v1beta3.DatastoreIODetails.toObject(message.datastoreDetails[j], options); + } + return object; + }; + + /** + * Converts this JobMetadata to JSON. + * @function toJSON + * @memberof google.dataflow.v1beta3.JobMetadata + * @instance + * @returns {Object.} JSON object + */ + JobMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for JobMetadata + * @function getTypeUrl + * @memberof google.dataflow.v1beta3.JobMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + JobMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.dataflow.v1beta3.JobMetadata"; + }; + + return JobMetadata; + })(); + + v1beta3.ExecutionStageState = (function() { + + /** + * Properties of an ExecutionStageState. + * @memberof google.dataflow.v1beta3 + * @interface IExecutionStageState + * @property {string|null} [executionStageName] ExecutionStageState executionStageName + * @property {google.dataflow.v1beta3.JobState|null} [executionStageState] ExecutionStageState executionStageState + * @property {google.protobuf.ITimestamp|null} [currentStateTime] ExecutionStageState currentStateTime + */ + + /** + * Constructs a new ExecutionStageState. + * @memberof google.dataflow.v1beta3 + * @classdesc Represents an ExecutionStageState. + * @implements IExecutionStageState + * @constructor + * @param {google.dataflow.v1beta3.IExecutionStageState=} [properties] Properties to set + */ + function ExecutionStageState(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExecutionStageState executionStageName. + * @member {string} executionStageName + * @memberof google.dataflow.v1beta3.ExecutionStageState + * @instance + */ + ExecutionStageState.prototype.executionStageName = ""; + + /** + * ExecutionStageState executionStageState. + * @member {google.dataflow.v1beta3.JobState} executionStageState + * @memberof google.dataflow.v1beta3.ExecutionStageState + * @instance + */ + ExecutionStageState.prototype.executionStageState = 0; + + /** + * ExecutionStageState currentStateTime. + * @member {google.protobuf.ITimestamp|null|undefined} currentStateTime + * @memberof google.dataflow.v1beta3.ExecutionStageState + * @instance + */ + ExecutionStageState.prototype.currentStateTime = null; + + /** + * Creates a new ExecutionStageState instance using the specified properties. + * @function create + * @memberof google.dataflow.v1beta3.ExecutionStageState + * @static + * @param {google.dataflow.v1beta3.IExecutionStageState=} [properties] Properties to set + * @returns {google.dataflow.v1beta3.ExecutionStageState} ExecutionStageState instance + */ + ExecutionStageState.create = function create(properties) { + return new ExecutionStageState(properties); + }; + + /** + * Encodes the specified ExecutionStageState message. Does not implicitly {@link google.dataflow.v1beta3.ExecutionStageState.verify|verify} messages. + * @function encode + * @memberof google.dataflow.v1beta3.ExecutionStageState + * @static + * @param {google.dataflow.v1beta3.IExecutionStageState} message ExecutionStageState message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExecutionStageState.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.executionStageName != null && Object.hasOwnProperty.call(message, "executionStageName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.executionStageName); + if (message.executionStageState != null && Object.hasOwnProperty.call(message, "executionStageState")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.executionStageState); + if (message.currentStateTime != null && Object.hasOwnProperty.call(message, "currentStateTime")) + $root.google.protobuf.Timestamp.encode(message.currentStateTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExecutionStageState message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.ExecutionStageState.verify|verify} messages. + * @function encodeDelimited + * @memberof google.dataflow.v1beta3.ExecutionStageState + * @static + * @param {google.dataflow.v1beta3.IExecutionStageState} message ExecutionStageState message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExecutionStageState.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExecutionStageState message from the specified reader or buffer. + * @function decode + * @memberof google.dataflow.v1beta3.ExecutionStageState + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.dataflow.v1beta3.ExecutionStageState} ExecutionStageState + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExecutionStageState.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.dataflow.v1beta3.ExecutionStageState(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.executionStageName = reader.string(); + break; + } + case 2: { + message.executionStageState = reader.int32(); + break; + } + case 3: { + message.currentStateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExecutionStageState message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.dataflow.v1beta3.ExecutionStageState + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.dataflow.v1beta3.ExecutionStageState} ExecutionStageState + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExecutionStageState.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExecutionStageState message. + * @function verify + * @memberof google.dataflow.v1beta3.ExecutionStageState + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExecutionStageState.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.executionStageName != null && message.hasOwnProperty("executionStageName")) + if (!$util.isString(message.executionStageName)) + return "executionStageName: string expected"; + if (message.executionStageState != null && message.hasOwnProperty("executionStageState")) + switch (message.executionStageState) { + default: + return "executionStageState: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + break; + } + if (message.currentStateTime != null && message.hasOwnProperty("currentStateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.currentStateTime); + if (error) + return "currentStateTime." + error; + } + return null; + }; + + /** + * Creates an ExecutionStageState message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.dataflow.v1beta3.ExecutionStageState + * @static + * @param {Object.} object Plain object + * @returns {google.dataflow.v1beta3.ExecutionStageState} ExecutionStageState + */ + ExecutionStageState.fromObject = function fromObject(object) { + if (object instanceof $root.google.dataflow.v1beta3.ExecutionStageState) + return object; + var message = new $root.google.dataflow.v1beta3.ExecutionStageState(); + if (object.executionStageName != null) + message.executionStageName = String(object.executionStageName); + switch (object.executionStageState) { + default: + if (typeof object.executionStageState === "number") { + message.executionStageState = object.executionStageState; + break; + } + break; + case "JOB_STATE_UNKNOWN": + case 0: + message.executionStageState = 0; + break; + case "JOB_STATE_STOPPED": + case 1: + message.executionStageState = 1; + break; + case "JOB_STATE_RUNNING": + case 2: + message.executionStageState = 2; + break; + case "JOB_STATE_DONE": + case 3: + message.executionStageState = 3; + break; + case "JOB_STATE_FAILED": + case 4: + message.executionStageState = 4; + break; + case "JOB_STATE_CANCELLED": + case 5: + message.executionStageState = 5; + break; + case "JOB_STATE_UPDATED": + case 6: + message.executionStageState = 6; + break; + case "JOB_STATE_DRAINING": + case 7: + message.executionStageState = 7; + break; + case "JOB_STATE_DRAINED": + case 8: + message.executionStageState = 8; + break; + case "JOB_STATE_PENDING": + case 9: + message.executionStageState = 9; + break; + case "JOB_STATE_CANCELLING": + case 10: + message.executionStageState = 10; + break; + case "JOB_STATE_QUEUED": + case 11: + message.executionStageState = 11; + break; + case "JOB_STATE_RESOURCE_CLEANING_UP": + case 12: + message.executionStageState = 12; + break; + } + if (object.currentStateTime != null) { + if (typeof object.currentStateTime !== "object") + throw TypeError(".google.dataflow.v1beta3.ExecutionStageState.currentStateTime: object expected"); + message.currentStateTime = $root.google.protobuf.Timestamp.fromObject(object.currentStateTime); + } + return message; + }; + + /** + * Creates a plain object from an ExecutionStageState message. Also converts values to other types if specified. + * @function toObject + * @memberof google.dataflow.v1beta3.ExecutionStageState + * @static + * @param {google.dataflow.v1beta3.ExecutionStageState} message ExecutionStageState + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExecutionStageState.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.executionStageName = ""; + object.executionStageState = options.enums === String ? "JOB_STATE_UNKNOWN" : 0; + object.currentStateTime = null; + } + if (message.executionStageName != null && message.hasOwnProperty("executionStageName")) + object.executionStageName = message.executionStageName; + if (message.executionStageState != null && message.hasOwnProperty("executionStageState")) + object.executionStageState = options.enums === String ? $root.google.dataflow.v1beta3.JobState[message.executionStageState] === undefined ? message.executionStageState : $root.google.dataflow.v1beta3.JobState[message.executionStageState] : message.executionStageState; + if (message.currentStateTime != null && message.hasOwnProperty("currentStateTime")) + object.currentStateTime = $root.google.protobuf.Timestamp.toObject(message.currentStateTime, options); + return object; + }; + + /** + * Converts this ExecutionStageState to JSON. + * @function toJSON + * @memberof google.dataflow.v1beta3.ExecutionStageState + * @instance + * @returns {Object.} JSON object + */ + ExecutionStageState.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExecutionStageState + * @function getTypeUrl + * @memberof google.dataflow.v1beta3.ExecutionStageState + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExecutionStageState.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.dataflow.v1beta3.ExecutionStageState"; + }; + + return ExecutionStageState; + })(); + + v1beta3.PipelineDescription = (function() { + + /** + * Properties of a PipelineDescription. + * @memberof google.dataflow.v1beta3 + * @interface IPipelineDescription + * @property {Array.|null} [originalPipelineTransform] PipelineDescription originalPipelineTransform + * @property {Array.|null} [executionPipelineStage] PipelineDescription executionPipelineStage + * @property {Array.|null} [displayData] PipelineDescription displayData + */ + + /** + * Constructs a new PipelineDescription. + * @memberof google.dataflow.v1beta3 + * @classdesc Represents a PipelineDescription. + * @implements IPipelineDescription + * @constructor + * @param {google.dataflow.v1beta3.IPipelineDescription=} [properties] Properties to set + */ + function PipelineDescription(properties) { + this.originalPipelineTransform = []; + this.executionPipelineStage = []; + this.displayData = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PipelineDescription originalPipelineTransform. + * @member {Array.} originalPipelineTransform + * @memberof google.dataflow.v1beta3.PipelineDescription + * @instance + */ + PipelineDescription.prototype.originalPipelineTransform = $util.emptyArray; + + /** + * PipelineDescription executionPipelineStage. + * @member {Array.} executionPipelineStage + * @memberof google.dataflow.v1beta3.PipelineDescription + * @instance + */ + PipelineDescription.prototype.executionPipelineStage = $util.emptyArray; + + /** + * PipelineDescription displayData. + * @member {Array.} displayData + * @memberof google.dataflow.v1beta3.PipelineDescription + * @instance + */ + PipelineDescription.prototype.displayData = $util.emptyArray; + + /** + * Creates a new PipelineDescription instance using the specified properties. + * @function create + * @memberof google.dataflow.v1beta3.PipelineDescription + * @static + * @param {google.dataflow.v1beta3.IPipelineDescription=} [properties] Properties to set + * @returns {google.dataflow.v1beta3.PipelineDescription} PipelineDescription instance + */ + PipelineDescription.create = function create(properties) { + return new PipelineDescription(properties); + }; + + /** + * Encodes the specified PipelineDescription message. Does not implicitly {@link google.dataflow.v1beta3.PipelineDescription.verify|verify} messages. + * @function encode + * @memberof google.dataflow.v1beta3.PipelineDescription + * @static + * @param {google.dataflow.v1beta3.IPipelineDescription} message PipelineDescription message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PipelineDescription.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.originalPipelineTransform != null && message.originalPipelineTransform.length) + for (var i = 0; i < message.originalPipelineTransform.length; ++i) + $root.google.dataflow.v1beta3.TransformSummary.encode(message.originalPipelineTransform[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.executionPipelineStage != null && message.executionPipelineStage.length) + for (var i = 0; i < message.executionPipelineStage.length; ++i) + $root.google.dataflow.v1beta3.ExecutionStageSummary.encode(message.executionPipelineStage[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.displayData != null && message.displayData.length) + for (var i = 0; i < message.displayData.length; ++i) + $root.google.dataflow.v1beta3.DisplayData.encode(message.displayData[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PipelineDescription message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.PipelineDescription.verify|verify} messages. + * @function encodeDelimited + * @memberof google.dataflow.v1beta3.PipelineDescription + * @static + * @param {google.dataflow.v1beta3.IPipelineDescription} message PipelineDescription message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PipelineDescription.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PipelineDescription message from the specified reader or buffer. + * @function decode + * @memberof google.dataflow.v1beta3.PipelineDescription + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.dataflow.v1beta3.PipelineDescription} PipelineDescription + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PipelineDescription.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.dataflow.v1beta3.PipelineDescription(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.originalPipelineTransform && message.originalPipelineTransform.length)) + message.originalPipelineTransform = []; + message.originalPipelineTransform.push($root.google.dataflow.v1beta3.TransformSummary.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.executionPipelineStage && message.executionPipelineStage.length)) + message.executionPipelineStage = []; + message.executionPipelineStage.push($root.google.dataflow.v1beta3.ExecutionStageSummary.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.displayData && message.displayData.length)) + message.displayData = []; + message.displayData.push($root.google.dataflow.v1beta3.DisplayData.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PipelineDescription message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.dataflow.v1beta3.PipelineDescription + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.dataflow.v1beta3.PipelineDescription} PipelineDescription + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PipelineDescription.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PipelineDescription message. + * @function verify + * @memberof google.dataflow.v1beta3.PipelineDescription + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PipelineDescription.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.originalPipelineTransform != null && message.hasOwnProperty("originalPipelineTransform")) { + if (!Array.isArray(message.originalPipelineTransform)) + return "originalPipelineTransform: array expected"; + for (var i = 0; i < message.originalPipelineTransform.length; ++i) { + var error = $root.google.dataflow.v1beta3.TransformSummary.verify(message.originalPipelineTransform[i]); + if (error) + return "originalPipelineTransform." + error; + } + } + if (message.executionPipelineStage != null && message.hasOwnProperty("executionPipelineStage")) { + if (!Array.isArray(message.executionPipelineStage)) + return "executionPipelineStage: array expected"; + for (var i = 0; i < message.executionPipelineStage.length; ++i) { + var error = $root.google.dataflow.v1beta3.ExecutionStageSummary.verify(message.executionPipelineStage[i]); + if (error) + return "executionPipelineStage." + error; + } + } + if (message.displayData != null && message.hasOwnProperty("displayData")) { + if (!Array.isArray(message.displayData)) + return "displayData: array expected"; + for (var i = 0; i < message.displayData.length; ++i) { + var error = $root.google.dataflow.v1beta3.DisplayData.verify(message.displayData[i]); + if (error) + return "displayData." + error; + } + } + return null; + }; + + /** + * Creates a PipelineDescription message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.dataflow.v1beta3.PipelineDescription + * @static + * @param {Object.} object Plain object + * @returns {google.dataflow.v1beta3.PipelineDescription} PipelineDescription + */ + PipelineDescription.fromObject = function fromObject(object) { + if (object instanceof $root.google.dataflow.v1beta3.PipelineDescription) + return object; + var message = new $root.google.dataflow.v1beta3.PipelineDescription(); + if (object.originalPipelineTransform) { + if (!Array.isArray(object.originalPipelineTransform)) + throw TypeError(".google.dataflow.v1beta3.PipelineDescription.originalPipelineTransform: array expected"); + message.originalPipelineTransform = []; + for (var i = 0; i < object.originalPipelineTransform.length; ++i) { + if (typeof object.originalPipelineTransform[i] !== "object") + throw TypeError(".google.dataflow.v1beta3.PipelineDescription.originalPipelineTransform: object expected"); + message.originalPipelineTransform[i] = $root.google.dataflow.v1beta3.TransformSummary.fromObject(object.originalPipelineTransform[i]); + } + } + if (object.executionPipelineStage) { + if (!Array.isArray(object.executionPipelineStage)) + throw TypeError(".google.dataflow.v1beta3.PipelineDescription.executionPipelineStage: array expected"); + message.executionPipelineStage = []; + for (var i = 0; i < object.executionPipelineStage.length; ++i) { + if (typeof object.executionPipelineStage[i] !== "object") + throw TypeError(".google.dataflow.v1beta3.PipelineDescription.executionPipelineStage: object expected"); + message.executionPipelineStage[i] = $root.google.dataflow.v1beta3.ExecutionStageSummary.fromObject(object.executionPipelineStage[i]); + } + } + if (object.displayData) { + if (!Array.isArray(object.displayData)) + throw TypeError(".google.dataflow.v1beta3.PipelineDescription.displayData: array expected"); + message.displayData = []; + for (var i = 0; i < object.displayData.length; ++i) { + if (typeof object.displayData[i] !== "object") + throw TypeError(".google.dataflow.v1beta3.PipelineDescription.displayData: object expected"); + message.displayData[i] = $root.google.dataflow.v1beta3.DisplayData.fromObject(object.displayData[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a PipelineDescription message. Also converts values to other types if specified. + * @function toObject + * @memberof google.dataflow.v1beta3.PipelineDescription + * @static + * @param {google.dataflow.v1beta3.PipelineDescription} message PipelineDescription + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PipelineDescription.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.originalPipelineTransform = []; + object.executionPipelineStage = []; + object.displayData = []; + } + if (message.originalPipelineTransform && message.originalPipelineTransform.length) { + object.originalPipelineTransform = []; + for (var j = 0; j < message.originalPipelineTransform.length; ++j) + object.originalPipelineTransform[j] = $root.google.dataflow.v1beta3.TransformSummary.toObject(message.originalPipelineTransform[j], options); + } + if (message.executionPipelineStage && message.executionPipelineStage.length) { + object.executionPipelineStage = []; + for (var j = 0; j < message.executionPipelineStage.length; ++j) + object.executionPipelineStage[j] = $root.google.dataflow.v1beta3.ExecutionStageSummary.toObject(message.executionPipelineStage[j], options); + } + if (message.displayData && message.displayData.length) { + object.displayData = []; + for (var j = 0; j < message.displayData.length; ++j) + object.displayData[j] = $root.google.dataflow.v1beta3.DisplayData.toObject(message.displayData[j], options); + } + return object; + }; + + /** + * Converts this PipelineDescription to JSON. + * @function toJSON + * @memberof google.dataflow.v1beta3.PipelineDescription + * @instance + * @returns {Object.} JSON object + */ + PipelineDescription.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PipelineDescription + * @function getTypeUrl + * @memberof google.dataflow.v1beta3.PipelineDescription + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PipelineDescription.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.dataflow.v1beta3.PipelineDescription"; + }; + + return PipelineDescription; + })(); + + /** + * KindType enum. + * @name google.dataflow.v1beta3.KindType + * @enum {number} + * @property {number} UNKNOWN_KIND=0 UNKNOWN_KIND value + * @property {number} PAR_DO_KIND=1 PAR_DO_KIND value + * @property {number} GROUP_BY_KEY_KIND=2 GROUP_BY_KEY_KIND value + * @property {number} FLATTEN_KIND=3 FLATTEN_KIND value + * @property {number} READ_KIND=4 READ_KIND value + * @property {number} WRITE_KIND=5 WRITE_KIND value + * @property {number} CONSTANT_KIND=6 CONSTANT_KIND value + * @property {number} SINGLETON_KIND=7 SINGLETON_KIND value + * @property {number} SHUFFLE_KIND=8 SHUFFLE_KIND value + */ + v1beta3.KindType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNKNOWN_KIND"] = 0; + values[valuesById[1] = "PAR_DO_KIND"] = 1; + values[valuesById[2] = "GROUP_BY_KEY_KIND"] = 2; + values[valuesById[3] = "FLATTEN_KIND"] = 3; + values[valuesById[4] = "READ_KIND"] = 4; + values[valuesById[5] = "WRITE_KIND"] = 5; + values[valuesById[6] = "CONSTANT_KIND"] = 6; + values[valuesById[7] = "SINGLETON_KIND"] = 7; + values[valuesById[8] = "SHUFFLE_KIND"] = 8; + return values; + })(); + + v1beta3.TransformSummary = (function() { + + /** + * Properties of a TransformSummary. + * @memberof google.dataflow.v1beta3 + * @interface ITransformSummary + * @property {google.dataflow.v1beta3.KindType|null} [kind] TransformSummary kind + * @property {string|null} [id] TransformSummary id + * @property {string|null} [name] TransformSummary name + * @property {Array.|null} [displayData] TransformSummary displayData + * @property {Array.|null} [outputCollectionName] TransformSummary outputCollectionName + * @property {Array.|null} [inputCollectionName] TransformSummary inputCollectionName + */ + + /** + * Constructs a new TransformSummary. + * @memberof google.dataflow.v1beta3 + * @classdesc Represents a TransformSummary. + * @implements ITransformSummary + * @constructor + * @param {google.dataflow.v1beta3.ITransformSummary=} [properties] Properties to set + */ + function TransformSummary(properties) { + this.displayData = []; + this.outputCollectionName = []; + this.inputCollectionName = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TransformSummary kind. + * @member {google.dataflow.v1beta3.KindType} kind + * @memberof google.dataflow.v1beta3.TransformSummary + * @instance + */ + TransformSummary.prototype.kind = 0; + + /** + * TransformSummary id. + * @member {string} id + * @memberof google.dataflow.v1beta3.TransformSummary + * @instance + */ + TransformSummary.prototype.id = ""; + + /** + * TransformSummary name. + * @member {string} name + * @memberof google.dataflow.v1beta3.TransformSummary + * @instance + */ + TransformSummary.prototype.name = ""; + + /** + * TransformSummary displayData. + * @member {Array.} displayData + * @memberof google.dataflow.v1beta3.TransformSummary + * @instance + */ + TransformSummary.prototype.displayData = $util.emptyArray; + + /** + * TransformSummary outputCollectionName. + * @member {Array.} outputCollectionName + * @memberof google.dataflow.v1beta3.TransformSummary + * @instance + */ + TransformSummary.prototype.outputCollectionName = $util.emptyArray; + + /** + * TransformSummary inputCollectionName. + * @member {Array.} inputCollectionName + * @memberof google.dataflow.v1beta3.TransformSummary + * @instance + */ + TransformSummary.prototype.inputCollectionName = $util.emptyArray; + + /** + * Creates a new TransformSummary instance using the specified properties. + * @function create + * @memberof google.dataflow.v1beta3.TransformSummary + * @static + * @param {google.dataflow.v1beta3.ITransformSummary=} [properties] Properties to set + * @returns {google.dataflow.v1beta3.TransformSummary} TransformSummary instance + */ + TransformSummary.create = function create(properties) { + return new TransformSummary(properties); + }; + + /** + * Encodes the specified TransformSummary message. Does not implicitly {@link google.dataflow.v1beta3.TransformSummary.verify|verify} messages. + * @function encode + * @memberof google.dataflow.v1beta3.TransformSummary + * @static + * @param {google.dataflow.v1beta3.ITransformSummary} message TransformSummary message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransformSummary.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.kind); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.id); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.name); + if (message.displayData != null && message.displayData.length) + for (var i = 0; i < message.displayData.length; ++i) + $root.google.dataflow.v1beta3.DisplayData.encode(message.displayData[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.outputCollectionName != null && message.outputCollectionName.length) + for (var i = 0; i < message.outputCollectionName.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.outputCollectionName[i]); + if (message.inputCollectionName != null && message.inputCollectionName.length) + for (var i = 0; i < message.inputCollectionName.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.inputCollectionName[i]); + return writer; + }; + + /** + * Encodes the specified TransformSummary message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.TransformSummary.verify|verify} messages. + * @function encodeDelimited + * @memberof google.dataflow.v1beta3.TransformSummary + * @static + * @param {google.dataflow.v1beta3.ITransformSummary} message TransformSummary message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransformSummary.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TransformSummary message from the specified reader or buffer. + * @function decode + * @memberof google.dataflow.v1beta3.TransformSummary + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.dataflow.v1beta3.TransformSummary} TransformSummary + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransformSummary.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.dataflow.v1beta3.TransformSummary(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.kind = reader.int32(); + break; + } + case 2: { + message.id = reader.string(); + break; + } + case 3: { + message.name = reader.string(); + break; + } + case 4: { + if (!(message.displayData && message.displayData.length)) + message.displayData = []; + message.displayData.push($root.google.dataflow.v1beta3.DisplayData.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.outputCollectionName && message.outputCollectionName.length)) + message.outputCollectionName = []; + message.outputCollectionName.push(reader.string()); + break; + } + case 6: { + if (!(message.inputCollectionName && message.inputCollectionName.length)) + message.inputCollectionName = []; + message.inputCollectionName.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TransformSummary message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.dataflow.v1beta3.TransformSummary + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.dataflow.v1beta3.TransformSummary} TransformSummary + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransformSummary.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TransformSummary message. + * @function verify + * @memberof google.dataflow.v1beta3.TransformSummary + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TransformSummary.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.kind != null && message.hasOwnProperty("kind")) + switch (message.kind) { + default: + return "kind: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + break; + } + if (message.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.displayData != null && message.hasOwnProperty("displayData")) { + if (!Array.isArray(message.displayData)) + return "displayData: array expected"; + for (var i = 0; i < message.displayData.length; ++i) { + var error = $root.google.dataflow.v1beta3.DisplayData.verify(message.displayData[i]); + if (error) + return "displayData." + error; + } + } + if (message.outputCollectionName != null && message.hasOwnProperty("outputCollectionName")) { + if (!Array.isArray(message.outputCollectionName)) + return "outputCollectionName: array expected"; + for (var i = 0; i < message.outputCollectionName.length; ++i) + if (!$util.isString(message.outputCollectionName[i])) + return "outputCollectionName: string[] expected"; + } + if (message.inputCollectionName != null && message.hasOwnProperty("inputCollectionName")) { + if (!Array.isArray(message.inputCollectionName)) + return "inputCollectionName: array expected"; + for (var i = 0; i < message.inputCollectionName.length; ++i) + if (!$util.isString(message.inputCollectionName[i])) + return "inputCollectionName: string[] expected"; + } + return null; + }; + + /** + * Creates a TransformSummary message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.dataflow.v1beta3.TransformSummary + * @static + * @param {Object.} object Plain object + * @returns {google.dataflow.v1beta3.TransformSummary} TransformSummary + */ + TransformSummary.fromObject = function fromObject(object) { + if (object instanceof $root.google.dataflow.v1beta3.TransformSummary) + return object; + var message = new $root.google.dataflow.v1beta3.TransformSummary(); + switch (object.kind) { + default: + if (typeof object.kind === "number") { + message.kind = object.kind; + break; + } + break; + case "UNKNOWN_KIND": + case 0: + message.kind = 0; + break; + case "PAR_DO_KIND": + case 1: + message.kind = 1; + break; + case "GROUP_BY_KEY_KIND": + case 2: + message.kind = 2; + break; + case "FLATTEN_KIND": + case 3: + message.kind = 3; + break; + case "READ_KIND": + case 4: + message.kind = 4; + break; + case "WRITE_KIND": + case 5: + message.kind = 5; + break; + case "CONSTANT_KIND": + case 6: + message.kind = 6; + break; + case "SINGLETON_KIND": + case 7: + message.kind = 7; + break; + case "SHUFFLE_KIND": + case 8: + message.kind = 8; + break; + } + if (object.id != null) + message.id = String(object.id); + if (object.name != null) + message.name = String(object.name); + if (object.displayData) { + if (!Array.isArray(object.displayData)) + throw TypeError(".google.dataflow.v1beta3.TransformSummary.displayData: array expected"); + message.displayData = []; + for (var i = 0; i < object.displayData.length; ++i) { + if (typeof object.displayData[i] !== "object") + throw TypeError(".google.dataflow.v1beta3.TransformSummary.displayData: object expected"); + message.displayData[i] = $root.google.dataflow.v1beta3.DisplayData.fromObject(object.displayData[i]); + } + } + if (object.outputCollectionName) { + if (!Array.isArray(object.outputCollectionName)) + throw TypeError(".google.dataflow.v1beta3.TransformSummary.outputCollectionName: array expected"); + message.outputCollectionName = []; + for (var i = 0; i < object.outputCollectionName.length; ++i) + message.outputCollectionName[i] = String(object.outputCollectionName[i]); + } + if (object.inputCollectionName) { + if (!Array.isArray(object.inputCollectionName)) + throw TypeError(".google.dataflow.v1beta3.TransformSummary.inputCollectionName: array expected"); + message.inputCollectionName = []; + for (var i = 0; i < object.inputCollectionName.length; ++i) + message.inputCollectionName[i] = String(object.inputCollectionName[i]); + } + return message; + }; + + /** + * Creates a plain object from a TransformSummary message. Also converts values to other types if specified. + * @function toObject + * @memberof google.dataflow.v1beta3.TransformSummary + * @static + * @param {google.dataflow.v1beta3.TransformSummary} message TransformSummary + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TransformSummary.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.displayData = []; + object.outputCollectionName = []; + object.inputCollectionName = []; + } + if (options.defaults) { + object.kind = options.enums === String ? "UNKNOWN_KIND" : 0; + object.id = ""; + object.name = ""; + } + if (message.kind != null && message.hasOwnProperty("kind")) + object.kind = options.enums === String ? $root.google.dataflow.v1beta3.KindType[message.kind] === undefined ? message.kind : $root.google.dataflow.v1beta3.KindType[message.kind] : message.kind; + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayData && message.displayData.length) { + object.displayData = []; + for (var j = 0; j < message.displayData.length; ++j) + object.displayData[j] = $root.google.dataflow.v1beta3.DisplayData.toObject(message.displayData[j], options); + } + if (message.outputCollectionName && message.outputCollectionName.length) { + object.outputCollectionName = []; + for (var j = 0; j < message.outputCollectionName.length; ++j) + object.outputCollectionName[j] = message.outputCollectionName[j]; + } + if (message.inputCollectionName && message.inputCollectionName.length) { + object.inputCollectionName = []; + for (var j = 0; j < message.inputCollectionName.length; ++j) + object.inputCollectionName[j] = message.inputCollectionName[j]; + } + return object; + }; + + /** + * Converts this TransformSummary to JSON. + * @function toJSON + * @memberof google.dataflow.v1beta3.TransformSummary + * @instance + * @returns {Object.} JSON object + */ + TransformSummary.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TransformSummary + * @function getTypeUrl + * @memberof google.dataflow.v1beta3.TransformSummary + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransformSummary.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.dataflow.v1beta3.TransformSummary"; + }; + + return TransformSummary; + })(); + + v1beta3.ExecutionStageSummary = (function() { + + /** + * Properties of an ExecutionStageSummary. + * @memberof google.dataflow.v1beta3 + * @interface IExecutionStageSummary + * @property {string|null} [name] ExecutionStageSummary name + * @property {string|null} [id] ExecutionStageSummary id + * @property {google.dataflow.v1beta3.KindType|null} [kind] ExecutionStageSummary kind + * @property {Array.|null} [inputSource] ExecutionStageSummary inputSource + * @property {Array.|null} [outputSource] ExecutionStageSummary outputSource + * @property {Array.|null} [prerequisiteStage] ExecutionStageSummary prerequisiteStage + * @property {Array.|null} [componentTransform] ExecutionStageSummary componentTransform + * @property {Array.|null} [componentSource] ExecutionStageSummary componentSource + */ + + /** + * Constructs a new ExecutionStageSummary. + * @memberof google.dataflow.v1beta3 + * @classdesc Represents an ExecutionStageSummary. + * @implements IExecutionStageSummary + * @constructor + * @param {google.dataflow.v1beta3.IExecutionStageSummary=} [properties] Properties to set + */ + function ExecutionStageSummary(properties) { + this.inputSource = []; + this.outputSource = []; + this.prerequisiteStage = []; + this.componentTransform = []; + this.componentSource = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExecutionStageSummary name. + * @member {string} name + * @memberof google.dataflow.v1beta3.ExecutionStageSummary + * @instance + */ + ExecutionStageSummary.prototype.name = ""; + + /** + * ExecutionStageSummary id. + * @member {string} id + * @memberof google.dataflow.v1beta3.ExecutionStageSummary + * @instance + */ + ExecutionStageSummary.prototype.id = ""; + + /** + * ExecutionStageSummary kind. + * @member {google.dataflow.v1beta3.KindType} kind + * @memberof google.dataflow.v1beta3.ExecutionStageSummary + * @instance + */ + ExecutionStageSummary.prototype.kind = 0; + + /** + * ExecutionStageSummary inputSource. + * @member {Array.} inputSource + * @memberof google.dataflow.v1beta3.ExecutionStageSummary + * @instance + */ + ExecutionStageSummary.prototype.inputSource = $util.emptyArray; + + /** + * ExecutionStageSummary outputSource. + * @member {Array.} outputSource + * @memberof google.dataflow.v1beta3.ExecutionStageSummary + * @instance + */ + ExecutionStageSummary.prototype.outputSource = $util.emptyArray; + + /** + * ExecutionStageSummary prerequisiteStage. + * @member {Array.} prerequisiteStage + * @memberof google.dataflow.v1beta3.ExecutionStageSummary + * @instance + */ + ExecutionStageSummary.prototype.prerequisiteStage = $util.emptyArray; + + /** + * ExecutionStageSummary componentTransform. + * @member {Array.} componentTransform + * @memberof google.dataflow.v1beta3.ExecutionStageSummary + * @instance + */ + ExecutionStageSummary.prototype.componentTransform = $util.emptyArray; + + /** + * ExecutionStageSummary componentSource. + * @member {Array.} componentSource + * @memberof google.dataflow.v1beta3.ExecutionStageSummary + * @instance + */ + ExecutionStageSummary.prototype.componentSource = $util.emptyArray; + + /** + * Creates a new ExecutionStageSummary instance using the specified properties. + * @function create + * @memberof google.dataflow.v1beta3.ExecutionStageSummary + * @static + * @param {google.dataflow.v1beta3.IExecutionStageSummary=} [properties] Properties to set + * @returns {google.dataflow.v1beta3.ExecutionStageSummary} ExecutionStageSummary instance + */ + ExecutionStageSummary.create = function create(properties) { + return new ExecutionStageSummary(properties); + }; + + /** + * Encodes the specified ExecutionStageSummary message. Does not implicitly {@link google.dataflow.v1beta3.ExecutionStageSummary.verify|verify} messages. + * @function encode + * @memberof google.dataflow.v1beta3.ExecutionStageSummary + * @static + * @param {google.dataflow.v1beta3.IExecutionStageSummary} message ExecutionStageSummary message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExecutionStageSummary.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.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.id); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.kind); + if (message.inputSource != null && message.inputSource.length) + for (var i = 0; i < message.inputSource.length; ++i) + $root.google.dataflow.v1beta3.ExecutionStageSummary.StageSource.encode(message.inputSource[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.outputSource != null && message.outputSource.length) + for (var i = 0; i < message.outputSource.length; ++i) + $root.google.dataflow.v1beta3.ExecutionStageSummary.StageSource.encode(message.outputSource[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.componentTransform != null && message.componentTransform.length) + for (var i = 0; i < message.componentTransform.length; ++i) + $root.google.dataflow.v1beta3.ExecutionStageSummary.ComponentTransform.encode(message.componentTransform[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.componentSource != null && message.componentSource.length) + for (var i = 0; i < message.componentSource.length; ++i) + $root.google.dataflow.v1beta3.ExecutionStageSummary.ComponentSource.encode(message.componentSource[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.prerequisiteStage != null && message.prerequisiteStage.length) + for (var i = 0; i < message.prerequisiteStage.length; ++i) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.prerequisiteStage[i]); + return writer; + }; + + /** + * Encodes the specified ExecutionStageSummary message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.ExecutionStageSummary.verify|verify} messages. + * @function encodeDelimited + * @memberof google.dataflow.v1beta3.ExecutionStageSummary + * @static + * @param {google.dataflow.v1beta3.IExecutionStageSummary} message ExecutionStageSummary message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExecutionStageSummary.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExecutionStageSummary message from the specified reader or buffer. + * @function decode + * @memberof google.dataflow.v1beta3.ExecutionStageSummary + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.dataflow.v1beta3.ExecutionStageSummary} ExecutionStageSummary + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExecutionStageSummary.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.dataflow.v1beta3.ExecutionStageSummary(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.id = reader.string(); + break; + } + case 3: { + message.kind = reader.int32(); + break; + } + case 4: { + if (!(message.inputSource && message.inputSource.length)) + message.inputSource = []; + message.inputSource.push($root.google.dataflow.v1beta3.ExecutionStageSummary.StageSource.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.outputSource && message.outputSource.length)) + message.outputSource = []; + message.outputSource.push($root.google.dataflow.v1beta3.ExecutionStageSummary.StageSource.decode(reader, reader.uint32())); + break; + } + case 8: { + if (!(message.prerequisiteStage && message.prerequisiteStage.length)) + message.prerequisiteStage = []; + message.prerequisiteStage.push(reader.string()); + break; + } + case 6: { + if (!(message.componentTransform && message.componentTransform.length)) + message.componentTransform = []; + message.componentTransform.push($root.google.dataflow.v1beta3.ExecutionStageSummary.ComponentTransform.decode(reader, reader.uint32())); + break; + } + case 7: { + if (!(message.componentSource && message.componentSource.length)) + message.componentSource = []; + message.componentSource.push($root.google.dataflow.v1beta3.ExecutionStageSummary.ComponentSource.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExecutionStageSummary message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.dataflow.v1beta3.ExecutionStageSummary + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.dataflow.v1beta3.ExecutionStageSummary} ExecutionStageSummary + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExecutionStageSummary.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExecutionStageSummary message. + * @function verify + * @memberof google.dataflow.v1beta3.ExecutionStageSummary + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExecutionStageSummary.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string expected"; + if (message.kind != null && message.hasOwnProperty("kind")) + switch (message.kind) { + default: + return "kind: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + break; + } + if (message.inputSource != null && message.hasOwnProperty("inputSource")) { + if (!Array.isArray(message.inputSource)) + return "inputSource: array expected"; + for (var i = 0; i < message.inputSource.length; ++i) { + var error = $root.google.dataflow.v1beta3.ExecutionStageSummary.StageSource.verify(message.inputSource[i]); + if (error) + return "inputSource." + error; + } + } + if (message.outputSource != null && message.hasOwnProperty("outputSource")) { + if (!Array.isArray(message.outputSource)) + return "outputSource: array expected"; + for (var i = 0; i < message.outputSource.length; ++i) { + var error = $root.google.dataflow.v1beta3.ExecutionStageSummary.StageSource.verify(message.outputSource[i]); + if (error) + return "outputSource." + error; + } + } + if (message.prerequisiteStage != null && message.hasOwnProperty("prerequisiteStage")) { + if (!Array.isArray(message.prerequisiteStage)) + return "prerequisiteStage: array expected"; + for (var i = 0; i < message.prerequisiteStage.length; ++i) + if (!$util.isString(message.prerequisiteStage[i])) + return "prerequisiteStage: string[] expected"; + } + if (message.componentTransform != null && message.hasOwnProperty("componentTransform")) { + if (!Array.isArray(message.componentTransform)) + return "componentTransform: array expected"; + for (var i = 0; i < message.componentTransform.length; ++i) { + var error = $root.google.dataflow.v1beta3.ExecutionStageSummary.ComponentTransform.verify(message.componentTransform[i]); + if (error) + return "componentTransform." + error; + } + } + if (message.componentSource != null && message.hasOwnProperty("componentSource")) { + if (!Array.isArray(message.componentSource)) + return "componentSource: array expected"; + for (var i = 0; i < message.componentSource.length; ++i) { + var error = $root.google.dataflow.v1beta3.ExecutionStageSummary.ComponentSource.verify(message.componentSource[i]); + if (error) + return "componentSource." + error; + } + } + return null; + }; + + /** + * Creates an ExecutionStageSummary message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.dataflow.v1beta3.ExecutionStageSummary + * @static + * @param {Object.} object Plain object + * @returns {google.dataflow.v1beta3.ExecutionStageSummary} ExecutionStageSummary + */ + ExecutionStageSummary.fromObject = function fromObject(object) { + if (object instanceof $root.google.dataflow.v1beta3.ExecutionStageSummary) + return object; + var message = new $root.google.dataflow.v1beta3.ExecutionStageSummary(); + if (object.name != null) + message.name = String(object.name); + if (object.id != null) + message.id = String(object.id); + switch (object.kind) { + default: + if (typeof object.kind === "number") { + message.kind = object.kind; + break; + } + break; + case "UNKNOWN_KIND": + case 0: + message.kind = 0; + break; + case "PAR_DO_KIND": + case 1: + message.kind = 1; + break; + case "GROUP_BY_KEY_KIND": + case 2: + message.kind = 2; + break; + case "FLATTEN_KIND": + case 3: + message.kind = 3; + break; + case "READ_KIND": + case 4: + message.kind = 4; + break; + case "WRITE_KIND": + case 5: + message.kind = 5; + break; + case "CONSTANT_KIND": + case 6: + message.kind = 6; + break; + case "SINGLETON_KIND": + case 7: + message.kind = 7; + break; + case "SHUFFLE_KIND": + case 8: + message.kind = 8; + break; + } + if (object.inputSource) { + if (!Array.isArray(object.inputSource)) + throw TypeError(".google.dataflow.v1beta3.ExecutionStageSummary.inputSource: array expected"); + message.inputSource = []; + for (var i = 0; i < object.inputSource.length; ++i) { + if (typeof object.inputSource[i] !== "object") + throw TypeError(".google.dataflow.v1beta3.ExecutionStageSummary.inputSource: object expected"); + message.inputSource[i] = $root.google.dataflow.v1beta3.ExecutionStageSummary.StageSource.fromObject(object.inputSource[i]); + } + } + if (object.outputSource) { + if (!Array.isArray(object.outputSource)) + throw TypeError(".google.dataflow.v1beta3.ExecutionStageSummary.outputSource: array expected"); + message.outputSource = []; + for (var i = 0; i < object.outputSource.length; ++i) { + if (typeof object.outputSource[i] !== "object") + throw TypeError(".google.dataflow.v1beta3.ExecutionStageSummary.outputSource: object expected"); + message.outputSource[i] = $root.google.dataflow.v1beta3.ExecutionStageSummary.StageSource.fromObject(object.outputSource[i]); + } + } + if (object.prerequisiteStage) { + if (!Array.isArray(object.prerequisiteStage)) + throw TypeError(".google.dataflow.v1beta3.ExecutionStageSummary.prerequisiteStage: array expected"); + message.prerequisiteStage = []; + for (var i = 0; i < object.prerequisiteStage.length; ++i) + message.prerequisiteStage[i] = String(object.prerequisiteStage[i]); + } + if (object.componentTransform) { + if (!Array.isArray(object.componentTransform)) + throw TypeError(".google.dataflow.v1beta3.ExecutionStageSummary.componentTransform: array expected"); + message.componentTransform = []; + for (var i = 0; i < object.componentTransform.length; ++i) { + if (typeof object.componentTransform[i] !== "object") + throw TypeError(".google.dataflow.v1beta3.ExecutionStageSummary.componentTransform: object expected"); + message.componentTransform[i] = $root.google.dataflow.v1beta3.ExecutionStageSummary.ComponentTransform.fromObject(object.componentTransform[i]); + } + } + if (object.componentSource) { + if (!Array.isArray(object.componentSource)) + throw TypeError(".google.dataflow.v1beta3.ExecutionStageSummary.componentSource: array expected"); + message.componentSource = []; + for (var i = 0; i < object.componentSource.length; ++i) { + if (typeof object.componentSource[i] !== "object") + throw TypeError(".google.dataflow.v1beta3.ExecutionStageSummary.componentSource: object expected"); + message.componentSource[i] = $root.google.dataflow.v1beta3.ExecutionStageSummary.ComponentSource.fromObject(object.componentSource[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an ExecutionStageSummary message. Also converts values to other types if specified. + * @function toObject + * @memberof google.dataflow.v1beta3.ExecutionStageSummary + * @static + * @param {google.dataflow.v1beta3.ExecutionStageSummary} message ExecutionStageSummary + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExecutionStageSummary.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.inputSource = []; + object.outputSource = []; + object.componentTransform = []; + object.componentSource = []; + object.prerequisiteStage = []; + } + if (options.defaults) { + object.name = ""; + object.id = ""; + object.kind = options.enums === String ? "UNKNOWN_KIND" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + if (message.kind != null && message.hasOwnProperty("kind")) + object.kind = options.enums === String ? $root.google.dataflow.v1beta3.KindType[message.kind] === undefined ? message.kind : $root.google.dataflow.v1beta3.KindType[message.kind] : message.kind; + if (message.inputSource && message.inputSource.length) { + object.inputSource = []; + for (var j = 0; j < message.inputSource.length; ++j) + object.inputSource[j] = $root.google.dataflow.v1beta3.ExecutionStageSummary.StageSource.toObject(message.inputSource[j], options); + } + if (message.outputSource && message.outputSource.length) { + object.outputSource = []; + for (var j = 0; j < message.outputSource.length; ++j) + object.outputSource[j] = $root.google.dataflow.v1beta3.ExecutionStageSummary.StageSource.toObject(message.outputSource[j], options); + } + if (message.componentTransform && message.componentTransform.length) { + object.componentTransform = []; + for (var j = 0; j < message.componentTransform.length; ++j) + object.componentTransform[j] = $root.google.dataflow.v1beta3.ExecutionStageSummary.ComponentTransform.toObject(message.componentTransform[j], options); + } + if (message.componentSource && message.componentSource.length) { + object.componentSource = []; + for (var j = 0; j < message.componentSource.length; ++j) + object.componentSource[j] = $root.google.dataflow.v1beta3.ExecutionStageSummary.ComponentSource.toObject(message.componentSource[j], options); + } + if (message.prerequisiteStage && message.prerequisiteStage.length) { + object.prerequisiteStage = []; + for (var j = 0; j < message.prerequisiteStage.length; ++j) + object.prerequisiteStage[j] = message.prerequisiteStage[j]; + } + return object; + }; + + /** + * Converts this ExecutionStageSummary to JSON. + * @function toJSON + * @memberof google.dataflow.v1beta3.ExecutionStageSummary + * @instance + * @returns {Object.} JSON object + */ + ExecutionStageSummary.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExecutionStageSummary + * @function getTypeUrl + * @memberof google.dataflow.v1beta3.ExecutionStageSummary + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExecutionStageSummary.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.dataflow.v1beta3.ExecutionStageSummary"; + }; + + ExecutionStageSummary.StageSource = (function() { + + /** + * Properties of a StageSource. + * @memberof google.dataflow.v1beta3.ExecutionStageSummary + * @interface IStageSource + * @property {string|null} [userName] StageSource userName + * @property {string|null} [name] StageSource name + * @property {string|null} [originalTransformOrCollection] StageSource originalTransformOrCollection + * @property {number|Long|null} [sizeBytes] StageSource sizeBytes + */ + + /** + * Constructs a new StageSource. + * @memberof google.dataflow.v1beta3.ExecutionStageSummary + * @classdesc Represents a StageSource. + * @implements IStageSource + * @constructor + * @param {google.dataflow.v1beta3.ExecutionStageSummary.IStageSource=} [properties] Properties to set + */ + function StageSource(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StageSource userName. + * @member {string} userName + * @memberof google.dataflow.v1beta3.ExecutionStageSummary.StageSource + * @instance + */ + StageSource.prototype.userName = ""; + + /** + * StageSource name. + * @member {string} name + * @memberof google.dataflow.v1beta3.ExecutionStageSummary.StageSource + * @instance + */ + StageSource.prototype.name = ""; + + /** + * StageSource originalTransformOrCollection. + * @member {string} originalTransformOrCollection + * @memberof google.dataflow.v1beta3.ExecutionStageSummary.StageSource + * @instance + */ + StageSource.prototype.originalTransformOrCollection = ""; + + /** + * StageSource sizeBytes. + * @member {number|Long} sizeBytes + * @memberof google.dataflow.v1beta3.ExecutionStageSummary.StageSource + * @instance + */ + StageSource.prototype.sizeBytes = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new StageSource instance using the specified properties. + * @function create + * @memberof google.dataflow.v1beta3.ExecutionStageSummary.StageSource + * @static + * @param {google.dataflow.v1beta3.ExecutionStageSummary.IStageSource=} [properties] Properties to set + * @returns {google.dataflow.v1beta3.ExecutionStageSummary.StageSource} StageSource instance + */ + StageSource.create = function create(properties) { + return new StageSource(properties); + }; + + /** + * Encodes the specified StageSource message. Does not implicitly {@link google.dataflow.v1beta3.ExecutionStageSummary.StageSource.verify|verify} messages. + * @function encode + * @memberof google.dataflow.v1beta3.ExecutionStageSummary.StageSource + * @static + * @param {google.dataflow.v1beta3.ExecutionStageSummary.IStageSource} message StageSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StageSource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.userName != null && Object.hasOwnProperty.call(message, "userName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.userName); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.name); + if (message.originalTransformOrCollection != null && Object.hasOwnProperty.call(message, "originalTransformOrCollection")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.originalTransformOrCollection); + if (message.sizeBytes != null && Object.hasOwnProperty.call(message, "sizeBytes")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.sizeBytes); + return writer; + }; + + /** + * Encodes the specified StageSource message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.ExecutionStageSummary.StageSource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.dataflow.v1beta3.ExecutionStageSummary.StageSource + * @static + * @param {google.dataflow.v1beta3.ExecutionStageSummary.IStageSource} message StageSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StageSource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StageSource message from the specified reader or buffer. + * @function decode + * @memberof google.dataflow.v1beta3.ExecutionStageSummary.StageSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.dataflow.v1beta3.ExecutionStageSummary.StageSource} StageSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StageSource.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.dataflow.v1beta3.ExecutionStageSummary.StageSource(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.userName = reader.string(); + break; + } + case 2: { + message.name = reader.string(); + break; + } + case 3: { + message.originalTransformOrCollection = reader.string(); + break; + } + case 4: { + message.sizeBytes = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StageSource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.dataflow.v1beta3.ExecutionStageSummary.StageSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.dataflow.v1beta3.ExecutionStageSummary.StageSource} StageSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StageSource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StageSource message. + * @function verify + * @memberof google.dataflow.v1beta3.ExecutionStageSummary.StageSource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StageSource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.userName != null && message.hasOwnProperty("userName")) + if (!$util.isString(message.userName)) + return "userName: string expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.originalTransformOrCollection != null && message.hasOwnProperty("originalTransformOrCollection")) + if (!$util.isString(message.originalTransformOrCollection)) + return "originalTransformOrCollection: string expected"; + if (message.sizeBytes != null && message.hasOwnProperty("sizeBytes")) + if (!$util.isInteger(message.sizeBytes) && !(message.sizeBytes && $util.isInteger(message.sizeBytes.low) && $util.isInteger(message.sizeBytes.high))) + return "sizeBytes: integer|Long expected"; + return null; + }; + + /** + * Creates a StageSource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.dataflow.v1beta3.ExecutionStageSummary.StageSource + * @static + * @param {Object.} object Plain object + * @returns {google.dataflow.v1beta3.ExecutionStageSummary.StageSource} StageSource + */ + StageSource.fromObject = function fromObject(object) { + if (object instanceof $root.google.dataflow.v1beta3.ExecutionStageSummary.StageSource) + return object; + var message = new $root.google.dataflow.v1beta3.ExecutionStageSummary.StageSource(); + if (object.userName != null) + message.userName = String(object.userName); + if (object.name != null) + message.name = String(object.name); + if (object.originalTransformOrCollection != null) + message.originalTransformOrCollection = String(object.originalTransformOrCollection); + if (object.sizeBytes != null) + if ($util.Long) + (message.sizeBytes = $util.Long.fromValue(object.sizeBytes)).unsigned = false; + else if (typeof object.sizeBytes === "string") + message.sizeBytes = parseInt(object.sizeBytes, 10); + else if (typeof object.sizeBytes === "number") + message.sizeBytes = object.sizeBytes; + else if (typeof object.sizeBytes === "object") + message.sizeBytes = new $util.LongBits(object.sizeBytes.low >>> 0, object.sizeBytes.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a StageSource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.dataflow.v1beta3.ExecutionStageSummary.StageSource + * @static + * @param {google.dataflow.v1beta3.ExecutionStageSummary.StageSource} message StageSource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StageSource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.userName = ""; + object.name = ""; + object.originalTransformOrCollection = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.sizeBytes = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.sizeBytes = options.longs === String ? "0" : 0; + } + if (message.userName != null && message.hasOwnProperty("userName")) + object.userName = message.userName; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.originalTransformOrCollection != null && message.hasOwnProperty("originalTransformOrCollection")) + object.originalTransformOrCollection = message.originalTransformOrCollection; + if (message.sizeBytes != null && message.hasOwnProperty("sizeBytes")) + if (typeof message.sizeBytes === "number") + object.sizeBytes = options.longs === String ? String(message.sizeBytes) : message.sizeBytes; + else + object.sizeBytes = options.longs === String ? $util.Long.prototype.toString.call(message.sizeBytes) : options.longs === Number ? new $util.LongBits(message.sizeBytes.low >>> 0, message.sizeBytes.high >>> 0).toNumber() : message.sizeBytes; + return object; + }; + + /** + * Converts this StageSource to JSON. + * @function toJSON + * @memberof google.dataflow.v1beta3.ExecutionStageSummary.StageSource + * @instance + * @returns {Object.} JSON object + */ + StageSource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StageSource + * @function getTypeUrl + * @memberof google.dataflow.v1beta3.ExecutionStageSummary.StageSource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StageSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.dataflow.v1beta3.ExecutionStageSummary.StageSource"; + }; + + return StageSource; + })(); + + ExecutionStageSummary.ComponentTransform = (function() { + + /** + * Properties of a ComponentTransform. + * @memberof google.dataflow.v1beta3.ExecutionStageSummary + * @interface IComponentTransform + * @property {string|null} [userName] ComponentTransform userName + * @property {string|null} [name] ComponentTransform name + * @property {string|null} [originalTransform] ComponentTransform originalTransform + */ + + /** + * Constructs a new ComponentTransform. + * @memberof google.dataflow.v1beta3.ExecutionStageSummary + * @classdesc Represents a ComponentTransform. + * @implements IComponentTransform + * @constructor + * @param {google.dataflow.v1beta3.ExecutionStageSummary.IComponentTransform=} [properties] Properties to set + */ + function ComponentTransform(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ComponentTransform userName. + * @member {string} userName + * @memberof google.dataflow.v1beta3.ExecutionStageSummary.ComponentTransform + * @instance + */ + ComponentTransform.prototype.userName = ""; + + /** + * ComponentTransform name. + * @member {string} name + * @memberof google.dataflow.v1beta3.ExecutionStageSummary.ComponentTransform + * @instance + */ + ComponentTransform.prototype.name = ""; + + /** + * ComponentTransform originalTransform. + * @member {string} originalTransform + * @memberof google.dataflow.v1beta3.ExecutionStageSummary.ComponentTransform + * @instance + */ + ComponentTransform.prototype.originalTransform = ""; + + /** + * Creates a new ComponentTransform instance using the specified properties. + * @function create + * @memberof google.dataflow.v1beta3.ExecutionStageSummary.ComponentTransform + * @static + * @param {google.dataflow.v1beta3.ExecutionStageSummary.IComponentTransform=} [properties] Properties to set + * @returns {google.dataflow.v1beta3.ExecutionStageSummary.ComponentTransform} ComponentTransform instance + */ + ComponentTransform.create = function create(properties) { + return new ComponentTransform(properties); + }; + + /** + * Encodes the specified ComponentTransform message. Does not implicitly {@link google.dataflow.v1beta3.ExecutionStageSummary.ComponentTransform.verify|verify} messages. + * @function encode + * @memberof google.dataflow.v1beta3.ExecutionStageSummary.ComponentTransform + * @static + * @param {google.dataflow.v1beta3.ExecutionStageSummary.IComponentTransform} message ComponentTransform message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ComponentTransform.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.userName != null && Object.hasOwnProperty.call(message, "userName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.userName); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.name); + if (message.originalTransform != null && Object.hasOwnProperty.call(message, "originalTransform")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.originalTransform); + return writer; + }; + + /** + * Encodes the specified ComponentTransform message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.ExecutionStageSummary.ComponentTransform.verify|verify} messages. + * @function encodeDelimited + * @memberof google.dataflow.v1beta3.ExecutionStageSummary.ComponentTransform + * @static + * @param {google.dataflow.v1beta3.ExecutionStageSummary.IComponentTransform} message ComponentTransform message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ComponentTransform.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ComponentTransform message from the specified reader or buffer. + * @function decode + * @memberof google.dataflow.v1beta3.ExecutionStageSummary.ComponentTransform + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.dataflow.v1beta3.ExecutionStageSummary.ComponentTransform} ComponentTransform + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ComponentTransform.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.dataflow.v1beta3.ExecutionStageSummary.ComponentTransform(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.userName = reader.string(); + break; + } + case 2: { + message.name = reader.string(); + break; + } + case 3: { + message.originalTransform = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ComponentTransform message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.dataflow.v1beta3.ExecutionStageSummary.ComponentTransform + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.dataflow.v1beta3.ExecutionStageSummary.ComponentTransform} ComponentTransform + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ComponentTransform.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ComponentTransform message. + * @function verify + * @memberof google.dataflow.v1beta3.ExecutionStageSummary.ComponentTransform + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ComponentTransform.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.userName != null && message.hasOwnProperty("userName")) + if (!$util.isString(message.userName)) + return "userName: string expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.originalTransform != null && message.hasOwnProperty("originalTransform")) + if (!$util.isString(message.originalTransform)) + return "originalTransform: string expected"; + return null; + }; + + /** + * Creates a ComponentTransform message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.dataflow.v1beta3.ExecutionStageSummary.ComponentTransform + * @static + * @param {Object.} object Plain object + * @returns {google.dataflow.v1beta3.ExecutionStageSummary.ComponentTransform} ComponentTransform + */ + ComponentTransform.fromObject = function fromObject(object) { + if (object instanceof $root.google.dataflow.v1beta3.ExecutionStageSummary.ComponentTransform) + return object; + var message = new $root.google.dataflow.v1beta3.ExecutionStageSummary.ComponentTransform(); + if (object.userName != null) + message.userName = String(object.userName); + if (object.name != null) + message.name = String(object.name); + if (object.originalTransform != null) + message.originalTransform = String(object.originalTransform); + return message; + }; + + /** + * Creates a plain object from a ComponentTransform message. Also converts values to other types if specified. + * @function toObject + * @memberof google.dataflow.v1beta3.ExecutionStageSummary.ComponentTransform + * @static + * @param {google.dataflow.v1beta3.ExecutionStageSummary.ComponentTransform} message ComponentTransform + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ComponentTransform.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.userName = ""; + object.name = ""; + object.originalTransform = ""; + } + if (message.userName != null && message.hasOwnProperty("userName")) + object.userName = message.userName; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.originalTransform != null && message.hasOwnProperty("originalTransform")) + object.originalTransform = message.originalTransform; + return object; + }; + + /** + * Converts this ComponentTransform to JSON. + * @function toJSON + * @memberof google.dataflow.v1beta3.ExecutionStageSummary.ComponentTransform + * @instance + * @returns {Object.} JSON object + */ + ComponentTransform.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ComponentTransform + * @function getTypeUrl + * @memberof google.dataflow.v1beta3.ExecutionStageSummary.ComponentTransform + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ComponentTransform.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.dataflow.v1beta3.ExecutionStageSummary.ComponentTransform"; + }; + + return ComponentTransform; + })(); + + ExecutionStageSummary.ComponentSource = (function() { + + /** + * Properties of a ComponentSource. + * @memberof google.dataflow.v1beta3.ExecutionStageSummary + * @interface IComponentSource + * @property {string|null} [userName] ComponentSource userName + * @property {string|null} [name] ComponentSource name + * @property {string|null} [originalTransformOrCollection] ComponentSource originalTransformOrCollection + */ + + /** + * Constructs a new ComponentSource. + * @memberof google.dataflow.v1beta3.ExecutionStageSummary + * @classdesc Represents a ComponentSource. + * @implements IComponentSource + * @constructor + * @param {google.dataflow.v1beta3.ExecutionStageSummary.IComponentSource=} [properties] Properties to set + */ + function ComponentSource(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ComponentSource userName. + * @member {string} userName + * @memberof google.dataflow.v1beta3.ExecutionStageSummary.ComponentSource + * @instance + */ + ComponentSource.prototype.userName = ""; + + /** + * ComponentSource name. + * @member {string} name + * @memberof google.dataflow.v1beta3.ExecutionStageSummary.ComponentSource + * @instance + */ + ComponentSource.prototype.name = ""; + + /** + * ComponentSource originalTransformOrCollection. + * @member {string} originalTransformOrCollection + * @memberof google.dataflow.v1beta3.ExecutionStageSummary.ComponentSource + * @instance + */ + ComponentSource.prototype.originalTransformOrCollection = ""; + + /** + * Creates a new ComponentSource instance using the specified properties. + * @function create + * @memberof google.dataflow.v1beta3.ExecutionStageSummary.ComponentSource + * @static + * @param {google.dataflow.v1beta3.ExecutionStageSummary.IComponentSource=} [properties] Properties to set + * @returns {google.dataflow.v1beta3.ExecutionStageSummary.ComponentSource} ComponentSource instance + */ + ComponentSource.create = function create(properties) { + return new ComponentSource(properties); + }; + + /** + * Encodes the specified ComponentSource message. Does not implicitly {@link google.dataflow.v1beta3.ExecutionStageSummary.ComponentSource.verify|verify} messages. + * @function encode + * @memberof google.dataflow.v1beta3.ExecutionStageSummary.ComponentSource + * @static + * @param {google.dataflow.v1beta3.ExecutionStageSummary.IComponentSource} message ComponentSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ComponentSource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.userName != null && Object.hasOwnProperty.call(message, "userName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.userName); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.name); + if (message.originalTransformOrCollection != null && Object.hasOwnProperty.call(message, "originalTransformOrCollection")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.originalTransformOrCollection); + return writer; + }; + + /** + * Encodes the specified ComponentSource message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.ExecutionStageSummary.ComponentSource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.dataflow.v1beta3.ExecutionStageSummary.ComponentSource + * @static + * @param {google.dataflow.v1beta3.ExecutionStageSummary.IComponentSource} message ComponentSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ComponentSource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ComponentSource message from the specified reader or buffer. + * @function decode + * @memberof google.dataflow.v1beta3.ExecutionStageSummary.ComponentSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.dataflow.v1beta3.ExecutionStageSummary.ComponentSource} ComponentSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ComponentSource.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.dataflow.v1beta3.ExecutionStageSummary.ComponentSource(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.userName = reader.string(); + break; + } + case 2: { + message.name = reader.string(); + break; + } + case 3: { + message.originalTransformOrCollection = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ComponentSource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.dataflow.v1beta3.ExecutionStageSummary.ComponentSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.dataflow.v1beta3.ExecutionStageSummary.ComponentSource} ComponentSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ComponentSource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ComponentSource message. + * @function verify + * @memberof google.dataflow.v1beta3.ExecutionStageSummary.ComponentSource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ComponentSource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.userName != null && message.hasOwnProperty("userName")) + if (!$util.isString(message.userName)) + return "userName: string expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.originalTransformOrCollection != null && message.hasOwnProperty("originalTransformOrCollection")) + if (!$util.isString(message.originalTransformOrCollection)) + return "originalTransformOrCollection: string expected"; + return null; + }; + + /** + * Creates a ComponentSource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.dataflow.v1beta3.ExecutionStageSummary.ComponentSource + * @static + * @param {Object.} object Plain object + * @returns {google.dataflow.v1beta3.ExecutionStageSummary.ComponentSource} ComponentSource + */ + ComponentSource.fromObject = function fromObject(object) { + if (object instanceof $root.google.dataflow.v1beta3.ExecutionStageSummary.ComponentSource) + return object; + var message = new $root.google.dataflow.v1beta3.ExecutionStageSummary.ComponentSource(); + if (object.userName != null) + message.userName = String(object.userName); + if (object.name != null) + message.name = String(object.name); + if (object.originalTransformOrCollection != null) + message.originalTransformOrCollection = String(object.originalTransformOrCollection); + return message; + }; + + /** + * Creates a plain object from a ComponentSource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.dataflow.v1beta3.ExecutionStageSummary.ComponentSource + * @static + * @param {google.dataflow.v1beta3.ExecutionStageSummary.ComponentSource} message ComponentSource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ComponentSource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.userName = ""; + object.name = ""; + object.originalTransformOrCollection = ""; + } + if (message.userName != null && message.hasOwnProperty("userName")) + object.userName = message.userName; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.originalTransformOrCollection != null && message.hasOwnProperty("originalTransformOrCollection")) + object.originalTransformOrCollection = message.originalTransformOrCollection; + return object; + }; + + /** + * Converts this ComponentSource to JSON. + * @function toJSON + * @memberof google.dataflow.v1beta3.ExecutionStageSummary.ComponentSource + * @instance + * @returns {Object.} JSON object + */ + ComponentSource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ComponentSource + * @function getTypeUrl + * @memberof google.dataflow.v1beta3.ExecutionStageSummary.ComponentSource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ComponentSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.dataflow.v1beta3.ExecutionStageSummary.ComponentSource"; + }; + + return ComponentSource; + })(); + + return ExecutionStageSummary; + })(); + + v1beta3.DisplayData = (function() { + + /** + * Properties of a DisplayData. + * @memberof google.dataflow.v1beta3 + * @interface IDisplayData + * @property {string|null} [key] DisplayData key + * @property {string|null} [namespace] DisplayData namespace + * @property {string|null} [strValue] DisplayData strValue + * @property {number|Long|null} [int64Value] DisplayData int64Value + * @property {number|null} [floatValue] DisplayData floatValue + * @property {string|null} [javaClassValue] DisplayData javaClassValue + * @property {google.protobuf.ITimestamp|null} [timestampValue] DisplayData timestampValue + * @property {google.protobuf.IDuration|null} [durationValue] DisplayData durationValue + * @property {boolean|null} [boolValue] DisplayData boolValue + * @property {string|null} [shortStrValue] DisplayData shortStrValue + * @property {string|null} [url] DisplayData url + * @property {string|null} [label] DisplayData label + */ + + /** + * Constructs a new DisplayData. + * @memberof google.dataflow.v1beta3 + * @classdesc Represents a DisplayData. + * @implements IDisplayData + * @constructor + * @param {google.dataflow.v1beta3.IDisplayData=} [properties] Properties to set + */ + function DisplayData(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DisplayData key. + * @member {string} key + * @memberof google.dataflow.v1beta3.DisplayData + * @instance + */ + DisplayData.prototype.key = ""; + + /** + * DisplayData namespace. + * @member {string} namespace + * @memberof google.dataflow.v1beta3.DisplayData + * @instance + */ + DisplayData.prototype.namespace = ""; + + /** + * DisplayData strValue. + * @member {string|null|undefined} strValue + * @memberof google.dataflow.v1beta3.DisplayData + * @instance + */ + DisplayData.prototype.strValue = null; + + /** + * DisplayData int64Value. + * @member {number|Long|null|undefined} int64Value + * @memberof google.dataflow.v1beta3.DisplayData + * @instance + */ + DisplayData.prototype.int64Value = null; + + /** + * DisplayData floatValue. + * @member {number|null|undefined} floatValue + * @memberof google.dataflow.v1beta3.DisplayData + * @instance + */ + DisplayData.prototype.floatValue = null; + + /** + * DisplayData javaClassValue. + * @member {string|null|undefined} javaClassValue + * @memberof google.dataflow.v1beta3.DisplayData + * @instance + */ + DisplayData.prototype.javaClassValue = null; + + /** + * DisplayData timestampValue. + * @member {google.protobuf.ITimestamp|null|undefined} timestampValue + * @memberof google.dataflow.v1beta3.DisplayData + * @instance + */ + DisplayData.prototype.timestampValue = null; + + /** + * DisplayData durationValue. + * @member {google.protobuf.IDuration|null|undefined} durationValue + * @memberof google.dataflow.v1beta3.DisplayData + * @instance + */ + DisplayData.prototype.durationValue = null; + + /** + * DisplayData boolValue. + * @member {boolean|null|undefined} boolValue + * @memberof google.dataflow.v1beta3.DisplayData + * @instance + */ + DisplayData.prototype.boolValue = null; + + /** + * DisplayData shortStrValue. + * @member {string} shortStrValue + * @memberof google.dataflow.v1beta3.DisplayData + * @instance + */ + DisplayData.prototype.shortStrValue = ""; + + /** + * DisplayData url. + * @member {string} url + * @memberof google.dataflow.v1beta3.DisplayData + * @instance + */ + DisplayData.prototype.url = ""; + + /** + * DisplayData label. + * @member {string} label + * @memberof google.dataflow.v1beta3.DisplayData + * @instance + */ + DisplayData.prototype.label = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DisplayData Value. + * @member {"strValue"|"int64Value"|"floatValue"|"javaClassValue"|"timestampValue"|"durationValue"|"boolValue"|undefined} Value + * @memberof google.dataflow.v1beta3.DisplayData + * @instance + */ + Object.defineProperty(DisplayData.prototype, "Value", { + get: $util.oneOfGetter($oneOfFields = ["strValue", "int64Value", "floatValue", "javaClassValue", "timestampValue", "durationValue", "boolValue"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DisplayData instance using the specified properties. + * @function create + * @memberof google.dataflow.v1beta3.DisplayData + * @static + * @param {google.dataflow.v1beta3.IDisplayData=} [properties] Properties to set + * @returns {google.dataflow.v1beta3.DisplayData} DisplayData instance + */ + DisplayData.create = function create(properties) { + return new DisplayData(properties); + }; + + /** + * Encodes the specified DisplayData message. Does not implicitly {@link google.dataflow.v1beta3.DisplayData.verify|verify} messages. + * @function encode + * @memberof google.dataflow.v1beta3.DisplayData + * @static + * @param {google.dataflow.v1beta3.IDisplayData} message DisplayData message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DisplayData.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.key != null && Object.hasOwnProperty.call(message, "key")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.key); + if (message.namespace != null && Object.hasOwnProperty.call(message, "namespace")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.namespace); + if (message.strValue != null && Object.hasOwnProperty.call(message, "strValue")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.strValue); + if (message.int64Value != null && Object.hasOwnProperty.call(message, "int64Value")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.int64Value); + if (message.floatValue != null && Object.hasOwnProperty.call(message, "floatValue")) + writer.uint32(/* id 6, wireType 5 =*/53).float(message.floatValue); + if (message.javaClassValue != null && Object.hasOwnProperty.call(message, "javaClassValue")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.javaClassValue); + if (message.timestampValue != null && Object.hasOwnProperty.call(message, "timestampValue")) + $root.google.protobuf.Timestamp.encode(message.timestampValue, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.durationValue != null && Object.hasOwnProperty.call(message, "durationValue")) + $root.google.protobuf.Duration.encode(message.durationValue, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.boolValue != null && Object.hasOwnProperty.call(message, "boolValue")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.boolValue); + if (message.shortStrValue != null && Object.hasOwnProperty.call(message, "shortStrValue")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.shortStrValue); + if (message.url != null && Object.hasOwnProperty.call(message, "url")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.url); + if (message.label != null && Object.hasOwnProperty.call(message, "label")) + writer.uint32(/* id 13, wireType 2 =*/106).string(message.label); + return writer; + }; + + /** + * Encodes the specified DisplayData message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.DisplayData.verify|verify} messages. + * @function encodeDelimited + * @memberof google.dataflow.v1beta3.DisplayData + * @static + * @param {google.dataflow.v1beta3.IDisplayData} message DisplayData message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DisplayData.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DisplayData message from the specified reader or buffer. + * @function decode + * @memberof google.dataflow.v1beta3.DisplayData + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.dataflow.v1beta3.DisplayData} DisplayData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DisplayData.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.dataflow.v1beta3.DisplayData(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.key = reader.string(); + break; + } + case 2: { + message.namespace = reader.string(); + break; + } + case 4: { + message.strValue = reader.string(); + break; + } + case 5: { + message.int64Value = reader.int64(); + break; + } + case 6: { + message.floatValue = reader.float(); + break; + } + case 7: { + message.javaClassValue = reader.string(); + break; + } + case 8: { + message.timestampValue = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 9: { + message.durationValue = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 10: { + message.boolValue = reader.bool(); + break; + } + case 11: { + message.shortStrValue = reader.string(); + break; + } + case 12: { + message.url = reader.string(); + break; + } + case 13: { + message.label = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DisplayData message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.dataflow.v1beta3.DisplayData + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.dataflow.v1beta3.DisplayData} DisplayData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DisplayData.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DisplayData message. + * @function verify + * @memberof google.dataflow.v1beta3.DisplayData + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DisplayData.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.key != null && message.hasOwnProperty("key")) + if (!$util.isString(message.key)) + return "key: string expected"; + if (message.namespace != null && message.hasOwnProperty("namespace")) + if (!$util.isString(message.namespace)) + return "namespace: string expected"; + if (message.strValue != null && message.hasOwnProperty("strValue")) { + properties.Value = 1; + if (!$util.isString(message.strValue)) + return "strValue: string expected"; + } + if (message.int64Value != null && message.hasOwnProperty("int64Value")) { + if (properties.Value === 1) + return "Value: multiple values"; + properties.Value = 1; + if (!$util.isInteger(message.int64Value) && !(message.int64Value && $util.isInteger(message.int64Value.low) && $util.isInteger(message.int64Value.high))) + return "int64Value: integer|Long expected"; + } + if (message.floatValue != null && message.hasOwnProperty("floatValue")) { + if (properties.Value === 1) + return "Value: multiple values"; + properties.Value = 1; + if (typeof message.floatValue !== "number") + return "floatValue: number expected"; + } + if (message.javaClassValue != null && message.hasOwnProperty("javaClassValue")) { + if (properties.Value === 1) + return "Value: multiple values"; + properties.Value = 1; + if (!$util.isString(message.javaClassValue)) + return "javaClassValue: string expected"; + } + if (message.timestampValue != null && message.hasOwnProperty("timestampValue")) { + if (properties.Value === 1) + return "Value: multiple values"; + properties.Value = 1; + { + var error = $root.google.protobuf.Timestamp.verify(message.timestampValue); + if (error) + return "timestampValue." + error; + } + } + if (message.durationValue != null && message.hasOwnProperty("durationValue")) { + if (properties.Value === 1) + return "Value: multiple values"; + properties.Value = 1; + { + var error = $root.google.protobuf.Duration.verify(message.durationValue); + if (error) + return "durationValue." + error; + } + } + if (message.boolValue != null && message.hasOwnProperty("boolValue")) { + if (properties.Value === 1) + return "Value: multiple values"; + properties.Value = 1; + if (typeof message.boolValue !== "boolean") + return "boolValue: boolean expected"; + } + if (message.shortStrValue != null && message.hasOwnProperty("shortStrValue")) + if (!$util.isString(message.shortStrValue)) + return "shortStrValue: string expected"; + if (message.url != null && message.hasOwnProperty("url")) + if (!$util.isString(message.url)) + return "url: string expected"; + if (message.label != null && message.hasOwnProperty("label")) + if (!$util.isString(message.label)) + return "label: string expected"; + return null; + }; + + /** + * Creates a DisplayData message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.dataflow.v1beta3.DisplayData + * @static + * @param {Object.} object Plain object + * @returns {google.dataflow.v1beta3.DisplayData} DisplayData + */ + DisplayData.fromObject = function fromObject(object) { + if (object instanceof $root.google.dataflow.v1beta3.DisplayData) + return object; + var message = new $root.google.dataflow.v1beta3.DisplayData(); + if (object.key != null) + message.key = String(object.key); + if (object.namespace != null) + message.namespace = String(object.namespace); + if (object.strValue != null) + message.strValue = String(object.strValue); + if (object.int64Value != null) + if ($util.Long) + (message.int64Value = $util.Long.fromValue(object.int64Value)).unsigned = false; + else if (typeof object.int64Value === "string") + message.int64Value = parseInt(object.int64Value, 10); + else if (typeof object.int64Value === "number") + message.int64Value = object.int64Value; + else if (typeof object.int64Value === "object") + message.int64Value = new $util.LongBits(object.int64Value.low >>> 0, object.int64Value.high >>> 0).toNumber(); + if (object.floatValue != null) + message.floatValue = Number(object.floatValue); + if (object.javaClassValue != null) + message.javaClassValue = String(object.javaClassValue); + if (object.timestampValue != null) { + if (typeof object.timestampValue !== "object") + throw TypeError(".google.dataflow.v1beta3.DisplayData.timestampValue: object expected"); + message.timestampValue = $root.google.protobuf.Timestamp.fromObject(object.timestampValue); + } + if (object.durationValue != null) { + if (typeof object.durationValue !== "object") + throw TypeError(".google.dataflow.v1beta3.DisplayData.durationValue: object expected"); + message.durationValue = $root.google.protobuf.Duration.fromObject(object.durationValue); + } + if (object.boolValue != null) + message.boolValue = Boolean(object.boolValue); + if (object.shortStrValue != null) + message.shortStrValue = String(object.shortStrValue); + if (object.url != null) + message.url = String(object.url); + if (object.label != null) + message.label = String(object.label); + return message; + }; + + /** + * Creates a plain object from a DisplayData message. Also converts values to other types if specified. + * @function toObject + * @memberof google.dataflow.v1beta3.DisplayData + * @static + * @param {google.dataflow.v1beta3.DisplayData} message DisplayData + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DisplayData.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.key = ""; + object.namespace = ""; + object.shortStrValue = ""; + object.url = ""; + object.label = ""; + } + if (message.key != null && message.hasOwnProperty("key")) + object.key = message.key; + if (message.namespace != null && message.hasOwnProperty("namespace")) + object.namespace = message.namespace; + if (message.strValue != null && message.hasOwnProperty("strValue")) { + object.strValue = message.strValue; + if (options.oneofs) + object.Value = "strValue"; + } + if (message.int64Value != null && message.hasOwnProperty("int64Value")) { + if (typeof message.int64Value === "number") + object.int64Value = options.longs === String ? String(message.int64Value) : message.int64Value; + else + object.int64Value = options.longs === String ? $util.Long.prototype.toString.call(message.int64Value) : options.longs === Number ? new $util.LongBits(message.int64Value.low >>> 0, message.int64Value.high >>> 0).toNumber() : message.int64Value; + if (options.oneofs) + object.Value = "int64Value"; + } + if (message.floatValue != null && message.hasOwnProperty("floatValue")) { + object.floatValue = options.json && !isFinite(message.floatValue) ? String(message.floatValue) : message.floatValue; + if (options.oneofs) + object.Value = "floatValue"; + } + if (message.javaClassValue != null && message.hasOwnProperty("javaClassValue")) { + object.javaClassValue = message.javaClassValue; + if (options.oneofs) + object.Value = "javaClassValue"; + } + if (message.timestampValue != null && message.hasOwnProperty("timestampValue")) { + object.timestampValue = $root.google.protobuf.Timestamp.toObject(message.timestampValue, options); + if (options.oneofs) + object.Value = "timestampValue"; + } + if (message.durationValue != null && message.hasOwnProperty("durationValue")) { + object.durationValue = $root.google.protobuf.Duration.toObject(message.durationValue, options); + if (options.oneofs) + object.Value = "durationValue"; + } + if (message.boolValue != null && message.hasOwnProperty("boolValue")) { + object.boolValue = message.boolValue; + if (options.oneofs) + object.Value = "boolValue"; + } + if (message.shortStrValue != null && message.hasOwnProperty("shortStrValue")) + object.shortStrValue = message.shortStrValue; + if (message.url != null && message.hasOwnProperty("url")) + object.url = message.url; + if (message.label != null && message.hasOwnProperty("label")) + object.label = message.label; + return object; + }; + + /** + * Converts this DisplayData to JSON. + * @function toJSON + * @memberof google.dataflow.v1beta3.DisplayData + * @instance + * @returns {Object.} JSON object + */ + DisplayData.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DisplayData + * @function getTypeUrl + * @memberof google.dataflow.v1beta3.DisplayData + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DisplayData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.dataflow.v1beta3.DisplayData"; + }; + + return DisplayData; + })(); + + v1beta3.Step = (function() { + + /** + * Properties of a Step. + * @memberof google.dataflow.v1beta3 + * @interface IStep + * @property {string|null} [kind] Step kind + * @property {string|null} [name] Step name + * @property {google.protobuf.IStruct|null} [properties] Step properties + */ + + /** + * Constructs a new Step. + * @memberof google.dataflow.v1beta3 + * @classdesc Represents a Step. + * @implements IStep + * @constructor + * @param {google.dataflow.v1beta3.IStep=} [properties] Properties to set + */ + function Step(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Step kind. + * @member {string} kind + * @memberof google.dataflow.v1beta3.Step + * @instance + */ + Step.prototype.kind = ""; + + /** + * Step name. + * @member {string} name + * @memberof google.dataflow.v1beta3.Step + * @instance + */ + Step.prototype.name = ""; + + /** + * Step properties. + * @member {google.protobuf.IStruct|null|undefined} properties + * @memberof google.dataflow.v1beta3.Step + * @instance + */ + Step.prototype.properties = null; + + /** + * Creates a new Step instance using the specified properties. + * @function create + * @memberof google.dataflow.v1beta3.Step + * @static + * @param {google.dataflow.v1beta3.IStep=} [properties] Properties to set + * @returns {google.dataflow.v1beta3.Step} Step instance + */ + Step.create = function create(properties) { + return new Step(properties); + }; + + /** + * Encodes the specified Step message. Does not implicitly {@link google.dataflow.v1beta3.Step.verify|verify} messages. + * @function encode + * @memberof google.dataflow.v1beta3.Step + * @static + * @param {google.dataflow.v1beta3.IStep} message Step message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Step.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.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.name); + if (message.properties != null && Object.hasOwnProperty.call(message, "properties")) + $root.google.protobuf.Struct.encode(message.properties, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Step message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.Step.verify|verify} messages. + * @function encodeDelimited + * @memberof google.dataflow.v1beta3.Step + * @static + * @param {google.dataflow.v1beta3.IStep} message Step message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Step.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Step message from the specified reader or buffer. + * @function decode + * @memberof google.dataflow.v1beta3.Step + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.dataflow.v1beta3.Step} Step + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Step.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.dataflow.v1beta3.Step(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.kind = reader.string(); + break; + } + case 2: { + message.name = reader.string(); + break; + } + case 3: { + message.properties = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Step message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.dataflow.v1beta3.Step + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.dataflow.v1beta3.Step} Step + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Step.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Step message. + * @function verify + * @memberof google.dataflow.v1beta3.Step + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Step.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.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.properties != null && message.hasOwnProperty("properties")) { + var error = $root.google.protobuf.Struct.verify(message.properties); + if (error) + return "properties." + error; + } + return null; + }; + + /** + * Creates a Step message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.dataflow.v1beta3.Step + * @static + * @param {Object.} object Plain object + * @returns {google.dataflow.v1beta3.Step} Step + */ + Step.fromObject = function fromObject(object) { + if (object instanceof $root.google.dataflow.v1beta3.Step) + return object; + var message = new $root.google.dataflow.v1beta3.Step(); + if (object.kind != null) + message.kind = String(object.kind); + if (object.name != null) + message.name = String(object.name); + if (object.properties != null) { + if (typeof object.properties !== "object") + throw TypeError(".google.dataflow.v1beta3.Step.properties: object expected"); + message.properties = $root.google.protobuf.Struct.fromObject(object.properties); + } + return message; + }; + + /** + * Creates a plain object from a Step message. Also converts values to other types if specified. + * @function toObject + * @memberof google.dataflow.v1beta3.Step + * @static + * @param {google.dataflow.v1beta3.Step} message Step + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Step.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.kind = ""; + object.name = ""; + object.properties = null; + } + if (message.kind != null && message.hasOwnProperty("kind")) + object.kind = message.kind; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.properties != null && message.hasOwnProperty("properties")) + object.properties = $root.google.protobuf.Struct.toObject(message.properties, options); + return object; + }; + + /** + * Converts this Step to JSON. + * @function toJSON + * @memberof google.dataflow.v1beta3.Step + * @instance + * @returns {Object.} JSON object + */ + Step.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Step + * @function getTypeUrl + * @memberof google.dataflow.v1beta3.Step + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Step.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.dataflow.v1beta3.Step"; + }; + + return Step; + })(); + + /** + * JobState enum. + * @name google.dataflow.v1beta3.JobState + * @enum {number} + * @property {number} JOB_STATE_UNKNOWN=0 JOB_STATE_UNKNOWN value + * @property {number} JOB_STATE_STOPPED=1 JOB_STATE_STOPPED value + * @property {number} JOB_STATE_RUNNING=2 JOB_STATE_RUNNING value + * @property {number} JOB_STATE_DONE=3 JOB_STATE_DONE value + * @property {number} JOB_STATE_FAILED=4 JOB_STATE_FAILED value + * @property {number} JOB_STATE_CANCELLED=5 JOB_STATE_CANCELLED value + * @property {number} JOB_STATE_UPDATED=6 JOB_STATE_UPDATED value + * @property {number} JOB_STATE_DRAINING=7 JOB_STATE_DRAINING value + * @property {number} JOB_STATE_DRAINED=8 JOB_STATE_DRAINED value + * @property {number} JOB_STATE_PENDING=9 JOB_STATE_PENDING value + * @property {number} JOB_STATE_CANCELLING=10 JOB_STATE_CANCELLING value + * @property {number} JOB_STATE_QUEUED=11 JOB_STATE_QUEUED value + * @property {number} JOB_STATE_RESOURCE_CLEANING_UP=12 JOB_STATE_RESOURCE_CLEANING_UP value + */ + v1beta3.JobState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "JOB_STATE_UNKNOWN"] = 0; + values[valuesById[1] = "JOB_STATE_STOPPED"] = 1; + values[valuesById[2] = "JOB_STATE_RUNNING"] = 2; + values[valuesById[3] = "JOB_STATE_DONE"] = 3; + values[valuesById[4] = "JOB_STATE_FAILED"] = 4; + values[valuesById[5] = "JOB_STATE_CANCELLED"] = 5; + values[valuesById[6] = "JOB_STATE_UPDATED"] = 6; + values[valuesById[7] = "JOB_STATE_DRAINING"] = 7; + values[valuesById[8] = "JOB_STATE_DRAINED"] = 8; + values[valuesById[9] = "JOB_STATE_PENDING"] = 9; + values[valuesById[10] = "JOB_STATE_CANCELLING"] = 10; + values[valuesById[11] = "JOB_STATE_QUEUED"] = 11; + values[valuesById[12] = "JOB_STATE_RESOURCE_CLEANING_UP"] = 12; + return values; + })(); + + v1beta3.JobExecutionInfo = (function() { + + /** + * Properties of a JobExecutionInfo. + * @memberof google.dataflow.v1beta3 + * @interface IJobExecutionInfo + * @property {Object.|null} [stages] JobExecutionInfo stages + */ + + /** + * Constructs a new JobExecutionInfo. + * @memberof google.dataflow.v1beta3 + * @classdesc Represents a JobExecutionInfo. + * @implements IJobExecutionInfo + * @constructor + * @param {google.dataflow.v1beta3.IJobExecutionInfo=} [properties] Properties to set + */ + function JobExecutionInfo(properties) { + this.stages = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * JobExecutionInfo stages. + * @member {Object.} stages + * @memberof google.dataflow.v1beta3.JobExecutionInfo + * @instance + */ + JobExecutionInfo.prototype.stages = $util.emptyObject; + + /** + * Creates a new JobExecutionInfo instance using the specified properties. + * @function create + * @memberof google.dataflow.v1beta3.JobExecutionInfo + * @static + * @param {google.dataflow.v1beta3.IJobExecutionInfo=} [properties] Properties to set + * @returns {google.dataflow.v1beta3.JobExecutionInfo} JobExecutionInfo instance + */ + JobExecutionInfo.create = function create(properties) { + return new JobExecutionInfo(properties); + }; + + /** + * Encodes the specified JobExecutionInfo message. Does not implicitly {@link google.dataflow.v1beta3.JobExecutionInfo.verify|verify} messages. + * @function encode + * @memberof google.dataflow.v1beta3.JobExecutionInfo + * @static + * @param {google.dataflow.v1beta3.IJobExecutionInfo} message JobExecutionInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JobExecutionInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.stages != null && Object.hasOwnProperty.call(message, "stages")) + for (var keys = Object.keys(message.stages), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.dataflow.v1beta3.JobExecutionStageInfo.encode(message.stages[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + return writer; + }; + + /** + * Encodes the specified JobExecutionInfo message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.JobExecutionInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.dataflow.v1beta3.JobExecutionInfo + * @static + * @param {google.dataflow.v1beta3.IJobExecutionInfo} message JobExecutionInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JobExecutionInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a JobExecutionInfo message from the specified reader or buffer. + * @function decode + * @memberof google.dataflow.v1beta3.JobExecutionInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.dataflow.v1beta3.JobExecutionInfo} JobExecutionInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JobExecutionInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.dataflow.v1beta3.JobExecutionInfo(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (message.stages === $util.emptyObject) + message.stages = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.dataflow.v1beta3.JobExecutionStageInfo.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.stages[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a JobExecutionInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.dataflow.v1beta3.JobExecutionInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.dataflow.v1beta3.JobExecutionInfo} JobExecutionInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JobExecutionInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a JobExecutionInfo message. + * @function verify + * @memberof google.dataflow.v1beta3.JobExecutionInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + JobExecutionInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.stages != null && message.hasOwnProperty("stages")) { + if (!$util.isObject(message.stages)) + return "stages: object expected"; + var key = Object.keys(message.stages); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.dataflow.v1beta3.JobExecutionStageInfo.verify(message.stages[key[i]]); + if (error) + return "stages." + error; + } + } + return null; + }; + + /** + * Creates a JobExecutionInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.dataflow.v1beta3.JobExecutionInfo + * @static + * @param {Object.} object Plain object + * @returns {google.dataflow.v1beta3.JobExecutionInfo} JobExecutionInfo + */ + JobExecutionInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.dataflow.v1beta3.JobExecutionInfo) + return object; + var message = new $root.google.dataflow.v1beta3.JobExecutionInfo(); + if (object.stages) { + if (typeof object.stages !== "object") + throw TypeError(".google.dataflow.v1beta3.JobExecutionInfo.stages: object expected"); + message.stages = {}; + for (var keys = Object.keys(object.stages), i = 0; i < keys.length; ++i) { + if (typeof object.stages[keys[i]] !== "object") + throw TypeError(".google.dataflow.v1beta3.JobExecutionInfo.stages: object expected"); + message.stages[keys[i]] = $root.google.dataflow.v1beta3.JobExecutionStageInfo.fromObject(object.stages[keys[i]]); + } + } + return message; + }; + + /** + * Creates a plain object from a JobExecutionInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.dataflow.v1beta3.JobExecutionInfo + * @static + * @param {google.dataflow.v1beta3.JobExecutionInfo} message JobExecutionInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + JobExecutionInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.stages = {}; + var keys2; + if (message.stages && (keys2 = Object.keys(message.stages)).length) { + object.stages = {}; + for (var j = 0; j < keys2.length; ++j) + object.stages[keys2[j]] = $root.google.dataflow.v1beta3.JobExecutionStageInfo.toObject(message.stages[keys2[j]], options); + } + return object; + }; + + /** + * Converts this JobExecutionInfo to JSON. + * @function toJSON + * @memberof google.dataflow.v1beta3.JobExecutionInfo + * @instance + * @returns {Object.} JSON object + */ + JobExecutionInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for JobExecutionInfo + * @function getTypeUrl + * @memberof google.dataflow.v1beta3.JobExecutionInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + JobExecutionInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.dataflow.v1beta3.JobExecutionInfo"; + }; + + return JobExecutionInfo; + })(); + + v1beta3.JobExecutionStageInfo = (function() { + + /** + * Properties of a JobExecutionStageInfo. + * @memberof google.dataflow.v1beta3 + * @interface IJobExecutionStageInfo + * @property {Array.|null} [stepName] JobExecutionStageInfo stepName + */ + + /** + * Constructs a new JobExecutionStageInfo. + * @memberof google.dataflow.v1beta3 + * @classdesc Represents a JobExecutionStageInfo. + * @implements IJobExecutionStageInfo + * @constructor + * @param {google.dataflow.v1beta3.IJobExecutionStageInfo=} [properties] Properties to set + */ + function JobExecutionStageInfo(properties) { + this.stepName = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * JobExecutionStageInfo stepName. + * @member {Array.} stepName + * @memberof google.dataflow.v1beta3.JobExecutionStageInfo + * @instance + */ + JobExecutionStageInfo.prototype.stepName = $util.emptyArray; + + /** + * Creates a new JobExecutionStageInfo instance using the specified properties. + * @function create + * @memberof google.dataflow.v1beta3.JobExecutionStageInfo + * @static + * @param {google.dataflow.v1beta3.IJobExecutionStageInfo=} [properties] Properties to set + * @returns {google.dataflow.v1beta3.JobExecutionStageInfo} JobExecutionStageInfo instance + */ + JobExecutionStageInfo.create = function create(properties) { + return new JobExecutionStageInfo(properties); + }; + + /** + * Encodes the specified JobExecutionStageInfo message. Does not implicitly {@link google.dataflow.v1beta3.JobExecutionStageInfo.verify|verify} messages. + * @function encode + * @memberof google.dataflow.v1beta3.JobExecutionStageInfo + * @static + * @param {google.dataflow.v1beta3.IJobExecutionStageInfo} message JobExecutionStageInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JobExecutionStageInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.stepName != null && message.stepName.length) + for (var i = 0; i < message.stepName.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.stepName[i]); + return writer; + }; + + /** + * Encodes the specified JobExecutionStageInfo message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.JobExecutionStageInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.dataflow.v1beta3.JobExecutionStageInfo + * @static + * @param {google.dataflow.v1beta3.IJobExecutionStageInfo} message JobExecutionStageInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JobExecutionStageInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a JobExecutionStageInfo message from the specified reader or buffer. + * @function decode + * @memberof google.dataflow.v1beta3.JobExecutionStageInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.dataflow.v1beta3.JobExecutionStageInfo} JobExecutionStageInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JobExecutionStageInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.dataflow.v1beta3.JobExecutionStageInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.stepName && message.stepName.length)) + message.stepName = []; + message.stepName.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a JobExecutionStageInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.dataflow.v1beta3.JobExecutionStageInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.dataflow.v1beta3.JobExecutionStageInfo} JobExecutionStageInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JobExecutionStageInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a JobExecutionStageInfo message. + * @function verify + * @memberof google.dataflow.v1beta3.JobExecutionStageInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + JobExecutionStageInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.stepName != null && message.hasOwnProperty("stepName")) { + if (!Array.isArray(message.stepName)) + return "stepName: array expected"; + for (var i = 0; i < message.stepName.length; ++i) + if (!$util.isString(message.stepName[i])) + return "stepName: string[] expected"; + } + return null; + }; + + /** + * Creates a JobExecutionStageInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.dataflow.v1beta3.JobExecutionStageInfo + * @static + * @param {Object.} object Plain object + * @returns {google.dataflow.v1beta3.JobExecutionStageInfo} JobExecutionStageInfo + */ + JobExecutionStageInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.dataflow.v1beta3.JobExecutionStageInfo) + return object; + var message = new $root.google.dataflow.v1beta3.JobExecutionStageInfo(); + if (object.stepName) { + if (!Array.isArray(object.stepName)) + throw TypeError(".google.dataflow.v1beta3.JobExecutionStageInfo.stepName: array expected"); + message.stepName = []; + for (var i = 0; i < object.stepName.length; ++i) + message.stepName[i] = String(object.stepName[i]); + } + return message; + }; + + /** + * Creates a plain object from a JobExecutionStageInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.dataflow.v1beta3.JobExecutionStageInfo + * @static + * @param {google.dataflow.v1beta3.JobExecutionStageInfo} message JobExecutionStageInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + JobExecutionStageInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.stepName = []; + if (message.stepName && message.stepName.length) { + object.stepName = []; + for (var j = 0; j < message.stepName.length; ++j) + object.stepName[j] = message.stepName[j]; + } + return object; + }; + + /** + * Converts this JobExecutionStageInfo to JSON. + * @function toJSON + * @memberof google.dataflow.v1beta3.JobExecutionStageInfo + * @instance + * @returns {Object.} JSON object + */ + JobExecutionStageInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for JobExecutionStageInfo + * @function getTypeUrl + * @memberof google.dataflow.v1beta3.JobExecutionStageInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + JobExecutionStageInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.dataflow.v1beta3.JobExecutionStageInfo"; + }; + + return JobExecutionStageInfo; + })(); + + /** + * JobView enum. + * @name google.dataflow.v1beta3.JobView + * @enum {number} + * @property {number} JOB_VIEW_UNKNOWN=0 JOB_VIEW_UNKNOWN value + * @property {number} JOB_VIEW_SUMMARY=1 JOB_VIEW_SUMMARY value + * @property {number} JOB_VIEW_ALL=2 JOB_VIEW_ALL value + * @property {number} JOB_VIEW_DESCRIPTION=3 JOB_VIEW_DESCRIPTION value + */ + v1beta3.JobView = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "JOB_VIEW_UNKNOWN"] = 0; + values[valuesById[1] = "JOB_VIEW_SUMMARY"] = 1; + values[valuesById[2] = "JOB_VIEW_ALL"] = 2; + values[valuesById[3] = "JOB_VIEW_DESCRIPTION"] = 3; + return values; + })(); + + v1beta3.CreateJobRequest = (function() { + + /** + * Properties of a CreateJobRequest. + * @memberof google.dataflow.v1beta3 + * @interface ICreateJobRequest + * @property {string|null} [projectId] CreateJobRequest projectId + * @property {google.dataflow.v1beta3.IJob|null} [job] CreateJobRequest job + * @property {google.dataflow.v1beta3.JobView|null} [view] CreateJobRequest view + * @property {string|null} [replaceJobId] CreateJobRequest replaceJobId + * @property {string|null} [location] CreateJobRequest location + */ + + /** + * Constructs a new CreateJobRequest. + * @memberof google.dataflow.v1beta3 + * @classdesc Represents a CreateJobRequest. + * @implements ICreateJobRequest + * @constructor + * @param {google.dataflow.v1beta3.ICreateJobRequest=} [properties] Properties to set + */ + function CreateJobRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateJobRequest projectId. + * @member {string} projectId + * @memberof google.dataflow.v1beta3.CreateJobRequest + * @instance + */ + CreateJobRequest.prototype.projectId = ""; + + /** + * CreateJobRequest job. + * @member {google.dataflow.v1beta3.IJob|null|undefined} job + * @memberof google.dataflow.v1beta3.CreateJobRequest + * @instance + */ + CreateJobRequest.prototype.job = null; + + /** + * CreateJobRequest view. + * @member {google.dataflow.v1beta3.JobView} view + * @memberof google.dataflow.v1beta3.CreateJobRequest + * @instance + */ + CreateJobRequest.prototype.view = 0; + + /** + * CreateJobRequest replaceJobId. + * @member {string} replaceJobId + * @memberof google.dataflow.v1beta3.CreateJobRequest + * @instance + */ + CreateJobRequest.prototype.replaceJobId = ""; + + /** + * CreateJobRequest location. + * @member {string} location + * @memberof google.dataflow.v1beta3.CreateJobRequest + * @instance + */ + CreateJobRequest.prototype.location = ""; + + /** + * Creates a new CreateJobRequest instance using the specified properties. + * @function create + * @memberof google.dataflow.v1beta3.CreateJobRequest + * @static + * @param {google.dataflow.v1beta3.ICreateJobRequest=} [properties] Properties to set + * @returns {google.dataflow.v1beta3.CreateJobRequest} CreateJobRequest instance + */ + CreateJobRequest.create = function create(properties) { + return new CreateJobRequest(properties); + }; + + /** + * Encodes the specified CreateJobRequest message. Does not implicitly {@link google.dataflow.v1beta3.CreateJobRequest.verify|verify} messages. + * @function encode + * @memberof google.dataflow.v1beta3.CreateJobRequest + * @static + * @param {google.dataflow.v1beta3.ICreateJobRequest} message CreateJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateJobRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); + if (message.job != null && Object.hasOwnProperty.call(message, "job")) + $root.google.dataflow.v1beta3.Job.encode(message.job, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.view != null && Object.hasOwnProperty.call(message, "view")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.view); + if (message.replaceJobId != null && Object.hasOwnProperty.call(message, "replaceJobId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.replaceJobId); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.location); + return writer; + }; + + /** + * Encodes the specified CreateJobRequest message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.CreateJobRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.dataflow.v1beta3.CreateJobRequest + * @static + * @param {google.dataflow.v1beta3.ICreateJobRequest} message CreateJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateJobRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateJobRequest message from the specified reader or buffer. + * @function decode + * @memberof google.dataflow.v1beta3.CreateJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.dataflow.v1beta3.CreateJobRequest} CreateJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateJobRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.dataflow.v1beta3.CreateJobRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.projectId = reader.string(); + break; + } + case 2: { + message.job = $root.google.dataflow.v1beta3.Job.decode(reader, reader.uint32()); + break; + } + case 3: { + message.view = reader.int32(); + break; + } + case 4: { + message.replaceJobId = reader.string(); + break; + } + case 5: { + message.location = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateJobRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.dataflow.v1beta3.CreateJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.dataflow.v1beta3.CreateJobRequest} CreateJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateJobRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateJobRequest message. + * @function verify + * @memberof google.dataflow.v1beta3.CreateJobRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateJobRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.projectId != null && message.hasOwnProperty("projectId")) + if (!$util.isString(message.projectId)) + return "projectId: string expected"; + if (message.job != null && message.hasOwnProperty("job")) { + var error = $root.google.dataflow.v1beta3.Job.verify(message.job); + if (error) + return "job." + error; + } + if (message.view != null && message.hasOwnProperty("view")) + switch (message.view) { + default: + return "view: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.replaceJobId != null && message.hasOwnProperty("replaceJobId")) + if (!$util.isString(message.replaceJobId)) + return "replaceJobId: string expected"; + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isString(message.location)) + return "location: string expected"; + return null; + }; + + /** + * Creates a CreateJobRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.dataflow.v1beta3.CreateJobRequest + * @static + * @param {Object.} object Plain object + * @returns {google.dataflow.v1beta3.CreateJobRequest} CreateJobRequest + */ + CreateJobRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.dataflow.v1beta3.CreateJobRequest) + return object; + var message = new $root.google.dataflow.v1beta3.CreateJobRequest(); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.job != null) { + if (typeof object.job !== "object") + throw TypeError(".google.dataflow.v1beta3.CreateJobRequest.job: object expected"); + message.job = $root.google.dataflow.v1beta3.Job.fromObject(object.job); + } + switch (object.view) { + default: + if (typeof object.view === "number") { + message.view = object.view; + break; + } + break; + case "JOB_VIEW_UNKNOWN": + case 0: + message.view = 0; + break; + case "JOB_VIEW_SUMMARY": + case 1: + message.view = 1; + break; + case "JOB_VIEW_ALL": + case 2: + message.view = 2; + break; + case "JOB_VIEW_DESCRIPTION": + case 3: + message.view = 3; + break; + } + if (object.replaceJobId != null) + message.replaceJobId = String(object.replaceJobId); + if (object.location != null) + message.location = String(object.location); + return message; + }; + + /** + * Creates a plain object from a CreateJobRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.dataflow.v1beta3.CreateJobRequest + * @static + * @param {google.dataflow.v1beta3.CreateJobRequest} message CreateJobRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateJobRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.projectId = ""; + object.job = null; + object.view = options.enums === String ? "JOB_VIEW_UNKNOWN" : 0; + object.replaceJobId = ""; + object.location = ""; + } + if (message.projectId != null && message.hasOwnProperty("projectId")) + object.projectId = message.projectId; + if (message.job != null && message.hasOwnProperty("job")) + object.job = $root.google.dataflow.v1beta3.Job.toObject(message.job, options); + if (message.view != null && message.hasOwnProperty("view")) + object.view = options.enums === String ? $root.google.dataflow.v1beta3.JobView[message.view] === undefined ? message.view : $root.google.dataflow.v1beta3.JobView[message.view] : message.view; + if (message.replaceJobId != null && message.hasOwnProperty("replaceJobId")) + object.replaceJobId = message.replaceJobId; + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + return object; + }; + + /** + * Converts this CreateJobRequest to JSON. + * @function toJSON + * @memberof google.dataflow.v1beta3.CreateJobRequest + * @instance + * @returns {Object.} JSON object + */ + CreateJobRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateJobRequest + * @function getTypeUrl + * @memberof google.dataflow.v1beta3.CreateJobRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateJobRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.dataflow.v1beta3.CreateJobRequest"; + }; + + return CreateJobRequest; + })(); + + v1beta3.GetJobRequest = (function() { + + /** + * Properties of a GetJobRequest. + * @memberof google.dataflow.v1beta3 + * @interface IGetJobRequest + * @property {string|null} [projectId] GetJobRequest projectId + * @property {string|null} [jobId] GetJobRequest jobId + * @property {google.dataflow.v1beta3.JobView|null} [view] GetJobRequest view + * @property {string|null} [location] GetJobRequest location + */ + + /** + * Constructs a new GetJobRequest. + * @memberof google.dataflow.v1beta3 + * @classdesc Represents a GetJobRequest. + * @implements IGetJobRequest + * @constructor + * @param {google.dataflow.v1beta3.IGetJobRequest=} [properties] Properties to set + */ + function GetJobRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetJobRequest projectId. + * @member {string} projectId + * @memberof google.dataflow.v1beta3.GetJobRequest + * @instance + */ + GetJobRequest.prototype.projectId = ""; + + /** + * GetJobRequest jobId. + * @member {string} jobId + * @memberof google.dataflow.v1beta3.GetJobRequest + * @instance + */ + GetJobRequest.prototype.jobId = ""; + + /** + * GetJobRequest view. + * @member {google.dataflow.v1beta3.JobView} view + * @memberof google.dataflow.v1beta3.GetJobRequest + * @instance + */ + GetJobRequest.prototype.view = 0; + + /** + * GetJobRequest location. + * @member {string} location + * @memberof google.dataflow.v1beta3.GetJobRequest + * @instance + */ + GetJobRequest.prototype.location = ""; + + /** + * Creates a new GetJobRequest instance using the specified properties. + * @function create + * @memberof google.dataflow.v1beta3.GetJobRequest + * @static + * @param {google.dataflow.v1beta3.IGetJobRequest=} [properties] Properties to set + * @returns {google.dataflow.v1beta3.GetJobRequest} GetJobRequest instance + */ + GetJobRequest.create = function create(properties) { + return new GetJobRequest(properties); + }; + + /** + * Encodes the specified GetJobRequest message. Does not implicitly {@link google.dataflow.v1beta3.GetJobRequest.verify|verify} messages. + * @function encode + * @memberof google.dataflow.v1beta3.GetJobRequest + * @static + * @param {google.dataflow.v1beta3.IGetJobRequest} message GetJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetJobRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); + if (message.jobId != null && Object.hasOwnProperty.call(message, "jobId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.jobId); + if (message.view != null && Object.hasOwnProperty.call(message, "view")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.view); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.location); + return writer; + }; + + /** + * Encodes the specified GetJobRequest message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.GetJobRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.dataflow.v1beta3.GetJobRequest + * @static + * @param {google.dataflow.v1beta3.IGetJobRequest} message GetJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetJobRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetJobRequest message from the specified reader or buffer. + * @function decode + * @memberof google.dataflow.v1beta3.GetJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.dataflow.v1beta3.GetJobRequest} GetJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetJobRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.dataflow.v1beta3.GetJobRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.projectId = reader.string(); + break; + } + case 2: { + message.jobId = reader.string(); + break; + } + case 3: { + message.view = reader.int32(); + break; + } + case 4: { + message.location = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetJobRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.dataflow.v1beta3.GetJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.dataflow.v1beta3.GetJobRequest} GetJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetJobRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetJobRequest message. + * @function verify + * @memberof google.dataflow.v1beta3.GetJobRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetJobRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.projectId != null && message.hasOwnProperty("projectId")) + if (!$util.isString(message.projectId)) + return "projectId: string expected"; + if (message.jobId != null && message.hasOwnProperty("jobId")) + if (!$util.isString(message.jobId)) + return "jobId: string expected"; + if (message.view != null && message.hasOwnProperty("view")) + switch (message.view) { + default: + return "view: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isString(message.location)) + return "location: string expected"; + return null; + }; + + /** + * Creates a GetJobRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.dataflow.v1beta3.GetJobRequest + * @static + * @param {Object.} object Plain object + * @returns {google.dataflow.v1beta3.GetJobRequest} GetJobRequest + */ + GetJobRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.dataflow.v1beta3.GetJobRequest) + return object; + var message = new $root.google.dataflow.v1beta3.GetJobRequest(); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.jobId != null) + message.jobId = String(object.jobId); + switch (object.view) { + default: + if (typeof object.view === "number") { + message.view = object.view; + break; + } + break; + case "JOB_VIEW_UNKNOWN": + case 0: + message.view = 0; + break; + case "JOB_VIEW_SUMMARY": + case 1: + message.view = 1; + break; + case "JOB_VIEW_ALL": + case 2: + message.view = 2; + break; + case "JOB_VIEW_DESCRIPTION": + case 3: + message.view = 3; + break; + } + if (object.location != null) + message.location = String(object.location); + return message; + }; + + /** + * Creates a plain object from a GetJobRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.dataflow.v1beta3.GetJobRequest + * @static + * @param {google.dataflow.v1beta3.GetJobRequest} message GetJobRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetJobRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.projectId = ""; + object.jobId = ""; + object.view = options.enums === String ? "JOB_VIEW_UNKNOWN" : 0; + object.location = ""; + } + if (message.projectId != null && message.hasOwnProperty("projectId")) + object.projectId = message.projectId; + if (message.jobId != null && message.hasOwnProperty("jobId")) + object.jobId = message.jobId; + if (message.view != null && message.hasOwnProperty("view")) + object.view = options.enums === String ? $root.google.dataflow.v1beta3.JobView[message.view] === undefined ? message.view : $root.google.dataflow.v1beta3.JobView[message.view] : message.view; + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + return object; + }; + + /** + * Converts this GetJobRequest to JSON. + * @function toJSON + * @memberof google.dataflow.v1beta3.GetJobRequest + * @instance + * @returns {Object.} JSON object + */ + GetJobRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetJobRequest + * @function getTypeUrl + * @memberof google.dataflow.v1beta3.GetJobRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetJobRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.dataflow.v1beta3.GetJobRequest"; + }; + + return GetJobRequest; + })(); + + v1beta3.UpdateJobRequest = (function() { + + /** + * Properties of an UpdateJobRequest. + * @memberof google.dataflow.v1beta3 + * @interface IUpdateJobRequest + * @property {string|null} [projectId] UpdateJobRequest projectId + * @property {string|null} [jobId] UpdateJobRequest jobId + * @property {google.dataflow.v1beta3.IJob|null} [job] UpdateJobRequest job + * @property {string|null} [location] UpdateJobRequest location + */ + + /** + * Constructs a new UpdateJobRequest. + * @memberof google.dataflow.v1beta3 + * @classdesc Represents an UpdateJobRequest. + * @implements IUpdateJobRequest + * @constructor + * @param {google.dataflow.v1beta3.IUpdateJobRequest=} [properties] Properties to set + */ + function UpdateJobRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateJobRequest projectId. + * @member {string} projectId + * @memberof google.dataflow.v1beta3.UpdateJobRequest + * @instance + */ + UpdateJobRequest.prototype.projectId = ""; + + /** + * UpdateJobRequest jobId. + * @member {string} jobId + * @memberof google.dataflow.v1beta3.UpdateJobRequest + * @instance + */ + UpdateJobRequest.prototype.jobId = ""; + + /** + * UpdateJobRequest job. + * @member {google.dataflow.v1beta3.IJob|null|undefined} job + * @memberof google.dataflow.v1beta3.UpdateJobRequest + * @instance + */ + UpdateJobRequest.prototype.job = null; + + /** + * UpdateJobRequest location. + * @member {string} location + * @memberof google.dataflow.v1beta3.UpdateJobRequest + * @instance + */ + UpdateJobRequest.prototype.location = ""; + + /** + * Creates a new UpdateJobRequest instance using the specified properties. + * @function create + * @memberof google.dataflow.v1beta3.UpdateJobRequest + * @static + * @param {google.dataflow.v1beta3.IUpdateJobRequest=} [properties] Properties to set + * @returns {google.dataflow.v1beta3.UpdateJobRequest} UpdateJobRequest instance + */ + UpdateJobRequest.create = function create(properties) { + return new UpdateJobRequest(properties); + }; + + /** + * Encodes the specified UpdateJobRequest message. Does not implicitly {@link google.dataflow.v1beta3.UpdateJobRequest.verify|verify} messages. + * @function encode + * @memberof google.dataflow.v1beta3.UpdateJobRequest + * @static + * @param {google.dataflow.v1beta3.IUpdateJobRequest} message UpdateJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateJobRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); + if (message.jobId != null && Object.hasOwnProperty.call(message, "jobId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.jobId); + if (message.job != null && Object.hasOwnProperty.call(message, "job")) + $root.google.dataflow.v1beta3.Job.encode(message.job, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.location); + return writer; + }; + + /** + * Encodes the specified UpdateJobRequest message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.UpdateJobRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.dataflow.v1beta3.UpdateJobRequest + * @static + * @param {google.dataflow.v1beta3.IUpdateJobRequest} message UpdateJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateJobRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateJobRequest message from the specified reader or buffer. + * @function decode + * @memberof google.dataflow.v1beta3.UpdateJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.dataflow.v1beta3.UpdateJobRequest} UpdateJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateJobRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.dataflow.v1beta3.UpdateJobRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.projectId = reader.string(); + break; + } + case 2: { + message.jobId = reader.string(); + break; + } + case 3: { + message.job = $root.google.dataflow.v1beta3.Job.decode(reader, reader.uint32()); + break; + } + case 4: { + message.location = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateJobRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.dataflow.v1beta3.UpdateJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.dataflow.v1beta3.UpdateJobRequest} UpdateJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateJobRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateJobRequest message. + * @function verify + * @memberof google.dataflow.v1beta3.UpdateJobRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateJobRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.projectId != null && message.hasOwnProperty("projectId")) + if (!$util.isString(message.projectId)) + return "projectId: string expected"; + if (message.jobId != null && message.hasOwnProperty("jobId")) + if (!$util.isString(message.jobId)) + return "jobId: string expected"; + if (message.job != null && message.hasOwnProperty("job")) { + var error = $root.google.dataflow.v1beta3.Job.verify(message.job); + if (error) + return "job." + error; + } + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isString(message.location)) + return "location: string expected"; + return null; + }; + + /** + * Creates an UpdateJobRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.dataflow.v1beta3.UpdateJobRequest + * @static + * @param {Object.} object Plain object + * @returns {google.dataflow.v1beta3.UpdateJobRequest} UpdateJobRequest + */ + UpdateJobRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.dataflow.v1beta3.UpdateJobRequest) + return object; + var message = new $root.google.dataflow.v1beta3.UpdateJobRequest(); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.jobId != null) + message.jobId = String(object.jobId); + if (object.job != null) { + if (typeof object.job !== "object") + throw TypeError(".google.dataflow.v1beta3.UpdateJobRequest.job: object expected"); + message.job = $root.google.dataflow.v1beta3.Job.fromObject(object.job); + } + if (object.location != null) + message.location = String(object.location); + return message; + }; + + /** + * Creates a plain object from an UpdateJobRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.dataflow.v1beta3.UpdateJobRequest + * @static + * @param {google.dataflow.v1beta3.UpdateJobRequest} message UpdateJobRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateJobRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.projectId = ""; + object.jobId = ""; + object.job = null; + object.location = ""; + } + if (message.projectId != null && message.hasOwnProperty("projectId")) + object.projectId = message.projectId; + if (message.jobId != null && message.hasOwnProperty("jobId")) + object.jobId = message.jobId; + if (message.job != null && message.hasOwnProperty("job")) + object.job = $root.google.dataflow.v1beta3.Job.toObject(message.job, options); + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + return object; + }; + + /** + * Converts this UpdateJobRequest to JSON. + * @function toJSON + * @memberof google.dataflow.v1beta3.UpdateJobRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateJobRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateJobRequest + * @function getTypeUrl + * @memberof google.dataflow.v1beta3.UpdateJobRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateJobRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.dataflow.v1beta3.UpdateJobRequest"; + }; + + return UpdateJobRequest; + })(); + + v1beta3.ListJobsRequest = (function() { + + /** + * Properties of a ListJobsRequest. + * @memberof google.dataflow.v1beta3 + * @interface IListJobsRequest + * @property {google.dataflow.v1beta3.ListJobsRequest.Filter|null} [filter] ListJobsRequest filter + * @property {string|null} [projectId] ListJobsRequest projectId + * @property {google.dataflow.v1beta3.JobView|null} [view] ListJobsRequest view + * @property {number|null} [pageSize] ListJobsRequest pageSize + * @property {string|null} [pageToken] ListJobsRequest pageToken + * @property {string|null} [location] ListJobsRequest location + */ + + /** + * Constructs a new ListJobsRequest. + * @memberof google.dataflow.v1beta3 + * @classdesc Represents a ListJobsRequest. + * @implements IListJobsRequest + * @constructor + * @param {google.dataflow.v1beta3.IListJobsRequest=} [properties] Properties to set + */ + function ListJobsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListJobsRequest filter. + * @member {google.dataflow.v1beta3.ListJobsRequest.Filter} filter + * @memberof google.dataflow.v1beta3.ListJobsRequest + * @instance + */ + ListJobsRequest.prototype.filter = 0; + + /** + * ListJobsRequest projectId. + * @member {string} projectId + * @memberof google.dataflow.v1beta3.ListJobsRequest + * @instance + */ + ListJobsRequest.prototype.projectId = ""; + + /** + * ListJobsRequest view. + * @member {google.dataflow.v1beta3.JobView} view + * @memberof google.dataflow.v1beta3.ListJobsRequest + * @instance + */ + ListJobsRequest.prototype.view = 0; + + /** + * ListJobsRequest pageSize. + * @member {number} pageSize + * @memberof google.dataflow.v1beta3.ListJobsRequest + * @instance + */ + ListJobsRequest.prototype.pageSize = 0; + + /** + * ListJobsRequest pageToken. + * @member {string} pageToken + * @memberof google.dataflow.v1beta3.ListJobsRequest + * @instance + */ + ListJobsRequest.prototype.pageToken = ""; + + /** + * ListJobsRequest location. + * @member {string} location + * @memberof google.dataflow.v1beta3.ListJobsRequest + * @instance + */ + ListJobsRequest.prototype.location = ""; + + /** + * Creates a new ListJobsRequest instance using the specified properties. + * @function create + * @memberof google.dataflow.v1beta3.ListJobsRequest + * @static + * @param {google.dataflow.v1beta3.IListJobsRequest=} [properties] Properties to set + * @returns {google.dataflow.v1beta3.ListJobsRequest} ListJobsRequest instance + */ + ListJobsRequest.create = function create(properties) { + return new ListJobsRequest(properties); + }; + + /** + * Encodes the specified ListJobsRequest message. Does not implicitly {@link google.dataflow.v1beta3.ListJobsRequest.verify|verify} messages. + * @function encode + * @memberof google.dataflow.v1beta3.ListJobsRequest + * @static + * @param {google.dataflow.v1beta3.IListJobsRequest} message ListJobsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListJobsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); + if (message.view != null && Object.hasOwnProperty.call(message, "view")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.view); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.filter); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 17, wireType 2 =*/138).string(message.location); + return writer; + }; + + /** + * Encodes the specified ListJobsRequest message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.ListJobsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.dataflow.v1beta3.ListJobsRequest + * @static + * @param {google.dataflow.v1beta3.IListJobsRequest} message ListJobsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListJobsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListJobsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.dataflow.v1beta3.ListJobsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.dataflow.v1beta3.ListJobsRequest} ListJobsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListJobsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.dataflow.v1beta3.ListJobsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 5: { + message.filter = reader.int32(); + break; + } + case 1: { + message.projectId = reader.string(); + break; + } + case 2: { + message.view = reader.int32(); + break; + } + case 3: { + message.pageSize = reader.int32(); + break; + } + case 4: { + message.pageToken = reader.string(); + break; + } + case 17: { + message.location = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListJobsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.dataflow.v1beta3.ListJobsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.dataflow.v1beta3.ListJobsRequest} ListJobsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListJobsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListJobsRequest message. + * @function verify + * @memberof google.dataflow.v1beta3.ListJobsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListJobsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + switch (message.filter) { + default: + return "filter: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.projectId != null && message.hasOwnProperty("projectId")) + if (!$util.isString(message.projectId)) + return "projectId: string expected"; + if (message.view != null && message.hasOwnProperty("view")) + switch (message.view) { + default: + return "view: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isString(message.location)) + return "location: string expected"; + return null; + }; + + /** + * Creates a ListJobsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.dataflow.v1beta3.ListJobsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.dataflow.v1beta3.ListJobsRequest} ListJobsRequest + */ + ListJobsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.dataflow.v1beta3.ListJobsRequest) + return object; + var message = new $root.google.dataflow.v1beta3.ListJobsRequest(); + switch (object.filter) { + default: + if (typeof object.filter === "number") { + message.filter = object.filter; + break; + } + break; + case "UNKNOWN": + case 0: + message.filter = 0; + break; + case "ALL": + case 1: + message.filter = 1; + break; + case "TERMINATED": + case 2: + message.filter = 2; + break; + case "ACTIVE": + case 3: + message.filter = 3; + break; + } + if (object.projectId != null) + message.projectId = String(object.projectId); + switch (object.view) { + default: + if (typeof object.view === "number") { + message.view = object.view; + break; + } + break; + case "JOB_VIEW_UNKNOWN": + case 0: + message.view = 0; + break; + case "JOB_VIEW_SUMMARY": + case 1: + message.view = 1; + break; + case "JOB_VIEW_ALL": + case 2: + message.view = 2; + break; + case "JOB_VIEW_DESCRIPTION": + case 3: + message.view = 3; + break; + } + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.location != null) + message.location = String(object.location); + return message; + }; + + /** + * Creates a plain object from a ListJobsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.dataflow.v1beta3.ListJobsRequest + * @static + * @param {google.dataflow.v1beta3.ListJobsRequest} message ListJobsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListJobsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.projectId = ""; + object.view = options.enums === String ? "JOB_VIEW_UNKNOWN" : 0; + object.pageSize = 0; + object.pageToken = ""; + object.filter = options.enums === String ? "UNKNOWN" : 0; + object.location = ""; + } + if (message.projectId != null && message.hasOwnProperty("projectId")) + object.projectId = message.projectId; + if (message.view != null && message.hasOwnProperty("view")) + object.view = options.enums === String ? $root.google.dataflow.v1beta3.JobView[message.view] === undefined ? message.view : $root.google.dataflow.v1beta3.JobView[message.view] : message.view; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = options.enums === String ? $root.google.dataflow.v1beta3.ListJobsRequest.Filter[message.filter] === undefined ? message.filter : $root.google.dataflow.v1beta3.ListJobsRequest.Filter[message.filter] : message.filter; + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + return object; + }; + + /** + * Converts this ListJobsRequest to JSON. + * @function toJSON + * @memberof google.dataflow.v1beta3.ListJobsRequest + * @instance + * @returns {Object.} JSON object + */ + ListJobsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListJobsRequest + * @function getTypeUrl + * @memberof google.dataflow.v1beta3.ListJobsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListJobsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.dataflow.v1beta3.ListJobsRequest"; + }; + + /** + * Filter enum. + * @name google.dataflow.v1beta3.ListJobsRequest.Filter + * @enum {number} + * @property {number} UNKNOWN=0 UNKNOWN value + * @property {number} ALL=1 ALL value + * @property {number} TERMINATED=2 TERMINATED value + * @property {number} ACTIVE=3 ACTIVE value + */ + ListJobsRequest.Filter = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNKNOWN"] = 0; + values[valuesById[1] = "ALL"] = 1; + values[valuesById[2] = "TERMINATED"] = 2; + values[valuesById[3] = "ACTIVE"] = 3; + return values; + })(); + + return ListJobsRequest; + })(); + + v1beta3.FailedLocation = (function() { + + /** + * Properties of a FailedLocation. + * @memberof google.dataflow.v1beta3 + * @interface IFailedLocation + * @property {string|null} [name] FailedLocation name + */ + + /** + * Constructs a new FailedLocation. + * @memberof google.dataflow.v1beta3 + * @classdesc Represents a FailedLocation. + * @implements IFailedLocation + * @constructor + * @param {google.dataflow.v1beta3.IFailedLocation=} [properties] Properties to set + */ + function FailedLocation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FailedLocation name. + * @member {string} name + * @memberof google.dataflow.v1beta3.FailedLocation + * @instance + */ + FailedLocation.prototype.name = ""; + + /** + * Creates a new FailedLocation instance using the specified properties. + * @function create + * @memberof google.dataflow.v1beta3.FailedLocation + * @static + * @param {google.dataflow.v1beta3.IFailedLocation=} [properties] Properties to set + * @returns {google.dataflow.v1beta3.FailedLocation} FailedLocation instance + */ + FailedLocation.create = function create(properties) { + return new FailedLocation(properties); + }; + + /** + * Encodes the specified FailedLocation message. Does not implicitly {@link google.dataflow.v1beta3.FailedLocation.verify|verify} messages. + * @function encode + * @memberof google.dataflow.v1beta3.FailedLocation + * @static + * @param {google.dataflow.v1beta3.IFailedLocation} message FailedLocation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FailedLocation.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 FailedLocation message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.FailedLocation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.dataflow.v1beta3.FailedLocation + * @static + * @param {google.dataflow.v1beta3.IFailedLocation} message FailedLocation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FailedLocation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FailedLocation message from the specified reader or buffer. + * @function decode + * @memberof google.dataflow.v1beta3.FailedLocation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.dataflow.v1beta3.FailedLocation} FailedLocation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FailedLocation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.dataflow.v1beta3.FailedLocation(); + 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 FailedLocation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.dataflow.v1beta3.FailedLocation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.dataflow.v1beta3.FailedLocation} FailedLocation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FailedLocation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FailedLocation message. + * @function verify + * @memberof google.dataflow.v1beta3.FailedLocation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FailedLocation.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 FailedLocation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.dataflow.v1beta3.FailedLocation + * @static + * @param {Object.} object Plain object + * @returns {google.dataflow.v1beta3.FailedLocation} FailedLocation + */ + FailedLocation.fromObject = function fromObject(object) { + if (object instanceof $root.google.dataflow.v1beta3.FailedLocation) + return object; + var message = new $root.google.dataflow.v1beta3.FailedLocation(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a FailedLocation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.dataflow.v1beta3.FailedLocation + * @static + * @param {google.dataflow.v1beta3.FailedLocation} message FailedLocation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FailedLocation.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 FailedLocation to JSON. + * @function toJSON + * @memberof google.dataflow.v1beta3.FailedLocation + * @instance + * @returns {Object.} JSON object + */ + FailedLocation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FailedLocation + * @function getTypeUrl + * @memberof google.dataflow.v1beta3.FailedLocation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FailedLocation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.dataflow.v1beta3.FailedLocation"; + }; + + return FailedLocation; + })(); + + v1beta3.ListJobsResponse = (function() { + + /** + * Properties of a ListJobsResponse. + * @memberof google.dataflow.v1beta3 + * @interface IListJobsResponse + * @property {Array.|null} [jobs] ListJobsResponse jobs + * @property {string|null} [nextPageToken] ListJobsResponse nextPageToken + * @property {Array.|null} [failedLocation] ListJobsResponse failedLocation + */ + + /** + * Constructs a new ListJobsResponse. + * @memberof google.dataflow.v1beta3 + * @classdesc Represents a ListJobsResponse. + * @implements IListJobsResponse + * @constructor + * @param {google.dataflow.v1beta3.IListJobsResponse=} [properties] Properties to set + */ + function ListJobsResponse(properties) { + this.jobs = []; + this.failedLocation = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListJobsResponse jobs. + * @member {Array.} jobs + * @memberof google.dataflow.v1beta3.ListJobsResponse + * @instance + */ + ListJobsResponse.prototype.jobs = $util.emptyArray; + + /** + * ListJobsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.dataflow.v1beta3.ListJobsResponse + * @instance + */ + ListJobsResponse.prototype.nextPageToken = ""; + + /** + * ListJobsResponse failedLocation. + * @member {Array.} failedLocation + * @memberof google.dataflow.v1beta3.ListJobsResponse + * @instance + */ + ListJobsResponse.prototype.failedLocation = $util.emptyArray; + + /** + * Creates a new ListJobsResponse instance using the specified properties. + * @function create + * @memberof google.dataflow.v1beta3.ListJobsResponse + * @static + * @param {google.dataflow.v1beta3.IListJobsResponse=} [properties] Properties to set + * @returns {google.dataflow.v1beta3.ListJobsResponse} ListJobsResponse instance + */ + ListJobsResponse.create = function create(properties) { + return new ListJobsResponse(properties); + }; + + /** + * Encodes the specified ListJobsResponse message. Does not implicitly {@link google.dataflow.v1beta3.ListJobsResponse.verify|verify} messages. + * @function encode + * @memberof google.dataflow.v1beta3.ListJobsResponse + * @static + * @param {google.dataflow.v1beta3.IListJobsResponse} message ListJobsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListJobsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.jobs != null && message.jobs.length) + for (var i = 0; i < message.jobs.length; ++i) + $root.google.dataflow.v1beta3.Job.encode(message.jobs[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.failedLocation != null && message.failedLocation.length) + for (var i = 0; i < message.failedLocation.length; ++i) + $root.google.dataflow.v1beta3.FailedLocation.encode(message.failedLocation[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ListJobsResponse message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.ListJobsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.dataflow.v1beta3.ListJobsResponse + * @static + * @param {google.dataflow.v1beta3.IListJobsResponse} message ListJobsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListJobsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListJobsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.dataflow.v1beta3.ListJobsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.dataflow.v1beta3.ListJobsResponse} ListJobsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListJobsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.dataflow.v1beta3.ListJobsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.jobs && message.jobs.length)) + message.jobs = []; + message.jobs.push($root.google.dataflow.v1beta3.Job.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 3: { + if (!(message.failedLocation && message.failedLocation.length)) + message.failedLocation = []; + message.failedLocation.push($root.google.dataflow.v1beta3.FailedLocation.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListJobsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.dataflow.v1beta3.ListJobsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.dataflow.v1beta3.ListJobsResponse} ListJobsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListJobsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListJobsResponse message. + * @function verify + * @memberof google.dataflow.v1beta3.ListJobsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListJobsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.jobs != null && message.hasOwnProperty("jobs")) { + if (!Array.isArray(message.jobs)) + return "jobs: array expected"; + for (var i = 0; i < message.jobs.length; ++i) { + var error = $root.google.dataflow.v1beta3.Job.verify(message.jobs[i]); + if (error) + return "jobs." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.failedLocation != null && message.hasOwnProperty("failedLocation")) { + if (!Array.isArray(message.failedLocation)) + return "failedLocation: array expected"; + for (var i = 0; i < message.failedLocation.length; ++i) { + var error = $root.google.dataflow.v1beta3.FailedLocation.verify(message.failedLocation[i]); + if (error) + return "failedLocation." + error; + } + } + return null; + }; + + /** + * Creates a ListJobsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.dataflow.v1beta3.ListJobsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.dataflow.v1beta3.ListJobsResponse} ListJobsResponse + */ + ListJobsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.dataflow.v1beta3.ListJobsResponse) + return object; + var message = new $root.google.dataflow.v1beta3.ListJobsResponse(); + if (object.jobs) { + if (!Array.isArray(object.jobs)) + throw TypeError(".google.dataflow.v1beta3.ListJobsResponse.jobs: array expected"); + message.jobs = []; + for (var i = 0; i < object.jobs.length; ++i) { + if (typeof object.jobs[i] !== "object") + throw TypeError(".google.dataflow.v1beta3.ListJobsResponse.jobs: object expected"); + message.jobs[i] = $root.google.dataflow.v1beta3.Job.fromObject(object.jobs[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.failedLocation) { + if (!Array.isArray(object.failedLocation)) + throw TypeError(".google.dataflow.v1beta3.ListJobsResponse.failedLocation: array expected"); + message.failedLocation = []; + for (var i = 0; i < object.failedLocation.length; ++i) { + if (typeof object.failedLocation[i] !== "object") + throw TypeError(".google.dataflow.v1beta3.ListJobsResponse.failedLocation: object expected"); + message.failedLocation[i] = $root.google.dataflow.v1beta3.FailedLocation.fromObject(object.failedLocation[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ListJobsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.dataflow.v1beta3.ListJobsResponse + * @static + * @param {google.dataflow.v1beta3.ListJobsResponse} message ListJobsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListJobsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.jobs = []; + object.failedLocation = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.jobs && message.jobs.length) { + object.jobs = []; + for (var j = 0; j < message.jobs.length; ++j) + object.jobs[j] = $root.google.dataflow.v1beta3.Job.toObject(message.jobs[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.failedLocation && message.failedLocation.length) { + object.failedLocation = []; + for (var j = 0; j < message.failedLocation.length; ++j) + object.failedLocation[j] = $root.google.dataflow.v1beta3.FailedLocation.toObject(message.failedLocation[j], options); + } + return object; + }; + + /** + * Converts this ListJobsResponse to JSON. + * @function toJSON + * @memberof google.dataflow.v1beta3.ListJobsResponse + * @instance + * @returns {Object.} JSON object + */ + ListJobsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListJobsResponse + * @function getTypeUrl + * @memberof google.dataflow.v1beta3.ListJobsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListJobsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.dataflow.v1beta3.ListJobsResponse"; + }; + + return ListJobsResponse; + })(); + + v1beta3.SnapshotJobRequest = (function() { + + /** + * Properties of a SnapshotJobRequest. + * @memberof google.dataflow.v1beta3 + * @interface ISnapshotJobRequest + * @property {string|null} [projectId] SnapshotJobRequest projectId + * @property {string|null} [jobId] SnapshotJobRequest jobId + * @property {google.protobuf.IDuration|null} [ttl] SnapshotJobRequest ttl + * @property {string|null} [location] SnapshotJobRequest location + * @property {boolean|null} [snapshotSources] SnapshotJobRequest snapshotSources + * @property {string|null} [description] SnapshotJobRequest description + */ + + /** + * Constructs a new SnapshotJobRequest. + * @memberof google.dataflow.v1beta3 + * @classdesc Represents a SnapshotJobRequest. + * @implements ISnapshotJobRequest + * @constructor + * @param {google.dataflow.v1beta3.ISnapshotJobRequest=} [properties] Properties to set + */ + function SnapshotJobRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SnapshotJobRequest projectId. + * @member {string} projectId + * @memberof google.dataflow.v1beta3.SnapshotJobRequest + * @instance + */ + SnapshotJobRequest.prototype.projectId = ""; + + /** + * SnapshotJobRequest jobId. + * @member {string} jobId + * @memberof google.dataflow.v1beta3.SnapshotJobRequest + * @instance + */ + SnapshotJobRequest.prototype.jobId = ""; + + /** + * SnapshotJobRequest ttl. + * @member {google.protobuf.IDuration|null|undefined} ttl + * @memberof google.dataflow.v1beta3.SnapshotJobRequest + * @instance + */ + SnapshotJobRequest.prototype.ttl = null; + + /** + * SnapshotJobRequest location. + * @member {string} location + * @memberof google.dataflow.v1beta3.SnapshotJobRequest + * @instance + */ + SnapshotJobRequest.prototype.location = ""; + + /** + * SnapshotJobRequest snapshotSources. + * @member {boolean} snapshotSources + * @memberof google.dataflow.v1beta3.SnapshotJobRequest + * @instance + */ + SnapshotJobRequest.prototype.snapshotSources = false; + + /** + * SnapshotJobRequest description. + * @member {string} description + * @memberof google.dataflow.v1beta3.SnapshotJobRequest + * @instance + */ + SnapshotJobRequest.prototype.description = ""; + + /** + * Creates a new SnapshotJobRequest instance using the specified properties. + * @function create + * @memberof google.dataflow.v1beta3.SnapshotJobRequest + * @static + * @param {google.dataflow.v1beta3.ISnapshotJobRequest=} [properties] Properties to set + * @returns {google.dataflow.v1beta3.SnapshotJobRequest} SnapshotJobRequest instance + */ + SnapshotJobRequest.create = function create(properties) { + return new SnapshotJobRequest(properties); + }; + + /** + * Encodes the specified SnapshotJobRequest message. Does not implicitly {@link google.dataflow.v1beta3.SnapshotJobRequest.verify|verify} messages. + * @function encode + * @memberof google.dataflow.v1beta3.SnapshotJobRequest + * @static + * @param {google.dataflow.v1beta3.ISnapshotJobRequest} message SnapshotJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SnapshotJobRequest.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.jobId != null && Object.hasOwnProperty.call(message, "jobId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.jobId); + if (message.ttl != null && Object.hasOwnProperty.call(message, "ttl")) + $root.google.protobuf.Duration.encode(message.ttl, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.location); + if (message.snapshotSources != null && Object.hasOwnProperty.call(message, "snapshotSources")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.snapshotSources); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.description); + return writer; + }; + + /** + * Encodes the specified SnapshotJobRequest message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.SnapshotJobRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.dataflow.v1beta3.SnapshotJobRequest + * @static + * @param {google.dataflow.v1beta3.ISnapshotJobRequest} message SnapshotJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SnapshotJobRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SnapshotJobRequest message from the specified reader or buffer. + * @function decode + * @memberof google.dataflow.v1beta3.SnapshotJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.dataflow.v1beta3.SnapshotJobRequest} SnapshotJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SnapshotJobRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.dataflow.v1beta3.SnapshotJobRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.projectId = reader.string(); + break; + } + case 2: { + message.jobId = reader.string(); + break; + } + case 3: { + message.ttl = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 4: { + message.location = reader.string(); + break; + } + case 5: { + message.snapshotSources = reader.bool(); + break; + } + case 6: { + message.description = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SnapshotJobRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.dataflow.v1beta3.SnapshotJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.dataflow.v1beta3.SnapshotJobRequest} SnapshotJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SnapshotJobRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SnapshotJobRequest message. + * @function verify + * @memberof google.dataflow.v1beta3.SnapshotJobRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SnapshotJobRequest.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.jobId != null && message.hasOwnProperty("jobId")) + if (!$util.isString(message.jobId)) + return "jobId: string expected"; + if (message.ttl != null && message.hasOwnProperty("ttl")) { + var error = $root.google.protobuf.Duration.verify(message.ttl); + if (error) + return "ttl." + error; + } + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isString(message.location)) + return "location: string expected"; + if (message.snapshotSources != null && message.hasOwnProperty("snapshotSources")) + if (typeof message.snapshotSources !== "boolean") + return "snapshotSources: boolean expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + return null; + }; + + /** + * Creates a SnapshotJobRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.dataflow.v1beta3.SnapshotJobRequest + * @static + * @param {Object.} object Plain object + * @returns {google.dataflow.v1beta3.SnapshotJobRequest} SnapshotJobRequest + */ + SnapshotJobRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.dataflow.v1beta3.SnapshotJobRequest) + return object; + var message = new $root.google.dataflow.v1beta3.SnapshotJobRequest(); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.jobId != null) + message.jobId = String(object.jobId); + if (object.ttl != null) { + if (typeof object.ttl !== "object") + throw TypeError(".google.dataflow.v1beta3.SnapshotJobRequest.ttl: object expected"); + message.ttl = $root.google.protobuf.Duration.fromObject(object.ttl); + } + if (object.location != null) + message.location = String(object.location); + if (object.snapshotSources != null) + message.snapshotSources = Boolean(object.snapshotSources); + if (object.description != null) + message.description = String(object.description); + return message; + }; + + /** + * Creates a plain object from a SnapshotJobRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.dataflow.v1beta3.SnapshotJobRequest + * @static + * @param {google.dataflow.v1beta3.SnapshotJobRequest} message SnapshotJobRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SnapshotJobRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.projectId = ""; + object.jobId = ""; + object.ttl = null; + object.location = ""; + object.snapshotSources = false; + object.description = ""; + } + if (message.projectId != null && message.hasOwnProperty("projectId")) + object.projectId = message.projectId; + if (message.jobId != null && message.hasOwnProperty("jobId")) + object.jobId = message.jobId; + if (message.ttl != null && message.hasOwnProperty("ttl")) + object.ttl = $root.google.protobuf.Duration.toObject(message.ttl, options); + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + if (message.snapshotSources != null && message.hasOwnProperty("snapshotSources")) + object.snapshotSources = message.snapshotSources; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + return object; + }; + + /** + * Converts this SnapshotJobRequest to JSON. + * @function toJSON + * @memberof google.dataflow.v1beta3.SnapshotJobRequest + * @instance + * @returns {Object.} JSON object + */ + SnapshotJobRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SnapshotJobRequest + * @function getTypeUrl + * @memberof google.dataflow.v1beta3.SnapshotJobRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SnapshotJobRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.dataflow.v1beta3.SnapshotJobRequest"; + }; + + return SnapshotJobRequest; + })(); + + v1beta3.CheckActiveJobsRequest = (function() { + + /** + * Properties of a CheckActiveJobsRequest. + * @memberof google.dataflow.v1beta3 + * @interface ICheckActiveJobsRequest + * @property {string|null} [projectId] CheckActiveJobsRequest projectId + */ + + /** + * Constructs a new CheckActiveJobsRequest. + * @memberof google.dataflow.v1beta3 + * @classdesc Represents a CheckActiveJobsRequest. + * @implements ICheckActiveJobsRequest + * @constructor + * @param {google.dataflow.v1beta3.ICheckActiveJobsRequest=} [properties] Properties to set + */ + function CheckActiveJobsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CheckActiveJobsRequest projectId. + * @member {string} projectId + * @memberof google.dataflow.v1beta3.CheckActiveJobsRequest + * @instance + */ + CheckActiveJobsRequest.prototype.projectId = ""; + + /** + * Creates a new CheckActiveJobsRequest instance using the specified properties. + * @function create + * @memberof google.dataflow.v1beta3.CheckActiveJobsRequest + * @static + * @param {google.dataflow.v1beta3.ICheckActiveJobsRequest=} [properties] Properties to set + * @returns {google.dataflow.v1beta3.CheckActiveJobsRequest} CheckActiveJobsRequest instance + */ + CheckActiveJobsRequest.create = function create(properties) { + return new CheckActiveJobsRequest(properties); + }; + + /** + * Encodes the specified CheckActiveJobsRequest message. Does not implicitly {@link google.dataflow.v1beta3.CheckActiveJobsRequest.verify|verify} messages. + * @function encode + * @memberof google.dataflow.v1beta3.CheckActiveJobsRequest + * @static + * @param {google.dataflow.v1beta3.ICheckActiveJobsRequest} message CheckActiveJobsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CheckActiveJobsRequest.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 CheckActiveJobsRequest message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.CheckActiveJobsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.dataflow.v1beta3.CheckActiveJobsRequest + * @static + * @param {google.dataflow.v1beta3.ICheckActiveJobsRequest} message CheckActiveJobsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CheckActiveJobsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CheckActiveJobsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.dataflow.v1beta3.CheckActiveJobsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.dataflow.v1beta3.CheckActiveJobsRequest} CheckActiveJobsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CheckActiveJobsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.dataflow.v1beta3.CheckActiveJobsRequest(); + 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 CheckActiveJobsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.dataflow.v1beta3.CheckActiveJobsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.dataflow.v1beta3.CheckActiveJobsRequest} CheckActiveJobsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CheckActiveJobsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CheckActiveJobsRequest message. + * @function verify + * @memberof google.dataflow.v1beta3.CheckActiveJobsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CheckActiveJobsRequest.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 CheckActiveJobsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.dataflow.v1beta3.CheckActiveJobsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.dataflow.v1beta3.CheckActiveJobsRequest} CheckActiveJobsRequest + */ + CheckActiveJobsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.dataflow.v1beta3.CheckActiveJobsRequest) + return object; + var message = new $root.google.dataflow.v1beta3.CheckActiveJobsRequest(); + if (object.projectId != null) + message.projectId = String(object.projectId); + return message; + }; + + /** + * Creates a plain object from a CheckActiveJobsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.dataflow.v1beta3.CheckActiveJobsRequest + * @static + * @param {google.dataflow.v1beta3.CheckActiveJobsRequest} message CheckActiveJobsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CheckActiveJobsRequest.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 CheckActiveJobsRequest to JSON. + * @function toJSON + * @memberof google.dataflow.v1beta3.CheckActiveJobsRequest + * @instance + * @returns {Object.} JSON object + */ + CheckActiveJobsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CheckActiveJobsRequest + * @function getTypeUrl + * @memberof google.dataflow.v1beta3.CheckActiveJobsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CheckActiveJobsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.dataflow.v1beta3.CheckActiveJobsRequest"; + }; + + return CheckActiveJobsRequest; + })(); + + v1beta3.CheckActiveJobsResponse = (function() { + + /** + * Properties of a CheckActiveJobsResponse. + * @memberof google.dataflow.v1beta3 + * @interface ICheckActiveJobsResponse + * @property {boolean|null} [activeJobsExist] CheckActiveJobsResponse activeJobsExist + */ + + /** + * Constructs a new CheckActiveJobsResponse. + * @memberof google.dataflow.v1beta3 + * @classdesc Represents a CheckActiveJobsResponse. + * @implements ICheckActiveJobsResponse + * @constructor + * @param {google.dataflow.v1beta3.ICheckActiveJobsResponse=} [properties] Properties to set + */ + function CheckActiveJobsResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CheckActiveJobsResponse activeJobsExist. + * @member {boolean} activeJobsExist + * @memberof google.dataflow.v1beta3.CheckActiveJobsResponse + * @instance + */ + CheckActiveJobsResponse.prototype.activeJobsExist = false; + + /** + * Creates a new CheckActiveJobsResponse instance using the specified properties. + * @function create + * @memberof google.dataflow.v1beta3.CheckActiveJobsResponse + * @static + * @param {google.dataflow.v1beta3.ICheckActiveJobsResponse=} [properties] Properties to set + * @returns {google.dataflow.v1beta3.CheckActiveJobsResponse} CheckActiveJobsResponse instance + */ + CheckActiveJobsResponse.create = function create(properties) { + return new CheckActiveJobsResponse(properties); + }; + + /** + * Encodes the specified CheckActiveJobsResponse message. Does not implicitly {@link google.dataflow.v1beta3.CheckActiveJobsResponse.verify|verify} messages. + * @function encode + * @memberof google.dataflow.v1beta3.CheckActiveJobsResponse + * @static + * @param {google.dataflow.v1beta3.ICheckActiveJobsResponse} message CheckActiveJobsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CheckActiveJobsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.activeJobsExist != null && Object.hasOwnProperty.call(message, "activeJobsExist")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.activeJobsExist); + return writer; + }; + + /** + * Encodes the specified CheckActiveJobsResponse message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.CheckActiveJobsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.dataflow.v1beta3.CheckActiveJobsResponse + * @static + * @param {google.dataflow.v1beta3.ICheckActiveJobsResponse} message CheckActiveJobsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CheckActiveJobsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CheckActiveJobsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.dataflow.v1beta3.CheckActiveJobsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.dataflow.v1beta3.CheckActiveJobsResponse} CheckActiveJobsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CheckActiveJobsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.dataflow.v1beta3.CheckActiveJobsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.activeJobsExist = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CheckActiveJobsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.dataflow.v1beta3.CheckActiveJobsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.dataflow.v1beta3.CheckActiveJobsResponse} CheckActiveJobsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CheckActiveJobsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CheckActiveJobsResponse message. + * @function verify + * @memberof google.dataflow.v1beta3.CheckActiveJobsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CheckActiveJobsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.activeJobsExist != null && message.hasOwnProperty("activeJobsExist")) + if (typeof message.activeJobsExist !== "boolean") + return "activeJobsExist: boolean expected"; + return null; + }; + + /** + * Creates a CheckActiveJobsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.dataflow.v1beta3.CheckActiveJobsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.dataflow.v1beta3.CheckActiveJobsResponse} CheckActiveJobsResponse + */ + CheckActiveJobsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.dataflow.v1beta3.CheckActiveJobsResponse) + return object; + var message = new $root.google.dataflow.v1beta3.CheckActiveJobsResponse(); + if (object.activeJobsExist != null) + message.activeJobsExist = Boolean(object.activeJobsExist); + return message; + }; + + /** + * Creates a plain object from a CheckActiveJobsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.dataflow.v1beta3.CheckActiveJobsResponse + * @static + * @param {google.dataflow.v1beta3.CheckActiveJobsResponse} message CheckActiveJobsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CheckActiveJobsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.activeJobsExist = false; + if (message.activeJobsExist != null && message.hasOwnProperty("activeJobsExist")) + object.activeJobsExist = message.activeJobsExist; + return object; + }; + + /** + * Converts this CheckActiveJobsResponse to JSON. + * @function toJSON + * @memberof google.dataflow.v1beta3.CheckActiveJobsResponse + * @instance + * @returns {Object.} JSON object + */ + CheckActiveJobsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CheckActiveJobsResponse + * @function getTypeUrl + * @memberof google.dataflow.v1beta3.CheckActiveJobsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CheckActiveJobsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.dataflow.v1beta3.CheckActiveJobsResponse"; + }; + + return CheckActiveJobsResponse; + })(); + + v1beta3.SnapshotsV1Beta3 = (function() { + + /** + * Constructs a new SnapshotsV1Beta3 service. + * @memberof google.dataflow.v1beta3 + * @classdesc Represents a SnapshotsV1Beta3 + * @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 SnapshotsV1Beta3(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (SnapshotsV1Beta3.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = SnapshotsV1Beta3; + + /** + * Creates new SnapshotsV1Beta3 service using the specified rpc implementation. + * @function create + * @memberof google.dataflow.v1beta3.SnapshotsV1Beta3 + * @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 {SnapshotsV1Beta3} RPC service. Useful where requests and/or responses are streamed. + */ + SnapshotsV1Beta3.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.dataflow.v1beta3.SnapshotsV1Beta3|getSnapshot}. + * @memberof google.dataflow.v1beta3.SnapshotsV1Beta3 + * @typedef GetSnapshotCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.dataflow.v1beta3.Snapshot} [response] Snapshot + */ + + /** + * Calls GetSnapshot. + * @function getSnapshot + * @memberof google.dataflow.v1beta3.SnapshotsV1Beta3 + * @instance + * @param {google.dataflow.v1beta3.IGetSnapshotRequest} request GetSnapshotRequest message or plain object + * @param {google.dataflow.v1beta3.SnapshotsV1Beta3.GetSnapshotCallback} callback Node-style callback called with the error, if any, and Snapshot + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SnapshotsV1Beta3.prototype.getSnapshot = function getSnapshot(request, callback) { + return this.rpcCall(getSnapshot, $root.google.dataflow.v1beta3.GetSnapshotRequest, $root.google.dataflow.v1beta3.Snapshot, request, callback); + }, "name", { value: "GetSnapshot" }); + + /** + * Calls GetSnapshot. + * @function getSnapshot + * @memberof google.dataflow.v1beta3.SnapshotsV1Beta3 + * @instance + * @param {google.dataflow.v1beta3.IGetSnapshotRequest} request GetSnapshotRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.dataflow.v1beta3.SnapshotsV1Beta3|deleteSnapshot}. + * @memberof google.dataflow.v1beta3.SnapshotsV1Beta3 + * @typedef DeleteSnapshotCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.dataflow.v1beta3.DeleteSnapshotResponse} [response] DeleteSnapshotResponse + */ + + /** + * Calls DeleteSnapshot. + * @function deleteSnapshot + * @memberof google.dataflow.v1beta3.SnapshotsV1Beta3 + * @instance + * @param {google.dataflow.v1beta3.IDeleteSnapshotRequest} request DeleteSnapshotRequest message or plain object + * @param {google.dataflow.v1beta3.SnapshotsV1Beta3.DeleteSnapshotCallback} callback Node-style callback called with the error, if any, and DeleteSnapshotResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SnapshotsV1Beta3.prototype.deleteSnapshot = function deleteSnapshot(request, callback) { + return this.rpcCall(deleteSnapshot, $root.google.dataflow.v1beta3.DeleteSnapshotRequest, $root.google.dataflow.v1beta3.DeleteSnapshotResponse, request, callback); + }, "name", { value: "DeleteSnapshot" }); + + /** + * Calls DeleteSnapshot. + * @function deleteSnapshot + * @memberof google.dataflow.v1beta3.SnapshotsV1Beta3 + * @instance + * @param {google.dataflow.v1beta3.IDeleteSnapshotRequest} request DeleteSnapshotRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.dataflow.v1beta3.SnapshotsV1Beta3|listSnapshots}. + * @memberof google.dataflow.v1beta3.SnapshotsV1Beta3 + * @typedef ListSnapshotsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.dataflow.v1beta3.ListSnapshotsResponse} [response] ListSnapshotsResponse + */ + + /** + * Calls ListSnapshots. + * @function listSnapshots + * @memberof google.dataflow.v1beta3.SnapshotsV1Beta3 + * @instance + * @param {google.dataflow.v1beta3.IListSnapshotsRequest} request ListSnapshotsRequest message or plain object + * @param {google.dataflow.v1beta3.SnapshotsV1Beta3.ListSnapshotsCallback} callback Node-style callback called with the error, if any, and ListSnapshotsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SnapshotsV1Beta3.prototype.listSnapshots = function listSnapshots(request, callback) { + return this.rpcCall(listSnapshots, $root.google.dataflow.v1beta3.ListSnapshotsRequest, $root.google.dataflow.v1beta3.ListSnapshotsResponse, request, callback); + }, "name", { value: "ListSnapshots" }); + + /** + * Calls ListSnapshots. + * @function listSnapshots + * @memberof google.dataflow.v1beta3.SnapshotsV1Beta3 + * @instance + * @param {google.dataflow.v1beta3.IListSnapshotsRequest} request ListSnapshotsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return SnapshotsV1Beta3; + })(); + + /** + * SnapshotState enum. + * @name google.dataflow.v1beta3.SnapshotState + * @enum {number} + * @property {number} UNKNOWN_SNAPSHOT_STATE=0 UNKNOWN_SNAPSHOT_STATE value + * @property {number} PENDING=1 PENDING value + * @property {number} RUNNING=2 RUNNING value + * @property {number} READY=3 READY value + * @property {number} FAILED=4 FAILED value + * @property {number} DELETED=5 DELETED value + */ + v1beta3.SnapshotState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNKNOWN_SNAPSHOT_STATE"] = 0; + values[valuesById[1] = "PENDING"] = 1; + values[valuesById[2] = "RUNNING"] = 2; + values[valuesById[3] = "READY"] = 3; + values[valuesById[4] = "FAILED"] = 4; + values[valuesById[5] = "DELETED"] = 5; + return values; + })(); + + v1beta3.PubsubSnapshotMetadata = (function() { + + /** + * Properties of a PubsubSnapshotMetadata. + * @memberof google.dataflow.v1beta3 + * @interface IPubsubSnapshotMetadata + * @property {string|null} [topicName] PubsubSnapshotMetadata topicName + * @property {string|null} [snapshotName] PubsubSnapshotMetadata snapshotName + * @property {google.protobuf.ITimestamp|null} [expireTime] PubsubSnapshotMetadata expireTime + */ + + /** + * Constructs a new PubsubSnapshotMetadata. + * @memberof google.dataflow.v1beta3 + * @classdesc Represents a PubsubSnapshotMetadata. + * @implements IPubsubSnapshotMetadata + * @constructor + * @param {google.dataflow.v1beta3.IPubsubSnapshotMetadata=} [properties] Properties to set + */ + function PubsubSnapshotMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PubsubSnapshotMetadata topicName. + * @member {string} topicName + * @memberof google.dataflow.v1beta3.PubsubSnapshotMetadata + * @instance + */ + PubsubSnapshotMetadata.prototype.topicName = ""; + + /** + * PubsubSnapshotMetadata snapshotName. + * @member {string} snapshotName + * @memberof google.dataflow.v1beta3.PubsubSnapshotMetadata + * @instance + */ + PubsubSnapshotMetadata.prototype.snapshotName = ""; + + /** + * PubsubSnapshotMetadata expireTime. + * @member {google.protobuf.ITimestamp|null|undefined} expireTime + * @memberof google.dataflow.v1beta3.PubsubSnapshotMetadata + * @instance + */ + PubsubSnapshotMetadata.prototype.expireTime = null; + + /** + * Creates a new PubsubSnapshotMetadata instance using the specified properties. + * @function create + * @memberof google.dataflow.v1beta3.PubsubSnapshotMetadata + * @static + * @param {google.dataflow.v1beta3.IPubsubSnapshotMetadata=} [properties] Properties to set + * @returns {google.dataflow.v1beta3.PubsubSnapshotMetadata} PubsubSnapshotMetadata instance + */ + PubsubSnapshotMetadata.create = function create(properties) { + return new PubsubSnapshotMetadata(properties); + }; + + /** + * Encodes the specified PubsubSnapshotMetadata message. Does not implicitly {@link google.dataflow.v1beta3.PubsubSnapshotMetadata.verify|verify} messages. + * @function encode + * @memberof google.dataflow.v1beta3.PubsubSnapshotMetadata + * @static + * @param {google.dataflow.v1beta3.IPubsubSnapshotMetadata} message PubsubSnapshotMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PubsubSnapshotMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.topicName != null && Object.hasOwnProperty.call(message, "topicName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.topicName); + if (message.snapshotName != null && Object.hasOwnProperty.call(message, "snapshotName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.snapshotName); + if (message.expireTime != null && Object.hasOwnProperty.call(message, "expireTime")) + $root.google.protobuf.Timestamp.encode(message.expireTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PubsubSnapshotMetadata message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.PubsubSnapshotMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.dataflow.v1beta3.PubsubSnapshotMetadata + * @static + * @param {google.dataflow.v1beta3.IPubsubSnapshotMetadata} message PubsubSnapshotMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PubsubSnapshotMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PubsubSnapshotMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.dataflow.v1beta3.PubsubSnapshotMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.dataflow.v1beta3.PubsubSnapshotMetadata} PubsubSnapshotMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PubsubSnapshotMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.dataflow.v1beta3.PubsubSnapshotMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.topicName = reader.string(); + break; + } + case 2: { + message.snapshotName = reader.string(); + break; + } + case 3: { + message.expireTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PubsubSnapshotMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.dataflow.v1beta3.PubsubSnapshotMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.dataflow.v1beta3.PubsubSnapshotMetadata} PubsubSnapshotMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PubsubSnapshotMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PubsubSnapshotMetadata message. + * @function verify + * @memberof google.dataflow.v1beta3.PubsubSnapshotMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PubsubSnapshotMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.topicName != null && message.hasOwnProperty("topicName")) + if (!$util.isString(message.topicName)) + return "topicName: string expected"; + if (message.snapshotName != null && message.hasOwnProperty("snapshotName")) + if (!$util.isString(message.snapshotName)) + return "snapshotName: string expected"; + if (message.expireTime != null && message.hasOwnProperty("expireTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.expireTime); + if (error) + return "expireTime." + error; + } + return null; + }; + + /** + * Creates a PubsubSnapshotMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.dataflow.v1beta3.PubsubSnapshotMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.dataflow.v1beta3.PubsubSnapshotMetadata} PubsubSnapshotMetadata + */ + PubsubSnapshotMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.dataflow.v1beta3.PubsubSnapshotMetadata) + return object; + var message = new $root.google.dataflow.v1beta3.PubsubSnapshotMetadata(); + if (object.topicName != null) + message.topicName = String(object.topicName); + if (object.snapshotName != null) + message.snapshotName = String(object.snapshotName); + if (object.expireTime != null) { + if (typeof object.expireTime !== "object") + throw TypeError(".google.dataflow.v1beta3.PubsubSnapshotMetadata.expireTime: object expected"); + message.expireTime = $root.google.protobuf.Timestamp.fromObject(object.expireTime); + } + return message; + }; + + /** + * Creates a plain object from a PubsubSnapshotMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.dataflow.v1beta3.PubsubSnapshotMetadata + * @static + * @param {google.dataflow.v1beta3.PubsubSnapshotMetadata} message PubsubSnapshotMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PubsubSnapshotMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.topicName = ""; + object.snapshotName = ""; + object.expireTime = null; + } + if (message.topicName != null && message.hasOwnProperty("topicName")) + object.topicName = message.topicName; + if (message.snapshotName != null && message.hasOwnProperty("snapshotName")) + object.snapshotName = message.snapshotName; + if (message.expireTime != null && message.hasOwnProperty("expireTime")) + object.expireTime = $root.google.protobuf.Timestamp.toObject(message.expireTime, options); + return object; + }; + + /** + * Converts this PubsubSnapshotMetadata to JSON. + * @function toJSON + * @memberof google.dataflow.v1beta3.PubsubSnapshotMetadata + * @instance + * @returns {Object.} JSON object + */ + PubsubSnapshotMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PubsubSnapshotMetadata + * @function getTypeUrl + * @memberof google.dataflow.v1beta3.PubsubSnapshotMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PubsubSnapshotMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.dataflow.v1beta3.PubsubSnapshotMetadata"; + }; + + return PubsubSnapshotMetadata; + })(); + + v1beta3.Snapshot = (function() { + + /** + * Properties of a Snapshot. + * @memberof google.dataflow.v1beta3 + * @interface ISnapshot + * @property {string|null} [id] Snapshot id + * @property {string|null} [projectId] Snapshot projectId + * @property {string|null} [sourceJobId] Snapshot sourceJobId + * @property {google.protobuf.ITimestamp|null} [creationTime] Snapshot creationTime + * @property {google.protobuf.IDuration|null} [ttl] Snapshot ttl + * @property {google.dataflow.v1beta3.SnapshotState|null} [state] Snapshot state + * @property {Array.|null} [pubsubMetadata] Snapshot pubsubMetadata + * @property {string|null} [description] Snapshot description + * @property {number|Long|null} [diskSizeBytes] Snapshot diskSizeBytes + * @property {string|null} [region] Snapshot region + */ + + /** + * Constructs a new Snapshot. + * @memberof google.dataflow.v1beta3 + * @classdesc Represents a Snapshot. + * @implements ISnapshot + * @constructor + * @param {google.dataflow.v1beta3.ISnapshot=} [properties] Properties to set + */ + function Snapshot(properties) { + this.pubsubMetadata = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Snapshot id. + * @member {string} id + * @memberof google.dataflow.v1beta3.Snapshot + * @instance + */ + Snapshot.prototype.id = ""; + + /** + * Snapshot projectId. + * @member {string} projectId + * @memberof google.dataflow.v1beta3.Snapshot + * @instance + */ + Snapshot.prototype.projectId = ""; + + /** + * Snapshot sourceJobId. + * @member {string} sourceJobId + * @memberof google.dataflow.v1beta3.Snapshot + * @instance + */ + Snapshot.prototype.sourceJobId = ""; + + /** + * Snapshot creationTime. + * @member {google.protobuf.ITimestamp|null|undefined} creationTime + * @memberof google.dataflow.v1beta3.Snapshot + * @instance + */ + Snapshot.prototype.creationTime = null; + + /** + * Snapshot ttl. + * @member {google.protobuf.IDuration|null|undefined} ttl + * @memberof google.dataflow.v1beta3.Snapshot + * @instance + */ + Snapshot.prototype.ttl = null; + + /** + * Snapshot state. + * @member {google.dataflow.v1beta3.SnapshotState} state + * @memberof google.dataflow.v1beta3.Snapshot + * @instance + */ + Snapshot.prototype.state = 0; + + /** + * Snapshot pubsubMetadata. + * @member {Array.} pubsubMetadata + * @memberof google.dataflow.v1beta3.Snapshot + * @instance + */ + Snapshot.prototype.pubsubMetadata = $util.emptyArray; + + /** + * Snapshot description. + * @member {string} description + * @memberof google.dataflow.v1beta3.Snapshot + * @instance + */ + Snapshot.prototype.description = ""; + + /** + * Snapshot diskSizeBytes. + * @member {number|Long} diskSizeBytes + * @memberof google.dataflow.v1beta3.Snapshot + * @instance + */ + Snapshot.prototype.diskSizeBytes = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Snapshot region. + * @member {string} region + * @memberof google.dataflow.v1beta3.Snapshot + * @instance + */ + Snapshot.prototype.region = ""; + + /** + * Creates a new Snapshot instance using the specified properties. + * @function create + * @memberof google.dataflow.v1beta3.Snapshot + * @static + * @param {google.dataflow.v1beta3.ISnapshot=} [properties] Properties to set + * @returns {google.dataflow.v1beta3.Snapshot} Snapshot instance + */ + Snapshot.create = function create(properties) { + return new Snapshot(properties); + }; + + /** + * Encodes the specified Snapshot message. Does not implicitly {@link google.dataflow.v1beta3.Snapshot.verify|verify} messages. + * @function encode + * @memberof google.dataflow.v1beta3.Snapshot + * @static + * @param {google.dataflow.v1beta3.ISnapshot} message Snapshot message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Snapshot.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.id); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.projectId); + if (message.sourceJobId != null && Object.hasOwnProperty.call(message, "sourceJobId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.sourceJobId); + if (message.creationTime != null && Object.hasOwnProperty.call(message, "creationTime")) + $root.google.protobuf.Timestamp.encode(message.creationTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.ttl != null && Object.hasOwnProperty.call(message, "ttl")) + $root.google.protobuf.Duration.encode(message.ttl, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.state); + if (message.pubsubMetadata != null && message.pubsubMetadata.length) + for (var i = 0; i < message.pubsubMetadata.length; ++i) + $root.google.dataflow.v1beta3.PubsubSnapshotMetadata.encode(message.pubsubMetadata[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.description); + if (message.diskSizeBytes != null && Object.hasOwnProperty.call(message, "diskSizeBytes")) + writer.uint32(/* id 9, wireType 0 =*/72).int64(message.diskSizeBytes); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.region); + return writer; + }; + + /** + * Encodes the specified Snapshot message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.Snapshot.verify|verify} messages. + * @function encodeDelimited + * @memberof google.dataflow.v1beta3.Snapshot + * @static + * @param {google.dataflow.v1beta3.ISnapshot} message Snapshot message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Snapshot.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Snapshot message from the specified reader or buffer. + * @function decode + * @memberof google.dataflow.v1beta3.Snapshot + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.dataflow.v1beta3.Snapshot} Snapshot + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Snapshot.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.dataflow.v1beta3.Snapshot(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.id = reader.string(); + break; + } + case 2: { + message.projectId = reader.string(); + break; + } + case 3: { + message.sourceJobId = reader.string(); + break; + } + case 4: { + message.creationTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.ttl = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 6: { + message.state = reader.int32(); + break; + } + case 7: { + if (!(message.pubsubMetadata && message.pubsubMetadata.length)) + message.pubsubMetadata = []; + message.pubsubMetadata.push($root.google.dataflow.v1beta3.PubsubSnapshotMetadata.decode(reader, reader.uint32())); + break; + } + case 8: { + message.description = reader.string(); + break; + } + case 9: { + message.diskSizeBytes = reader.int64(); + break; + } + case 10: { + message.region = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Snapshot message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.dataflow.v1beta3.Snapshot + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.dataflow.v1beta3.Snapshot} Snapshot + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Snapshot.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Snapshot message. + * @function verify + * @memberof google.dataflow.v1beta3.Snapshot + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Snapshot.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string expected"; + if (message.projectId != null && message.hasOwnProperty("projectId")) + if (!$util.isString(message.projectId)) + return "projectId: string expected"; + if (message.sourceJobId != null && message.hasOwnProperty("sourceJobId")) + if (!$util.isString(message.sourceJobId)) + return "sourceJobId: string expected"; + if (message.creationTime != null && message.hasOwnProperty("creationTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.creationTime); + if (error) + return "creationTime." + error; + } + if (message.ttl != null && message.hasOwnProperty("ttl")) { + var error = $root.google.protobuf.Duration.verify(message.ttl); + if (error) + return "ttl." + error; + } + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.pubsubMetadata != null && message.hasOwnProperty("pubsubMetadata")) { + if (!Array.isArray(message.pubsubMetadata)) + return "pubsubMetadata: array expected"; + for (var i = 0; i < message.pubsubMetadata.length; ++i) { + var error = $root.google.dataflow.v1beta3.PubsubSnapshotMetadata.verify(message.pubsubMetadata[i]); + if (error) + return "pubsubMetadata." + error; + } + } + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.diskSizeBytes != null && message.hasOwnProperty("diskSizeBytes")) + if (!$util.isInteger(message.diskSizeBytes) && !(message.diskSizeBytes && $util.isInteger(message.diskSizeBytes.low) && $util.isInteger(message.diskSizeBytes.high))) + return "diskSizeBytes: integer|Long expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + return null; + }; + + /** + * Creates a Snapshot message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.dataflow.v1beta3.Snapshot + * @static + * @param {Object.} object Plain object + * @returns {google.dataflow.v1beta3.Snapshot} Snapshot + */ + Snapshot.fromObject = function fromObject(object) { + if (object instanceof $root.google.dataflow.v1beta3.Snapshot) + return object; + var message = new $root.google.dataflow.v1beta3.Snapshot(); + if (object.id != null) + message.id = String(object.id); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.sourceJobId != null) + message.sourceJobId = String(object.sourceJobId); + if (object.creationTime != null) { + if (typeof object.creationTime !== "object") + throw TypeError(".google.dataflow.v1beta3.Snapshot.creationTime: object expected"); + message.creationTime = $root.google.protobuf.Timestamp.fromObject(object.creationTime); + } + if (object.ttl != null) { + if (typeof object.ttl !== "object") + throw TypeError(".google.dataflow.v1beta3.Snapshot.ttl: object expected"); + message.ttl = $root.google.protobuf.Duration.fromObject(object.ttl); + } + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "UNKNOWN_SNAPSHOT_STATE": + case 0: + message.state = 0; + break; + case "PENDING": + case 1: + message.state = 1; + break; + case "RUNNING": + case 2: + message.state = 2; + break; + case "READY": + case 3: + message.state = 3; + break; + case "FAILED": + case 4: + message.state = 4; + break; + case "DELETED": + case 5: + message.state = 5; + break; + } + if (object.pubsubMetadata) { + if (!Array.isArray(object.pubsubMetadata)) + throw TypeError(".google.dataflow.v1beta3.Snapshot.pubsubMetadata: array expected"); + message.pubsubMetadata = []; + for (var i = 0; i < object.pubsubMetadata.length; ++i) { + if (typeof object.pubsubMetadata[i] !== "object") + throw TypeError(".google.dataflow.v1beta3.Snapshot.pubsubMetadata: object expected"); + message.pubsubMetadata[i] = $root.google.dataflow.v1beta3.PubsubSnapshotMetadata.fromObject(object.pubsubMetadata[i]); + } + } + if (object.description != null) + message.description = String(object.description); + if (object.diskSizeBytes != null) + if ($util.Long) + (message.diskSizeBytes = $util.Long.fromValue(object.diskSizeBytes)).unsigned = false; + else if (typeof object.diskSizeBytes === "string") + message.diskSizeBytes = parseInt(object.diskSizeBytes, 10); + else if (typeof object.diskSizeBytes === "number") + message.diskSizeBytes = object.diskSizeBytes; + else if (typeof object.diskSizeBytes === "object") + message.diskSizeBytes = new $util.LongBits(object.diskSizeBytes.low >>> 0, object.diskSizeBytes.high >>> 0).toNumber(); + if (object.region != null) + message.region = String(object.region); + return message; + }; + + /** + * Creates a plain object from a Snapshot message. Also converts values to other types if specified. + * @function toObject + * @memberof google.dataflow.v1beta3.Snapshot + * @static + * @param {google.dataflow.v1beta3.Snapshot} message Snapshot + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Snapshot.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.pubsubMetadata = []; + if (options.defaults) { + object.id = ""; + object.projectId = ""; + object.sourceJobId = ""; + object.creationTime = null; + object.ttl = null; + object.state = options.enums === String ? "UNKNOWN_SNAPSHOT_STATE" : 0; + object.description = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.diskSizeBytes = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.diskSizeBytes = options.longs === String ? "0" : 0; + object.region = ""; + } + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + if (message.projectId != null && message.hasOwnProperty("projectId")) + object.projectId = message.projectId; + if (message.sourceJobId != null && message.hasOwnProperty("sourceJobId")) + object.sourceJobId = message.sourceJobId; + if (message.creationTime != null && message.hasOwnProperty("creationTime")) + object.creationTime = $root.google.protobuf.Timestamp.toObject(message.creationTime, options); + if (message.ttl != null && message.hasOwnProperty("ttl")) + object.ttl = $root.google.protobuf.Duration.toObject(message.ttl, options); + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.dataflow.v1beta3.SnapshotState[message.state] === undefined ? message.state : $root.google.dataflow.v1beta3.SnapshotState[message.state] : message.state; + if (message.pubsubMetadata && message.pubsubMetadata.length) { + object.pubsubMetadata = []; + for (var j = 0; j < message.pubsubMetadata.length; ++j) + object.pubsubMetadata[j] = $root.google.dataflow.v1beta3.PubsubSnapshotMetadata.toObject(message.pubsubMetadata[j], options); + } + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.diskSizeBytes != null && message.hasOwnProperty("diskSizeBytes")) + if (typeof message.diskSizeBytes === "number") + object.diskSizeBytes = options.longs === String ? String(message.diskSizeBytes) : message.diskSizeBytes; + else + object.diskSizeBytes = options.longs === String ? $util.Long.prototype.toString.call(message.diskSizeBytes) : options.longs === Number ? new $util.LongBits(message.diskSizeBytes.low >>> 0, message.diskSizeBytes.high >>> 0).toNumber() : message.diskSizeBytes; + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + return object; + }; + + /** + * Converts this Snapshot to JSON. + * @function toJSON + * @memberof google.dataflow.v1beta3.Snapshot + * @instance + * @returns {Object.} JSON object + */ + Snapshot.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Snapshot + * @function getTypeUrl + * @memberof google.dataflow.v1beta3.Snapshot + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Snapshot.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.dataflow.v1beta3.Snapshot"; + }; + + return Snapshot; + })(); + + v1beta3.GetSnapshotRequest = (function() { + + /** + * Properties of a GetSnapshotRequest. + * @memberof google.dataflow.v1beta3 + * @interface IGetSnapshotRequest + * @property {string|null} [projectId] GetSnapshotRequest projectId + * @property {string|null} [snapshotId] GetSnapshotRequest snapshotId + * @property {string|null} [location] GetSnapshotRequest location + */ + + /** + * Constructs a new GetSnapshotRequest. + * @memberof google.dataflow.v1beta3 + * @classdesc Represents a GetSnapshotRequest. + * @implements IGetSnapshotRequest + * @constructor + * @param {google.dataflow.v1beta3.IGetSnapshotRequest=} [properties] Properties to set + */ + function GetSnapshotRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetSnapshotRequest projectId. + * @member {string} projectId + * @memberof google.dataflow.v1beta3.GetSnapshotRequest + * @instance + */ + GetSnapshotRequest.prototype.projectId = ""; + + /** + * GetSnapshotRequest snapshotId. + * @member {string} snapshotId + * @memberof google.dataflow.v1beta3.GetSnapshotRequest + * @instance + */ + GetSnapshotRequest.prototype.snapshotId = ""; + + /** + * GetSnapshotRequest location. + * @member {string} location + * @memberof google.dataflow.v1beta3.GetSnapshotRequest + * @instance + */ + GetSnapshotRequest.prototype.location = ""; + + /** + * Creates a new GetSnapshotRequest instance using the specified properties. + * @function create + * @memberof google.dataflow.v1beta3.GetSnapshotRequest + * @static + * @param {google.dataflow.v1beta3.IGetSnapshotRequest=} [properties] Properties to set + * @returns {google.dataflow.v1beta3.GetSnapshotRequest} GetSnapshotRequest instance + */ + GetSnapshotRequest.create = function create(properties) { + return new GetSnapshotRequest(properties); + }; + + /** + * Encodes the specified GetSnapshotRequest message. Does not implicitly {@link google.dataflow.v1beta3.GetSnapshotRequest.verify|verify} messages. + * @function encode + * @memberof google.dataflow.v1beta3.GetSnapshotRequest + * @static + * @param {google.dataflow.v1beta3.IGetSnapshotRequest} message GetSnapshotRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetSnapshotRequest.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.snapshotId != null && Object.hasOwnProperty.call(message, "snapshotId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.snapshotId); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.location); + return writer; + }; + + /** + * Encodes the specified GetSnapshotRequest message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.GetSnapshotRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.dataflow.v1beta3.GetSnapshotRequest + * @static + * @param {google.dataflow.v1beta3.IGetSnapshotRequest} message GetSnapshotRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetSnapshotRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetSnapshotRequest message from the specified reader or buffer. + * @function decode + * @memberof google.dataflow.v1beta3.GetSnapshotRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.dataflow.v1beta3.GetSnapshotRequest} GetSnapshotRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetSnapshotRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.dataflow.v1beta3.GetSnapshotRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.projectId = reader.string(); + break; + } + case 2: { + message.snapshotId = reader.string(); + break; + } + case 3: { + message.location = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetSnapshotRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.dataflow.v1beta3.GetSnapshotRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.dataflow.v1beta3.GetSnapshotRequest} GetSnapshotRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetSnapshotRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetSnapshotRequest message. + * @function verify + * @memberof google.dataflow.v1beta3.GetSnapshotRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetSnapshotRequest.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.snapshotId != null && message.hasOwnProperty("snapshotId")) + if (!$util.isString(message.snapshotId)) + return "snapshotId: string expected"; + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isString(message.location)) + return "location: string expected"; + return null; + }; + + /** + * Creates a GetSnapshotRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.dataflow.v1beta3.GetSnapshotRequest + * @static + * @param {Object.} object Plain object + * @returns {google.dataflow.v1beta3.GetSnapshotRequest} GetSnapshotRequest + */ + GetSnapshotRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.dataflow.v1beta3.GetSnapshotRequest) + return object; + var message = new $root.google.dataflow.v1beta3.GetSnapshotRequest(); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.snapshotId != null) + message.snapshotId = String(object.snapshotId); + if (object.location != null) + message.location = String(object.location); + return message; + }; + + /** + * Creates a plain object from a GetSnapshotRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.dataflow.v1beta3.GetSnapshotRequest + * @static + * @param {google.dataflow.v1beta3.GetSnapshotRequest} message GetSnapshotRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetSnapshotRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.projectId = ""; + object.snapshotId = ""; + object.location = ""; + } + if (message.projectId != null && message.hasOwnProperty("projectId")) + object.projectId = message.projectId; + if (message.snapshotId != null && message.hasOwnProperty("snapshotId")) + object.snapshotId = message.snapshotId; + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + return object; + }; + + /** + * Converts this GetSnapshotRequest to JSON. + * @function toJSON + * @memberof google.dataflow.v1beta3.GetSnapshotRequest + * @instance + * @returns {Object.} JSON object + */ + GetSnapshotRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetSnapshotRequest + * @function getTypeUrl + * @memberof google.dataflow.v1beta3.GetSnapshotRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetSnapshotRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.dataflow.v1beta3.GetSnapshotRequest"; + }; + + return GetSnapshotRequest; + })(); + + v1beta3.DeleteSnapshotRequest = (function() { + + /** + * Properties of a DeleteSnapshotRequest. + * @memberof google.dataflow.v1beta3 + * @interface IDeleteSnapshotRequest + * @property {string|null} [projectId] DeleteSnapshotRequest projectId + * @property {string|null} [snapshotId] DeleteSnapshotRequest snapshotId + * @property {string|null} [location] DeleteSnapshotRequest location + */ + + /** + * Constructs a new DeleteSnapshotRequest. + * @memberof google.dataflow.v1beta3 + * @classdesc Represents a DeleteSnapshotRequest. + * @implements IDeleteSnapshotRequest + * @constructor + * @param {google.dataflow.v1beta3.IDeleteSnapshotRequest=} [properties] Properties to set + */ + function DeleteSnapshotRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteSnapshotRequest projectId. + * @member {string} projectId + * @memberof google.dataflow.v1beta3.DeleteSnapshotRequest + * @instance + */ + DeleteSnapshotRequest.prototype.projectId = ""; + + /** + * DeleteSnapshotRequest snapshotId. + * @member {string} snapshotId + * @memberof google.dataflow.v1beta3.DeleteSnapshotRequest + * @instance + */ + DeleteSnapshotRequest.prototype.snapshotId = ""; + + /** + * DeleteSnapshotRequest location. + * @member {string} location + * @memberof google.dataflow.v1beta3.DeleteSnapshotRequest + * @instance + */ + DeleteSnapshotRequest.prototype.location = ""; + + /** + * Creates a new DeleteSnapshotRequest instance using the specified properties. + * @function create + * @memberof google.dataflow.v1beta3.DeleteSnapshotRequest + * @static + * @param {google.dataflow.v1beta3.IDeleteSnapshotRequest=} [properties] Properties to set + * @returns {google.dataflow.v1beta3.DeleteSnapshotRequest} DeleteSnapshotRequest instance + */ + DeleteSnapshotRequest.create = function create(properties) { + return new DeleteSnapshotRequest(properties); + }; + + /** + * Encodes the specified DeleteSnapshotRequest message. Does not implicitly {@link google.dataflow.v1beta3.DeleteSnapshotRequest.verify|verify} messages. + * @function encode + * @memberof google.dataflow.v1beta3.DeleteSnapshotRequest + * @static + * @param {google.dataflow.v1beta3.IDeleteSnapshotRequest} message DeleteSnapshotRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteSnapshotRequest.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.snapshotId != null && Object.hasOwnProperty.call(message, "snapshotId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.snapshotId); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.location); + return writer; + }; + + /** + * Encodes the specified DeleteSnapshotRequest message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.DeleteSnapshotRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.dataflow.v1beta3.DeleteSnapshotRequest + * @static + * @param {google.dataflow.v1beta3.IDeleteSnapshotRequest} message DeleteSnapshotRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteSnapshotRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteSnapshotRequest message from the specified reader or buffer. + * @function decode + * @memberof google.dataflow.v1beta3.DeleteSnapshotRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.dataflow.v1beta3.DeleteSnapshotRequest} DeleteSnapshotRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteSnapshotRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.dataflow.v1beta3.DeleteSnapshotRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.projectId = reader.string(); + break; + } + case 2: { + message.snapshotId = reader.string(); + break; + } + case 3: { + message.location = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteSnapshotRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.dataflow.v1beta3.DeleteSnapshotRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.dataflow.v1beta3.DeleteSnapshotRequest} DeleteSnapshotRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteSnapshotRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteSnapshotRequest message. + * @function verify + * @memberof google.dataflow.v1beta3.DeleteSnapshotRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteSnapshotRequest.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.snapshotId != null && message.hasOwnProperty("snapshotId")) + if (!$util.isString(message.snapshotId)) + return "snapshotId: string expected"; + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isString(message.location)) + return "location: string expected"; + return null; + }; + + /** + * Creates a DeleteSnapshotRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.dataflow.v1beta3.DeleteSnapshotRequest + * @static + * @param {Object.} object Plain object + * @returns {google.dataflow.v1beta3.DeleteSnapshotRequest} DeleteSnapshotRequest + */ + DeleteSnapshotRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.dataflow.v1beta3.DeleteSnapshotRequest) + return object; + var message = new $root.google.dataflow.v1beta3.DeleteSnapshotRequest(); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.snapshotId != null) + message.snapshotId = String(object.snapshotId); + if (object.location != null) + message.location = String(object.location); + return message; + }; + + /** + * Creates a plain object from a DeleteSnapshotRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.dataflow.v1beta3.DeleteSnapshotRequest + * @static + * @param {google.dataflow.v1beta3.DeleteSnapshotRequest} message DeleteSnapshotRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteSnapshotRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.projectId = ""; + object.snapshotId = ""; + object.location = ""; + } + if (message.projectId != null && message.hasOwnProperty("projectId")) + object.projectId = message.projectId; + if (message.snapshotId != null && message.hasOwnProperty("snapshotId")) + object.snapshotId = message.snapshotId; + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + return object; + }; + + /** + * Converts this DeleteSnapshotRequest to JSON. + * @function toJSON + * @memberof google.dataflow.v1beta3.DeleteSnapshotRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteSnapshotRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteSnapshotRequest + * @function getTypeUrl + * @memberof google.dataflow.v1beta3.DeleteSnapshotRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteSnapshotRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.dataflow.v1beta3.DeleteSnapshotRequest"; + }; + + return DeleteSnapshotRequest; + })(); + + v1beta3.DeleteSnapshotResponse = (function() { + + /** + * Properties of a DeleteSnapshotResponse. + * @memberof google.dataflow.v1beta3 + * @interface IDeleteSnapshotResponse + */ + + /** + * Constructs a new DeleteSnapshotResponse. + * @memberof google.dataflow.v1beta3 + * @classdesc Represents a DeleteSnapshotResponse. + * @implements IDeleteSnapshotResponse + * @constructor + * @param {google.dataflow.v1beta3.IDeleteSnapshotResponse=} [properties] Properties to set + */ + function DeleteSnapshotResponse(properties) { + if (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 DeleteSnapshotResponse instance using the specified properties. + * @function create + * @memberof google.dataflow.v1beta3.DeleteSnapshotResponse + * @static + * @param {google.dataflow.v1beta3.IDeleteSnapshotResponse=} [properties] Properties to set + * @returns {google.dataflow.v1beta3.DeleteSnapshotResponse} DeleteSnapshotResponse instance + */ + DeleteSnapshotResponse.create = function create(properties) { + return new DeleteSnapshotResponse(properties); + }; + + /** + * Encodes the specified DeleteSnapshotResponse message. Does not implicitly {@link google.dataflow.v1beta3.DeleteSnapshotResponse.verify|verify} messages. + * @function encode + * @memberof google.dataflow.v1beta3.DeleteSnapshotResponse + * @static + * @param {google.dataflow.v1beta3.IDeleteSnapshotResponse} message DeleteSnapshotResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteSnapshotResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified DeleteSnapshotResponse message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.DeleteSnapshotResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.dataflow.v1beta3.DeleteSnapshotResponse + * @static + * @param {google.dataflow.v1beta3.IDeleteSnapshotResponse} message DeleteSnapshotResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteSnapshotResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteSnapshotResponse message from the specified reader or buffer. + * @function decode + * @memberof google.dataflow.v1beta3.DeleteSnapshotResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.dataflow.v1beta3.DeleteSnapshotResponse} DeleteSnapshotResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteSnapshotResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.dataflow.v1beta3.DeleteSnapshotResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteSnapshotResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.dataflow.v1beta3.DeleteSnapshotResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.dataflow.v1beta3.DeleteSnapshotResponse} DeleteSnapshotResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteSnapshotResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteSnapshotResponse message. + * @function verify + * @memberof google.dataflow.v1beta3.DeleteSnapshotResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteSnapshotResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a DeleteSnapshotResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.dataflow.v1beta3.DeleteSnapshotResponse + * @static + * @param {Object.} object Plain object + * @returns {google.dataflow.v1beta3.DeleteSnapshotResponse} DeleteSnapshotResponse + */ + DeleteSnapshotResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.dataflow.v1beta3.DeleteSnapshotResponse) + return object; + return new $root.google.dataflow.v1beta3.DeleteSnapshotResponse(); + }; + + /** + * Creates a plain object from a DeleteSnapshotResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.dataflow.v1beta3.DeleteSnapshotResponse + * @static + * @param {google.dataflow.v1beta3.DeleteSnapshotResponse} message DeleteSnapshotResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteSnapshotResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this DeleteSnapshotResponse to JSON. + * @function toJSON + * @memberof google.dataflow.v1beta3.DeleteSnapshotResponse + * @instance + * @returns {Object.} JSON object + */ + DeleteSnapshotResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteSnapshotResponse + * @function getTypeUrl + * @memberof google.dataflow.v1beta3.DeleteSnapshotResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteSnapshotResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.dataflow.v1beta3.DeleteSnapshotResponse"; + }; + + return DeleteSnapshotResponse; + })(); + + v1beta3.ListSnapshotsRequest = (function() { + + /** + * Properties of a ListSnapshotsRequest. + * @memberof google.dataflow.v1beta3 + * @interface IListSnapshotsRequest + * @property {string|null} [projectId] ListSnapshotsRequest projectId + * @property {string|null} [jobId] ListSnapshotsRequest jobId + * @property {string|null} [location] ListSnapshotsRequest location + */ + + /** + * Constructs a new ListSnapshotsRequest. + * @memberof google.dataflow.v1beta3 + * @classdesc Represents a ListSnapshotsRequest. + * @implements IListSnapshotsRequest + * @constructor + * @param {google.dataflow.v1beta3.IListSnapshotsRequest=} [properties] Properties to set + */ + function ListSnapshotsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListSnapshotsRequest projectId. + * @member {string} projectId + * @memberof google.dataflow.v1beta3.ListSnapshotsRequest + * @instance + */ + ListSnapshotsRequest.prototype.projectId = ""; + + /** + * ListSnapshotsRequest jobId. + * @member {string} jobId + * @memberof google.dataflow.v1beta3.ListSnapshotsRequest + * @instance + */ + ListSnapshotsRequest.prototype.jobId = ""; + + /** + * ListSnapshotsRequest location. + * @member {string} location + * @memberof google.dataflow.v1beta3.ListSnapshotsRequest + * @instance + */ + ListSnapshotsRequest.prototype.location = ""; + + /** + * Creates a new ListSnapshotsRequest instance using the specified properties. + * @function create + * @memberof google.dataflow.v1beta3.ListSnapshotsRequest + * @static + * @param {google.dataflow.v1beta3.IListSnapshotsRequest=} [properties] Properties to set + * @returns {google.dataflow.v1beta3.ListSnapshotsRequest} ListSnapshotsRequest instance + */ + ListSnapshotsRequest.create = function create(properties) { + return new ListSnapshotsRequest(properties); + }; + + /** + * Encodes the specified ListSnapshotsRequest message. Does not implicitly {@link google.dataflow.v1beta3.ListSnapshotsRequest.verify|verify} messages. + * @function encode + * @memberof google.dataflow.v1beta3.ListSnapshotsRequest + * @static + * @param {google.dataflow.v1beta3.IListSnapshotsRequest} message ListSnapshotsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSnapshotsRequest.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.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.location); + if (message.jobId != null && Object.hasOwnProperty.call(message, "jobId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.jobId); + return writer; + }; + + /** + * Encodes the specified ListSnapshotsRequest message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.ListSnapshotsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.dataflow.v1beta3.ListSnapshotsRequest + * @static + * @param {google.dataflow.v1beta3.IListSnapshotsRequest} message ListSnapshotsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSnapshotsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListSnapshotsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.dataflow.v1beta3.ListSnapshotsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.dataflow.v1beta3.ListSnapshotsRequest} ListSnapshotsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSnapshotsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.dataflow.v1beta3.ListSnapshotsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.projectId = reader.string(); + break; + } + case 3: { + message.jobId = reader.string(); + break; + } + case 2: { + message.location = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListSnapshotsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.dataflow.v1beta3.ListSnapshotsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.dataflow.v1beta3.ListSnapshotsRequest} ListSnapshotsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSnapshotsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListSnapshotsRequest message. + * @function verify + * @memberof google.dataflow.v1beta3.ListSnapshotsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListSnapshotsRequest.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.jobId != null && message.hasOwnProperty("jobId")) + if (!$util.isString(message.jobId)) + return "jobId: string expected"; + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isString(message.location)) + return "location: string expected"; + return null; + }; + + /** + * Creates a ListSnapshotsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.dataflow.v1beta3.ListSnapshotsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.dataflow.v1beta3.ListSnapshotsRequest} ListSnapshotsRequest + */ + ListSnapshotsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.dataflow.v1beta3.ListSnapshotsRequest) + return object; + var message = new $root.google.dataflow.v1beta3.ListSnapshotsRequest(); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.jobId != null) + message.jobId = String(object.jobId); + if (object.location != null) + message.location = String(object.location); + return message; + }; + + /** + * Creates a plain object from a ListSnapshotsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.dataflow.v1beta3.ListSnapshotsRequest + * @static + * @param {google.dataflow.v1beta3.ListSnapshotsRequest} message ListSnapshotsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListSnapshotsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.projectId = ""; + object.location = ""; + object.jobId = ""; + } + if (message.projectId != null && message.hasOwnProperty("projectId")) + object.projectId = message.projectId; + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + if (message.jobId != null && message.hasOwnProperty("jobId")) + object.jobId = message.jobId; + return object; + }; + + /** + * Converts this ListSnapshotsRequest to JSON. + * @function toJSON + * @memberof google.dataflow.v1beta3.ListSnapshotsRequest + * @instance + * @returns {Object.} JSON object + */ + ListSnapshotsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListSnapshotsRequest + * @function getTypeUrl + * @memberof google.dataflow.v1beta3.ListSnapshotsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListSnapshotsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.dataflow.v1beta3.ListSnapshotsRequest"; + }; + + return ListSnapshotsRequest; + })(); + + v1beta3.ListSnapshotsResponse = (function() { + + /** + * Properties of a ListSnapshotsResponse. + * @memberof google.dataflow.v1beta3 + * @interface IListSnapshotsResponse + * @property {Array.|null} [snapshots] ListSnapshotsResponse snapshots + */ + + /** + * Constructs a new ListSnapshotsResponse. + * @memberof google.dataflow.v1beta3 + * @classdesc Represents a ListSnapshotsResponse. + * @implements IListSnapshotsResponse + * @constructor + * @param {google.dataflow.v1beta3.IListSnapshotsResponse=} [properties] Properties to set + */ + function ListSnapshotsResponse(properties) { + this.snapshots = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListSnapshotsResponse snapshots. + * @member {Array.} snapshots + * @memberof google.dataflow.v1beta3.ListSnapshotsResponse + * @instance + */ + ListSnapshotsResponse.prototype.snapshots = $util.emptyArray; + + /** + * Creates a new ListSnapshotsResponse instance using the specified properties. + * @function create + * @memberof google.dataflow.v1beta3.ListSnapshotsResponse + * @static + * @param {google.dataflow.v1beta3.IListSnapshotsResponse=} [properties] Properties to set + * @returns {google.dataflow.v1beta3.ListSnapshotsResponse} ListSnapshotsResponse instance + */ + ListSnapshotsResponse.create = function create(properties) { + return new ListSnapshotsResponse(properties); + }; + + /** + * Encodes the specified ListSnapshotsResponse message. Does not implicitly {@link google.dataflow.v1beta3.ListSnapshotsResponse.verify|verify} messages. + * @function encode + * @memberof google.dataflow.v1beta3.ListSnapshotsResponse + * @static + * @param {google.dataflow.v1beta3.IListSnapshotsResponse} message ListSnapshotsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSnapshotsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.snapshots != null && message.snapshots.length) + for (var i = 0; i < message.snapshots.length; ++i) + $root.google.dataflow.v1beta3.Snapshot.encode(message.snapshots[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ListSnapshotsResponse message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.ListSnapshotsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.dataflow.v1beta3.ListSnapshotsResponse + * @static + * @param {google.dataflow.v1beta3.IListSnapshotsResponse} message ListSnapshotsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSnapshotsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListSnapshotsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.dataflow.v1beta3.ListSnapshotsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.dataflow.v1beta3.ListSnapshotsResponse} ListSnapshotsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSnapshotsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.dataflow.v1beta3.ListSnapshotsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.snapshots && message.snapshots.length)) + message.snapshots = []; + message.snapshots.push($root.google.dataflow.v1beta3.Snapshot.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListSnapshotsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.dataflow.v1beta3.ListSnapshotsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.dataflow.v1beta3.ListSnapshotsResponse} ListSnapshotsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSnapshotsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListSnapshotsResponse message. + * @function verify + * @memberof google.dataflow.v1beta3.ListSnapshotsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListSnapshotsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.snapshots != null && message.hasOwnProperty("snapshots")) { + if (!Array.isArray(message.snapshots)) + return "snapshots: array expected"; + for (var i = 0; i < message.snapshots.length; ++i) { + var error = $root.google.dataflow.v1beta3.Snapshot.verify(message.snapshots[i]); + if (error) + return "snapshots." + error; + } + } + return null; + }; + + /** + * Creates a ListSnapshotsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.dataflow.v1beta3.ListSnapshotsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.dataflow.v1beta3.ListSnapshotsResponse} ListSnapshotsResponse + */ + ListSnapshotsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.dataflow.v1beta3.ListSnapshotsResponse) + return object; + var message = new $root.google.dataflow.v1beta3.ListSnapshotsResponse(); + if (object.snapshots) { + if (!Array.isArray(object.snapshots)) + throw TypeError(".google.dataflow.v1beta3.ListSnapshotsResponse.snapshots: array expected"); + message.snapshots = []; + for (var i = 0; i < object.snapshots.length; ++i) { + if (typeof object.snapshots[i] !== "object") + throw TypeError(".google.dataflow.v1beta3.ListSnapshotsResponse.snapshots: object expected"); + message.snapshots[i] = $root.google.dataflow.v1beta3.Snapshot.fromObject(object.snapshots[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ListSnapshotsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.dataflow.v1beta3.ListSnapshotsResponse + * @static + * @param {google.dataflow.v1beta3.ListSnapshotsResponse} message ListSnapshotsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListSnapshotsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.snapshots = []; + if (message.snapshots && message.snapshots.length) { + object.snapshots = []; + for (var j = 0; j < message.snapshots.length; ++j) + object.snapshots[j] = $root.google.dataflow.v1beta3.Snapshot.toObject(message.snapshots[j], options); + } + return object; + }; + + /** + * Converts this ListSnapshotsResponse to JSON. + * @function toJSON + * @memberof google.dataflow.v1beta3.ListSnapshotsResponse + * @instance + * @returns {Object.} JSON object + */ + ListSnapshotsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListSnapshotsResponse + * @function getTypeUrl + * @memberof google.dataflow.v1beta3.ListSnapshotsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListSnapshotsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.dataflow.v1beta3.ListSnapshotsResponse"; + }; + + return ListSnapshotsResponse; + })(); + + v1beta3.MessagesV1Beta3 = (function() { + + /** + * Constructs a new MessagesV1Beta3 service. + * @memberof google.dataflow.v1beta3 + * @classdesc Represents a MessagesV1Beta3 + * @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 MessagesV1Beta3(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (MessagesV1Beta3.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = MessagesV1Beta3; + + /** + * Creates new MessagesV1Beta3 service using the specified rpc implementation. + * @function create + * @memberof google.dataflow.v1beta3.MessagesV1Beta3 + * @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 {MessagesV1Beta3} RPC service. Useful where requests and/or responses are streamed. + */ + MessagesV1Beta3.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.dataflow.v1beta3.MessagesV1Beta3|listJobMessages}. + * @memberof google.dataflow.v1beta3.MessagesV1Beta3 + * @typedef ListJobMessagesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.dataflow.v1beta3.ListJobMessagesResponse} [response] ListJobMessagesResponse + */ + + /** + * Calls ListJobMessages. + * @function listJobMessages + * @memberof google.dataflow.v1beta3.MessagesV1Beta3 + * @instance + * @param {google.dataflow.v1beta3.IListJobMessagesRequest} request ListJobMessagesRequest message or plain object + * @param {google.dataflow.v1beta3.MessagesV1Beta3.ListJobMessagesCallback} callback Node-style callback called with the error, if any, and ListJobMessagesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(MessagesV1Beta3.prototype.listJobMessages = function listJobMessages(request, callback) { + return this.rpcCall(listJobMessages, $root.google.dataflow.v1beta3.ListJobMessagesRequest, $root.google.dataflow.v1beta3.ListJobMessagesResponse, request, callback); + }, "name", { value: "ListJobMessages" }); + + /** + * Calls ListJobMessages. + * @function listJobMessages + * @memberof google.dataflow.v1beta3.MessagesV1Beta3 + * @instance + * @param {google.dataflow.v1beta3.IListJobMessagesRequest} request ListJobMessagesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return MessagesV1Beta3; + })(); + + v1beta3.JobMessage = (function() { + + /** + * Properties of a JobMessage. + * @memberof google.dataflow.v1beta3 + * @interface IJobMessage + * @property {string|null} [id] JobMessage id + * @property {google.protobuf.ITimestamp|null} [time] JobMessage time + * @property {string|null} [messageText] JobMessage messageText + * @property {google.dataflow.v1beta3.JobMessageImportance|null} [messageImportance] JobMessage messageImportance + */ + + /** + * Constructs a new JobMessage. + * @memberof google.dataflow.v1beta3 + * @classdesc Represents a JobMessage. + * @implements IJobMessage + * @constructor + * @param {google.dataflow.v1beta3.IJobMessage=} [properties] Properties to set + */ + function JobMessage(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * JobMessage id. + * @member {string} id + * @memberof google.dataflow.v1beta3.JobMessage + * @instance + */ + JobMessage.prototype.id = ""; + + /** + * JobMessage time. + * @member {google.protobuf.ITimestamp|null|undefined} time + * @memberof google.dataflow.v1beta3.JobMessage + * @instance + */ + JobMessage.prototype.time = null; + + /** + * JobMessage messageText. + * @member {string} messageText + * @memberof google.dataflow.v1beta3.JobMessage + * @instance + */ + JobMessage.prototype.messageText = ""; + + /** + * JobMessage messageImportance. + * @member {google.dataflow.v1beta3.JobMessageImportance} messageImportance + * @memberof google.dataflow.v1beta3.JobMessage + * @instance + */ + JobMessage.prototype.messageImportance = 0; + + /** + * Creates a new JobMessage instance using the specified properties. + * @function create + * @memberof google.dataflow.v1beta3.JobMessage + * @static + * @param {google.dataflow.v1beta3.IJobMessage=} [properties] Properties to set + * @returns {google.dataflow.v1beta3.JobMessage} JobMessage instance + */ + JobMessage.create = function create(properties) { + return new JobMessage(properties); + }; + + /** + * Encodes the specified JobMessage message. Does not implicitly {@link google.dataflow.v1beta3.JobMessage.verify|verify} messages. + * @function encode + * @memberof google.dataflow.v1beta3.JobMessage + * @static + * @param {google.dataflow.v1beta3.IJobMessage} message JobMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JobMessage.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.id); + if (message.time != null && Object.hasOwnProperty.call(message, "time")) + $root.google.protobuf.Timestamp.encode(message.time, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.messageText != null && Object.hasOwnProperty.call(message, "messageText")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.messageText); + if (message.messageImportance != null && Object.hasOwnProperty.call(message, "messageImportance")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.messageImportance); + return writer; + }; + + /** + * Encodes the specified JobMessage message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.JobMessage.verify|verify} messages. + * @function encodeDelimited + * @memberof google.dataflow.v1beta3.JobMessage + * @static + * @param {google.dataflow.v1beta3.IJobMessage} message JobMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JobMessage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a JobMessage message from the specified reader or buffer. + * @function decode + * @memberof google.dataflow.v1beta3.JobMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.dataflow.v1beta3.JobMessage} JobMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JobMessage.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.dataflow.v1beta3.JobMessage(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.id = reader.string(); + break; + } + case 2: { + message.time = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.messageText = reader.string(); + break; + } + case 4: { + message.messageImportance = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a JobMessage message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.dataflow.v1beta3.JobMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.dataflow.v1beta3.JobMessage} JobMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JobMessage.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a JobMessage message. + * @function verify + * @memberof google.dataflow.v1beta3.JobMessage + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + JobMessage.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string expected"; + if (message.time != null && message.hasOwnProperty("time")) { + var error = $root.google.protobuf.Timestamp.verify(message.time); + if (error) + return "time." + error; + } + if (message.messageText != null && message.hasOwnProperty("messageText")) + if (!$util.isString(message.messageText)) + return "messageText: string expected"; + if (message.messageImportance != null && message.hasOwnProperty("messageImportance")) + switch (message.messageImportance) { + default: + return "messageImportance: enum value expected"; + case 0: + case 1: + case 2: + case 5: + case 3: + case 4: + break; + } + return null; + }; + + /** + * Creates a JobMessage message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.dataflow.v1beta3.JobMessage + * @static + * @param {Object.} object Plain object + * @returns {google.dataflow.v1beta3.JobMessage} JobMessage + */ + JobMessage.fromObject = function fromObject(object) { + if (object instanceof $root.google.dataflow.v1beta3.JobMessage) + return object; + var message = new $root.google.dataflow.v1beta3.JobMessage(); + if (object.id != null) + message.id = String(object.id); + if (object.time != null) { + if (typeof object.time !== "object") + throw TypeError(".google.dataflow.v1beta3.JobMessage.time: object expected"); + message.time = $root.google.protobuf.Timestamp.fromObject(object.time); + } + if (object.messageText != null) + message.messageText = String(object.messageText); + switch (object.messageImportance) { + default: + if (typeof object.messageImportance === "number") { + message.messageImportance = object.messageImportance; + break; + } + break; + case "JOB_MESSAGE_IMPORTANCE_UNKNOWN": + case 0: + message.messageImportance = 0; + break; + case "JOB_MESSAGE_DEBUG": + case 1: + message.messageImportance = 1; + break; + case "JOB_MESSAGE_DETAILED": + case 2: + message.messageImportance = 2; + break; + case "JOB_MESSAGE_BASIC": + case 5: + message.messageImportance = 5; + break; + case "JOB_MESSAGE_WARNING": + case 3: + message.messageImportance = 3; + break; + case "JOB_MESSAGE_ERROR": + case 4: + message.messageImportance = 4; + break; + } + return message; + }; + + /** + * Creates a plain object from a JobMessage message. Also converts values to other types if specified. + * @function toObject + * @memberof google.dataflow.v1beta3.JobMessage + * @static + * @param {google.dataflow.v1beta3.JobMessage} message JobMessage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + JobMessage.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.id = ""; + object.time = null; + object.messageText = ""; + object.messageImportance = options.enums === String ? "JOB_MESSAGE_IMPORTANCE_UNKNOWN" : 0; + } + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + if (message.time != null && message.hasOwnProperty("time")) + object.time = $root.google.protobuf.Timestamp.toObject(message.time, options); + if (message.messageText != null && message.hasOwnProperty("messageText")) + object.messageText = message.messageText; + if (message.messageImportance != null && message.hasOwnProperty("messageImportance")) + object.messageImportance = options.enums === String ? $root.google.dataflow.v1beta3.JobMessageImportance[message.messageImportance] === undefined ? message.messageImportance : $root.google.dataflow.v1beta3.JobMessageImportance[message.messageImportance] : message.messageImportance; + return object; + }; + + /** + * Converts this JobMessage to JSON. + * @function toJSON + * @memberof google.dataflow.v1beta3.JobMessage + * @instance + * @returns {Object.} JSON object + */ + JobMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for JobMessage + * @function getTypeUrl + * @memberof google.dataflow.v1beta3.JobMessage + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + JobMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.dataflow.v1beta3.JobMessage"; + }; + + return JobMessage; + })(); + + /** + * JobMessageImportance enum. + * @name google.dataflow.v1beta3.JobMessageImportance + * @enum {number} + * @property {number} JOB_MESSAGE_IMPORTANCE_UNKNOWN=0 JOB_MESSAGE_IMPORTANCE_UNKNOWN value + * @property {number} JOB_MESSAGE_DEBUG=1 JOB_MESSAGE_DEBUG value + * @property {number} JOB_MESSAGE_DETAILED=2 JOB_MESSAGE_DETAILED value + * @property {number} JOB_MESSAGE_BASIC=5 JOB_MESSAGE_BASIC value + * @property {number} JOB_MESSAGE_WARNING=3 JOB_MESSAGE_WARNING value + * @property {number} JOB_MESSAGE_ERROR=4 JOB_MESSAGE_ERROR value + */ + v1beta3.JobMessageImportance = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "JOB_MESSAGE_IMPORTANCE_UNKNOWN"] = 0; + values[valuesById[1] = "JOB_MESSAGE_DEBUG"] = 1; + values[valuesById[2] = "JOB_MESSAGE_DETAILED"] = 2; + values[valuesById[5] = "JOB_MESSAGE_BASIC"] = 5; + values[valuesById[3] = "JOB_MESSAGE_WARNING"] = 3; + values[valuesById[4] = "JOB_MESSAGE_ERROR"] = 4; + return values; + })(); + + v1beta3.StructuredMessage = (function() { + + /** + * Properties of a StructuredMessage. + * @memberof google.dataflow.v1beta3 + * @interface IStructuredMessage + * @property {string|null} [messageText] StructuredMessage messageText + * @property {string|null} [messageKey] StructuredMessage messageKey + * @property {Array.|null} [parameters] StructuredMessage parameters + */ + + /** + * Constructs a new StructuredMessage. + * @memberof google.dataflow.v1beta3 + * @classdesc Represents a StructuredMessage. + * @implements IStructuredMessage + * @constructor + * @param {google.dataflow.v1beta3.IStructuredMessage=} [properties] Properties to set + */ + function StructuredMessage(properties) { + this.parameters = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StructuredMessage messageText. + * @member {string} messageText + * @memberof google.dataflow.v1beta3.StructuredMessage + * @instance + */ + StructuredMessage.prototype.messageText = ""; + + /** + * StructuredMessage messageKey. + * @member {string} messageKey + * @memberof google.dataflow.v1beta3.StructuredMessage + * @instance + */ + StructuredMessage.prototype.messageKey = ""; + + /** + * StructuredMessage parameters. + * @member {Array.} parameters + * @memberof google.dataflow.v1beta3.StructuredMessage + * @instance + */ + StructuredMessage.prototype.parameters = $util.emptyArray; + + /** + * Creates a new StructuredMessage instance using the specified properties. + * @function create + * @memberof google.dataflow.v1beta3.StructuredMessage + * @static + * @param {google.dataflow.v1beta3.IStructuredMessage=} [properties] Properties to set + * @returns {google.dataflow.v1beta3.StructuredMessage} StructuredMessage instance + */ + StructuredMessage.create = function create(properties) { + return new StructuredMessage(properties); + }; + + /** + * Encodes the specified StructuredMessage message. Does not implicitly {@link google.dataflow.v1beta3.StructuredMessage.verify|verify} messages. + * @function encode + * @memberof google.dataflow.v1beta3.StructuredMessage + * @static + * @param {google.dataflow.v1beta3.IStructuredMessage} message StructuredMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StructuredMessage.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.messageText != null && Object.hasOwnProperty.call(message, "messageText")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.messageText); + if (message.messageKey != null && Object.hasOwnProperty.call(message, "messageKey")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.messageKey); + if (message.parameters != null && message.parameters.length) + for (var i = 0; i < message.parameters.length; ++i) + $root.google.dataflow.v1beta3.StructuredMessage.Parameter.encode(message.parameters[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified StructuredMessage message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.StructuredMessage.verify|verify} messages. + * @function encodeDelimited + * @memberof google.dataflow.v1beta3.StructuredMessage + * @static + * @param {google.dataflow.v1beta3.IStructuredMessage} message StructuredMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StructuredMessage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StructuredMessage message from the specified reader or buffer. + * @function decode + * @memberof google.dataflow.v1beta3.StructuredMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.dataflow.v1beta3.StructuredMessage} StructuredMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StructuredMessage.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.dataflow.v1beta3.StructuredMessage(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.messageText = reader.string(); + break; + } + case 2: { + message.messageKey = reader.string(); + break; + } + case 3: { + if (!(message.parameters && message.parameters.length)) + message.parameters = []; + message.parameters.push($root.google.dataflow.v1beta3.StructuredMessage.Parameter.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StructuredMessage message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.dataflow.v1beta3.StructuredMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.dataflow.v1beta3.StructuredMessage} StructuredMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StructuredMessage.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StructuredMessage message. + * @function verify + * @memberof google.dataflow.v1beta3.StructuredMessage + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StructuredMessage.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.messageText != null && message.hasOwnProperty("messageText")) + if (!$util.isString(message.messageText)) + return "messageText: string expected"; + if (message.messageKey != null && message.hasOwnProperty("messageKey")) + if (!$util.isString(message.messageKey)) + return "messageKey: string expected"; + if (message.parameters != null && message.hasOwnProperty("parameters")) { + if (!Array.isArray(message.parameters)) + return "parameters: array expected"; + for (var i = 0; i < message.parameters.length; ++i) { + var error = $root.google.dataflow.v1beta3.StructuredMessage.Parameter.verify(message.parameters[i]); + if (error) + return "parameters." + error; + } + } + return null; + }; + + /** + * Creates a StructuredMessage message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.dataflow.v1beta3.StructuredMessage + * @static + * @param {Object.} object Plain object + * @returns {google.dataflow.v1beta3.StructuredMessage} StructuredMessage + */ + StructuredMessage.fromObject = function fromObject(object) { + if (object instanceof $root.google.dataflow.v1beta3.StructuredMessage) + return object; + var message = new $root.google.dataflow.v1beta3.StructuredMessage(); + if (object.messageText != null) + message.messageText = String(object.messageText); + if (object.messageKey != null) + message.messageKey = String(object.messageKey); + if (object.parameters) { + if (!Array.isArray(object.parameters)) + throw TypeError(".google.dataflow.v1beta3.StructuredMessage.parameters: array expected"); + message.parameters = []; + for (var i = 0; i < object.parameters.length; ++i) { + if (typeof object.parameters[i] !== "object") + throw TypeError(".google.dataflow.v1beta3.StructuredMessage.parameters: object expected"); + message.parameters[i] = $root.google.dataflow.v1beta3.StructuredMessage.Parameter.fromObject(object.parameters[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a StructuredMessage message. Also converts values to other types if specified. + * @function toObject + * @memberof google.dataflow.v1beta3.StructuredMessage + * @static + * @param {google.dataflow.v1beta3.StructuredMessage} message StructuredMessage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StructuredMessage.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.parameters = []; + if (options.defaults) { + object.messageText = ""; + object.messageKey = ""; + } + if (message.messageText != null && message.hasOwnProperty("messageText")) + object.messageText = message.messageText; + if (message.messageKey != null && message.hasOwnProperty("messageKey")) + object.messageKey = message.messageKey; + if (message.parameters && message.parameters.length) { + object.parameters = []; + for (var j = 0; j < message.parameters.length; ++j) + object.parameters[j] = $root.google.dataflow.v1beta3.StructuredMessage.Parameter.toObject(message.parameters[j], options); + } + return object; + }; + + /** + * Converts this StructuredMessage to JSON. + * @function toJSON + * @memberof google.dataflow.v1beta3.StructuredMessage + * @instance + * @returns {Object.} JSON object + */ + StructuredMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StructuredMessage + * @function getTypeUrl + * @memberof google.dataflow.v1beta3.StructuredMessage + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StructuredMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.dataflow.v1beta3.StructuredMessage"; + }; + + StructuredMessage.Parameter = (function() { + + /** + * Properties of a Parameter. + * @memberof google.dataflow.v1beta3.StructuredMessage + * @interface IParameter + * @property {string|null} [key] Parameter key + * @property {google.protobuf.IValue|null} [value] Parameter value + */ + + /** + * Constructs a new Parameter. + * @memberof google.dataflow.v1beta3.StructuredMessage + * @classdesc Represents a Parameter. + * @implements IParameter + * @constructor + * @param {google.dataflow.v1beta3.StructuredMessage.IParameter=} [properties] Properties to set + */ + function Parameter(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Parameter key. + * @member {string} key + * @memberof google.dataflow.v1beta3.StructuredMessage.Parameter + * @instance + */ + Parameter.prototype.key = ""; + + /** + * Parameter value. + * @member {google.protobuf.IValue|null|undefined} value + * @memberof google.dataflow.v1beta3.StructuredMessage.Parameter + * @instance + */ + Parameter.prototype.value = null; + + /** + * Creates a new Parameter instance using the specified properties. + * @function create + * @memberof google.dataflow.v1beta3.StructuredMessage.Parameter + * @static + * @param {google.dataflow.v1beta3.StructuredMessage.IParameter=} [properties] Properties to set + * @returns {google.dataflow.v1beta3.StructuredMessage.Parameter} Parameter instance + */ + Parameter.create = function create(properties) { + return new Parameter(properties); + }; + + /** + * Encodes the specified Parameter message. Does not implicitly {@link google.dataflow.v1beta3.StructuredMessage.Parameter.verify|verify} messages. + * @function encode + * @memberof google.dataflow.v1beta3.StructuredMessage.Parameter + * @static + * @param {google.dataflow.v1beta3.StructuredMessage.IParameter} message Parameter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Parameter.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.key != null && Object.hasOwnProperty.call(message, "key")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.key); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + $root.google.protobuf.Value.encode(message.value, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Parameter message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.StructuredMessage.Parameter.verify|verify} messages. + * @function encodeDelimited + * @memberof google.dataflow.v1beta3.StructuredMessage.Parameter + * @static + * @param {google.dataflow.v1beta3.StructuredMessage.IParameter} message Parameter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Parameter.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Parameter message from the specified reader or buffer. + * @function decode + * @memberof google.dataflow.v1beta3.StructuredMessage.Parameter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.dataflow.v1beta3.StructuredMessage.Parameter} Parameter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Parameter.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.dataflow.v1beta3.StructuredMessage.Parameter(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.key = reader.string(); + break; + } + case 2: { + message.value = $root.google.protobuf.Value.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Parameter message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.dataflow.v1beta3.StructuredMessage.Parameter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.dataflow.v1beta3.StructuredMessage.Parameter} Parameter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Parameter.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Parameter message. + * @function verify + * @memberof google.dataflow.v1beta3.StructuredMessage.Parameter + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Parameter.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.key != null && message.hasOwnProperty("key")) + if (!$util.isString(message.key)) + return "key: string expected"; + if (message.value != null && message.hasOwnProperty("value")) { + var error = $root.google.protobuf.Value.verify(message.value); + if (error) + return "value." + error; + } + return null; + }; + + /** + * Creates a Parameter message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.dataflow.v1beta3.StructuredMessage.Parameter + * @static + * @param {Object.} object Plain object + * @returns {google.dataflow.v1beta3.StructuredMessage.Parameter} Parameter + */ + Parameter.fromObject = function fromObject(object) { + if (object instanceof $root.google.dataflow.v1beta3.StructuredMessage.Parameter) + return object; + var message = new $root.google.dataflow.v1beta3.StructuredMessage.Parameter(); + if (object.key != null) + message.key = String(object.key); + if (object.value != null) { + if (typeof object.value !== "object") + throw TypeError(".google.dataflow.v1beta3.StructuredMessage.Parameter.value: object expected"); + message.value = $root.google.protobuf.Value.fromObject(object.value); + } + return message; + }; + + /** + * Creates a plain object from a Parameter message. Also converts values to other types if specified. + * @function toObject + * @memberof google.dataflow.v1beta3.StructuredMessage.Parameter + * @static + * @param {google.dataflow.v1beta3.StructuredMessage.Parameter} message Parameter + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Parameter.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.key = ""; + object.value = null; + } + if (message.key != null && message.hasOwnProperty("key")) + object.key = message.key; + if (message.value != null && message.hasOwnProperty("value")) + object.value = $root.google.protobuf.Value.toObject(message.value, options); + return object; + }; + + /** + * Converts this Parameter to JSON. + * @function toJSON + * @memberof google.dataflow.v1beta3.StructuredMessage.Parameter + * @instance + * @returns {Object.} JSON object + */ + Parameter.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Parameter + * @function getTypeUrl + * @memberof google.dataflow.v1beta3.StructuredMessage.Parameter + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Parameter.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.dataflow.v1beta3.StructuredMessage.Parameter"; + }; + + return Parameter; + })(); + + return StructuredMessage; + })(); + + v1beta3.AutoscalingEvent = (function() { + + /** + * Properties of an AutoscalingEvent. + * @memberof google.dataflow.v1beta3 + * @interface IAutoscalingEvent + * @property {number|Long|null} [currentNumWorkers] AutoscalingEvent currentNumWorkers + * @property {number|Long|null} [targetNumWorkers] AutoscalingEvent targetNumWorkers + * @property {google.dataflow.v1beta3.AutoscalingEvent.AutoscalingEventType|null} [eventType] AutoscalingEvent eventType + * @property {google.dataflow.v1beta3.IStructuredMessage|null} [description] AutoscalingEvent description + * @property {google.protobuf.ITimestamp|null} [time] AutoscalingEvent time + * @property {string|null} [workerPool] AutoscalingEvent workerPool + */ + + /** + * Constructs a new AutoscalingEvent. + * @memberof google.dataflow.v1beta3 + * @classdesc Represents an AutoscalingEvent. + * @implements IAutoscalingEvent + * @constructor + * @param {google.dataflow.v1beta3.IAutoscalingEvent=} [properties] Properties to set + */ + function AutoscalingEvent(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AutoscalingEvent currentNumWorkers. + * @member {number|Long} currentNumWorkers + * @memberof google.dataflow.v1beta3.AutoscalingEvent + * @instance + */ + AutoscalingEvent.prototype.currentNumWorkers = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * AutoscalingEvent targetNumWorkers. + * @member {number|Long} targetNumWorkers + * @memberof google.dataflow.v1beta3.AutoscalingEvent + * @instance + */ + AutoscalingEvent.prototype.targetNumWorkers = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * AutoscalingEvent eventType. + * @member {google.dataflow.v1beta3.AutoscalingEvent.AutoscalingEventType} eventType + * @memberof google.dataflow.v1beta3.AutoscalingEvent + * @instance + */ + AutoscalingEvent.prototype.eventType = 0; + + /** + * AutoscalingEvent description. + * @member {google.dataflow.v1beta3.IStructuredMessage|null|undefined} description + * @memberof google.dataflow.v1beta3.AutoscalingEvent + * @instance + */ + AutoscalingEvent.prototype.description = null; + + /** + * AutoscalingEvent time. + * @member {google.protobuf.ITimestamp|null|undefined} time + * @memberof google.dataflow.v1beta3.AutoscalingEvent + * @instance + */ + AutoscalingEvent.prototype.time = null; + + /** + * AutoscalingEvent workerPool. + * @member {string} workerPool + * @memberof google.dataflow.v1beta3.AutoscalingEvent + * @instance + */ + AutoscalingEvent.prototype.workerPool = ""; + + /** + * Creates a new AutoscalingEvent instance using the specified properties. + * @function create + * @memberof google.dataflow.v1beta3.AutoscalingEvent + * @static + * @param {google.dataflow.v1beta3.IAutoscalingEvent=} [properties] Properties to set + * @returns {google.dataflow.v1beta3.AutoscalingEvent} AutoscalingEvent instance + */ + AutoscalingEvent.create = function create(properties) { + return new AutoscalingEvent(properties); + }; + + /** + * Encodes the specified AutoscalingEvent message. Does not implicitly {@link google.dataflow.v1beta3.AutoscalingEvent.verify|verify} messages. + * @function encode + * @memberof google.dataflow.v1beta3.AutoscalingEvent + * @static + * @param {google.dataflow.v1beta3.IAutoscalingEvent} message AutoscalingEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AutoscalingEvent.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.currentNumWorkers != null && Object.hasOwnProperty.call(message, "currentNumWorkers")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.currentNumWorkers); + if (message.targetNumWorkers != null && Object.hasOwnProperty.call(message, "targetNumWorkers")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.targetNumWorkers); + if (message.eventType != null && Object.hasOwnProperty.call(message, "eventType")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.eventType); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + $root.google.dataflow.v1beta3.StructuredMessage.encode(message.description, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.time != null && Object.hasOwnProperty.call(message, "time")) + $root.google.protobuf.Timestamp.encode(message.time, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.workerPool != null && Object.hasOwnProperty.call(message, "workerPool")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.workerPool); + return writer; + }; + + /** + * Encodes the specified AutoscalingEvent message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.AutoscalingEvent.verify|verify} messages. + * @function encodeDelimited + * @memberof google.dataflow.v1beta3.AutoscalingEvent + * @static + * @param {google.dataflow.v1beta3.IAutoscalingEvent} message AutoscalingEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AutoscalingEvent.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AutoscalingEvent message from the specified reader or buffer. + * @function decode + * @memberof google.dataflow.v1beta3.AutoscalingEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.dataflow.v1beta3.AutoscalingEvent} AutoscalingEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AutoscalingEvent.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.dataflow.v1beta3.AutoscalingEvent(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.currentNumWorkers = reader.int64(); + break; + } + case 2: { + message.targetNumWorkers = reader.int64(); + break; + } + case 3: { + message.eventType = reader.int32(); + break; + } + case 4: { + message.description = $root.google.dataflow.v1beta3.StructuredMessage.decode(reader, reader.uint32()); + break; + } + case 5: { + message.time = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 7: { + message.workerPool = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AutoscalingEvent message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.dataflow.v1beta3.AutoscalingEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.dataflow.v1beta3.AutoscalingEvent} AutoscalingEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AutoscalingEvent.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AutoscalingEvent message. + * @function verify + * @memberof google.dataflow.v1beta3.AutoscalingEvent + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AutoscalingEvent.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.currentNumWorkers != null && message.hasOwnProperty("currentNumWorkers")) + if (!$util.isInteger(message.currentNumWorkers) && !(message.currentNumWorkers && $util.isInteger(message.currentNumWorkers.low) && $util.isInteger(message.currentNumWorkers.high))) + return "currentNumWorkers: integer|Long expected"; + if (message.targetNumWorkers != null && message.hasOwnProperty("targetNumWorkers")) + if (!$util.isInteger(message.targetNumWorkers) && !(message.targetNumWorkers && $util.isInteger(message.targetNumWorkers.low) && $util.isInteger(message.targetNumWorkers.high))) + return "targetNumWorkers: integer|Long expected"; + if (message.eventType != null && message.hasOwnProperty("eventType")) + switch (message.eventType) { + default: + return "eventType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.description != null && message.hasOwnProperty("description")) { + var error = $root.google.dataflow.v1beta3.StructuredMessage.verify(message.description); + if (error) + return "description." + error; + } + if (message.time != null && message.hasOwnProperty("time")) { + var error = $root.google.protobuf.Timestamp.verify(message.time); + if (error) + return "time." + error; + } + if (message.workerPool != null && message.hasOwnProperty("workerPool")) + if (!$util.isString(message.workerPool)) + return "workerPool: string expected"; + return null; + }; + + /** + * Creates an AutoscalingEvent message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.dataflow.v1beta3.AutoscalingEvent + * @static + * @param {Object.} object Plain object + * @returns {google.dataflow.v1beta3.AutoscalingEvent} AutoscalingEvent + */ + AutoscalingEvent.fromObject = function fromObject(object) { + if (object instanceof $root.google.dataflow.v1beta3.AutoscalingEvent) + return object; + var message = new $root.google.dataflow.v1beta3.AutoscalingEvent(); + if (object.currentNumWorkers != null) + if ($util.Long) + (message.currentNumWorkers = $util.Long.fromValue(object.currentNumWorkers)).unsigned = false; + else if (typeof object.currentNumWorkers === "string") + message.currentNumWorkers = parseInt(object.currentNumWorkers, 10); + else if (typeof object.currentNumWorkers === "number") + message.currentNumWorkers = object.currentNumWorkers; + else if (typeof object.currentNumWorkers === "object") + message.currentNumWorkers = new $util.LongBits(object.currentNumWorkers.low >>> 0, object.currentNumWorkers.high >>> 0).toNumber(); + if (object.targetNumWorkers != null) + if ($util.Long) + (message.targetNumWorkers = $util.Long.fromValue(object.targetNumWorkers)).unsigned = false; + else if (typeof object.targetNumWorkers === "string") + message.targetNumWorkers = parseInt(object.targetNumWorkers, 10); + else if (typeof object.targetNumWorkers === "number") + message.targetNumWorkers = object.targetNumWorkers; + else if (typeof object.targetNumWorkers === "object") + message.targetNumWorkers = new $util.LongBits(object.targetNumWorkers.low >>> 0, object.targetNumWorkers.high >>> 0).toNumber(); + switch (object.eventType) { + default: + if (typeof object.eventType === "number") { + message.eventType = object.eventType; + break; + } + break; + case "TYPE_UNKNOWN": + case 0: + message.eventType = 0; + break; + case "TARGET_NUM_WORKERS_CHANGED": + case 1: + message.eventType = 1; + break; + case "CURRENT_NUM_WORKERS_CHANGED": + case 2: + message.eventType = 2; + break; + case "ACTUATION_FAILURE": + case 3: + message.eventType = 3; + break; + case "NO_CHANGE": + case 4: + message.eventType = 4; + break; + } + if (object.description != null) { + if (typeof object.description !== "object") + throw TypeError(".google.dataflow.v1beta3.AutoscalingEvent.description: object expected"); + message.description = $root.google.dataflow.v1beta3.StructuredMessage.fromObject(object.description); + } + if (object.time != null) { + if (typeof object.time !== "object") + throw TypeError(".google.dataflow.v1beta3.AutoscalingEvent.time: object expected"); + message.time = $root.google.protobuf.Timestamp.fromObject(object.time); + } + if (object.workerPool != null) + message.workerPool = String(object.workerPool); + return message; + }; + + /** + * Creates a plain object from an AutoscalingEvent message. Also converts values to other types if specified. + * @function toObject + * @memberof google.dataflow.v1beta3.AutoscalingEvent + * @static + * @param {google.dataflow.v1beta3.AutoscalingEvent} message AutoscalingEvent + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AutoscalingEvent.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.currentNumWorkers = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.currentNumWorkers = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.targetNumWorkers = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.targetNumWorkers = options.longs === String ? "0" : 0; + object.eventType = options.enums === String ? "TYPE_UNKNOWN" : 0; + object.description = null; + object.time = null; + object.workerPool = ""; + } + if (message.currentNumWorkers != null && message.hasOwnProperty("currentNumWorkers")) + if (typeof message.currentNumWorkers === "number") + object.currentNumWorkers = options.longs === String ? String(message.currentNumWorkers) : message.currentNumWorkers; + else + object.currentNumWorkers = options.longs === String ? $util.Long.prototype.toString.call(message.currentNumWorkers) : options.longs === Number ? new $util.LongBits(message.currentNumWorkers.low >>> 0, message.currentNumWorkers.high >>> 0).toNumber() : message.currentNumWorkers; + if (message.targetNumWorkers != null && message.hasOwnProperty("targetNumWorkers")) + if (typeof message.targetNumWorkers === "number") + object.targetNumWorkers = options.longs === String ? String(message.targetNumWorkers) : message.targetNumWorkers; + else + object.targetNumWorkers = options.longs === String ? $util.Long.prototype.toString.call(message.targetNumWorkers) : options.longs === Number ? new $util.LongBits(message.targetNumWorkers.low >>> 0, message.targetNumWorkers.high >>> 0).toNumber() : message.targetNumWorkers; + if (message.eventType != null && message.hasOwnProperty("eventType")) + object.eventType = options.enums === String ? $root.google.dataflow.v1beta3.AutoscalingEvent.AutoscalingEventType[message.eventType] === undefined ? message.eventType : $root.google.dataflow.v1beta3.AutoscalingEvent.AutoscalingEventType[message.eventType] : message.eventType; + if (message.description != null && message.hasOwnProperty("description")) + object.description = $root.google.dataflow.v1beta3.StructuredMessage.toObject(message.description, options); + if (message.time != null && message.hasOwnProperty("time")) + object.time = $root.google.protobuf.Timestamp.toObject(message.time, options); + if (message.workerPool != null && message.hasOwnProperty("workerPool")) + object.workerPool = message.workerPool; + return object; + }; + + /** + * Converts this AutoscalingEvent to JSON. + * @function toJSON + * @memberof google.dataflow.v1beta3.AutoscalingEvent + * @instance + * @returns {Object.} JSON object + */ + AutoscalingEvent.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AutoscalingEvent + * @function getTypeUrl + * @memberof google.dataflow.v1beta3.AutoscalingEvent + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AutoscalingEvent.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.dataflow.v1beta3.AutoscalingEvent"; + }; + + /** + * AutoscalingEventType enum. + * @name google.dataflow.v1beta3.AutoscalingEvent.AutoscalingEventType + * @enum {number} + * @property {number} TYPE_UNKNOWN=0 TYPE_UNKNOWN value + * @property {number} TARGET_NUM_WORKERS_CHANGED=1 TARGET_NUM_WORKERS_CHANGED value + * @property {number} CURRENT_NUM_WORKERS_CHANGED=2 CURRENT_NUM_WORKERS_CHANGED value + * @property {number} ACTUATION_FAILURE=3 ACTUATION_FAILURE value + * @property {number} NO_CHANGE=4 NO_CHANGE value + */ + AutoscalingEvent.AutoscalingEventType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TYPE_UNKNOWN"] = 0; + values[valuesById[1] = "TARGET_NUM_WORKERS_CHANGED"] = 1; + values[valuesById[2] = "CURRENT_NUM_WORKERS_CHANGED"] = 2; + values[valuesById[3] = "ACTUATION_FAILURE"] = 3; + values[valuesById[4] = "NO_CHANGE"] = 4; + return values; + })(); + + return AutoscalingEvent; + })(); + + v1beta3.ListJobMessagesRequest = (function() { + + /** + * Properties of a ListJobMessagesRequest. + * @memberof google.dataflow.v1beta3 + * @interface IListJobMessagesRequest + * @property {string|null} [projectId] ListJobMessagesRequest projectId + * @property {string|null} [jobId] ListJobMessagesRequest jobId + * @property {google.dataflow.v1beta3.JobMessageImportance|null} [minimumImportance] ListJobMessagesRequest minimumImportance + * @property {number|null} [pageSize] ListJobMessagesRequest pageSize + * @property {string|null} [pageToken] ListJobMessagesRequest pageToken + * @property {google.protobuf.ITimestamp|null} [startTime] ListJobMessagesRequest startTime + * @property {google.protobuf.ITimestamp|null} [endTime] ListJobMessagesRequest endTime + * @property {string|null} [location] ListJobMessagesRequest location + */ + + /** + * Constructs a new ListJobMessagesRequest. + * @memberof google.dataflow.v1beta3 + * @classdesc Represents a ListJobMessagesRequest. + * @implements IListJobMessagesRequest + * @constructor + * @param {google.dataflow.v1beta3.IListJobMessagesRequest=} [properties] Properties to set + */ + function ListJobMessagesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListJobMessagesRequest projectId. + * @member {string} projectId + * @memberof google.dataflow.v1beta3.ListJobMessagesRequest + * @instance + */ + ListJobMessagesRequest.prototype.projectId = ""; + + /** + * ListJobMessagesRequest jobId. + * @member {string} jobId + * @memberof google.dataflow.v1beta3.ListJobMessagesRequest + * @instance + */ + ListJobMessagesRequest.prototype.jobId = ""; + + /** + * ListJobMessagesRequest minimumImportance. + * @member {google.dataflow.v1beta3.JobMessageImportance} minimumImportance + * @memberof google.dataflow.v1beta3.ListJobMessagesRequest + * @instance + */ + ListJobMessagesRequest.prototype.minimumImportance = 0; + + /** + * ListJobMessagesRequest pageSize. + * @member {number} pageSize + * @memberof google.dataflow.v1beta3.ListJobMessagesRequest + * @instance + */ + ListJobMessagesRequest.prototype.pageSize = 0; + + /** + * ListJobMessagesRequest pageToken. + * @member {string} pageToken + * @memberof google.dataflow.v1beta3.ListJobMessagesRequest + * @instance + */ + ListJobMessagesRequest.prototype.pageToken = ""; + + /** + * ListJobMessagesRequest startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.dataflow.v1beta3.ListJobMessagesRequest + * @instance + */ + ListJobMessagesRequest.prototype.startTime = null; + + /** + * ListJobMessagesRequest endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.dataflow.v1beta3.ListJobMessagesRequest + * @instance + */ + ListJobMessagesRequest.prototype.endTime = null; + + /** + * ListJobMessagesRequest location. + * @member {string} location + * @memberof google.dataflow.v1beta3.ListJobMessagesRequest + * @instance + */ + ListJobMessagesRequest.prototype.location = ""; + + /** + * Creates a new ListJobMessagesRequest instance using the specified properties. + * @function create + * @memberof google.dataflow.v1beta3.ListJobMessagesRequest + * @static + * @param {google.dataflow.v1beta3.IListJobMessagesRequest=} [properties] Properties to set + * @returns {google.dataflow.v1beta3.ListJobMessagesRequest} ListJobMessagesRequest instance + */ + ListJobMessagesRequest.create = function create(properties) { + return new ListJobMessagesRequest(properties); + }; + + /** + * Encodes the specified ListJobMessagesRequest message. Does not implicitly {@link google.dataflow.v1beta3.ListJobMessagesRequest.verify|verify} messages. + * @function encode + * @memberof google.dataflow.v1beta3.ListJobMessagesRequest + * @static + * @param {google.dataflow.v1beta3.IListJobMessagesRequest} message ListJobMessagesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListJobMessagesRequest.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.jobId != null && Object.hasOwnProperty.call(message, "jobId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.jobId); + if (message.minimumImportance != null && Object.hasOwnProperty.call(message, "minimumImportance")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.minimumImportance); + 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); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.location); + return writer; + }; + + /** + * Encodes the specified ListJobMessagesRequest message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.ListJobMessagesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.dataflow.v1beta3.ListJobMessagesRequest + * @static + * @param {google.dataflow.v1beta3.IListJobMessagesRequest} message ListJobMessagesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListJobMessagesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListJobMessagesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.dataflow.v1beta3.ListJobMessagesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.dataflow.v1beta3.ListJobMessagesRequest} ListJobMessagesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListJobMessagesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.dataflow.v1beta3.ListJobMessagesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.projectId = reader.string(); + break; + } + case 2: { + message.jobId = reader.string(); + break; + } + case 3: { + message.minimumImportance = reader.int32(); + break; + } + case 4: { + message.pageSize = reader.int32(); + break; + } + case 5: { + message.pageToken = reader.string(); + break; + } + case 6: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 7: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 8: { + message.location = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListJobMessagesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.dataflow.v1beta3.ListJobMessagesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.dataflow.v1beta3.ListJobMessagesRequest} ListJobMessagesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListJobMessagesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListJobMessagesRequest message. + * @function verify + * @memberof google.dataflow.v1beta3.ListJobMessagesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListJobMessagesRequest.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.jobId != null && message.hasOwnProperty("jobId")) + if (!$util.isString(message.jobId)) + return "jobId: string expected"; + if (message.minimumImportance != null && message.hasOwnProperty("minimumImportance")) + switch (message.minimumImportance) { + default: + return "minimumImportance: enum value expected"; + case 0: + case 1: + case 2: + case 5: + case 3: + case 4: + break; + } + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + 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.location != null && message.hasOwnProperty("location")) + if (!$util.isString(message.location)) + return "location: string expected"; + return null; + }; + + /** + * Creates a ListJobMessagesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.dataflow.v1beta3.ListJobMessagesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.dataflow.v1beta3.ListJobMessagesRequest} ListJobMessagesRequest + */ + ListJobMessagesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.dataflow.v1beta3.ListJobMessagesRequest) + return object; + var message = new $root.google.dataflow.v1beta3.ListJobMessagesRequest(); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.jobId != null) + message.jobId = String(object.jobId); + switch (object.minimumImportance) { + default: + if (typeof object.minimumImportance === "number") { + message.minimumImportance = object.minimumImportance; + break; + } + break; + case "JOB_MESSAGE_IMPORTANCE_UNKNOWN": + case 0: + message.minimumImportance = 0; + break; + case "JOB_MESSAGE_DEBUG": + case 1: + message.minimumImportance = 1; + break; + case "JOB_MESSAGE_DETAILED": + case 2: + message.minimumImportance = 2; + break; + case "JOB_MESSAGE_BASIC": + case 5: + message.minimumImportance = 5; + break; + case "JOB_MESSAGE_WARNING": + case 3: + message.minimumImportance = 3; + break; + case "JOB_MESSAGE_ERROR": + case 4: + message.minimumImportance = 4; + break; + } + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.dataflow.v1beta3.ListJobMessagesRequest.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.dataflow.v1beta3.ListJobMessagesRequest.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + if (object.location != null) + message.location = String(object.location); + return message; + }; + + /** + * Creates a plain object from a ListJobMessagesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.dataflow.v1beta3.ListJobMessagesRequest + * @static + * @param {google.dataflow.v1beta3.ListJobMessagesRequest} message ListJobMessagesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListJobMessagesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.projectId = ""; + object.jobId = ""; + object.minimumImportance = options.enums === String ? "JOB_MESSAGE_IMPORTANCE_UNKNOWN" : 0; + object.pageSize = 0; + object.pageToken = ""; + object.startTime = null; + object.endTime = null; + object.location = ""; + } + if (message.projectId != null && message.hasOwnProperty("projectId")) + object.projectId = message.projectId; + if (message.jobId != null && message.hasOwnProperty("jobId")) + object.jobId = message.jobId; + if (message.minimumImportance != null && message.hasOwnProperty("minimumImportance")) + object.minimumImportance = options.enums === String ? $root.google.dataflow.v1beta3.JobMessageImportance[message.minimumImportance] === undefined ? message.minimumImportance : $root.google.dataflow.v1beta3.JobMessageImportance[message.minimumImportance] : message.minimumImportance; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + 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.location != null && message.hasOwnProperty("location")) + object.location = message.location; + return object; + }; + + /** + * Converts this ListJobMessagesRequest to JSON. + * @function toJSON + * @memberof google.dataflow.v1beta3.ListJobMessagesRequest + * @instance + * @returns {Object.} JSON object + */ + ListJobMessagesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListJobMessagesRequest + * @function getTypeUrl + * @memberof google.dataflow.v1beta3.ListJobMessagesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListJobMessagesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.dataflow.v1beta3.ListJobMessagesRequest"; + }; + + return ListJobMessagesRequest; + })(); + + v1beta3.ListJobMessagesResponse = (function() { + + /** + * Properties of a ListJobMessagesResponse. + * @memberof google.dataflow.v1beta3 + * @interface IListJobMessagesResponse + * @property {Array.|null} [jobMessages] ListJobMessagesResponse jobMessages + * @property {string|null} [nextPageToken] ListJobMessagesResponse nextPageToken + * @property {Array.|null} [autoscalingEvents] ListJobMessagesResponse autoscalingEvents + */ + + /** + * Constructs a new ListJobMessagesResponse. + * @memberof google.dataflow.v1beta3 + * @classdesc Represents a ListJobMessagesResponse. + * @implements IListJobMessagesResponse + * @constructor + * @param {google.dataflow.v1beta3.IListJobMessagesResponse=} [properties] Properties to set + */ + function ListJobMessagesResponse(properties) { + this.jobMessages = []; + this.autoscalingEvents = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListJobMessagesResponse jobMessages. + * @member {Array.} jobMessages + * @memberof google.dataflow.v1beta3.ListJobMessagesResponse + * @instance + */ + ListJobMessagesResponse.prototype.jobMessages = $util.emptyArray; + + /** + * ListJobMessagesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.dataflow.v1beta3.ListJobMessagesResponse + * @instance + */ + ListJobMessagesResponse.prototype.nextPageToken = ""; + + /** + * ListJobMessagesResponse autoscalingEvents. + * @member {Array.} autoscalingEvents + * @memberof google.dataflow.v1beta3.ListJobMessagesResponse + * @instance + */ + ListJobMessagesResponse.prototype.autoscalingEvents = $util.emptyArray; + + /** + * Creates a new ListJobMessagesResponse instance using the specified properties. + * @function create + * @memberof google.dataflow.v1beta3.ListJobMessagesResponse + * @static + * @param {google.dataflow.v1beta3.IListJobMessagesResponse=} [properties] Properties to set + * @returns {google.dataflow.v1beta3.ListJobMessagesResponse} ListJobMessagesResponse instance + */ + ListJobMessagesResponse.create = function create(properties) { + return new ListJobMessagesResponse(properties); + }; + + /** + * Encodes the specified ListJobMessagesResponse message. Does not implicitly {@link google.dataflow.v1beta3.ListJobMessagesResponse.verify|verify} messages. + * @function encode + * @memberof google.dataflow.v1beta3.ListJobMessagesResponse + * @static + * @param {google.dataflow.v1beta3.IListJobMessagesResponse} message ListJobMessagesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListJobMessagesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.jobMessages != null && message.jobMessages.length) + for (var i = 0; i < message.jobMessages.length; ++i) + $root.google.dataflow.v1beta3.JobMessage.encode(message.jobMessages[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.autoscalingEvents != null && message.autoscalingEvents.length) + for (var i = 0; i < message.autoscalingEvents.length; ++i) + $root.google.dataflow.v1beta3.AutoscalingEvent.encode(message.autoscalingEvents[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ListJobMessagesResponse message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.ListJobMessagesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.dataflow.v1beta3.ListJobMessagesResponse + * @static + * @param {google.dataflow.v1beta3.IListJobMessagesResponse} message ListJobMessagesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListJobMessagesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListJobMessagesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.dataflow.v1beta3.ListJobMessagesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.dataflow.v1beta3.ListJobMessagesResponse} ListJobMessagesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListJobMessagesResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.dataflow.v1beta3.ListJobMessagesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.jobMessages && message.jobMessages.length)) + message.jobMessages = []; + message.jobMessages.push($root.google.dataflow.v1beta3.JobMessage.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 3: { + if (!(message.autoscalingEvents && message.autoscalingEvents.length)) + message.autoscalingEvents = []; + message.autoscalingEvents.push($root.google.dataflow.v1beta3.AutoscalingEvent.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListJobMessagesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.dataflow.v1beta3.ListJobMessagesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.dataflow.v1beta3.ListJobMessagesResponse} ListJobMessagesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListJobMessagesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListJobMessagesResponse message. + * @function verify + * @memberof google.dataflow.v1beta3.ListJobMessagesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListJobMessagesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.jobMessages != null && message.hasOwnProperty("jobMessages")) { + if (!Array.isArray(message.jobMessages)) + return "jobMessages: array expected"; + for (var i = 0; i < message.jobMessages.length; ++i) { + var error = $root.google.dataflow.v1beta3.JobMessage.verify(message.jobMessages[i]); + if (error) + return "jobMessages." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.autoscalingEvents != null && message.hasOwnProperty("autoscalingEvents")) { + if (!Array.isArray(message.autoscalingEvents)) + return "autoscalingEvents: array expected"; + for (var i = 0; i < message.autoscalingEvents.length; ++i) { + var error = $root.google.dataflow.v1beta3.AutoscalingEvent.verify(message.autoscalingEvents[i]); + if (error) + return "autoscalingEvents." + error; + } + } + return null; + }; + + /** + * Creates a ListJobMessagesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.dataflow.v1beta3.ListJobMessagesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.dataflow.v1beta3.ListJobMessagesResponse} ListJobMessagesResponse + */ + ListJobMessagesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.dataflow.v1beta3.ListJobMessagesResponse) + return object; + var message = new $root.google.dataflow.v1beta3.ListJobMessagesResponse(); + if (object.jobMessages) { + if (!Array.isArray(object.jobMessages)) + throw TypeError(".google.dataflow.v1beta3.ListJobMessagesResponse.jobMessages: array expected"); + message.jobMessages = []; + for (var i = 0; i < object.jobMessages.length; ++i) { + if (typeof object.jobMessages[i] !== "object") + throw TypeError(".google.dataflow.v1beta3.ListJobMessagesResponse.jobMessages: object expected"); + message.jobMessages[i] = $root.google.dataflow.v1beta3.JobMessage.fromObject(object.jobMessages[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.autoscalingEvents) { + if (!Array.isArray(object.autoscalingEvents)) + throw TypeError(".google.dataflow.v1beta3.ListJobMessagesResponse.autoscalingEvents: array expected"); + message.autoscalingEvents = []; + for (var i = 0; i < object.autoscalingEvents.length; ++i) { + if (typeof object.autoscalingEvents[i] !== "object") + throw TypeError(".google.dataflow.v1beta3.ListJobMessagesResponse.autoscalingEvents: object expected"); + message.autoscalingEvents[i] = $root.google.dataflow.v1beta3.AutoscalingEvent.fromObject(object.autoscalingEvents[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ListJobMessagesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.dataflow.v1beta3.ListJobMessagesResponse + * @static + * @param {google.dataflow.v1beta3.ListJobMessagesResponse} message ListJobMessagesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListJobMessagesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.jobMessages = []; + object.autoscalingEvents = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.jobMessages && message.jobMessages.length) { + object.jobMessages = []; + for (var j = 0; j < message.jobMessages.length; ++j) + object.jobMessages[j] = $root.google.dataflow.v1beta3.JobMessage.toObject(message.jobMessages[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.autoscalingEvents && message.autoscalingEvents.length) { + object.autoscalingEvents = []; + for (var j = 0; j < message.autoscalingEvents.length; ++j) + object.autoscalingEvents[j] = $root.google.dataflow.v1beta3.AutoscalingEvent.toObject(message.autoscalingEvents[j], options); + } + return object; + }; + + /** + * Converts this ListJobMessagesResponse to JSON. + * @function toJSON + * @memberof google.dataflow.v1beta3.ListJobMessagesResponse + * @instance + * @returns {Object.} JSON object + */ + ListJobMessagesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListJobMessagesResponse + * @function getTypeUrl + * @memberof google.dataflow.v1beta3.ListJobMessagesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListJobMessagesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.dataflow.v1beta3.ListJobMessagesResponse"; + }; + + return ListJobMessagesResponse; + })(); + + v1beta3.MetricsV1Beta3 = (function() { + + /** + * Constructs a new MetricsV1Beta3 service. + * @memberof google.dataflow.v1beta3 + * @classdesc Represents a MetricsV1Beta3 + * @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 MetricsV1Beta3(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (MetricsV1Beta3.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = MetricsV1Beta3; + + /** + * Creates new MetricsV1Beta3 service using the specified rpc implementation. + * @function create + * @memberof google.dataflow.v1beta3.MetricsV1Beta3 + * @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 {MetricsV1Beta3} RPC service. Useful where requests and/or responses are streamed. + */ + MetricsV1Beta3.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.dataflow.v1beta3.MetricsV1Beta3|getJobMetrics}. + * @memberof google.dataflow.v1beta3.MetricsV1Beta3 + * @typedef GetJobMetricsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.dataflow.v1beta3.JobMetrics} [response] JobMetrics + */ + + /** + * Calls GetJobMetrics. + * @function getJobMetrics + * @memberof google.dataflow.v1beta3.MetricsV1Beta3 + * @instance + * @param {google.dataflow.v1beta3.IGetJobMetricsRequest} request GetJobMetricsRequest message or plain object + * @param {google.dataflow.v1beta3.MetricsV1Beta3.GetJobMetricsCallback} callback Node-style callback called with the error, if any, and JobMetrics + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(MetricsV1Beta3.prototype.getJobMetrics = function getJobMetrics(request, callback) { + return this.rpcCall(getJobMetrics, $root.google.dataflow.v1beta3.GetJobMetricsRequest, $root.google.dataflow.v1beta3.JobMetrics, request, callback); + }, "name", { value: "GetJobMetrics" }); + + /** + * Calls GetJobMetrics. + * @function getJobMetrics + * @memberof google.dataflow.v1beta3.MetricsV1Beta3 + * @instance + * @param {google.dataflow.v1beta3.IGetJobMetricsRequest} request GetJobMetricsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.dataflow.v1beta3.MetricsV1Beta3|getJobExecutionDetails}. + * @memberof google.dataflow.v1beta3.MetricsV1Beta3 + * @typedef GetJobExecutionDetailsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.dataflow.v1beta3.JobExecutionDetails} [response] JobExecutionDetails + */ + + /** + * Calls GetJobExecutionDetails. + * @function getJobExecutionDetails + * @memberof google.dataflow.v1beta3.MetricsV1Beta3 + * @instance + * @param {google.dataflow.v1beta3.IGetJobExecutionDetailsRequest} request GetJobExecutionDetailsRequest message or plain object + * @param {google.dataflow.v1beta3.MetricsV1Beta3.GetJobExecutionDetailsCallback} callback Node-style callback called with the error, if any, and JobExecutionDetails + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(MetricsV1Beta3.prototype.getJobExecutionDetails = function getJobExecutionDetails(request, callback) { + return this.rpcCall(getJobExecutionDetails, $root.google.dataflow.v1beta3.GetJobExecutionDetailsRequest, $root.google.dataflow.v1beta3.JobExecutionDetails, request, callback); + }, "name", { value: "GetJobExecutionDetails" }); + + /** + * Calls GetJobExecutionDetails. + * @function getJobExecutionDetails + * @memberof google.dataflow.v1beta3.MetricsV1Beta3 + * @instance + * @param {google.dataflow.v1beta3.IGetJobExecutionDetailsRequest} request GetJobExecutionDetailsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.dataflow.v1beta3.MetricsV1Beta3|getStageExecutionDetails}. + * @memberof google.dataflow.v1beta3.MetricsV1Beta3 + * @typedef GetStageExecutionDetailsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.dataflow.v1beta3.StageExecutionDetails} [response] StageExecutionDetails + */ + + /** + * Calls GetStageExecutionDetails. + * @function getStageExecutionDetails + * @memberof google.dataflow.v1beta3.MetricsV1Beta3 + * @instance + * @param {google.dataflow.v1beta3.IGetStageExecutionDetailsRequest} request GetStageExecutionDetailsRequest message or plain object + * @param {google.dataflow.v1beta3.MetricsV1Beta3.GetStageExecutionDetailsCallback} callback Node-style callback called with the error, if any, and StageExecutionDetails + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(MetricsV1Beta3.prototype.getStageExecutionDetails = function getStageExecutionDetails(request, callback) { + return this.rpcCall(getStageExecutionDetails, $root.google.dataflow.v1beta3.GetStageExecutionDetailsRequest, $root.google.dataflow.v1beta3.StageExecutionDetails, request, callback); + }, "name", { value: "GetStageExecutionDetails" }); + + /** + * Calls GetStageExecutionDetails. + * @function getStageExecutionDetails + * @memberof google.dataflow.v1beta3.MetricsV1Beta3 + * @instance + * @param {google.dataflow.v1beta3.IGetStageExecutionDetailsRequest} request GetStageExecutionDetailsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return MetricsV1Beta3; + })(); + + v1beta3.MetricStructuredName = (function() { + + /** + * Properties of a MetricStructuredName. + * @memberof google.dataflow.v1beta3 + * @interface IMetricStructuredName + * @property {string|null} [origin] MetricStructuredName origin + * @property {string|null} [name] MetricStructuredName name + * @property {Object.|null} [context] MetricStructuredName context + */ + + /** + * Constructs a new MetricStructuredName. + * @memberof google.dataflow.v1beta3 + * @classdesc Represents a MetricStructuredName. + * @implements IMetricStructuredName + * @constructor + * @param {google.dataflow.v1beta3.IMetricStructuredName=} [properties] Properties to set + */ + function MetricStructuredName(properties) { + this.context = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MetricStructuredName origin. + * @member {string} origin + * @memberof google.dataflow.v1beta3.MetricStructuredName + * @instance + */ + MetricStructuredName.prototype.origin = ""; + + /** + * MetricStructuredName name. + * @member {string} name + * @memberof google.dataflow.v1beta3.MetricStructuredName + * @instance + */ + MetricStructuredName.prototype.name = ""; + + /** + * MetricStructuredName context. + * @member {Object.} context + * @memberof google.dataflow.v1beta3.MetricStructuredName + * @instance + */ + MetricStructuredName.prototype.context = $util.emptyObject; + + /** + * Creates a new MetricStructuredName instance using the specified properties. + * @function create + * @memberof google.dataflow.v1beta3.MetricStructuredName + * @static + * @param {google.dataflow.v1beta3.IMetricStructuredName=} [properties] Properties to set + * @returns {google.dataflow.v1beta3.MetricStructuredName} MetricStructuredName instance + */ + MetricStructuredName.create = function create(properties) { + return new MetricStructuredName(properties); + }; + + /** + * Encodes the specified MetricStructuredName message. Does not implicitly {@link google.dataflow.v1beta3.MetricStructuredName.verify|verify} messages. + * @function encode + * @memberof google.dataflow.v1beta3.MetricStructuredName + * @static + * @param {google.dataflow.v1beta3.IMetricStructuredName} message MetricStructuredName message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MetricStructuredName.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.origin != null && Object.hasOwnProperty.call(message, "origin")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.origin); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.name); + if (message.context != null && Object.hasOwnProperty.call(message, "context")) + for (var keys = Object.keys(message.context), i = 0; i < keys.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.context[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified MetricStructuredName message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.MetricStructuredName.verify|verify} messages. + * @function encodeDelimited + * @memberof google.dataflow.v1beta3.MetricStructuredName + * @static + * @param {google.dataflow.v1beta3.IMetricStructuredName} message MetricStructuredName message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MetricStructuredName.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MetricStructuredName message from the specified reader or buffer. + * @function decode + * @memberof google.dataflow.v1beta3.MetricStructuredName + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.dataflow.v1beta3.MetricStructuredName} MetricStructuredName + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MetricStructuredName.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.dataflow.v1beta3.MetricStructuredName(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.origin = reader.string(); + break; + } + case 2: { + message.name = reader.string(); + break; + } + case 3: { + if (message.context === $util.emptyObject) + message.context = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.context[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MetricStructuredName message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.dataflow.v1beta3.MetricStructuredName + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.dataflow.v1beta3.MetricStructuredName} MetricStructuredName + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MetricStructuredName.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MetricStructuredName message. + * @function verify + * @memberof google.dataflow.v1beta3.MetricStructuredName + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MetricStructuredName.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.origin != null && message.hasOwnProperty("origin")) + if (!$util.isString(message.origin)) + return "origin: string expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.context != null && message.hasOwnProperty("context")) { + if (!$util.isObject(message.context)) + return "context: object expected"; + var key = Object.keys(message.context); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.context[key[i]])) + return "context: string{k:string} expected"; + } + return null; + }; + + /** + * Creates a MetricStructuredName message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.dataflow.v1beta3.MetricStructuredName + * @static + * @param {Object.} object Plain object + * @returns {google.dataflow.v1beta3.MetricStructuredName} MetricStructuredName + */ + MetricStructuredName.fromObject = function fromObject(object) { + if (object instanceof $root.google.dataflow.v1beta3.MetricStructuredName) + return object; + var message = new $root.google.dataflow.v1beta3.MetricStructuredName(); + if (object.origin != null) + message.origin = String(object.origin); + if (object.name != null) + message.name = String(object.name); + if (object.context) { + if (typeof object.context !== "object") + throw TypeError(".google.dataflow.v1beta3.MetricStructuredName.context: object expected"); + message.context = {}; + for (var keys = Object.keys(object.context), i = 0; i < keys.length; ++i) + message.context[keys[i]] = String(object.context[keys[i]]); + } + return message; + }; + + /** + * Creates a plain object from a MetricStructuredName message. Also converts values to other types if specified. + * @function toObject + * @memberof google.dataflow.v1beta3.MetricStructuredName + * @static + * @param {google.dataflow.v1beta3.MetricStructuredName} message MetricStructuredName + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MetricStructuredName.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.context = {}; + if (options.defaults) { + object.origin = ""; + object.name = ""; + } + if (message.origin != null && message.hasOwnProperty("origin")) + object.origin = message.origin; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + var keys2; + if (message.context && (keys2 = Object.keys(message.context)).length) { + object.context = {}; + for (var j = 0; j < keys2.length; ++j) + object.context[keys2[j]] = message.context[keys2[j]]; + } + return object; + }; + + /** + * Converts this MetricStructuredName to JSON. + * @function toJSON + * @memberof google.dataflow.v1beta3.MetricStructuredName + * @instance + * @returns {Object.} JSON object + */ + MetricStructuredName.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MetricStructuredName + * @function getTypeUrl + * @memberof google.dataflow.v1beta3.MetricStructuredName + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MetricStructuredName.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.dataflow.v1beta3.MetricStructuredName"; + }; + + return MetricStructuredName; + })(); + + v1beta3.MetricUpdate = (function() { + + /** + * Properties of a MetricUpdate. + * @memberof google.dataflow.v1beta3 + * @interface IMetricUpdate + * @property {google.dataflow.v1beta3.IMetricStructuredName|null} [name] MetricUpdate name + * @property {string|null} [kind] MetricUpdate kind + * @property {boolean|null} [cumulative] MetricUpdate cumulative + * @property {google.protobuf.IValue|null} [scalar] MetricUpdate scalar + * @property {google.protobuf.IValue|null} [meanSum] MetricUpdate meanSum + * @property {google.protobuf.IValue|null} [meanCount] MetricUpdate meanCount + * @property {google.protobuf.IValue|null} [set] MetricUpdate set + * @property {google.protobuf.IValue|null} [distribution] MetricUpdate distribution + * @property {google.protobuf.IValue|null} [gauge] MetricUpdate gauge + * @property {google.protobuf.IValue|null} [internal] MetricUpdate internal + * @property {google.protobuf.ITimestamp|null} [updateTime] MetricUpdate updateTime + */ + + /** + * Constructs a new MetricUpdate. + * @memberof google.dataflow.v1beta3 + * @classdesc Represents a MetricUpdate. + * @implements IMetricUpdate + * @constructor + * @param {google.dataflow.v1beta3.IMetricUpdate=} [properties] Properties to set + */ + function MetricUpdate(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MetricUpdate name. + * @member {google.dataflow.v1beta3.IMetricStructuredName|null|undefined} name + * @memberof google.dataflow.v1beta3.MetricUpdate + * @instance + */ + MetricUpdate.prototype.name = null; + + /** + * MetricUpdate kind. + * @member {string} kind + * @memberof google.dataflow.v1beta3.MetricUpdate + * @instance + */ + MetricUpdate.prototype.kind = ""; + + /** + * MetricUpdate cumulative. + * @member {boolean} cumulative + * @memberof google.dataflow.v1beta3.MetricUpdate + * @instance + */ + MetricUpdate.prototype.cumulative = false; + + /** + * MetricUpdate scalar. + * @member {google.protobuf.IValue|null|undefined} scalar + * @memberof google.dataflow.v1beta3.MetricUpdate + * @instance + */ + MetricUpdate.prototype.scalar = null; + + /** + * MetricUpdate meanSum. + * @member {google.protobuf.IValue|null|undefined} meanSum + * @memberof google.dataflow.v1beta3.MetricUpdate + * @instance + */ + MetricUpdate.prototype.meanSum = null; + + /** + * MetricUpdate meanCount. + * @member {google.protobuf.IValue|null|undefined} meanCount + * @memberof google.dataflow.v1beta3.MetricUpdate + * @instance + */ + MetricUpdate.prototype.meanCount = null; + + /** + * MetricUpdate set. + * @member {google.protobuf.IValue|null|undefined} set + * @memberof google.dataflow.v1beta3.MetricUpdate + * @instance + */ + MetricUpdate.prototype.set = null; + + /** + * MetricUpdate distribution. + * @member {google.protobuf.IValue|null|undefined} distribution + * @memberof google.dataflow.v1beta3.MetricUpdate + * @instance + */ + MetricUpdate.prototype.distribution = null; + + /** + * MetricUpdate gauge. + * @member {google.protobuf.IValue|null|undefined} gauge + * @memberof google.dataflow.v1beta3.MetricUpdate + * @instance + */ + MetricUpdate.prototype.gauge = null; + + /** + * MetricUpdate internal. + * @member {google.protobuf.IValue|null|undefined} internal + * @memberof google.dataflow.v1beta3.MetricUpdate + * @instance + */ + MetricUpdate.prototype.internal = null; + + /** + * MetricUpdate updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.dataflow.v1beta3.MetricUpdate + * @instance + */ + MetricUpdate.prototype.updateTime = null; + + /** + * Creates a new MetricUpdate instance using the specified properties. + * @function create + * @memberof google.dataflow.v1beta3.MetricUpdate + * @static + * @param {google.dataflow.v1beta3.IMetricUpdate=} [properties] Properties to set + * @returns {google.dataflow.v1beta3.MetricUpdate} MetricUpdate instance + */ + MetricUpdate.create = function create(properties) { + return new MetricUpdate(properties); + }; + + /** + * Encodes the specified MetricUpdate message. Does not implicitly {@link google.dataflow.v1beta3.MetricUpdate.verify|verify} messages. + * @function encode + * @memberof google.dataflow.v1beta3.MetricUpdate + * @static + * @param {google.dataflow.v1beta3.IMetricUpdate} message MetricUpdate message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MetricUpdate.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + $root.google.dataflow.v1beta3.MetricStructuredName.encode(message.name, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.kind); + if (message.cumulative != null && Object.hasOwnProperty.call(message, "cumulative")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.cumulative); + if (message.scalar != null && Object.hasOwnProperty.call(message, "scalar")) + $root.google.protobuf.Value.encode(message.scalar, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.meanSum != null && Object.hasOwnProperty.call(message, "meanSum")) + $root.google.protobuf.Value.encode(message.meanSum, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.meanCount != null && Object.hasOwnProperty.call(message, "meanCount")) + $root.google.protobuf.Value.encode(message.meanCount, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.set != null && Object.hasOwnProperty.call(message, "set")) + $root.google.protobuf.Value.encode(message.set, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.internal != null && Object.hasOwnProperty.call(message, "internal")) + $root.google.protobuf.Value.encode(message.internal, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.distribution != null && Object.hasOwnProperty.call(message, "distribution")) + $root.google.protobuf.Value.encode(message.distribution, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.gauge != null && Object.hasOwnProperty.call(message, "gauge")) + $root.google.protobuf.Value.encode(message.gauge, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MetricUpdate message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.MetricUpdate.verify|verify} messages. + * @function encodeDelimited + * @memberof google.dataflow.v1beta3.MetricUpdate + * @static + * @param {google.dataflow.v1beta3.IMetricUpdate} message MetricUpdate message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MetricUpdate.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MetricUpdate message from the specified reader or buffer. + * @function decode + * @memberof google.dataflow.v1beta3.MetricUpdate + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.dataflow.v1beta3.MetricUpdate} MetricUpdate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MetricUpdate.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.dataflow.v1beta3.MetricUpdate(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = $root.google.dataflow.v1beta3.MetricStructuredName.decode(reader, reader.uint32()); + break; + } + case 2: { + message.kind = reader.string(); + break; + } + case 3: { + message.cumulative = reader.bool(); + break; + } + case 4: { + message.scalar = $root.google.protobuf.Value.decode(reader, reader.uint32()); + break; + } + case 5: { + message.meanSum = $root.google.protobuf.Value.decode(reader, reader.uint32()); + break; + } + case 6: { + message.meanCount = $root.google.protobuf.Value.decode(reader, reader.uint32()); + break; + } + case 7: { + message.set = $root.google.protobuf.Value.decode(reader, reader.uint32()); + break; + } + case 11: { + message.distribution = $root.google.protobuf.Value.decode(reader, reader.uint32()); + break; + } + case 12: { + message.gauge = $root.google.protobuf.Value.decode(reader, reader.uint32()); + break; + } + case 8: { + message.internal = $root.google.protobuf.Value.decode(reader, reader.uint32()); + break; + } + case 9: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MetricUpdate message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.dataflow.v1beta3.MetricUpdate + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.dataflow.v1beta3.MetricUpdate} MetricUpdate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MetricUpdate.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MetricUpdate message. + * @function verify + * @memberof google.dataflow.v1beta3.MetricUpdate + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MetricUpdate.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) { + var error = $root.google.dataflow.v1beta3.MetricStructuredName.verify(message.name); + if (error) + return "name." + error; + } + if (message.kind != null && message.hasOwnProperty("kind")) + if (!$util.isString(message.kind)) + return "kind: string expected"; + if (message.cumulative != null && message.hasOwnProperty("cumulative")) + if (typeof message.cumulative !== "boolean") + return "cumulative: boolean expected"; + if (message.scalar != null && message.hasOwnProperty("scalar")) { + var error = $root.google.protobuf.Value.verify(message.scalar); + if (error) + return "scalar." + error; + } + if (message.meanSum != null && message.hasOwnProperty("meanSum")) { + var error = $root.google.protobuf.Value.verify(message.meanSum); + if (error) + return "meanSum." + error; + } + if (message.meanCount != null && message.hasOwnProperty("meanCount")) { + var error = $root.google.protobuf.Value.verify(message.meanCount); + if (error) + return "meanCount." + error; + } + if (message.set != null && message.hasOwnProperty("set")) { + var error = $root.google.protobuf.Value.verify(message.set); + if (error) + return "set." + error; + } + if (message.distribution != null && message.hasOwnProperty("distribution")) { + var error = $root.google.protobuf.Value.verify(message.distribution); + if (error) + return "distribution." + error; + } + if (message.gauge != null && message.hasOwnProperty("gauge")) { + var error = $root.google.protobuf.Value.verify(message.gauge); + if (error) + return "gauge." + error; + } + if (message.internal != null && message.hasOwnProperty("internal")) { + var error = $root.google.protobuf.Value.verify(message.internal); + if (error) + return "internal." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + return null; + }; + + /** + * Creates a MetricUpdate message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.dataflow.v1beta3.MetricUpdate + * @static + * @param {Object.} object Plain object + * @returns {google.dataflow.v1beta3.MetricUpdate} MetricUpdate + */ + MetricUpdate.fromObject = function fromObject(object) { + if (object instanceof $root.google.dataflow.v1beta3.MetricUpdate) + return object; + var message = new $root.google.dataflow.v1beta3.MetricUpdate(); + if (object.name != null) { + if (typeof object.name !== "object") + throw TypeError(".google.dataflow.v1beta3.MetricUpdate.name: object expected"); + message.name = $root.google.dataflow.v1beta3.MetricStructuredName.fromObject(object.name); + } + if (object.kind != null) + message.kind = String(object.kind); + if (object.cumulative != null) + message.cumulative = Boolean(object.cumulative); + if (object.scalar != null) { + if (typeof object.scalar !== "object") + throw TypeError(".google.dataflow.v1beta3.MetricUpdate.scalar: object expected"); + message.scalar = $root.google.protobuf.Value.fromObject(object.scalar); + } + if (object.meanSum != null) { + if (typeof object.meanSum !== "object") + throw TypeError(".google.dataflow.v1beta3.MetricUpdate.meanSum: object expected"); + message.meanSum = $root.google.protobuf.Value.fromObject(object.meanSum); + } + if (object.meanCount != null) { + if (typeof object.meanCount !== "object") + throw TypeError(".google.dataflow.v1beta3.MetricUpdate.meanCount: object expected"); + message.meanCount = $root.google.protobuf.Value.fromObject(object.meanCount); + } + if (object.set != null) { + if (typeof object.set !== "object") + throw TypeError(".google.dataflow.v1beta3.MetricUpdate.set: object expected"); + message.set = $root.google.protobuf.Value.fromObject(object.set); + } + if (object.distribution != null) { + if (typeof object.distribution !== "object") + throw TypeError(".google.dataflow.v1beta3.MetricUpdate.distribution: object expected"); + message.distribution = $root.google.protobuf.Value.fromObject(object.distribution); + } + if (object.gauge != null) { + if (typeof object.gauge !== "object") + throw TypeError(".google.dataflow.v1beta3.MetricUpdate.gauge: object expected"); + message.gauge = $root.google.protobuf.Value.fromObject(object.gauge); + } + if (object.internal != null) { + if (typeof object.internal !== "object") + throw TypeError(".google.dataflow.v1beta3.MetricUpdate.internal: object expected"); + message.internal = $root.google.protobuf.Value.fromObject(object.internal); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.dataflow.v1beta3.MetricUpdate.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + return message; + }; + + /** + * Creates a plain object from a MetricUpdate message. Also converts values to other types if specified. + * @function toObject + * @memberof google.dataflow.v1beta3.MetricUpdate + * @static + * @param {google.dataflow.v1beta3.MetricUpdate} message MetricUpdate + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MetricUpdate.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = null; + object.kind = ""; + object.cumulative = false; + object.scalar = null; + object.meanSum = null; + object.meanCount = null; + object.set = null; + object.internal = null; + object.updateTime = null; + object.distribution = null; + object.gauge = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = $root.google.dataflow.v1beta3.MetricStructuredName.toObject(message.name, options); + if (message.kind != null && message.hasOwnProperty("kind")) + object.kind = message.kind; + if (message.cumulative != null && message.hasOwnProperty("cumulative")) + object.cumulative = message.cumulative; + if (message.scalar != null && message.hasOwnProperty("scalar")) + object.scalar = $root.google.protobuf.Value.toObject(message.scalar, options); + if (message.meanSum != null && message.hasOwnProperty("meanSum")) + object.meanSum = $root.google.protobuf.Value.toObject(message.meanSum, options); + if (message.meanCount != null && message.hasOwnProperty("meanCount")) + object.meanCount = $root.google.protobuf.Value.toObject(message.meanCount, options); + if (message.set != null && message.hasOwnProperty("set")) + object.set = $root.google.protobuf.Value.toObject(message.set, options); + if (message.internal != null && message.hasOwnProperty("internal")) + object.internal = $root.google.protobuf.Value.toObject(message.internal, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.distribution != null && message.hasOwnProperty("distribution")) + object.distribution = $root.google.protobuf.Value.toObject(message.distribution, options); + if (message.gauge != null && message.hasOwnProperty("gauge")) + object.gauge = $root.google.protobuf.Value.toObject(message.gauge, options); + return object; + }; + + /** + * Converts this MetricUpdate to JSON. + * @function toJSON + * @memberof google.dataflow.v1beta3.MetricUpdate + * @instance + * @returns {Object.} JSON object + */ + MetricUpdate.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MetricUpdate + * @function getTypeUrl + * @memberof google.dataflow.v1beta3.MetricUpdate + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MetricUpdate.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.dataflow.v1beta3.MetricUpdate"; + }; + + return MetricUpdate; + })(); + + v1beta3.GetJobMetricsRequest = (function() { + + /** + * Properties of a GetJobMetricsRequest. + * @memberof google.dataflow.v1beta3 + * @interface IGetJobMetricsRequest + * @property {string|null} [projectId] GetJobMetricsRequest projectId + * @property {string|null} [jobId] GetJobMetricsRequest jobId + * @property {google.protobuf.ITimestamp|null} [startTime] GetJobMetricsRequest startTime + * @property {string|null} [location] GetJobMetricsRequest location + */ + + /** + * Constructs a new GetJobMetricsRequest. + * @memberof google.dataflow.v1beta3 + * @classdesc Represents a GetJobMetricsRequest. + * @implements IGetJobMetricsRequest + * @constructor + * @param {google.dataflow.v1beta3.IGetJobMetricsRequest=} [properties] Properties to set + */ + function GetJobMetricsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetJobMetricsRequest projectId. + * @member {string} projectId + * @memberof google.dataflow.v1beta3.GetJobMetricsRequest + * @instance + */ + GetJobMetricsRequest.prototype.projectId = ""; + + /** + * GetJobMetricsRequest jobId. + * @member {string} jobId + * @memberof google.dataflow.v1beta3.GetJobMetricsRequest + * @instance + */ + GetJobMetricsRequest.prototype.jobId = ""; + + /** + * GetJobMetricsRequest startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.dataflow.v1beta3.GetJobMetricsRequest + * @instance + */ + GetJobMetricsRequest.prototype.startTime = null; + + /** + * GetJobMetricsRequest location. + * @member {string} location + * @memberof google.dataflow.v1beta3.GetJobMetricsRequest + * @instance + */ + GetJobMetricsRequest.prototype.location = ""; + + /** + * Creates a new GetJobMetricsRequest instance using the specified properties. + * @function create + * @memberof google.dataflow.v1beta3.GetJobMetricsRequest + * @static + * @param {google.dataflow.v1beta3.IGetJobMetricsRequest=} [properties] Properties to set + * @returns {google.dataflow.v1beta3.GetJobMetricsRequest} GetJobMetricsRequest instance + */ + GetJobMetricsRequest.create = function create(properties) { + return new GetJobMetricsRequest(properties); + }; + + /** + * Encodes the specified GetJobMetricsRequest message. Does not implicitly {@link google.dataflow.v1beta3.GetJobMetricsRequest.verify|verify} messages. + * @function encode + * @memberof google.dataflow.v1beta3.GetJobMetricsRequest + * @static + * @param {google.dataflow.v1beta3.IGetJobMetricsRequest} message GetJobMetricsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetJobMetricsRequest.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.jobId != null && Object.hasOwnProperty.call(message, "jobId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.jobId); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.location); + return writer; + }; + + /** + * Encodes the specified GetJobMetricsRequest message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.GetJobMetricsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.dataflow.v1beta3.GetJobMetricsRequest + * @static + * @param {google.dataflow.v1beta3.IGetJobMetricsRequest} message GetJobMetricsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetJobMetricsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetJobMetricsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.dataflow.v1beta3.GetJobMetricsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.dataflow.v1beta3.GetJobMetricsRequest} GetJobMetricsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetJobMetricsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.dataflow.v1beta3.GetJobMetricsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.projectId = reader.string(); + break; + } + case 2: { + message.jobId = reader.string(); + break; + } + case 3: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + message.location = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetJobMetricsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.dataflow.v1beta3.GetJobMetricsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.dataflow.v1beta3.GetJobMetricsRequest} GetJobMetricsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetJobMetricsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetJobMetricsRequest message. + * @function verify + * @memberof google.dataflow.v1beta3.GetJobMetricsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetJobMetricsRequest.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.jobId != null && message.hasOwnProperty("jobId")) + if (!$util.isString(message.jobId)) + return "jobId: string expected"; + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (error) + return "startTime." + error; + } + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isString(message.location)) + return "location: string expected"; + return null; + }; + + /** + * Creates a GetJobMetricsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.dataflow.v1beta3.GetJobMetricsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.dataflow.v1beta3.GetJobMetricsRequest} GetJobMetricsRequest + */ + GetJobMetricsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.dataflow.v1beta3.GetJobMetricsRequest) + return object; + var message = new $root.google.dataflow.v1beta3.GetJobMetricsRequest(); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.jobId != null) + message.jobId = String(object.jobId); + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.dataflow.v1beta3.GetJobMetricsRequest.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + if (object.location != null) + message.location = String(object.location); + return message; + }; + + /** + * Creates a plain object from a GetJobMetricsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.dataflow.v1beta3.GetJobMetricsRequest + * @static + * @param {google.dataflow.v1beta3.GetJobMetricsRequest} message GetJobMetricsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetJobMetricsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.projectId = ""; + object.jobId = ""; + object.startTime = null; + object.location = ""; + } + if (message.projectId != null && message.hasOwnProperty("projectId")) + object.projectId = message.projectId; + if (message.jobId != null && message.hasOwnProperty("jobId")) + object.jobId = message.jobId; + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + return object; + }; + + /** + * Converts this GetJobMetricsRequest to JSON. + * @function toJSON + * @memberof google.dataflow.v1beta3.GetJobMetricsRequest + * @instance + * @returns {Object.} JSON object + */ + GetJobMetricsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetJobMetricsRequest + * @function getTypeUrl + * @memberof google.dataflow.v1beta3.GetJobMetricsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetJobMetricsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.dataflow.v1beta3.GetJobMetricsRequest"; + }; + + return GetJobMetricsRequest; + })(); + + v1beta3.JobMetrics = (function() { + + /** + * Properties of a JobMetrics. + * @memberof google.dataflow.v1beta3 + * @interface IJobMetrics + * @property {google.protobuf.ITimestamp|null} [metricTime] JobMetrics metricTime + * @property {Array.|null} [metrics] JobMetrics metrics + */ + + /** + * Constructs a new JobMetrics. + * @memberof google.dataflow.v1beta3 + * @classdesc Represents a JobMetrics. + * @implements IJobMetrics + * @constructor + * @param {google.dataflow.v1beta3.IJobMetrics=} [properties] Properties to set + */ + function JobMetrics(properties) { + this.metrics = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * JobMetrics metricTime. + * @member {google.protobuf.ITimestamp|null|undefined} metricTime + * @memberof google.dataflow.v1beta3.JobMetrics + * @instance + */ + JobMetrics.prototype.metricTime = null; + + /** + * JobMetrics metrics. + * @member {Array.} metrics + * @memberof google.dataflow.v1beta3.JobMetrics + * @instance + */ + JobMetrics.prototype.metrics = $util.emptyArray; + + /** + * Creates a new JobMetrics instance using the specified properties. + * @function create + * @memberof google.dataflow.v1beta3.JobMetrics + * @static + * @param {google.dataflow.v1beta3.IJobMetrics=} [properties] Properties to set + * @returns {google.dataflow.v1beta3.JobMetrics} JobMetrics instance + */ + JobMetrics.create = function create(properties) { + return new JobMetrics(properties); + }; + + /** + * Encodes the specified JobMetrics message. Does not implicitly {@link google.dataflow.v1beta3.JobMetrics.verify|verify} messages. + * @function encode + * @memberof google.dataflow.v1beta3.JobMetrics + * @static + * @param {google.dataflow.v1beta3.IJobMetrics} message JobMetrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JobMetrics.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.metricTime != null && Object.hasOwnProperty.call(message, "metricTime")) + $root.google.protobuf.Timestamp.encode(message.metricTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.metrics != null && message.metrics.length) + for (var i = 0; i < message.metrics.length; ++i) + $root.google.dataflow.v1beta3.MetricUpdate.encode(message.metrics[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified JobMetrics message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.JobMetrics.verify|verify} messages. + * @function encodeDelimited + * @memberof google.dataflow.v1beta3.JobMetrics + * @static + * @param {google.dataflow.v1beta3.IJobMetrics} message JobMetrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JobMetrics.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a JobMetrics message from the specified reader or buffer. + * @function decode + * @memberof google.dataflow.v1beta3.JobMetrics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.dataflow.v1beta3.JobMetrics} JobMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JobMetrics.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.dataflow.v1beta3.JobMetrics(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.metricTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 2: { + if (!(message.metrics && message.metrics.length)) + message.metrics = []; + message.metrics.push($root.google.dataflow.v1beta3.MetricUpdate.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a JobMetrics message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.dataflow.v1beta3.JobMetrics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.dataflow.v1beta3.JobMetrics} JobMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JobMetrics.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a JobMetrics message. + * @function verify + * @memberof google.dataflow.v1beta3.JobMetrics + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + JobMetrics.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.metricTime != null && message.hasOwnProperty("metricTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.metricTime); + if (error) + return "metricTime." + error; + } + if (message.metrics != null && message.hasOwnProperty("metrics")) { + if (!Array.isArray(message.metrics)) + return "metrics: array expected"; + for (var i = 0; i < message.metrics.length; ++i) { + var error = $root.google.dataflow.v1beta3.MetricUpdate.verify(message.metrics[i]); + if (error) + return "metrics." + error; + } + } + return null; + }; + + /** + * Creates a JobMetrics message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.dataflow.v1beta3.JobMetrics + * @static + * @param {Object.} object Plain object + * @returns {google.dataflow.v1beta3.JobMetrics} JobMetrics + */ + JobMetrics.fromObject = function fromObject(object) { + if (object instanceof $root.google.dataflow.v1beta3.JobMetrics) + return object; + var message = new $root.google.dataflow.v1beta3.JobMetrics(); + if (object.metricTime != null) { + if (typeof object.metricTime !== "object") + throw TypeError(".google.dataflow.v1beta3.JobMetrics.metricTime: object expected"); + message.metricTime = $root.google.protobuf.Timestamp.fromObject(object.metricTime); + } + if (object.metrics) { + if (!Array.isArray(object.metrics)) + throw TypeError(".google.dataflow.v1beta3.JobMetrics.metrics: array expected"); + message.metrics = []; + for (var i = 0; i < object.metrics.length; ++i) { + if (typeof object.metrics[i] !== "object") + throw TypeError(".google.dataflow.v1beta3.JobMetrics.metrics: object expected"); + message.metrics[i] = $root.google.dataflow.v1beta3.MetricUpdate.fromObject(object.metrics[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a JobMetrics message. Also converts values to other types if specified. + * @function toObject + * @memberof google.dataflow.v1beta3.JobMetrics + * @static + * @param {google.dataflow.v1beta3.JobMetrics} message JobMetrics + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + JobMetrics.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.metrics = []; + if (options.defaults) + object.metricTime = null; + if (message.metricTime != null && message.hasOwnProperty("metricTime")) + object.metricTime = $root.google.protobuf.Timestamp.toObject(message.metricTime, options); + if (message.metrics && message.metrics.length) { + object.metrics = []; + for (var j = 0; j < message.metrics.length; ++j) + object.metrics[j] = $root.google.dataflow.v1beta3.MetricUpdate.toObject(message.metrics[j], options); + } + return object; + }; + + /** + * Converts this JobMetrics to JSON. + * @function toJSON + * @memberof google.dataflow.v1beta3.JobMetrics + * @instance + * @returns {Object.} JSON object + */ + JobMetrics.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for JobMetrics + * @function getTypeUrl + * @memberof google.dataflow.v1beta3.JobMetrics + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + JobMetrics.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.dataflow.v1beta3.JobMetrics"; + }; + + return JobMetrics; + })(); + + v1beta3.GetJobExecutionDetailsRequest = (function() { + + /** + * Properties of a GetJobExecutionDetailsRequest. + * @memberof google.dataflow.v1beta3 + * @interface IGetJobExecutionDetailsRequest + * @property {string|null} [projectId] GetJobExecutionDetailsRequest projectId + * @property {string|null} [jobId] GetJobExecutionDetailsRequest jobId + * @property {string|null} [location] GetJobExecutionDetailsRequest location + * @property {number|null} [pageSize] GetJobExecutionDetailsRequest pageSize + * @property {string|null} [pageToken] GetJobExecutionDetailsRequest pageToken + */ + + /** + * Constructs a new GetJobExecutionDetailsRequest. + * @memberof google.dataflow.v1beta3 + * @classdesc Represents a GetJobExecutionDetailsRequest. + * @implements IGetJobExecutionDetailsRequest + * @constructor + * @param {google.dataflow.v1beta3.IGetJobExecutionDetailsRequest=} [properties] Properties to set + */ + function GetJobExecutionDetailsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetJobExecutionDetailsRequest projectId. + * @member {string} projectId + * @memberof google.dataflow.v1beta3.GetJobExecutionDetailsRequest + * @instance + */ + GetJobExecutionDetailsRequest.prototype.projectId = ""; + + /** + * GetJobExecutionDetailsRequest jobId. + * @member {string} jobId + * @memberof google.dataflow.v1beta3.GetJobExecutionDetailsRequest + * @instance + */ + GetJobExecutionDetailsRequest.prototype.jobId = ""; + + /** + * GetJobExecutionDetailsRequest location. + * @member {string} location + * @memberof google.dataflow.v1beta3.GetJobExecutionDetailsRequest + * @instance + */ + GetJobExecutionDetailsRequest.prototype.location = ""; + + /** + * GetJobExecutionDetailsRequest pageSize. + * @member {number} pageSize + * @memberof google.dataflow.v1beta3.GetJobExecutionDetailsRequest + * @instance + */ + GetJobExecutionDetailsRequest.prototype.pageSize = 0; + + /** + * GetJobExecutionDetailsRequest pageToken. + * @member {string} pageToken + * @memberof google.dataflow.v1beta3.GetJobExecutionDetailsRequest + * @instance + */ + GetJobExecutionDetailsRequest.prototype.pageToken = ""; + + /** + * Creates a new GetJobExecutionDetailsRequest instance using the specified properties. + * @function create + * @memberof google.dataflow.v1beta3.GetJobExecutionDetailsRequest + * @static + * @param {google.dataflow.v1beta3.IGetJobExecutionDetailsRequest=} [properties] Properties to set + * @returns {google.dataflow.v1beta3.GetJobExecutionDetailsRequest} GetJobExecutionDetailsRequest instance + */ + GetJobExecutionDetailsRequest.create = function create(properties) { + return new GetJobExecutionDetailsRequest(properties); + }; + + /** + * Encodes the specified GetJobExecutionDetailsRequest message. Does not implicitly {@link google.dataflow.v1beta3.GetJobExecutionDetailsRequest.verify|verify} messages. + * @function encode + * @memberof google.dataflow.v1beta3.GetJobExecutionDetailsRequest + * @static + * @param {google.dataflow.v1beta3.IGetJobExecutionDetailsRequest} message GetJobExecutionDetailsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetJobExecutionDetailsRequest.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.jobId != null && Object.hasOwnProperty.call(message, "jobId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.jobId); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.location); + 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 GetJobExecutionDetailsRequest message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.GetJobExecutionDetailsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.dataflow.v1beta3.GetJobExecutionDetailsRequest + * @static + * @param {google.dataflow.v1beta3.IGetJobExecutionDetailsRequest} message GetJobExecutionDetailsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetJobExecutionDetailsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetJobExecutionDetailsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.dataflow.v1beta3.GetJobExecutionDetailsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.dataflow.v1beta3.GetJobExecutionDetailsRequest} GetJobExecutionDetailsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetJobExecutionDetailsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.dataflow.v1beta3.GetJobExecutionDetailsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.projectId = reader.string(); + break; + } + case 2: { + message.jobId = reader.string(); + break; + } + case 3: { + message.location = 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 GetJobExecutionDetailsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.dataflow.v1beta3.GetJobExecutionDetailsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.dataflow.v1beta3.GetJobExecutionDetailsRequest} GetJobExecutionDetailsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetJobExecutionDetailsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetJobExecutionDetailsRequest message. + * @function verify + * @memberof google.dataflow.v1beta3.GetJobExecutionDetailsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetJobExecutionDetailsRequest.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.jobId != null && message.hasOwnProperty("jobId")) + if (!$util.isString(message.jobId)) + return "jobId: string expected"; + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isString(message.location)) + return "location: 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 GetJobExecutionDetailsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.dataflow.v1beta3.GetJobExecutionDetailsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.dataflow.v1beta3.GetJobExecutionDetailsRequest} GetJobExecutionDetailsRequest + */ + GetJobExecutionDetailsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.dataflow.v1beta3.GetJobExecutionDetailsRequest) + return object; + var message = new $root.google.dataflow.v1beta3.GetJobExecutionDetailsRequest(); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.jobId != null) + message.jobId = String(object.jobId); + if (object.location != null) + message.location = String(object.location); + 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 GetJobExecutionDetailsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.dataflow.v1beta3.GetJobExecutionDetailsRequest + * @static + * @param {google.dataflow.v1beta3.GetJobExecutionDetailsRequest} message GetJobExecutionDetailsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetJobExecutionDetailsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.projectId = ""; + object.jobId = ""; + object.location = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.projectId != null && message.hasOwnProperty("projectId")) + object.projectId = message.projectId; + if (message.jobId != null && message.hasOwnProperty("jobId")) + object.jobId = message.jobId; + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + 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 GetJobExecutionDetailsRequest to JSON. + * @function toJSON + * @memberof google.dataflow.v1beta3.GetJobExecutionDetailsRequest + * @instance + * @returns {Object.} JSON object + */ + GetJobExecutionDetailsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetJobExecutionDetailsRequest + * @function getTypeUrl + * @memberof google.dataflow.v1beta3.GetJobExecutionDetailsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetJobExecutionDetailsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.dataflow.v1beta3.GetJobExecutionDetailsRequest"; + }; + + return GetJobExecutionDetailsRequest; + })(); + + v1beta3.ProgressTimeseries = (function() { + + /** + * Properties of a ProgressTimeseries. + * @memberof google.dataflow.v1beta3 + * @interface IProgressTimeseries + * @property {number|null} [currentProgress] ProgressTimeseries currentProgress + * @property {Array.|null} [dataPoints] ProgressTimeseries dataPoints + */ + + /** + * Constructs a new ProgressTimeseries. + * @memberof google.dataflow.v1beta3 + * @classdesc Represents a ProgressTimeseries. + * @implements IProgressTimeseries + * @constructor + * @param {google.dataflow.v1beta3.IProgressTimeseries=} [properties] Properties to set + */ + function ProgressTimeseries(properties) { + this.dataPoints = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ProgressTimeseries currentProgress. + * @member {number} currentProgress + * @memberof google.dataflow.v1beta3.ProgressTimeseries + * @instance + */ + ProgressTimeseries.prototype.currentProgress = 0; + + /** + * ProgressTimeseries dataPoints. + * @member {Array.} dataPoints + * @memberof google.dataflow.v1beta3.ProgressTimeseries + * @instance + */ + ProgressTimeseries.prototype.dataPoints = $util.emptyArray; + + /** + * Creates a new ProgressTimeseries instance using the specified properties. + * @function create + * @memberof google.dataflow.v1beta3.ProgressTimeseries + * @static + * @param {google.dataflow.v1beta3.IProgressTimeseries=} [properties] Properties to set + * @returns {google.dataflow.v1beta3.ProgressTimeseries} ProgressTimeseries instance + */ + ProgressTimeseries.create = function create(properties) { + return new ProgressTimeseries(properties); + }; + + /** + * Encodes the specified ProgressTimeseries message. Does not implicitly {@link google.dataflow.v1beta3.ProgressTimeseries.verify|verify} messages. + * @function encode + * @memberof google.dataflow.v1beta3.ProgressTimeseries + * @static + * @param {google.dataflow.v1beta3.IProgressTimeseries} message ProgressTimeseries message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProgressTimeseries.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.currentProgress != null && Object.hasOwnProperty.call(message, "currentProgress")) + writer.uint32(/* id 1, wireType 1 =*/9).double(message.currentProgress); + if (message.dataPoints != null && message.dataPoints.length) + for (var i = 0; i < message.dataPoints.length; ++i) + $root.google.dataflow.v1beta3.ProgressTimeseries.Point.encode(message.dataPoints[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ProgressTimeseries message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.ProgressTimeseries.verify|verify} messages. + * @function encodeDelimited + * @memberof google.dataflow.v1beta3.ProgressTimeseries + * @static + * @param {google.dataflow.v1beta3.IProgressTimeseries} message ProgressTimeseries message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProgressTimeseries.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ProgressTimeseries message from the specified reader or buffer. + * @function decode + * @memberof google.dataflow.v1beta3.ProgressTimeseries + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.dataflow.v1beta3.ProgressTimeseries} ProgressTimeseries + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProgressTimeseries.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.dataflow.v1beta3.ProgressTimeseries(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.currentProgress = reader.double(); + break; + } + case 2: { + if (!(message.dataPoints && message.dataPoints.length)) + message.dataPoints = []; + message.dataPoints.push($root.google.dataflow.v1beta3.ProgressTimeseries.Point.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ProgressTimeseries message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.dataflow.v1beta3.ProgressTimeseries + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.dataflow.v1beta3.ProgressTimeseries} ProgressTimeseries + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProgressTimeseries.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ProgressTimeseries message. + * @function verify + * @memberof google.dataflow.v1beta3.ProgressTimeseries + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ProgressTimeseries.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.currentProgress != null && message.hasOwnProperty("currentProgress")) + if (typeof message.currentProgress !== "number") + return "currentProgress: number expected"; + if (message.dataPoints != null && message.hasOwnProperty("dataPoints")) { + if (!Array.isArray(message.dataPoints)) + return "dataPoints: array expected"; + for (var i = 0; i < message.dataPoints.length; ++i) { + var error = $root.google.dataflow.v1beta3.ProgressTimeseries.Point.verify(message.dataPoints[i]); + if (error) + return "dataPoints." + error; + } + } + return null; + }; + + /** + * Creates a ProgressTimeseries message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.dataflow.v1beta3.ProgressTimeseries + * @static + * @param {Object.} object Plain object + * @returns {google.dataflow.v1beta3.ProgressTimeseries} ProgressTimeseries + */ + ProgressTimeseries.fromObject = function fromObject(object) { + if (object instanceof $root.google.dataflow.v1beta3.ProgressTimeseries) + return object; + var message = new $root.google.dataflow.v1beta3.ProgressTimeseries(); + if (object.currentProgress != null) + message.currentProgress = Number(object.currentProgress); + if (object.dataPoints) { + if (!Array.isArray(object.dataPoints)) + throw TypeError(".google.dataflow.v1beta3.ProgressTimeseries.dataPoints: array expected"); + message.dataPoints = []; + for (var i = 0; i < object.dataPoints.length; ++i) { + if (typeof object.dataPoints[i] !== "object") + throw TypeError(".google.dataflow.v1beta3.ProgressTimeseries.dataPoints: object expected"); + message.dataPoints[i] = $root.google.dataflow.v1beta3.ProgressTimeseries.Point.fromObject(object.dataPoints[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ProgressTimeseries message. Also converts values to other types if specified. + * @function toObject + * @memberof google.dataflow.v1beta3.ProgressTimeseries + * @static + * @param {google.dataflow.v1beta3.ProgressTimeseries} message ProgressTimeseries + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ProgressTimeseries.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.dataPoints = []; + if (options.defaults) + object.currentProgress = 0; + if (message.currentProgress != null && message.hasOwnProperty("currentProgress")) + object.currentProgress = options.json && !isFinite(message.currentProgress) ? String(message.currentProgress) : message.currentProgress; + if (message.dataPoints && message.dataPoints.length) { + object.dataPoints = []; + for (var j = 0; j < message.dataPoints.length; ++j) + object.dataPoints[j] = $root.google.dataflow.v1beta3.ProgressTimeseries.Point.toObject(message.dataPoints[j], options); + } + return object; + }; + + /** + * Converts this ProgressTimeseries to JSON. + * @function toJSON + * @memberof google.dataflow.v1beta3.ProgressTimeseries + * @instance + * @returns {Object.} JSON object + */ + ProgressTimeseries.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ProgressTimeseries + * @function getTypeUrl + * @memberof google.dataflow.v1beta3.ProgressTimeseries + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ProgressTimeseries.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.dataflow.v1beta3.ProgressTimeseries"; + }; + + ProgressTimeseries.Point = (function() { + + /** + * Properties of a Point. + * @memberof google.dataflow.v1beta3.ProgressTimeseries + * @interface IPoint + * @property {google.protobuf.ITimestamp|null} [time] Point time + * @property {number|null} [value] Point value + */ + + /** + * Constructs a new Point. + * @memberof google.dataflow.v1beta3.ProgressTimeseries + * @classdesc Represents a Point. + * @implements IPoint + * @constructor + * @param {google.dataflow.v1beta3.ProgressTimeseries.IPoint=} [properties] Properties to set + */ + function Point(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Point time. + * @member {google.protobuf.ITimestamp|null|undefined} time + * @memberof google.dataflow.v1beta3.ProgressTimeseries.Point + * @instance + */ + Point.prototype.time = null; + + /** + * Point value. + * @member {number} value + * @memberof google.dataflow.v1beta3.ProgressTimeseries.Point + * @instance + */ + Point.prototype.value = 0; + + /** + * Creates a new Point instance using the specified properties. + * @function create + * @memberof google.dataflow.v1beta3.ProgressTimeseries.Point + * @static + * @param {google.dataflow.v1beta3.ProgressTimeseries.IPoint=} [properties] Properties to set + * @returns {google.dataflow.v1beta3.ProgressTimeseries.Point} Point instance + */ + Point.create = function create(properties) { + return new Point(properties); + }; + + /** + * Encodes the specified Point message. Does not implicitly {@link google.dataflow.v1beta3.ProgressTimeseries.Point.verify|verify} messages. + * @function encode + * @memberof google.dataflow.v1beta3.ProgressTimeseries.Point + * @static + * @param {google.dataflow.v1beta3.ProgressTimeseries.IPoint} message Point message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Point.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.time != null && Object.hasOwnProperty.call(message, "time")) + $root.google.protobuf.Timestamp.encode(message.time, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.value); + return writer; + }; + + /** + * Encodes the specified Point message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.ProgressTimeseries.Point.verify|verify} messages. + * @function encodeDelimited + * @memberof google.dataflow.v1beta3.ProgressTimeseries.Point + * @static + * @param {google.dataflow.v1beta3.ProgressTimeseries.IPoint} message Point message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Point.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Point message from the specified reader or buffer. + * @function decode + * @memberof google.dataflow.v1beta3.ProgressTimeseries.Point + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.dataflow.v1beta3.ProgressTimeseries.Point} Point + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Point.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.dataflow.v1beta3.ProgressTimeseries.Point(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.time = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 2: { + message.value = reader.double(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Point message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.dataflow.v1beta3.ProgressTimeseries.Point + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.dataflow.v1beta3.ProgressTimeseries.Point} Point + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Point.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Point message. + * @function verify + * @memberof google.dataflow.v1beta3.ProgressTimeseries.Point + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Point.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.time != null && message.hasOwnProperty("time")) { + var error = $root.google.protobuf.Timestamp.verify(message.time); + if (error) + return "time." + error; + } + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value !== "number") + return "value: number expected"; + return null; + }; + + /** + * Creates a Point message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.dataflow.v1beta3.ProgressTimeseries.Point + * @static + * @param {Object.} object Plain object + * @returns {google.dataflow.v1beta3.ProgressTimeseries.Point} Point + */ + Point.fromObject = function fromObject(object) { + if (object instanceof $root.google.dataflow.v1beta3.ProgressTimeseries.Point) + return object; + var message = new $root.google.dataflow.v1beta3.ProgressTimeseries.Point(); + if (object.time != null) { + if (typeof object.time !== "object") + throw TypeError(".google.dataflow.v1beta3.ProgressTimeseries.Point.time: object expected"); + message.time = $root.google.protobuf.Timestamp.fromObject(object.time); + } + if (object.value != null) + message.value = Number(object.value); + return message; + }; + + /** + * Creates a plain object from a Point message. Also converts values to other types if specified. + * @function toObject + * @memberof google.dataflow.v1beta3.ProgressTimeseries.Point + * @static + * @param {google.dataflow.v1beta3.ProgressTimeseries.Point} message Point + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Point.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.time = null; + object.value = 0; + } + if (message.time != null && message.hasOwnProperty("time")) + object.time = $root.google.protobuf.Timestamp.toObject(message.time, options); + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.json && !isFinite(message.value) ? String(message.value) : message.value; + return object; + }; + + /** + * Converts this Point to JSON. + * @function toJSON + * @memberof google.dataflow.v1beta3.ProgressTimeseries.Point + * @instance + * @returns {Object.} JSON object + */ + Point.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Point + * @function getTypeUrl + * @memberof google.dataflow.v1beta3.ProgressTimeseries.Point + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Point.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.dataflow.v1beta3.ProgressTimeseries.Point"; + }; + + return Point; + })(); + + return ProgressTimeseries; + })(); + + /** + * ExecutionState enum. + * @name google.dataflow.v1beta3.ExecutionState + * @enum {number} + * @property {number} EXECUTION_STATE_UNKNOWN=0 EXECUTION_STATE_UNKNOWN value + * @property {number} EXECUTION_STATE_NOT_STARTED=1 EXECUTION_STATE_NOT_STARTED value + * @property {number} EXECUTION_STATE_RUNNING=2 EXECUTION_STATE_RUNNING value + * @property {number} EXECUTION_STATE_SUCCEEDED=3 EXECUTION_STATE_SUCCEEDED value + * @property {number} EXECUTION_STATE_FAILED=4 EXECUTION_STATE_FAILED value + * @property {number} EXECUTION_STATE_CANCELLED=5 EXECUTION_STATE_CANCELLED value + */ + v1beta3.ExecutionState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "EXECUTION_STATE_UNKNOWN"] = 0; + values[valuesById[1] = "EXECUTION_STATE_NOT_STARTED"] = 1; + values[valuesById[2] = "EXECUTION_STATE_RUNNING"] = 2; + values[valuesById[3] = "EXECUTION_STATE_SUCCEEDED"] = 3; + values[valuesById[4] = "EXECUTION_STATE_FAILED"] = 4; + values[valuesById[5] = "EXECUTION_STATE_CANCELLED"] = 5; + return values; + })(); + + v1beta3.StageSummary = (function() { + + /** + * Properties of a StageSummary. + * @memberof google.dataflow.v1beta3 + * @interface IStageSummary + * @property {string|null} [stageId] StageSummary stageId + * @property {google.dataflow.v1beta3.ExecutionState|null} [state] StageSummary state + * @property {google.protobuf.ITimestamp|null} [startTime] StageSummary startTime + * @property {google.protobuf.ITimestamp|null} [endTime] StageSummary endTime + * @property {google.dataflow.v1beta3.IProgressTimeseries|null} [progress] StageSummary progress + * @property {Array.|null} [metrics] StageSummary metrics + */ + + /** + * Constructs a new StageSummary. + * @memberof google.dataflow.v1beta3 + * @classdesc Represents a StageSummary. + * @implements IStageSummary + * @constructor + * @param {google.dataflow.v1beta3.IStageSummary=} [properties] Properties to set + */ + function StageSummary(properties) { + this.metrics = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StageSummary stageId. + * @member {string} stageId + * @memberof google.dataflow.v1beta3.StageSummary + * @instance + */ + StageSummary.prototype.stageId = ""; + + /** + * StageSummary state. + * @member {google.dataflow.v1beta3.ExecutionState} state + * @memberof google.dataflow.v1beta3.StageSummary + * @instance + */ + StageSummary.prototype.state = 0; + + /** + * StageSummary startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.dataflow.v1beta3.StageSummary + * @instance + */ + StageSummary.prototype.startTime = null; + + /** + * StageSummary endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.dataflow.v1beta3.StageSummary + * @instance + */ + StageSummary.prototype.endTime = null; + + /** + * StageSummary progress. + * @member {google.dataflow.v1beta3.IProgressTimeseries|null|undefined} progress + * @memberof google.dataflow.v1beta3.StageSummary + * @instance + */ + StageSummary.prototype.progress = null; + + /** + * StageSummary metrics. + * @member {Array.} metrics + * @memberof google.dataflow.v1beta3.StageSummary + * @instance + */ + StageSummary.prototype.metrics = $util.emptyArray; + + /** + * Creates a new StageSummary instance using the specified properties. + * @function create + * @memberof google.dataflow.v1beta3.StageSummary + * @static + * @param {google.dataflow.v1beta3.IStageSummary=} [properties] Properties to set + * @returns {google.dataflow.v1beta3.StageSummary} StageSummary instance + */ + StageSummary.create = function create(properties) { + return new StageSummary(properties); + }; + + /** + * Encodes the specified StageSummary message. Does not implicitly {@link google.dataflow.v1beta3.StageSummary.verify|verify} messages. + * @function encode + * @memberof google.dataflow.v1beta3.StageSummary + * @static + * @param {google.dataflow.v1beta3.IStageSummary} message StageSummary message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StageSummary.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.stageId != null && Object.hasOwnProperty.call(message, "stageId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.stageId); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.state); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.progress != null && Object.hasOwnProperty.call(message, "progress")) + $root.google.dataflow.v1beta3.ProgressTimeseries.encode(message.progress, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.metrics != null && message.metrics.length) + for (var i = 0; i < message.metrics.length; ++i) + $root.google.dataflow.v1beta3.MetricUpdate.encode(message.metrics[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified StageSummary message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.StageSummary.verify|verify} messages. + * @function encodeDelimited + * @memberof google.dataflow.v1beta3.StageSummary + * @static + * @param {google.dataflow.v1beta3.IStageSummary} message StageSummary message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StageSummary.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StageSummary message from the specified reader or buffer. + * @function decode + * @memberof google.dataflow.v1beta3.StageSummary + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.dataflow.v1beta3.StageSummary} StageSummary + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StageSummary.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.dataflow.v1beta3.StageSummary(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.stageId = reader.string(); + break; + } + case 2: { + message.state = reader.int32(); + break; + } + case 3: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.progress = $root.google.dataflow.v1beta3.ProgressTimeseries.decode(reader, reader.uint32()); + break; + } + case 6: { + if (!(message.metrics && message.metrics.length)) + message.metrics = []; + message.metrics.push($root.google.dataflow.v1beta3.MetricUpdate.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StageSummary message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.dataflow.v1beta3.StageSummary + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.dataflow.v1beta3.StageSummary} StageSummary + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StageSummary.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StageSummary message. + * @function verify + * @memberof google.dataflow.v1beta3.StageSummary + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StageSummary.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.stageId != null && message.hasOwnProperty("stageId")) + if (!$util.isString(message.stageId)) + return "stageId: string expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + 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.progress != null && message.hasOwnProperty("progress")) { + var error = $root.google.dataflow.v1beta3.ProgressTimeseries.verify(message.progress); + if (error) + return "progress." + error; + } + if (message.metrics != null && message.hasOwnProperty("metrics")) { + if (!Array.isArray(message.metrics)) + return "metrics: array expected"; + for (var i = 0; i < message.metrics.length; ++i) { + var error = $root.google.dataflow.v1beta3.MetricUpdate.verify(message.metrics[i]); + if (error) + return "metrics." + error; + } + } + return null; + }; + + /** + * Creates a StageSummary message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.dataflow.v1beta3.StageSummary + * @static + * @param {Object.} object Plain object + * @returns {google.dataflow.v1beta3.StageSummary} StageSummary + */ + StageSummary.fromObject = function fromObject(object) { + if (object instanceof $root.google.dataflow.v1beta3.StageSummary) + return object; + var message = new $root.google.dataflow.v1beta3.StageSummary(); + if (object.stageId != null) + message.stageId = String(object.stageId); + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "EXECUTION_STATE_UNKNOWN": + case 0: + message.state = 0; + break; + case "EXECUTION_STATE_NOT_STARTED": + case 1: + message.state = 1; + break; + case "EXECUTION_STATE_RUNNING": + case 2: + message.state = 2; + break; + case "EXECUTION_STATE_SUCCEEDED": + case 3: + message.state = 3; + break; + case "EXECUTION_STATE_FAILED": + case 4: + message.state = 4; + break; + case "EXECUTION_STATE_CANCELLED": + case 5: + message.state = 5; + break; + } + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.dataflow.v1beta3.StageSummary.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.dataflow.v1beta3.StageSummary.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + if (object.progress != null) { + if (typeof object.progress !== "object") + throw TypeError(".google.dataflow.v1beta3.StageSummary.progress: object expected"); + message.progress = $root.google.dataflow.v1beta3.ProgressTimeseries.fromObject(object.progress); + } + if (object.metrics) { + if (!Array.isArray(object.metrics)) + throw TypeError(".google.dataflow.v1beta3.StageSummary.metrics: array expected"); + message.metrics = []; + for (var i = 0; i < object.metrics.length; ++i) { + if (typeof object.metrics[i] !== "object") + throw TypeError(".google.dataflow.v1beta3.StageSummary.metrics: object expected"); + message.metrics[i] = $root.google.dataflow.v1beta3.MetricUpdate.fromObject(object.metrics[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a StageSummary message. Also converts values to other types if specified. + * @function toObject + * @memberof google.dataflow.v1beta3.StageSummary + * @static + * @param {google.dataflow.v1beta3.StageSummary} message StageSummary + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StageSummary.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.metrics = []; + if (options.defaults) { + object.stageId = ""; + object.state = options.enums === String ? "EXECUTION_STATE_UNKNOWN" : 0; + object.startTime = null; + object.endTime = null; + object.progress = null; + } + if (message.stageId != null && message.hasOwnProperty("stageId")) + object.stageId = message.stageId; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.dataflow.v1beta3.ExecutionState[message.state] === undefined ? message.state : $root.google.dataflow.v1beta3.ExecutionState[message.state] : message.state; + 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.progress != null && message.hasOwnProperty("progress")) + object.progress = $root.google.dataflow.v1beta3.ProgressTimeseries.toObject(message.progress, options); + if (message.metrics && message.metrics.length) { + object.metrics = []; + for (var j = 0; j < message.metrics.length; ++j) + object.metrics[j] = $root.google.dataflow.v1beta3.MetricUpdate.toObject(message.metrics[j], options); + } + return object; + }; + + /** + * Converts this StageSummary to JSON. + * @function toJSON + * @memberof google.dataflow.v1beta3.StageSummary + * @instance + * @returns {Object.} JSON object + */ + StageSummary.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StageSummary + * @function getTypeUrl + * @memberof google.dataflow.v1beta3.StageSummary + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StageSummary.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.dataflow.v1beta3.StageSummary"; + }; + + return StageSummary; + })(); + + v1beta3.JobExecutionDetails = (function() { + + /** + * Properties of a JobExecutionDetails. + * @memberof google.dataflow.v1beta3 + * @interface IJobExecutionDetails + * @property {Array.|null} [stages] JobExecutionDetails stages + * @property {string|null} [nextPageToken] JobExecutionDetails nextPageToken + */ + + /** + * Constructs a new JobExecutionDetails. + * @memberof google.dataflow.v1beta3 + * @classdesc Represents a JobExecutionDetails. + * @implements IJobExecutionDetails + * @constructor + * @param {google.dataflow.v1beta3.IJobExecutionDetails=} [properties] Properties to set + */ + function JobExecutionDetails(properties) { + this.stages = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * JobExecutionDetails stages. + * @member {Array.} stages + * @memberof google.dataflow.v1beta3.JobExecutionDetails + * @instance + */ + JobExecutionDetails.prototype.stages = $util.emptyArray; + + /** + * JobExecutionDetails nextPageToken. + * @member {string} nextPageToken + * @memberof google.dataflow.v1beta3.JobExecutionDetails + * @instance + */ + JobExecutionDetails.prototype.nextPageToken = ""; + + /** + * Creates a new JobExecutionDetails instance using the specified properties. + * @function create + * @memberof google.dataflow.v1beta3.JobExecutionDetails + * @static + * @param {google.dataflow.v1beta3.IJobExecutionDetails=} [properties] Properties to set + * @returns {google.dataflow.v1beta3.JobExecutionDetails} JobExecutionDetails instance + */ + JobExecutionDetails.create = function create(properties) { + return new JobExecutionDetails(properties); + }; + + /** + * Encodes the specified JobExecutionDetails message. Does not implicitly {@link google.dataflow.v1beta3.JobExecutionDetails.verify|verify} messages. + * @function encode + * @memberof google.dataflow.v1beta3.JobExecutionDetails + * @static + * @param {google.dataflow.v1beta3.IJobExecutionDetails} message JobExecutionDetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JobExecutionDetails.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.stages != null && message.stages.length) + for (var i = 0; i < message.stages.length; ++i) + $root.google.dataflow.v1beta3.StageSummary.encode(message.stages[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 JobExecutionDetails message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.JobExecutionDetails.verify|verify} messages. + * @function encodeDelimited + * @memberof google.dataflow.v1beta3.JobExecutionDetails + * @static + * @param {google.dataflow.v1beta3.IJobExecutionDetails} message JobExecutionDetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JobExecutionDetails.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a JobExecutionDetails message from the specified reader or buffer. + * @function decode + * @memberof google.dataflow.v1beta3.JobExecutionDetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.dataflow.v1beta3.JobExecutionDetails} JobExecutionDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JobExecutionDetails.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.dataflow.v1beta3.JobExecutionDetails(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.stages && message.stages.length)) + message.stages = []; + message.stages.push($root.google.dataflow.v1beta3.StageSummary.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a JobExecutionDetails message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.dataflow.v1beta3.JobExecutionDetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.dataflow.v1beta3.JobExecutionDetails} JobExecutionDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JobExecutionDetails.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a JobExecutionDetails message. + * @function verify + * @memberof google.dataflow.v1beta3.JobExecutionDetails + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + JobExecutionDetails.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.stages != null && message.hasOwnProperty("stages")) { + if (!Array.isArray(message.stages)) + return "stages: array expected"; + for (var i = 0; i < message.stages.length; ++i) { + var error = $root.google.dataflow.v1beta3.StageSummary.verify(message.stages[i]); + if (error) + return "stages." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a JobExecutionDetails message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.dataflow.v1beta3.JobExecutionDetails + * @static + * @param {Object.} object Plain object + * @returns {google.dataflow.v1beta3.JobExecutionDetails} JobExecutionDetails + */ + JobExecutionDetails.fromObject = function fromObject(object) { + if (object instanceof $root.google.dataflow.v1beta3.JobExecutionDetails) + return object; + var message = new $root.google.dataflow.v1beta3.JobExecutionDetails(); + if (object.stages) { + if (!Array.isArray(object.stages)) + throw TypeError(".google.dataflow.v1beta3.JobExecutionDetails.stages: array expected"); + message.stages = []; + for (var i = 0; i < object.stages.length; ++i) { + if (typeof object.stages[i] !== "object") + throw TypeError(".google.dataflow.v1beta3.JobExecutionDetails.stages: object expected"); + message.stages[i] = $root.google.dataflow.v1beta3.StageSummary.fromObject(object.stages[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a JobExecutionDetails message. Also converts values to other types if specified. + * @function toObject + * @memberof google.dataflow.v1beta3.JobExecutionDetails + * @static + * @param {google.dataflow.v1beta3.JobExecutionDetails} message JobExecutionDetails + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + JobExecutionDetails.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.stages = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.stages && message.stages.length) { + object.stages = []; + for (var j = 0; j < message.stages.length; ++j) + object.stages[j] = $root.google.dataflow.v1beta3.StageSummary.toObject(message.stages[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this JobExecutionDetails to JSON. + * @function toJSON + * @memberof google.dataflow.v1beta3.JobExecutionDetails + * @instance + * @returns {Object.} JSON object + */ + JobExecutionDetails.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for JobExecutionDetails + * @function getTypeUrl + * @memberof google.dataflow.v1beta3.JobExecutionDetails + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + JobExecutionDetails.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.dataflow.v1beta3.JobExecutionDetails"; + }; + + return JobExecutionDetails; + })(); + + v1beta3.GetStageExecutionDetailsRequest = (function() { + + /** + * Properties of a GetStageExecutionDetailsRequest. + * @memberof google.dataflow.v1beta3 + * @interface IGetStageExecutionDetailsRequest + * @property {string|null} [projectId] GetStageExecutionDetailsRequest projectId + * @property {string|null} [jobId] GetStageExecutionDetailsRequest jobId + * @property {string|null} [location] GetStageExecutionDetailsRequest location + * @property {string|null} [stageId] GetStageExecutionDetailsRequest stageId + * @property {number|null} [pageSize] GetStageExecutionDetailsRequest pageSize + * @property {string|null} [pageToken] GetStageExecutionDetailsRequest pageToken + * @property {google.protobuf.ITimestamp|null} [startTime] GetStageExecutionDetailsRequest startTime + * @property {google.protobuf.ITimestamp|null} [endTime] GetStageExecutionDetailsRequest endTime + */ + + /** + * Constructs a new GetStageExecutionDetailsRequest. + * @memberof google.dataflow.v1beta3 + * @classdesc Represents a GetStageExecutionDetailsRequest. + * @implements IGetStageExecutionDetailsRequest + * @constructor + * @param {google.dataflow.v1beta3.IGetStageExecutionDetailsRequest=} [properties] Properties to set + */ + function GetStageExecutionDetailsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetStageExecutionDetailsRequest projectId. + * @member {string} projectId + * @memberof google.dataflow.v1beta3.GetStageExecutionDetailsRequest + * @instance + */ + GetStageExecutionDetailsRequest.prototype.projectId = ""; + + /** + * GetStageExecutionDetailsRequest jobId. + * @member {string} jobId + * @memberof google.dataflow.v1beta3.GetStageExecutionDetailsRequest + * @instance + */ + GetStageExecutionDetailsRequest.prototype.jobId = ""; + + /** + * GetStageExecutionDetailsRequest location. + * @member {string} location + * @memberof google.dataflow.v1beta3.GetStageExecutionDetailsRequest + * @instance + */ + GetStageExecutionDetailsRequest.prototype.location = ""; + + /** + * GetStageExecutionDetailsRequest stageId. + * @member {string} stageId + * @memberof google.dataflow.v1beta3.GetStageExecutionDetailsRequest + * @instance + */ + GetStageExecutionDetailsRequest.prototype.stageId = ""; + + /** + * GetStageExecutionDetailsRequest pageSize. + * @member {number} pageSize + * @memberof google.dataflow.v1beta3.GetStageExecutionDetailsRequest + * @instance + */ + GetStageExecutionDetailsRequest.prototype.pageSize = 0; + + /** + * GetStageExecutionDetailsRequest pageToken. + * @member {string} pageToken + * @memberof google.dataflow.v1beta3.GetStageExecutionDetailsRequest + * @instance + */ + GetStageExecutionDetailsRequest.prototype.pageToken = ""; + + /** + * GetStageExecutionDetailsRequest startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.dataflow.v1beta3.GetStageExecutionDetailsRequest + * @instance + */ + GetStageExecutionDetailsRequest.prototype.startTime = null; + + /** + * GetStageExecutionDetailsRequest endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.dataflow.v1beta3.GetStageExecutionDetailsRequest + * @instance + */ + GetStageExecutionDetailsRequest.prototype.endTime = null; + + /** + * Creates a new GetStageExecutionDetailsRequest instance using the specified properties. + * @function create + * @memberof google.dataflow.v1beta3.GetStageExecutionDetailsRequest + * @static + * @param {google.dataflow.v1beta3.IGetStageExecutionDetailsRequest=} [properties] Properties to set + * @returns {google.dataflow.v1beta3.GetStageExecutionDetailsRequest} GetStageExecutionDetailsRequest instance + */ + GetStageExecutionDetailsRequest.create = function create(properties) { + return new GetStageExecutionDetailsRequest(properties); + }; + + /** + * Encodes the specified GetStageExecutionDetailsRequest message. Does not implicitly {@link google.dataflow.v1beta3.GetStageExecutionDetailsRequest.verify|verify} messages. + * @function encode + * @memberof google.dataflow.v1beta3.GetStageExecutionDetailsRequest + * @static + * @param {google.dataflow.v1beta3.IGetStageExecutionDetailsRequest} message GetStageExecutionDetailsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetStageExecutionDetailsRequest.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.jobId != null && Object.hasOwnProperty.call(message, "jobId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.jobId); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.location); + if (message.stageId != null && Object.hasOwnProperty.call(message, "stageId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.stageId); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.pageToken); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetStageExecutionDetailsRequest message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.GetStageExecutionDetailsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.dataflow.v1beta3.GetStageExecutionDetailsRequest + * @static + * @param {google.dataflow.v1beta3.IGetStageExecutionDetailsRequest} message GetStageExecutionDetailsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetStageExecutionDetailsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetStageExecutionDetailsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.dataflow.v1beta3.GetStageExecutionDetailsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.dataflow.v1beta3.GetStageExecutionDetailsRequest} GetStageExecutionDetailsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetStageExecutionDetailsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.dataflow.v1beta3.GetStageExecutionDetailsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.projectId = reader.string(); + break; + } + case 2: { + message.jobId = reader.string(); + break; + } + case 3: { + message.location = reader.string(); + break; + } + case 4: { + message.stageId = reader.string(); + break; + } + case 5: { + message.pageSize = reader.int32(); + break; + } + case 6: { + message.pageToken = reader.string(); + break; + } + case 7: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 8: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetStageExecutionDetailsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.dataflow.v1beta3.GetStageExecutionDetailsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.dataflow.v1beta3.GetStageExecutionDetailsRequest} GetStageExecutionDetailsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetStageExecutionDetailsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetStageExecutionDetailsRequest message. + * @function verify + * @memberof google.dataflow.v1beta3.GetStageExecutionDetailsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetStageExecutionDetailsRequest.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.jobId != null && message.hasOwnProperty("jobId")) + if (!$util.isString(message.jobId)) + return "jobId: string expected"; + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isString(message.location)) + return "location: string expected"; + if (message.stageId != null && message.hasOwnProperty("stageId")) + if (!$util.isString(message.stageId)) + return "stageId: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (error) + return "startTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + return null; + }; + + /** + * Creates a GetStageExecutionDetailsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.dataflow.v1beta3.GetStageExecutionDetailsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.dataflow.v1beta3.GetStageExecutionDetailsRequest} GetStageExecutionDetailsRequest + */ + GetStageExecutionDetailsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.dataflow.v1beta3.GetStageExecutionDetailsRequest) + return object; + var message = new $root.google.dataflow.v1beta3.GetStageExecutionDetailsRequest(); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.jobId != null) + message.jobId = String(object.jobId); + if (object.location != null) + message.location = String(object.location); + if (object.stageId != null) + message.stageId = String(object.stageId); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.dataflow.v1beta3.GetStageExecutionDetailsRequest.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.dataflow.v1beta3.GetStageExecutionDetailsRequest.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + return message; + }; + + /** + * Creates a plain object from a GetStageExecutionDetailsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.dataflow.v1beta3.GetStageExecutionDetailsRequest + * @static + * @param {google.dataflow.v1beta3.GetStageExecutionDetailsRequest} message GetStageExecutionDetailsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetStageExecutionDetailsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.projectId = ""; + object.jobId = ""; + object.location = ""; + object.stageId = ""; + object.pageSize = 0; + object.pageToken = ""; + object.startTime = null; + object.endTime = null; + } + if (message.projectId != null && message.hasOwnProperty("projectId")) + object.projectId = message.projectId; + if (message.jobId != null && message.hasOwnProperty("jobId")) + object.jobId = message.jobId; + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + if (message.stageId != null && message.hasOwnProperty("stageId")) + object.stageId = message.stageId; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + return object; + }; + + /** + * Converts this GetStageExecutionDetailsRequest to JSON. + * @function toJSON + * @memberof google.dataflow.v1beta3.GetStageExecutionDetailsRequest + * @instance + * @returns {Object.} JSON object + */ + GetStageExecutionDetailsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetStageExecutionDetailsRequest + * @function getTypeUrl + * @memberof google.dataflow.v1beta3.GetStageExecutionDetailsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetStageExecutionDetailsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.dataflow.v1beta3.GetStageExecutionDetailsRequest"; + }; + + return GetStageExecutionDetailsRequest; + })(); + + v1beta3.WorkItemDetails = (function() { + + /** + * Properties of a WorkItemDetails. + * @memberof google.dataflow.v1beta3 + * @interface IWorkItemDetails + * @property {string|null} [taskId] WorkItemDetails taskId + * @property {string|null} [attemptId] WorkItemDetails attemptId + * @property {google.protobuf.ITimestamp|null} [startTime] WorkItemDetails startTime + * @property {google.protobuf.ITimestamp|null} [endTime] WorkItemDetails endTime + * @property {google.dataflow.v1beta3.ExecutionState|null} [state] WorkItemDetails state + * @property {google.dataflow.v1beta3.IProgressTimeseries|null} [progress] WorkItemDetails progress + * @property {Array.|null} [metrics] WorkItemDetails metrics + */ + + /** + * Constructs a new WorkItemDetails. + * @memberof google.dataflow.v1beta3 + * @classdesc Represents a WorkItemDetails. + * @implements IWorkItemDetails + * @constructor + * @param {google.dataflow.v1beta3.IWorkItemDetails=} [properties] Properties to set + */ + function WorkItemDetails(properties) { + this.metrics = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * WorkItemDetails taskId. + * @member {string} taskId + * @memberof google.dataflow.v1beta3.WorkItemDetails + * @instance + */ + WorkItemDetails.prototype.taskId = ""; + + /** + * WorkItemDetails attemptId. + * @member {string} attemptId + * @memberof google.dataflow.v1beta3.WorkItemDetails + * @instance + */ + WorkItemDetails.prototype.attemptId = ""; + + /** + * WorkItemDetails startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.dataflow.v1beta3.WorkItemDetails + * @instance + */ + WorkItemDetails.prototype.startTime = null; + + /** + * WorkItemDetails endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.dataflow.v1beta3.WorkItemDetails + * @instance + */ + WorkItemDetails.prototype.endTime = null; + + /** + * WorkItemDetails state. + * @member {google.dataflow.v1beta3.ExecutionState} state + * @memberof google.dataflow.v1beta3.WorkItemDetails + * @instance + */ + WorkItemDetails.prototype.state = 0; + + /** + * WorkItemDetails progress. + * @member {google.dataflow.v1beta3.IProgressTimeseries|null|undefined} progress + * @memberof google.dataflow.v1beta3.WorkItemDetails + * @instance + */ + WorkItemDetails.prototype.progress = null; + + /** + * WorkItemDetails metrics. + * @member {Array.} metrics + * @memberof google.dataflow.v1beta3.WorkItemDetails + * @instance + */ + WorkItemDetails.prototype.metrics = $util.emptyArray; + + /** + * Creates a new WorkItemDetails instance using the specified properties. + * @function create + * @memberof google.dataflow.v1beta3.WorkItemDetails + * @static + * @param {google.dataflow.v1beta3.IWorkItemDetails=} [properties] Properties to set + * @returns {google.dataflow.v1beta3.WorkItemDetails} WorkItemDetails instance + */ + WorkItemDetails.create = function create(properties) { + return new WorkItemDetails(properties); + }; + + /** + * Encodes the specified WorkItemDetails message. Does not implicitly {@link google.dataflow.v1beta3.WorkItemDetails.verify|verify} messages. + * @function encode + * @memberof google.dataflow.v1beta3.WorkItemDetails + * @static + * @param {google.dataflow.v1beta3.IWorkItemDetails} message WorkItemDetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WorkItemDetails.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.taskId != null && Object.hasOwnProperty.call(message, "taskId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.taskId); + if (message.attemptId != null && Object.hasOwnProperty.call(message, "attemptId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.attemptId); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.state); + if (message.progress != null && Object.hasOwnProperty.call(message, "progress")) + $root.google.dataflow.v1beta3.ProgressTimeseries.encode(message.progress, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.metrics != null && message.metrics.length) + for (var i = 0; i < message.metrics.length; ++i) + $root.google.dataflow.v1beta3.MetricUpdate.encode(message.metrics[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified WorkItemDetails message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.WorkItemDetails.verify|verify} messages. + * @function encodeDelimited + * @memberof google.dataflow.v1beta3.WorkItemDetails + * @static + * @param {google.dataflow.v1beta3.IWorkItemDetails} message WorkItemDetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WorkItemDetails.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WorkItemDetails message from the specified reader or buffer. + * @function decode + * @memberof google.dataflow.v1beta3.WorkItemDetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.dataflow.v1beta3.WorkItemDetails} WorkItemDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WorkItemDetails.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.dataflow.v1beta3.WorkItemDetails(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.taskId = reader.string(); + break; + } + case 2: { + message.attemptId = reader.string(); + break; + } + case 3: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.state = reader.int32(); + break; + } + case 6: { + message.progress = $root.google.dataflow.v1beta3.ProgressTimeseries.decode(reader, reader.uint32()); + break; + } + case 7: { + if (!(message.metrics && message.metrics.length)) + message.metrics = []; + message.metrics.push($root.google.dataflow.v1beta3.MetricUpdate.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WorkItemDetails message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.dataflow.v1beta3.WorkItemDetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.dataflow.v1beta3.WorkItemDetails} WorkItemDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WorkItemDetails.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WorkItemDetails message. + * @function verify + * @memberof google.dataflow.v1beta3.WorkItemDetails + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WorkItemDetails.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.taskId != null && message.hasOwnProperty("taskId")) + if (!$util.isString(message.taskId)) + return "taskId: string expected"; + if (message.attemptId != null && message.hasOwnProperty("attemptId")) + if (!$util.isString(message.attemptId)) + return "attemptId: string expected"; + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (error) + return "startTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.progress != null && message.hasOwnProperty("progress")) { + var error = $root.google.dataflow.v1beta3.ProgressTimeseries.verify(message.progress); + if (error) + return "progress." + error; + } + if (message.metrics != null && message.hasOwnProperty("metrics")) { + if (!Array.isArray(message.metrics)) + return "metrics: array expected"; + for (var i = 0; i < message.metrics.length; ++i) { + var error = $root.google.dataflow.v1beta3.MetricUpdate.verify(message.metrics[i]); + if (error) + return "metrics." + error; + } + } + return null; + }; + + /** + * Creates a WorkItemDetails message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.dataflow.v1beta3.WorkItemDetails + * @static + * @param {Object.} object Plain object + * @returns {google.dataflow.v1beta3.WorkItemDetails} WorkItemDetails + */ + WorkItemDetails.fromObject = function fromObject(object) { + if (object instanceof $root.google.dataflow.v1beta3.WorkItemDetails) + return object; + var message = new $root.google.dataflow.v1beta3.WorkItemDetails(); + if (object.taskId != null) + message.taskId = String(object.taskId); + if (object.attemptId != null) + message.attemptId = String(object.attemptId); + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.dataflow.v1beta3.WorkItemDetails.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.dataflow.v1beta3.WorkItemDetails.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "EXECUTION_STATE_UNKNOWN": + case 0: + message.state = 0; + break; + case "EXECUTION_STATE_NOT_STARTED": + case 1: + message.state = 1; + break; + case "EXECUTION_STATE_RUNNING": + case 2: + message.state = 2; + break; + case "EXECUTION_STATE_SUCCEEDED": + case 3: + message.state = 3; + break; + case "EXECUTION_STATE_FAILED": + case 4: + message.state = 4; + break; + case "EXECUTION_STATE_CANCELLED": + case 5: + message.state = 5; + break; + } + if (object.progress != null) { + if (typeof object.progress !== "object") + throw TypeError(".google.dataflow.v1beta3.WorkItemDetails.progress: object expected"); + message.progress = $root.google.dataflow.v1beta3.ProgressTimeseries.fromObject(object.progress); + } + if (object.metrics) { + if (!Array.isArray(object.metrics)) + throw TypeError(".google.dataflow.v1beta3.WorkItemDetails.metrics: array expected"); + message.metrics = []; + for (var i = 0; i < object.metrics.length; ++i) { + if (typeof object.metrics[i] !== "object") + throw TypeError(".google.dataflow.v1beta3.WorkItemDetails.metrics: object expected"); + message.metrics[i] = $root.google.dataflow.v1beta3.MetricUpdate.fromObject(object.metrics[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a WorkItemDetails message. Also converts values to other types if specified. + * @function toObject + * @memberof google.dataflow.v1beta3.WorkItemDetails + * @static + * @param {google.dataflow.v1beta3.WorkItemDetails} message WorkItemDetails + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WorkItemDetails.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.metrics = []; + if (options.defaults) { + object.taskId = ""; + object.attemptId = ""; + object.startTime = null; + object.endTime = null; + object.state = options.enums === String ? "EXECUTION_STATE_UNKNOWN" : 0; + object.progress = null; + } + if (message.taskId != null && message.hasOwnProperty("taskId")) + object.taskId = message.taskId; + if (message.attemptId != null && message.hasOwnProperty("attemptId")) + object.attemptId = message.attemptId; + 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.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.dataflow.v1beta3.ExecutionState[message.state] === undefined ? message.state : $root.google.dataflow.v1beta3.ExecutionState[message.state] : message.state; + if (message.progress != null && message.hasOwnProperty("progress")) + object.progress = $root.google.dataflow.v1beta3.ProgressTimeseries.toObject(message.progress, options); + if (message.metrics && message.metrics.length) { + object.metrics = []; + for (var j = 0; j < message.metrics.length; ++j) + object.metrics[j] = $root.google.dataflow.v1beta3.MetricUpdate.toObject(message.metrics[j], options); + } + return object; + }; + + /** + * Converts this WorkItemDetails to JSON. + * @function toJSON + * @memberof google.dataflow.v1beta3.WorkItemDetails + * @instance + * @returns {Object.} JSON object + */ + WorkItemDetails.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for WorkItemDetails + * @function getTypeUrl + * @memberof google.dataflow.v1beta3.WorkItemDetails + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WorkItemDetails.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.dataflow.v1beta3.WorkItemDetails"; + }; + + return WorkItemDetails; + })(); + + v1beta3.WorkerDetails = (function() { + + /** + * Properties of a WorkerDetails. + * @memberof google.dataflow.v1beta3 + * @interface IWorkerDetails + * @property {string|null} [workerName] WorkerDetails workerName + * @property {Array.|null} [workItems] WorkerDetails workItems + */ + + /** + * Constructs a new WorkerDetails. + * @memberof google.dataflow.v1beta3 + * @classdesc Represents a WorkerDetails. + * @implements IWorkerDetails + * @constructor + * @param {google.dataflow.v1beta3.IWorkerDetails=} [properties] Properties to set + */ + function WorkerDetails(properties) { + this.workItems = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * WorkerDetails workerName. + * @member {string} workerName + * @memberof google.dataflow.v1beta3.WorkerDetails + * @instance + */ + WorkerDetails.prototype.workerName = ""; + + /** + * WorkerDetails workItems. + * @member {Array.} workItems + * @memberof google.dataflow.v1beta3.WorkerDetails + * @instance + */ + WorkerDetails.prototype.workItems = $util.emptyArray; + + /** + * Creates a new WorkerDetails instance using the specified properties. + * @function create + * @memberof google.dataflow.v1beta3.WorkerDetails + * @static + * @param {google.dataflow.v1beta3.IWorkerDetails=} [properties] Properties to set + * @returns {google.dataflow.v1beta3.WorkerDetails} WorkerDetails instance + */ + WorkerDetails.create = function create(properties) { + return new WorkerDetails(properties); + }; + + /** + * Encodes the specified WorkerDetails message. Does not implicitly {@link google.dataflow.v1beta3.WorkerDetails.verify|verify} messages. + * @function encode + * @memberof google.dataflow.v1beta3.WorkerDetails + * @static + * @param {google.dataflow.v1beta3.IWorkerDetails} message WorkerDetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WorkerDetails.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.workerName != null && Object.hasOwnProperty.call(message, "workerName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.workerName); + if (message.workItems != null && message.workItems.length) + for (var i = 0; i < message.workItems.length; ++i) + $root.google.dataflow.v1beta3.WorkItemDetails.encode(message.workItems[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified WorkerDetails message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.WorkerDetails.verify|verify} messages. + * @function encodeDelimited + * @memberof google.dataflow.v1beta3.WorkerDetails + * @static + * @param {google.dataflow.v1beta3.IWorkerDetails} message WorkerDetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WorkerDetails.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WorkerDetails message from the specified reader or buffer. + * @function decode + * @memberof google.dataflow.v1beta3.WorkerDetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.dataflow.v1beta3.WorkerDetails} WorkerDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WorkerDetails.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.dataflow.v1beta3.WorkerDetails(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.workerName = reader.string(); + break; + } + case 2: { + if (!(message.workItems && message.workItems.length)) + message.workItems = []; + message.workItems.push($root.google.dataflow.v1beta3.WorkItemDetails.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WorkerDetails message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.dataflow.v1beta3.WorkerDetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.dataflow.v1beta3.WorkerDetails} WorkerDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WorkerDetails.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WorkerDetails message. + * @function verify + * @memberof google.dataflow.v1beta3.WorkerDetails + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WorkerDetails.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.workerName != null && message.hasOwnProperty("workerName")) + if (!$util.isString(message.workerName)) + return "workerName: string expected"; + if (message.workItems != null && message.hasOwnProperty("workItems")) { + if (!Array.isArray(message.workItems)) + return "workItems: array expected"; + for (var i = 0; i < message.workItems.length; ++i) { + var error = $root.google.dataflow.v1beta3.WorkItemDetails.verify(message.workItems[i]); + if (error) + return "workItems." + error; + } + } + return null; + }; + + /** + * Creates a WorkerDetails message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.dataflow.v1beta3.WorkerDetails + * @static + * @param {Object.} object Plain object + * @returns {google.dataflow.v1beta3.WorkerDetails} WorkerDetails + */ + WorkerDetails.fromObject = function fromObject(object) { + if (object instanceof $root.google.dataflow.v1beta3.WorkerDetails) + return object; + var message = new $root.google.dataflow.v1beta3.WorkerDetails(); + if (object.workerName != null) + message.workerName = String(object.workerName); + if (object.workItems) { + if (!Array.isArray(object.workItems)) + throw TypeError(".google.dataflow.v1beta3.WorkerDetails.workItems: array expected"); + message.workItems = []; + for (var i = 0; i < object.workItems.length; ++i) { + if (typeof object.workItems[i] !== "object") + throw TypeError(".google.dataflow.v1beta3.WorkerDetails.workItems: object expected"); + message.workItems[i] = $root.google.dataflow.v1beta3.WorkItemDetails.fromObject(object.workItems[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a WorkerDetails message. Also converts values to other types if specified. + * @function toObject + * @memberof google.dataflow.v1beta3.WorkerDetails + * @static + * @param {google.dataflow.v1beta3.WorkerDetails} message WorkerDetails + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WorkerDetails.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.workItems = []; + if (options.defaults) + object.workerName = ""; + if (message.workerName != null && message.hasOwnProperty("workerName")) + object.workerName = message.workerName; + if (message.workItems && message.workItems.length) { + object.workItems = []; + for (var j = 0; j < message.workItems.length; ++j) + object.workItems[j] = $root.google.dataflow.v1beta3.WorkItemDetails.toObject(message.workItems[j], options); + } + return object; + }; + + /** + * Converts this WorkerDetails to JSON. + * @function toJSON + * @memberof google.dataflow.v1beta3.WorkerDetails + * @instance + * @returns {Object.} JSON object + */ + WorkerDetails.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for WorkerDetails + * @function getTypeUrl + * @memberof google.dataflow.v1beta3.WorkerDetails + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WorkerDetails.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.dataflow.v1beta3.WorkerDetails"; + }; + + return WorkerDetails; + })(); + + v1beta3.StageExecutionDetails = (function() { + + /** + * Properties of a StageExecutionDetails. + * @memberof google.dataflow.v1beta3 + * @interface IStageExecutionDetails + * @property {Array.|null} [workers] StageExecutionDetails workers + * @property {string|null} [nextPageToken] StageExecutionDetails nextPageToken + */ + + /** + * Constructs a new StageExecutionDetails. + * @memberof google.dataflow.v1beta3 + * @classdesc Represents a StageExecutionDetails. + * @implements IStageExecutionDetails + * @constructor + * @param {google.dataflow.v1beta3.IStageExecutionDetails=} [properties] Properties to set + */ + function StageExecutionDetails(properties) { + this.workers = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StageExecutionDetails workers. + * @member {Array.} workers + * @memberof google.dataflow.v1beta3.StageExecutionDetails + * @instance + */ + StageExecutionDetails.prototype.workers = $util.emptyArray; + + /** + * StageExecutionDetails nextPageToken. + * @member {string} nextPageToken + * @memberof google.dataflow.v1beta3.StageExecutionDetails + * @instance + */ + StageExecutionDetails.prototype.nextPageToken = ""; + + /** + * Creates a new StageExecutionDetails instance using the specified properties. + * @function create + * @memberof google.dataflow.v1beta3.StageExecutionDetails + * @static + * @param {google.dataflow.v1beta3.IStageExecutionDetails=} [properties] Properties to set + * @returns {google.dataflow.v1beta3.StageExecutionDetails} StageExecutionDetails instance + */ + StageExecutionDetails.create = function create(properties) { + return new StageExecutionDetails(properties); + }; + + /** + * Encodes the specified StageExecutionDetails message. Does not implicitly {@link google.dataflow.v1beta3.StageExecutionDetails.verify|verify} messages. + * @function encode + * @memberof google.dataflow.v1beta3.StageExecutionDetails + * @static + * @param {google.dataflow.v1beta3.IStageExecutionDetails} message StageExecutionDetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StageExecutionDetails.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.workers != null && message.workers.length) + for (var i = 0; i < message.workers.length; ++i) + $root.google.dataflow.v1beta3.WorkerDetails.encode(message.workers[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 StageExecutionDetails message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.StageExecutionDetails.verify|verify} messages. + * @function encodeDelimited + * @memberof google.dataflow.v1beta3.StageExecutionDetails + * @static + * @param {google.dataflow.v1beta3.IStageExecutionDetails} message StageExecutionDetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StageExecutionDetails.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StageExecutionDetails message from the specified reader or buffer. + * @function decode + * @memberof google.dataflow.v1beta3.StageExecutionDetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.dataflow.v1beta3.StageExecutionDetails} StageExecutionDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StageExecutionDetails.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.dataflow.v1beta3.StageExecutionDetails(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.workers && message.workers.length)) + message.workers = []; + message.workers.push($root.google.dataflow.v1beta3.WorkerDetails.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StageExecutionDetails message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.dataflow.v1beta3.StageExecutionDetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.dataflow.v1beta3.StageExecutionDetails} StageExecutionDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StageExecutionDetails.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StageExecutionDetails message. + * @function verify + * @memberof google.dataflow.v1beta3.StageExecutionDetails + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StageExecutionDetails.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.workers != null && message.hasOwnProperty("workers")) { + if (!Array.isArray(message.workers)) + return "workers: array expected"; + for (var i = 0; i < message.workers.length; ++i) { + var error = $root.google.dataflow.v1beta3.WorkerDetails.verify(message.workers[i]); + if (error) + return "workers." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a StageExecutionDetails message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.dataflow.v1beta3.StageExecutionDetails + * @static + * @param {Object.} object Plain object + * @returns {google.dataflow.v1beta3.StageExecutionDetails} StageExecutionDetails + */ + StageExecutionDetails.fromObject = function fromObject(object) { + if (object instanceof $root.google.dataflow.v1beta3.StageExecutionDetails) + return object; + var message = new $root.google.dataflow.v1beta3.StageExecutionDetails(); + if (object.workers) { + if (!Array.isArray(object.workers)) + throw TypeError(".google.dataflow.v1beta3.StageExecutionDetails.workers: array expected"); + message.workers = []; + for (var i = 0; i < object.workers.length; ++i) { + if (typeof object.workers[i] !== "object") + throw TypeError(".google.dataflow.v1beta3.StageExecutionDetails.workers: object expected"); + message.workers[i] = $root.google.dataflow.v1beta3.WorkerDetails.fromObject(object.workers[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a StageExecutionDetails message. Also converts values to other types if specified. + * @function toObject + * @memberof google.dataflow.v1beta3.StageExecutionDetails + * @static + * @param {google.dataflow.v1beta3.StageExecutionDetails} message StageExecutionDetails + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StageExecutionDetails.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.workers = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.workers && message.workers.length) { + object.workers = []; + for (var j = 0; j < message.workers.length; ++j) + object.workers[j] = $root.google.dataflow.v1beta3.WorkerDetails.toObject(message.workers[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this StageExecutionDetails to JSON. + * @function toJSON + * @memberof google.dataflow.v1beta3.StageExecutionDetails + * @instance + * @returns {Object.} JSON object + */ + StageExecutionDetails.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StageExecutionDetails + * @function getTypeUrl + * @memberof google.dataflow.v1beta3.StageExecutionDetails + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StageExecutionDetails.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.dataflow.v1beta3.StageExecutionDetails"; + }; + + return StageExecutionDetails; + })(); + + v1beta3.TopologyConfig = (function() { + + /** + * Properties of a TopologyConfig. + * @memberof google.dataflow.v1beta3 + * @interface ITopologyConfig + * @property {Array.|null} [computations] TopologyConfig computations + * @property {Array.|null} [dataDiskAssignments] TopologyConfig dataDiskAssignments + * @property {Object.|null} [userStageToComputationNameMap] TopologyConfig userStageToComputationNameMap + * @property {number|null} [forwardingKeyBits] TopologyConfig forwardingKeyBits + * @property {number|null} [persistentStateVersion] TopologyConfig persistentStateVersion + */ + + /** + * Constructs a new TopologyConfig. + * @memberof google.dataflow.v1beta3 + * @classdesc Represents a TopologyConfig. + * @implements ITopologyConfig + * @constructor + * @param {google.dataflow.v1beta3.ITopologyConfig=} [properties] Properties to set + */ + function TopologyConfig(properties) { + this.computations = []; + this.dataDiskAssignments = []; + this.userStageToComputationNameMap = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TopologyConfig computations. + * @member {Array.} computations + * @memberof google.dataflow.v1beta3.TopologyConfig + * @instance + */ + TopologyConfig.prototype.computations = $util.emptyArray; + + /** + * TopologyConfig dataDiskAssignments. + * @member {Array.} dataDiskAssignments + * @memberof google.dataflow.v1beta3.TopologyConfig + * @instance + */ + TopologyConfig.prototype.dataDiskAssignments = $util.emptyArray; + + /** + * TopologyConfig userStageToComputationNameMap. + * @member {Object.} userStageToComputationNameMap + * @memberof google.dataflow.v1beta3.TopologyConfig + * @instance + */ + TopologyConfig.prototype.userStageToComputationNameMap = $util.emptyObject; + + /** + * TopologyConfig forwardingKeyBits. + * @member {number} forwardingKeyBits + * @memberof google.dataflow.v1beta3.TopologyConfig + * @instance + */ + TopologyConfig.prototype.forwardingKeyBits = 0; + + /** + * TopologyConfig persistentStateVersion. + * @member {number} persistentStateVersion + * @memberof google.dataflow.v1beta3.TopologyConfig + * @instance + */ + TopologyConfig.prototype.persistentStateVersion = 0; + + /** + * Creates a new TopologyConfig instance using the specified properties. + * @function create + * @memberof google.dataflow.v1beta3.TopologyConfig + * @static + * @param {google.dataflow.v1beta3.ITopologyConfig=} [properties] Properties to set + * @returns {google.dataflow.v1beta3.TopologyConfig} TopologyConfig instance + */ + TopologyConfig.create = function create(properties) { + return new TopologyConfig(properties); + }; + + /** + * Encodes the specified TopologyConfig message. Does not implicitly {@link google.dataflow.v1beta3.TopologyConfig.verify|verify} messages. + * @function encode + * @memberof google.dataflow.v1beta3.TopologyConfig + * @static + * @param {google.dataflow.v1beta3.ITopologyConfig} message TopologyConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TopologyConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.computations != null && message.computations.length) + for (var i = 0; i < message.computations.length; ++i) + $root.google.dataflow.v1beta3.ComputationTopology.encode(message.computations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.dataDiskAssignments != null && message.dataDiskAssignments.length) + for (var i = 0; i < message.dataDiskAssignments.length; ++i) + $root.google.dataflow.v1beta3.DataDiskAssignment.encode(message.dataDiskAssignments[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.userStageToComputationNameMap != null && Object.hasOwnProperty.call(message, "userStageToComputationNameMap")) + for (var keys = Object.keys(message.userStageToComputationNameMap), i = 0; i < keys.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.userStageToComputationNameMap[keys[i]]).ldelim(); + if (message.forwardingKeyBits != null && Object.hasOwnProperty.call(message, "forwardingKeyBits")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.forwardingKeyBits); + if (message.persistentStateVersion != null && Object.hasOwnProperty.call(message, "persistentStateVersion")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.persistentStateVersion); + return writer; + }; + + /** + * Encodes the specified TopologyConfig message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.TopologyConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.dataflow.v1beta3.TopologyConfig + * @static + * @param {google.dataflow.v1beta3.ITopologyConfig} message TopologyConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TopologyConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TopologyConfig message from the specified reader or buffer. + * @function decode + * @memberof google.dataflow.v1beta3.TopologyConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.dataflow.v1beta3.TopologyConfig} TopologyConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TopologyConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.dataflow.v1beta3.TopologyConfig(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.computations && message.computations.length)) + message.computations = []; + message.computations.push($root.google.dataflow.v1beta3.ComputationTopology.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.dataDiskAssignments && message.dataDiskAssignments.length)) + message.dataDiskAssignments = []; + message.dataDiskAssignments.push($root.google.dataflow.v1beta3.DataDiskAssignment.decode(reader, reader.uint32())); + break; + } + case 3: { + if (message.userStageToComputationNameMap === $util.emptyObject) + message.userStageToComputationNameMap = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.userStageToComputationNameMap[key] = value; + break; + } + case 4: { + message.forwardingKeyBits = reader.int32(); + break; + } + case 5: { + message.persistentStateVersion = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TopologyConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.dataflow.v1beta3.TopologyConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.dataflow.v1beta3.TopologyConfig} TopologyConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TopologyConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TopologyConfig message. + * @function verify + * @memberof google.dataflow.v1beta3.TopologyConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TopologyConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.computations != null && message.hasOwnProperty("computations")) { + if (!Array.isArray(message.computations)) + return "computations: array expected"; + for (var i = 0; i < message.computations.length; ++i) { + var error = $root.google.dataflow.v1beta3.ComputationTopology.verify(message.computations[i]); + if (error) + return "computations." + error; + } + } + if (message.dataDiskAssignments != null && message.hasOwnProperty("dataDiskAssignments")) { + if (!Array.isArray(message.dataDiskAssignments)) + return "dataDiskAssignments: array expected"; + for (var i = 0; i < message.dataDiskAssignments.length; ++i) { + var error = $root.google.dataflow.v1beta3.DataDiskAssignment.verify(message.dataDiskAssignments[i]); + if (error) + return "dataDiskAssignments." + error; + } + } + if (message.userStageToComputationNameMap != null && message.hasOwnProperty("userStageToComputationNameMap")) { + if (!$util.isObject(message.userStageToComputationNameMap)) + return "userStageToComputationNameMap: object expected"; + var key = Object.keys(message.userStageToComputationNameMap); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.userStageToComputationNameMap[key[i]])) + return "userStageToComputationNameMap: string{k:string} expected"; + } + if (message.forwardingKeyBits != null && message.hasOwnProperty("forwardingKeyBits")) + if (!$util.isInteger(message.forwardingKeyBits)) + return "forwardingKeyBits: integer expected"; + if (message.persistentStateVersion != null && message.hasOwnProperty("persistentStateVersion")) + if (!$util.isInteger(message.persistentStateVersion)) + return "persistentStateVersion: integer expected"; + return null; + }; + + /** + * Creates a TopologyConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.dataflow.v1beta3.TopologyConfig + * @static + * @param {Object.} object Plain object + * @returns {google.dataflow.v1beta3.TopologyConfig} TopologyConfig + */ + TopologyConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.dataflow.v1beta3.TopologyConfig) + return object; + var message = new $root.google.dataflow.v1beta3.TopologyConfig(); + if (object.computations) { + if (!Array.isArray(object.computations)) + throw TypeError(".google.dataflow.v1beta3.TopologyConfig.computations: array expected"); + message.computations = []; + for (var i = 0; i < object.computations.length; ++i) { + if (typeof object.computations[i] !== "object") + throw TypeError(".google.dataflow.v1beta3.TopologyConfig.computations: object expected"); + message.computations[i] = $root.google.dataflow.v1beta3.ComputationTopology.fromObject(object.computations[i]); + } + } + if (object.dataDiskAssignments) { + if (!Array.isArray(object.dataDiskAssignments)) + throw TypeError(".google.dataflow.v1beta3.TopologyConfig.dataDiskAssignments: array expected"); + message.dataDiskAssignments = []; + for (var i = 0; i < object.dataDiskAssignments.length; ++i) { + if (typeof object.dataDiskAssignments[i] !== "object") + throw TypeError(".google.dataflow.v1beta3.TopologyConfig.dataDiskAssignments: object expected"); + message.dataDiskAssignments[i] = $root.google.dataflow.v1beta3.DataDiskAssignment.fromObject(object.dataDiskAssignments[i]); + } + } + if (object.userStageToComputationNameMap) { + if (typeof object.userStageToComputationNameMap !== "object") + throw TypeError(".google.dataflow.v1beta3.TopologyConfig.userStageToComputationNameMap: object expected"); + message.userStageToComputationNameMap = {}; + for (var keys = Object.keys(object.userStageToComputationNameMap), i = 0; i < keys.length; ++i) + message.userStageToComputationNameMap[keys[i]] = String(object.userStageToComputationNameMap[keys[i]]); + } + if (object.forwardingKeyBits != null) + message.forwardingKeyBits = object.forwardingKeyBits | 0; + if (object.persistentStateVersion != null) + message.persistentStateVersion = object.persistentStateVersion | 0; + return message; + }; + + /** + * Creates a plain object from a TopologyConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.dataflow.v1beta3.TopologyConfig + * @static + * @param {google.dataflow.v1beta3.TopologyConfig} message TopologyConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TopologyConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.computations = []; + object.dataDiskAssignments = []; + } + if (options.objects || options.defaults) + object.userStageToComputationNameMap = {}; + if (options.defaults) { + object.forwardingKeyBits = 0; + object.persistentStateVersion = 0; + } + if (message.computations && message.computations.length) { + object.computations = []; + for (var j = 0; j < message.computations.length; ++j) + object.computations[j] = $root.google.dataflow.v1beta3.ComputationTopology.toObject(message.computations[j], options); + } + if (message.dataDiskAssignments && message.dataDiskAssignments.length) { + object.dataDiskAssignments = []; + for (var j = 0; j < message.dataDiskAssignments.length; ++j) + object.dataDiskAssignments[j] = $root.google.dataflow.v1beta3.DataDiskAssignment.toObject(message.dataDiskAssignments[j], options); + } + var keys2; + if (message.userStageToComputationNameMap && (keys2 = Object.keys(message.userStageToComputationNameMap)).length) { + object.userStageToComputationNameMap = {}; + for (var j = 0; j < keys2.length; ++j) + object.userStageToComputationNameMap[keys2[j]] = message.userStageToComputationNameMap[keys2[j]]; + } + if (message.forwardingKeyBits != null && message.hasOwnProperty("forwardingKeyBits")) + object.forwardingKeyBits = message.forwardingKeyBits; + if (message.persistentStateVersion != null && message.hasOwnProperty("persistentStateVersion")) + object.persistentStateVersion = message.persistentStateVersion; + return object; + }; + + /** + * Converts this TopologyConfig to JSON. + * @function toJSON + * @memberof google.dataflow.v1beta3.TopologyConfig + * @instance + * @returns {Object.} JSON object + */ + TopologyConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TopologyConfig + * @function getTypeUrl + * @memberof google.dataflow.v1beta3.TopologyConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TopologyConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.dataflow.v1beta3.TopologyConfig"; + }; + + return TopologyConfig; + })(); + + v1beta3.PubsubLocation = (function() { + + /** + * Properties of a PubsubLocation. + * @memberof google.dataflow.v1beta3 + * @interface IPubsubLocation + * @property {string|null} [topic] PubsubLocation topic + * @property {string|null} [subscription] PubsubLocation subscription + * @property {string|null} [timestampLabel] PubsubLocation timestampLabel + * @property {string|null} [idLabel] PubsubLocation idLabel + * @property {boolean|null} [dropLateData] PubsubLocation dropLateData + * @property {string|null} [trackingSubscription] PubsubLocation trackingSubscription + * @property {boolean|null} [withAttributes] PubsubLocation withAttributes + */ + + /** + * Constructs a new PubsubLocation. + * @memberof google.dataflow.v1beta3 + * @classdesc Represents a PubsubLocation. + * @implements IPubsubLocation + * @constructor + * @param {google.dataflow.v1beta3.IPubsubLocation=} [properties] Properties to set + */ + function PubsubLocation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PubsubLocation topic. + * @member {string} topic + * @memberof google.dataflow.v1beta3.PubsubLocation + * @instance + */ + PubsubLocation.prototype.topic = ""; + + /** + * PubsubLocation subscription. + * @member {string} subscription + * @memberof google.dataflow.v1beta3.PubsubLocation + * @instance + */ + PubsubLocation.prototype.subscription = ""; + + /** + * PubsubLocation timestampLabel. + * @member {string} timestampLabel + * @memberof google.dataflow.v1beta3.PubsubLocation + * @instance + */ + PubsubLocation.prototype.timestampLabel = ""; + + /** + * PubsubLocation idLabel. + * @member {string} idLabel + * @memberof google.dataflow.v1beta3.PubsubLocation + * @instance + */ + PubsubLocation.prototype.idLabel = ""; + + /** + * PubsubLocation dropLateData. + * @member {boolean} dropLateData + * @memberof google.dataflow.v1beta3.PubsubLocation + * @instance + */ + PubsubLocation.prototype.dropLateData = false; + + /** + * PubsubLocation trackingSubscription. + * @member {string} trackingSubscription + * @memberof google.dataflow.v1beta3.PubsubLocation + * @instance + */ + PubsubLocation.prototype.trackingSubscription = ""; + + /** + * PubsubLocation withAttributes. + * @member {boolean} withAttributes + * @memberof google.dataflow.v1beta3.PubsubLocation + * @instance + */ + PubsubLocation.prototype.withAttributes = false; + + /** + * Creates a new PubsubLocation instance using the specified properties. + * @function create + * @memberof google.dataflow.v1beta3.PubsubLocation + * @static + * @param {google.dataflow.v1beta3.IPubsubLocation=} [properties] Properties to set + * @returns {google.dataflow.v1beta3.PubsubLocation} PubsubLocation instance + */ + PubsubLocation.create = function create(properties) { + return new PubsubLocation(properties); + }; + + /** + * Encodes the specified PubsubLocation message. Does not implicitly {@link google.dataflow.v1beta3.PubsubLocation.verify|verify} messages. + * @function encode + * @memberof google.dataflow.v1beta3.PubsubLocation + * @static + * @param {google.dataflow.v1beta3.IPubsubLocation} message PubsubLocation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PubsubLocation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.topic != null && Object.hasOwnProperty.call(message, "topic")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.topic); + if (message.subscription != null && Object.hasOwnProperty.call(message, "subscription")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.subscription); + if (message.timestampLabel != null && Object.hasOwnProperty.call(message, "timestampLabel")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.timestampLabel); + if (message.idLabel != null && Object.hasOwnProperty.call(message, "idLabel")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.idLabel); + if (message.dropLateData != null && Object.hasOwnProperty.call(message, "dropLateData")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.dropLateData); + if (message.trackingSubscription != null && Object.hasOwnProperty.call(message, "trackingSubscription")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.trackingSubscription); + if (message.withAttributes != null && Object.hasOwnProperty.call(message, "withAttributes")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.withAttributes); + return writer; + }; + + /** + * Encodes the specified PubsubLocation message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.PubsubLocation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.dataflow.v1beta3.PubsubLocation + * @static + * @param {google.dataflow.v1beta3.IPubsubLocation} message PubsubLocation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PubsubLocation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PubsubLocation message from the specified reader or buffer. + * @function decode + * @memberof google.dataflow.v1beta3.PubsubLocation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.dataflow.v1beta3.PubsubLocation} PubsubLocation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PubsubLocation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.dataflow.v1beta3.PubsubLocation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.topic = reader.string(); + break; + } + case 2: { + message.subscription = reader.string(); + break; + } + case 3: { + message.timestampLabel = reader.string(); + break; + } + case 4: { + message.idLabel = reader.string(); + break; + } + case 5: { + message.dropLateData = reader.bool(); + break; + } + case 6: { + message.trackingSubscription = reader.string(); + break; + } + case 7: { + message.withAttributes = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PubsubLocation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.dataflow.v1beta3.PubsubLocation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.dataflow.v1beta3.PubsubLocation} PubsubLocation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PubsubLocation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PubsubLocation message. + * @function verify + * @memberof google.dataflow.v1beta3.PubsubLocation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PubsubLocation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.topic != null && message.hasOwnProperty("topic")) + if (!$util.isString(message.topic)) + return "topic: string expected"; + if (message.subscription != null && message.hasOwnProperty("subscription")) + if (!$util.isString(message.subscription)) + return "subscription: string expected"; + if (message.timestampLabel != null && message.hasOwnProperty("timestampLabel")) + if (!$util.isString(message.timestampLabel)) + return "timestampLabel: string expected"; + if (message.idLabel != null && message.hasOwnProperty("idLabel")) + if (!$util.isString(message.idLabel)) + return "idLabel: string expected"; + if (message.dropLateData != null && message.hasOwnProperty("dropLateData")) + if (typeof message.dropLateData !== "boolean") + return "dropLateData: boolean expected"; + if (message.trackingSubscription != null && message.hasOwnProperty("trackingSubscription")) + if (!$util.isString(message.trackingSubscription)) + return "trackingSubscription: string expected"; + if (message.withAttributes != null && message.hasOwnProperty("withAttributes")) + if (typeof message.withAttributes !== "boolean") + return "withAttributes: boolean expected"; + return null; + }; + + /** + * Creates a PubsubLocation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.dataflow.v1beta3.PubsubLocation + * @static + * @param {Object.} object Plain object + * @returns {google.dataflow.v1beta3.PubsubLocation} PubsubLocation + */ + PubsubLocation.fromObject = function fromObject(object) { + if (object instanceof $root.google.dataflow.v1beta3.PubsubLocation) + return object; + var message = new $root.google.dataflow.v1beta3.PubsubLocation(); + if (object.topic != null) + message.topic = String(object.topic); + if (object.subscription != null) + message.subscription = String(object.subscription); + if (object.timestampLabel != null) + message.timestampLabel = String(object.timestampLabel); + if (object.idLabel != null) + message.idLabel = String(object.idLabel); + if (object.dropLateData != null) + message.dropLateData = Boolean(object.dropLateData); + if (object.trackingSubscription != null) + message.trackingSubscription = String(object.trackingSubscription); + if (object.withAttributes != null) + message.withAttributes = Boolean(object.withAttributes); + return message; + }; + + /** + * Creates a plain object from a PubsubLocation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.dataflow.v1beta3.PubsubLocation + * @static + * @param {google.dataflow.v1beta3.PubsubLocation} message PubsubLocation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PubsubLocation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.topic = ""; + object.subscription = ""; + object.timestampLabel = ""; + object.idLabel = ""; + object.dropLateData = false; + object.trackingSubscription = ""; + object.withAttributes = false; + } + if (message.topic != null && message.hasOwnProperty("topic")) + object.topic = message.topic; + if (message.subscription != null && message.hasOwnProperty("subscription")) + object.subscription = message.subscription; + if (message.timestampLabel != null && message.hasOwnProperty("timestampLabel")) + object.timestampLabel = message.timestampLabel; + if (message.idLabel != null && message.hasOwnProperty("idLabel")) + object.idLabel = message.idLabel; + if (message.dropLateData != null && message.hasOwnProperty("dropLateData")) + object.dropLateData = message.dropLateData; + if (message.trackingSubscription != null && message.hasOwnProperty("trackingSubscription")) + object.trackingSubscription = message.trackingSubscription; + if (message.withAttributes != null && message.hasOwnProperty("withAttributes")) + object.withAttributes = message.withAttributes; + return object; + }; + + /** + * Converts this PubsubLocation to JSON. + * @function toJSON + * @memberof google.dataflow.v1beta3.PubsubLocation + * @instance + * @returns {Object.} JSON object + */ + PubsubLocation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PubsubLocation + * @function getTypeUrl + * @memberof google.dataflow.v1beta3.PubsubLocation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PubsubLocation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.dataflow.v1beta3.PubsubLocation"; + }; + + return PubsubLocation; + })(); + + v1beta3.StreamingStageLocation = (function() { + + /** + * Properties of a StreamingStageLocation. + * @memberof google.dataflow.v1beta3 + * @interface IStreamingStageLocation + * @property {string|null} [streamId] StreamingStageLocation streamId + */ + + /** + * Constructs a new StreamingStageLocation. + * @memberof google.dataflow.v1beta3 + * @classdesc Represents a StreamingStageLocation. + * @implements IStreamingStageLocation + * @constructor + * @param {google.dataflow.v1beta3.IStreamingStageLocation=} [properties] Properties to set + */ + function StreamingStageLocation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StreamingStageLocation streamId. + * @member {string} streamId + * @memberof google.dataflow.v1beta3.StreamingStageLocation + * @instance + */ + StreamingStageLocation.prototype.streamId = ""; + + /** + * Creates a new StreamingStageLocation instance using the specified properties. + * @function create + * @memberof google.dataflow.v1beta3.StreamingStageLocation + * @static + * @param {google.dataflow.v1beta3.IStreamingStageLocation=} [properties] Properties to set + * @returns {google.dataflow.v1beta3.StreamingStageLocation} StreamingStageLocation instance + */ + StreamingStageLocation.create = function create(properties) { + return new StreamingStageLocation(properties); + }; + + /** + * Encodes the specified StreamingStageLocation message. Does not implicitly {@link google.dataflow.v1beta3.StreamingStageLocation.verify|verify} messages. + * @function encode + * @memberof google.dataflow.v1beta3.StreamingStageLocation + * @static + * @param {google.dataflow.v1beta3.IStreamingStageLocation} message StreamingStageLocation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamingStageLocation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.streamId != null && Object.hasOwnProperty.call(message, "streamId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.streamId); + return writer; + }; + + /** + * Encodes the specified StreamingStageLocation message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.StreamingStageLocation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.dataflow.v1beta3.StreamingStageLocation + * @static + * @param {google.dataflow.v1beta3.IStreamingStageLocation} message StreamingStageLocation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamingStageLocation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StreamingStageLocation message from the specified reader or buffer. + * @function decode + * @memberof google.dataflow.v1beta3.StreamingStageLocation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.dataflow.v1beta3.StreamingStageLocation} StreamingStageLocation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamingStageLocation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.dataflow.v1beta3.StreamingStageLocation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.streamId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StreamingStageLocation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.dataflow.v1beta3.StreamingStageLocation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.dataflow.v1beta3.StreamingStageLocation} StreamingStageLocation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamingStageLocation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StreamingStageLocation message. + * @function verify + * @memberof google.dataflow.v1beta3.StreamingStageLocation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StreamingStageLocation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.streamId != null && message.hasOwnProperty("streamId")) + if (!$util.isString(message.streamId)) + return "streamId: string expected"; + return null; + }; + + /** + * Creates a StreamingStageLocation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.dataflow.v1beta3.StreamingStageLocation + * @static + * @param {Object.} object Plain object + * @returns {google.dataflow.v1beta3.StreamingStageLocation} StreamingStageLocation + */ + StreamingStageLocation.fromObject = function fromObject(object) { + if (object instanceof $root.google.dataflow.v1beta3.StreamingStageLocation) + return object; + var message = new $root.google.dataflow.v1beta3.StreamingStageLocation(); + if (object.streamId != null) + message.streamId = String(object.streamId); + return message; + }; + + /** + * Creates a plain object from a StreamingStageLocation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.dataflow.v1beta3.StreamingStageLocation + * @static + * @param {google.dataflow.v1beta3.StreamingStageLocation} message StreamingStageLocation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StreamingStageLocation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.streamId = ""; + if (message.streamId != null && message.hasOwnProperty("streamId")) + object.streamId = message.streamId; + return object; + }; + + /** + * Converts this StreamingStageLocation to JSON. + * @function toJSON + * @memberof google.dataflow.v1beta3.StreamingStageLocation + * @instance + * @returns {Object.} JSON object + */ + StreamingStageLocation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StreamingStageLocation + * @function getTypeUrl + * @memberof google.dataflow.v1beta3.StreamingStageLocation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StreamingStageLocation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.dataflow.v1beta3.StreamingStageLocation"; + }; + + return StreamingStageLocation; + })(); + + v1beta3.StreamingSideInputLocation = (function() { + + /** + * Properties of a StreamingSideInputLocation. + * @memberof google.dataflow.v1beta3 + * @interface IStreamingSideInputLocation + * @property {string|null} [tag] StreamingSideInputLocation tag + * @property {string|null} [stateFamily] StreamingSideInputLocation stateFamily + */ + + /** + * Constructs a new StreamingSideInputLocation. + * @memberof google.dataflow.v1beta3 + * @classdesc Represents a StreamingSideInputLocation. + * @implements IStreamingSideInputLocation + * @constructor + * @param {google.dataflow.v1beta3.IStreamingSideInputLocation=} [properties] Properties to set + */ + function StreamingSideInputLocation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StreamingSideInputLocation tag. + * @member {string} tag + * @memberof google.dataflow.v1beta3.StreamingSideInputLocation + * @instance + */ + StreamingSideInputLocation.prototype.tag = ""; + + /** + * StreamingSideInputLocation stateFamily. + * @member {string} stateFamily + * @memberof google.dataflow.v1beta3.StreamingSideInputLocation + * @instance + */ + StreamingSideInputLocation.prototype.stateFamily = ""; + + /** + * Creates a new StreamingSideInputLocation instance using the specified properties. + * @function create + * @memberof google.dataflow.v1beta3.StreamingSideInputLocation + * @static + * @param {google.dataflow.v1beta3.IStreamingSideInputLocation=} [properties] Properties to set + * @returns {google.dataflow.v1beta3.StreamingSideInputLocation} StreamingSideInputLocation instance + */ + StreamingSideInputLocation.create = function create(properties) { + return new StreamingSideInputLocation(properties); + }; + + /** + * Encodes the specified StreamingSideInputLocation message. Does not implicitly {@link google.dataflow.v1beta3.StreamingSideInputLocation.verify|verify} messages. + * @function encode + * @memberof google.dataflow.v1beta3.StreamingSideInputLocation + * @static + * @param {google.dataflow.v1beta3.IStreamingSideInputLocation} message StreamingSideInputLocation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamingSideInputLocation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tag != null && Object.hasOwnProperty.call(message, "tag")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.tag); + if (message.stateFamily != null && Object.hasOwnProperty.call(message, "stateFamily")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.stateFamily); + return writer; + }; + + /** + * Encodes the specified StreamingSideInputLocation message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.StreamingSideInputLocation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.dataflow.v1beta3.StreamingSideInputLocation + * @static + * @param {google.dataflow.v1beta3.IStreamingSideInputLocation} message StreamingSideInputLocation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamingSideInputLocation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StreamingSideInputLocation message from the specified reader or buffer. + * @function decode + * @memberof google.dataflow.v1beta3.StreamingSideInputLocation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.dataflow.v1beta3.StreamingSideInputLocation} StreamingSideInputLocation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamingSideInputLocation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.dataflow.v1beta3.StreamingSideInputLocation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.tag = reader.string(); + break; + } + case 2: { + message.stateFamily = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StreamingSideInputLocation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.dataflow.v1beta3.StreamingSideInputLocation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.dataflow.v1beta3.StreamingSideInputLocation} StreamingSideInputLocation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamingSideInputLocation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StreamingSideInputLocation message. + * @function verify + * @memberof google.dataflow.v1beta3.StreamingSideInputLocation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StreamingSideInputLocation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tag != null && message.hasOwnProperty("tag")) + if (!$util.isString(message.tag)) + return "tag: string expected"; + if (message.stateFamily != null && message.hasOwnProperty("stateFamily")) + if (!$util.isString(message.stateFamily)) + return "stateFamily: string expected"; + return null; + }; + + /** + * Creates a StreamingSideInputLocation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.dataflow.v1beta3.StreamingSideInputLocation + * @static + * @param {Object.} object Plain object + * @returns {google.dataflow.v1beta3.StreamingSideInputLocation} StreamingSideInputLocation + */ + StreamingSideInputLocation.fromObject = function fromObject(object) { + if (object instanceof $root.google.dataflow.v1beta3.StreamingSideInputLocation) + return object; + var message = new $root.google.dataflow.v1beta3.StreamingSideInputLocation(); + if (object.tag != null) + message.tag = String(object.tag); + if (object.stateFamily != null) + message.stateFamily = String(object.stateFamily); + return message; + }; + + /** + * Creates a plain object from a StreamingSideInputLocation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.dataflow.v1beta3.StreamingSideInputLocation + * @static + * @param {google.dataflow.v1beta3.StreamingSideInputLocation} message StreamingSideInputLocation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StreamingSideInputLocation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.tag = ""; + object.stateFamily = ""; + } + if (message.tag != null && message.hasOwnProperty("tag")) + object.tag = message.tag; + if (message.stateFamily != null && message.hasOwnProperty("stateFamily")) + object.stateFamily = message.stateFamily; + return object; + }; + + /** + * Converts this StreamingSideInputLocation to JSON. + * @function toJSON + * @memberof google.dataflow.v1beta3.StreamingSideInputLocation + * @instance + * @returns {Object.} JSON object + */ + StreamingSideInputLocation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StreamingSideInputLocation + * @function getTypeUrl + * @memberof google.dataflow.v1beta3.StreamingSideInputLocation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StreamingSideInputLocation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.dataflow.v1beta3.StreamingSideInputLocation"; + }; + + return StreamingSideInputLocation; + })(); + + v1beta3.CustomSourceLocation = (function() { + + /** + * Properties of a CustomSourceLocation. + * @memberof google.dataflow.v1beta3 + * @interface ICustomSourceLocation + * @property {boolean|null} [stateful] CustomSourceLocation stateful + */ + + /** + * Constructs a new CustomSourceLocation. + * @memberof google.dataflow.v1beta3 + * @classdesc Represents a CustomSourceLocation. + * @implements ICustomSourceLocation + * @constructor + * @param {google.dataflow.v1beta3.ICustomSourceLocation=} [properties] Properties to set + */ + function CustomSourceLocation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CustomSourceLocation stateful. + * @member {boolean} stateful + * @memberof google.dataflow.v1beta3.CustomSourceLocation + * @instance + */ + CustomSourceLocation.prototype.stateful = false; + + /** + * Creates a new CustomSourceLocation instance using the specified properties. + * @function create + * @memberof google.dataflow.v1beta3.CustomSourceLocation + * @static + * @param {google.dataflow.v1beta3.ICustomSourceLocation=} [properties] Properties to set + * @returns {google.dataflow.v1beta3.CustomSourceLocation} CustomSourceLocation instance + */ + CustomSourceLocation.create = function create(properties) { + return new CustomSourceLocation(properties); + }; + + /** + * Encodes the specified CustomSourceLocation message. Does not implicitly {@link google.dataflow.v1beta3.CustomSourceLocation.verify|verify} messages. + * @function encode + * @memberof google.dataflow.v1beta3.CustomSourceLocation + * @static + * @param {google.dataflow.v1beta3.ICustomSourceLocation} message CustomSourceLocation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomSourceLocation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.stateful != null && Object.hasOwnProperty.call(message, "stateful")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.stateful); + return writer; + }; + + /** + * Encodes the specified CustomSourceLocation message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.CustomSourceLocation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.dataflow.v1beta3.CustomSourceLocation + * @static + * @param {google.dataflow.v1beta3.ICustomSourceLocation} message CustomSourceLocation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomSourceLocation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CustomSourceLocation message from the specified reader or buffer. + * @function decode + * @memberof google.dataflow.v1beta3.CustomSourceLocation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.dataflow.v1beta3.CustomSourceLocation} CustomSourceLocation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomSourceLocation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.dataflow.v1beta3.CustomSourceLocation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.stateful = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CustomSourceLocation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.dataflow.v1beta3.CustomSourceLocation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.dataflow.v1beta3.CustomSourceLocation} CustomSourceLocation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomSourceLocation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CustomSourceLocation message. + * @function verify + * @memberof google.dataflow.v1beta3.CustomSourceLocation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CustomSourceLocation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.stateful != null && message.hasOwnProperty("stateful")) + if (typeof message.stateful !== "boolean") + return "stateful: boolean expected"; + return null; + }; + + /** + * Creates a CustomSourceLocation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.dataflow.v1beta3.CustomSourceLocation + * @static + * @param {Object.} object Plain object + * @returns {google.dataflow.v1beta3.CustomSourceLocation} CustomSourceLocation + */ + CustomSourceLocation.fromObject = function fromObject(object) { + if (object instanceof $root.google.dataflow.v1beta3.CustomSourceLocation) + return object; + var message = new $root.google.dataflow.v1beta3.CustomSourceLocation(); + if (object.stateful != null) + message.stateful = Boolean(object.stateful); + return message; + }; + + /** + * Creates a plain object from a CustomSourceLocation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.dataflow.v1beta3.CustomSourceLocation + * @static + * @param {google.dataflow.v1beta3.CustomSourceLocation} message CustomSourceLocation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CustomSourceLocation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.stateful = false; + if (message.stateful != null && message.hasOwnProperty("stateful")) + object.stateful = message.stateful; + return object; + }; + + /** + * Converts this CustomSourceLocation to JSON. + * @function toJSON + * @memberof google.dataflow.v1beta3.CustomSourceLocation + * @instance + * @returns {Object.} JSON object + */ + CustomSourceLocation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CustomSourceLocation + * @function getTypeUrl + * @memberof google.dataflow.v1beta3.CustomSourceLocation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomSourceLocation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.dataflow.v1beta3.CustomSourceLocation"; + }; + + return CustomSourceLocation; + })(); + + v1beta3.StreamLocation = (function() { + + /** + * Properties of a StreamLocation. + * @memberof google.dataflow.v1beta3 + * @interface IStreamLocation + * @property {google.dataflow.v1beta3.IStreamingStageLocation|null} [streamingStageLocation] StreamLocation streamingStageLocation + * @property {google.dataflow.v1beta3.IPubsubLocation|null} [pubsubLocation] StreamLocation pubsubLocation + * @property {google.dataflow.v1beta3.IStreamingSideInputLocation|null} [sideInputLocation] StreamLocation sideInputLocation + * @property {google.dataflow.v1beta3.ICustomSourceLocation|null} [customSourceLocation] StreamLocation customSourceLocation + */ + + /** + * Constructs a new StreamLocation. + * @memberof google.dataflow.v1beta3 + * @classdesc Represents a StreamLocation. + * @implements IStreamLocation + * @constructor + * @param {google.dataflow.v1beta3.IStreamLocation=} [properties] Properties to set + */ + function StreamLocation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StreamLocation streamingStageLocation. + * @member {google.dataflow.v1beta3.IStreamingStageLocation|null|undefined} streamingStageLocation + * @memberof google.dataflow.v1beta3.StreamLocation + * @instance + */ + StreamLocation.prototype.streamingStageLocation = null; + + /** + * StreamLocation pubsubLocation. + * @member {google.dataflow.v1beta3.IPubsubLocation|null|undefined} pubsubLocation + * @memberof google.dataflow.v1beta3.StreamLocation + * @instance + */ + StreamLocation.prototype.pubsubLocation = null; + + /** + * StreamLocation sideInputLocation. + * @member {google.dataflow.v1beta3.IStreamingSideInputLocation|null|undefined} sideInputLocation + * @memberof google.dataflow.v1beta3.StreamLocation + * @instance + */ + StreamLocation.prototype.sideInputLocation = null; + + /** + * StreamLocation customSourceLocation. + * @member {google.dataflow.v1beta3.ICustomSourceLocation|null|undefined} customSourceLocation + * @memberof google.dataflow.v1beta3.StreamLocation + * @instance + */ + StreamLocation.prototype.customSourceLocation = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * StreamLocation location. + * @member {"streamingStageLocation"|"pubsubLocation"|"sideInputLocation"|"customSourceLocation"|undefined} location + * @memberof google.dataflow.v1beta3.StreamLocation + * @instance + */ + Object.defineProperty(StreamLocation.prototype, "location", { + get: $util.oneOfGetter($oneOfFields = ["streamingStageLocation", "pubsubLocation", "sideInputLocation", "customSourceLocation"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new StreamLocation instance using the specified properties. + * @function create + * @memberof google.dataflow.v1beta3.StreamLocation + * @static + * @param {google.dataflow.v1beta3.IStreamLocation=} [properties] Properties to set + * @returns {google.dataflow.v1beta3.StreamLocation} StreamLocation instance + */ + StreamLocation.create = function create(properties) { + return new StreamLocation(properties); + }; + + /** + * Encodes the specified StreamLocation message. Does not implicitly {@link google.dataflow.v1beta3.StreamLocation.verify|verify} messages. + * @function encode + * @memberof google.dataflow.v1beta3.StreamLocation + * @static + * @param {google.dataflow.v1beta3.IStreamLocation} message StreamLocation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamLocation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.streamingStageLocation != null && Object.hasOwnProperty.call(message, "streamingStageLocation")) + $root.google.dataflow.v1beta3.StreamingStageLocation.encode(message.streamingStageLocation, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.pubsubLocation != null && Object.hasOwnProperty.call(message, "pubsubLocation")) + $root.google.dataflow.v1beta3.PubsubLocation.encode(message.pubsubLocation, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.sideInputLocation != null && Object.hasOwnProperty.call(message, "sideInputLocation")) + $root.google.dataflow.v1beta3.StreamingSideInputLocation.encode(message.sideInputLocation, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.customSourceLocation != null && Object.hasOwnProperty.call(message, "customSourceLocation")) + $root.google.dataflow.v1beta3.CustomSourceLocation.encode(message.customSourceLocation, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified StreamLocation message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.StreamLocation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.dataflow.v1beta3.StreamLocation + * @static + * @param {google.dataflow.v1beta3.IStreamLocation} message StreamLocation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamLocation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StreamLocation message from the specified reader or buffer. + * @function decode + * @memberof google.dataflow.v1beta3.StreamLocation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.dataflow.v1beta3.StreamLocation} StreamLocation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamLocation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.dataflow.v1beta3.StreamLocation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.streamingStageLocation = $root.google.dataflow.v1beta3.StreamingStageLocation.decode(reader, reader.uint32()); + break; + } + case 2: { + message.pubsubLocation = $root.google.dataflow.v1beta3.PubsubLocation.decode(reader, reader.uint32()); + break; + } + case 3: { + message.sideInputLocation = $root.google.dataflow.v1beta3.StreamingSideInputLocation.decode(reader, reader.uint32()); + break; + } + case 4: { + message.customSourceLocation = $root.google.dataflow.v1beta3.CustomSourceLocation.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StreamLocation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.dataflow.v1beta3.StreamLocation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.dataflow.v1beta3.StreamLocation} StreamLocation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamLocation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StreamLocation message. + * @function verify + * @memberof google.dataflow.v1beta3.StreamLocation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StreamLocation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.streamingStageLocation != null && message.hasOwnProperty("streamingStageLocation")) { + properties.location = 1; + { + var error = $root.google.dataflow.v1beta3.StreamingStageLocation.verify(message.streamingStageLocation); + if (error) + return "streamingStageLocation." + error; + } + } + if (message.pubsubLocation != null && message.hasOwnProperty("pubsubLocation")) { + if (properties.location === 1) + return "location: multiple values"; + properties.location = 1; + { + var error = $root.google.dataflow.v1beta3.PubsubLocation.verify(message.pubsubLocation); + if (error) + return "pubsubLocation." + error; + } + } + if (message.sideInputLocation != null && message.hasOwnProperty("sideInputLocation")) { + if (properties.location === 1) + return "location: multiple values"; + properties.location = 1; + { + var error = $root.google.dataflow.v1beta3.StreamingSideInputLocation.verify(message.sideInputLocation); + if (error) + return "sideInputLocation." + error; + } + } + if (message.customSourceLocation != null && message.hasOwnProperty("customSourceLocation")) { + if (properties.location === 1) + return "location: multiple values"; + properties.location = 1; + { + var error = $root.google.dataflow.v1beta3.CustomSourceLocation.verify(message.customSourceLocation); + if (error) + return "customSourceLocation." + error; + } + } + return null; + }; + + /** + * Creates a StreamLocation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.dataflow.v1beta3.StreamLocation + * @static + * @param {Object.} object Plain object + * @returns {google.dataflow.v1beta3.StreamLocation} StreamLocation + */ + StreamLocation.fromObject = function fromObject(object) { + if (object instanceof $root.google.dataflow.v1beta3.StreamLocation) + return object; + var message = new $root.google.dataflow.v1beta3.StreamLocation(); + if (object.streamingStageLocation != null) { + if (typeof object.streamingStageLocation !== "object") + throw TypeError(".google.dataflow.v1beta3.StreamLocation.streamingStageLocation: object expected"); + message.streamingStageLocation = $root.google.dataflow.v1beta3.StreamingStageLocation.fromObject(object.streamingStageLocation); + } + if (object.pubsubLocation != null) { + if (typeof object.pubsubLocation !== "object") + throw TypeError(".google.dataflow.v1beta3.StreamLocation.pubsubLocation: object expected"); + message.pubsubLocation = $root.google.dataflow.v1beta3.PubsubLocation.fromObject(object.pubsubLocation); + } + if (object.sideInputLocation != null) { + if (typeof object.sideInputLocation !== "object") + throw TypeError(".google.dataflow.v1beta3.StreamLocation.sideInputLocation: object expected"); + message.sideInputLocation = $root.google.dataflow.v1beta3.StreamingSideInputLocation.fromObject(object.sideInputLocation); + } + if (object.customSourceLocation != null) { + if (typeof object.customSourceLocation !== "object") + throw TypeError(".google.dataflow.v1beta3.StreamLocation.customSourceLocation: object expected"); + message.customSourceLocation = $root.google.dataflow.v1beta3.CustomSourceLocation.fromObject(object.customSourceLocation); + } + return message; + }; + + /** + * Creates a plain object from a StreamLocation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.dataflow.v1beta3.StreamLocation + * @static + * @param {google.dataflow.v1beta3.StreamLocation} message StreamLocation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StreamLocation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.streamingStageLocation != null && message.hasOwnProperty("streamingStageLocation")) { + object.streamingStageLocation = $root.google.dataflow.v1beta3.StreamingStageLocation.toObject(message.streamingStageLocation, options); + if (options.oneofs) + object.location = "streamingStageLocation"; + } + if (message.pubsubLocation != null && message.hasOwnProperty("pubsubLocation")) { + object.pubsubLocation = $root.google.dataflow.v1beta3.PubsubLocation.toObject(message.pubsubLocation, options); + if (options.oneofs) + object.location = "pubsubLocation"; + } + if (message.sideInputLocation != null && message.hasOwnProperty("sideInputLocation")) { + object.sideInputLocation = $root.google.dataflow.v1beta3.StreamingSideInputLocation.toObject(message.sideInputLocation, options); + if (options.oneofs) + object.location = "sideInputLocation"; + } + if (message.customSourceLocation != null && message.hasOwnProperty("customSourceLocation")) { + object.customSourceLocation = $root.google.dataflow.v1beta3.CustomSourceLocation.toObject(message.customSourceLocation, options); + if (options.oneofs) + object.location = "customSourceLocation"; + } + return object; + }; + + /** + * Converts this StreamLocation to JSON. + * @function toJSON + * @memberof google.dataflow.v1beta3.StreamLocation + * @instance + * @returns {Object.} JSON object + */ + StreamLocation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StreamLocation + * @function getTypeUrl + * @memberof google.dataflow.v1beta3.StreamLocation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StreamLocation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.dataflow.v1beta3.StreamLocation"; + }; + + return StreamLocation; + })(); + + v1beta3.StateFamilyConfig = (function() { + + /** + * Properties of a StateFamilyConfig. + * @memberof google.dataflow.v1beta3 + * @interface IStateFamilyConfig + * @property {string|null} [stateFamily] StateFamilyConfig stateFamily + * @property {boolean|null} [isRead] StateFamilyConfig isRead + */ + + /** + * Constructs a new StateFamilyConfig. + * @memberof google.dataflow.v1beta3 + * @classdesc Represents a StateFamilyConfig. + * @implements IStateFamilyConfig + * @constructor + * @param {google.dataflow.v1beta3.IStateFamilyConfig=} [properties] Properties to set + */ + function StateFamilyConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StateFamilyConfig stateFamily. + * @member {string} stateFamily + * @memberof google.dataflow.v1beta3.StateFamilyConfig + * @instance + */ + StateFamilyConfig.prototype.stateFamily = ""; + + /** + * StateFamilyConfig isRead. + * @member {boolean} isRead + * @memberof google.dataflow.v1beta3.StateFamilyConfig + * @instance + */ + StateFamilyConfig.prototype.isRead = false; + + /** + * Creates a new StateFamilyConfig instance using the specified properties. + * @function create + * @memberof google.dataflow.v1beta3.StateFamilyConfig + * @static + * @param {google.dataflow.v1beta3.IStateFamilyConfig=} [properties] Properties to set + * @returns {google.dataflow.v1beta3.StateFamilyConfig} StateFamilyConfig instance + */ + StateFamilyConfig.create = function create(properties) { + return new StateFamilyConfig(properties); + }; + + /** + * Encodes the specified StateFamilyConfig message. Does not implicitly {@link google.dataflow.v1beta3.StateFamilyConfig.verify|verify} messages. + * @function encode + * @memberof google.dataflow.v1beta3.StateFamilyConfig + * @static + * @param {google.dataflow.v1beta3.IStateFamilyConfig} message StateFamilyConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StateFamilyConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.stateFamily != null && Object.hasOwnProperty.call(message, "stateFamily")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.stateFamily); + if (message.isRead != null && Object.hasOwnProperty.call(message, "isRead")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.isRead); + return writer; + }; + + /** + * Encodes the specified StateFamilyConfig message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.StateFamilyConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.dataflow.v1beta3.StateFamilyConfig + * @static + * @param {google.dataflow.v1beta3.IStateFamilyConfig} message StateFamilyConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StateFamilyConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StateFamilyConfig message from the specified reader or buffer. + * @function decode + * @memberof google.dataflow.v1beta3.StateFamilyConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.dataflow.v1beta3.StateFamilyConfig} StateFamilyConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StateFamilyConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.dataflow.v1beta3.StateFamilyConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.stateFamily = reader.string(); + break; + } + case 2: { + message.isRead = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StateFamilyConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.dataflow.v1beta3.StateFamilyConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.dataflow.v1beta3.StateFamilyConfig} StateFamilyConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StateFamilyConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StateFamilyConfig message. + * @function verify + * @memberof google.dataflow.v1beta3.StateFamilyConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StateFamilyConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.stateFamily != null && message.hasOwnProperty("stateFamily")) + if (!$util.isString(message.stateFamily)) + return "stateFamily: string expected"; + if (message.isRead != null && message.hasOwnProperty("isRead")) + if (typeof message.isRead !== "boolean") + return "isRead: boolean expected"; + return null; + }; + + /** + * Creates a StateFamilyConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.dataflow.v1beta3.StateFamilyConfig + * @static + * @param {Object.} object Plain object + * @returns {google.dataflow.v1beta3.StateFamilyConfig} StateFamilyConfig + */ + StateFamilyConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.dataflow.v1beta3.StateFamilyConfig) + return object; + var message = new $root.google.dataflow.v1beta3.StateFamilyConfig(); + if (object.stateFamily != null) + message.stateFamily = String(object.stateFamily); + if (object.isRead != null) + message.isRead = Boolean(object.isRead); + return message; + }; + + /** + * Creates a plain object from a StateFamilyConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.dataflow.v1beta3.StateFamilyConfig + * @static + * @param {google.dataflow.v1beta3.StateFamilyConfig} message StateFamilyConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StateFamilyConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.stateFamily = ""; + object.isRead = false; + } + if (message.stateFamily != null && message.hasOwnProperty("stateFamily")) + object.stateFamily = message.stateFamily; + if (message.isRead != null && message.hasOwnProperty("isRead")) + object.isRead = message.isRead; + return object; + }; + + /** + * Converts this StateFamilyConfig to JSON. + * @function toJSON + * @memberof google.dataflow.v1beta3.StateFamilyConfig + * @instance + * @returns {Object.} JSON object + */ + StateFamilyConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StateFamilyConfig + * @function getTypeUrl + * @memberof google.dataflow.v1beta3.StateFamilyConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StateFamilyConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.dataflow.v1beta3.StateFamilyConfig"; + }; + + return StateFamilyConfig; + })(); + + v1beta3.ComputationTopology = (function() { + + /** + * Properties of a ComputationTopology. + * @memberof google.dataflow.v1beta3 + * @interface IComputationTopology + * @property {string|null} [systemStageName] ComputationTopology systemStageName + * @property {string|null} [computationId] ComputationTopology computationId + * @property {Array.|null} [keyRanges] ComputationTopology keyRanges + * @property {Array.|null} [inputs] ComputationTopology inputs + * @property {Array.|null} [outputs] ComputationTopology outputs + * @property {Array.|null} [stateFamilies] ComputationTopology stateFamilies + */ + + /** + * Constructs a new ComputationTopology. + * @memberof google.dataflow.v1beta3 + * @classdesc Represents a ComputationTopology. + * @implements IComputationTopology + * @constructor + * @param {google.dataflow.v1beta3.IComputationTopology=} [properties] Properties to set + */ + function ComputationTopology(properties) { + this.keyRanges = []; + this.inputs = []; + this.outputs = []; + this.stateFamilies = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ComputationTopology systemStageName. + * @member {string} systemStageName + * @memberof google.dataflow.v1beta3.ComputationTopology + * @instance + */ + ComputationTopology.prototype.systemStageName = ""; + + /** + * ComputationTopology computationId. + * @member {string} computationId + * @memberof google.dataflow.v1beta3.ComputationTopology + * @instance + */ + ComputationTopology.prototype.computationId = ""; + + /** + * ComputationTopology keyRanges. + * @member {Array.} keyRanges + * @memberof google.dataflow.v1beta3.ComputationTopology + * @instance + */ + ComputationTopology.prototype.keyRanges = $util.emptyArray; + + /** + * ComputationTopology inputs. + * @member {Array.} inputs + * @memberof google.dataflow.v1beta3.ComputationTopology + * @instance + */ + ComputationTopology.prototype.inputs = $util.emptyArray; + + /** + * ComputationTopology outputs. + * @member {Array.} outputs + * @memberof google.dataflow.v1beta3.ComputationTopology + * @instance + */ + ComputationTopology.prototype.outputs = $util.emptyArray; + + /** + * ComputationTopology stateFamilies. + * @member {Array.} stateFamilies + * @memberof google.dataflow.v1beta3.ComputationTopology + * @instance + */ + ComputationTopology.prototype.stateFamilies = $util.emptyArray; + + /** + * Creates a new ComputationTopology instance using the specified properties. + * @function create + * @memberof google.dataflow.v1beta3.ComputationTopology + * @static + * @param {google.dataflow.v1beta3.IComputationTopology=} [properties] Properties to set + * @returns {google.dataflow.v1beta3.ComputationTopology} ComputationTopology instance + */ + ComputationTopology.create = function create(properties) { + return new ComputationTopology(properties); + }; + + /** + * Encodes the specified ComputationTopology message. Does not implicitly {@link google.dataflow.v1beta3.ComputationTopology.verify|verify} messages. + * @function encode + * @memberof google.dataflow.v1beta3.ComputationTopology + * @static + * @param {google.dataflow.v1beta3.IComputationTopology} message ComputationTopology message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ComputationTopology.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.systemStageName != null && Object.hasOwnProperty.call(message, "systemStageName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.systemStageName); + if (message.keyRanges != null && message.keyRanges.length) + for (var i = 0; i < message.keyRanges.length; ++i) + $root.google.dataflow.v1beta3.KeyRangeLocation.encode(message.keyRanges[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.inputs != null && message.inputs.length) + for (var i = 0; i < message.inputs.length; ++i) + $root.google.dataflow.v1beta3.StreamLocation.encode(message.inputs[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.outputs != null && message.outputs.length) + for (var i = 0; i < message.outputs.length; ++i) + $root.google.dataflow.v1beta3.StreamLocation.encode(message.outputs[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.computationId != null && Object.hasOwnProperty.call(message, "computationId")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.computationId); + if (message.stateFamilies != null && message.stateFamilies.length) + for (var i = 0; i < message.stateFamilies.length; ++i) + $root.google.dataflow.v1beta3.StateFamilyConfig.encode(message.stateFamilies[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ComputationTopology message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.ComputationTopology.verify|verify} messages. + * @function encodeDelimited + * @memberof google.dataflow.v1beta3.ComputationTopology + * @static + * @param {google.dataflow.v1beta3.IComputationTopology} message ComputationTopology message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ComputationTopology.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ComputationTopology message from the specified reader or buffer. + * @function decode + * @memberof google.dataflow.v1beta3.ComputationTopology + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.dataflow.v1beta3.ComputationTopology} ComputationTopology + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ComputationTopology.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.dataflow.v1beta3.ComputationTopology(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.systemStageName = reader.string(); + break; + } + case 5: { + message.computationId = reader.string(); + break; + } + case 2: { + if (!(message.keyRanges && message.keyRanges.length)) + message.keyRanges = []; + message.keyRanges.push($root.google.dataflow.v1beta3.KeyRangeLocation.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.inputs && message.inputs.length)) + message.inputs = []; + message.inputs.push($root.google.dataflow.v1beta3.StreamLocation.decode(reader, reader.uint32())); + break; + } + case 4: { + if (!(message.outputs && message.outputs.length)) + message.outputs = []; + message.outputs.push($root.google.dataflow.v1beta3.StreamLocation.decode(reader, reader.uint32())); + break; + } + case 7: { + if (!(message.stateFamilies && message.stateFamilies.length)) + message.stateFamilies = []; + message.stateFamilies.push($root.google.dataflow.v1beta3.StateFamilyConfig.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ComputationTopology message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.dataflow.v1beta3.ComputationTopology + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.dataflow.v1beta3.ComputationTopology} ComputationTopology + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ComputationTopology.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ComputationTopology message. + * @function verify + * @memberof google.dataflow.v1beta3.ComputationTopology + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ComputationTopology.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.systemStageName != null && message.hasOwnProperty("systemStageName")) + if (!$util.isString(message.systemStageName)) + return "systemStageName: string expected"; + if (message.computationId != null && message.hasOwnProperty("computationId")) + if (!$util.isString(message.computationId)) + return "computationId: string expected"; + if (message.keyRanges != null && message.hasOwnProperty("keyRanges")) { + if (!Array.isArray(message.keyRanges)) + return "keyRanges: array expected"; + for (var i = 0; i < message.keyRanges.length; ++i) { + var error = $root.google.dataflow.v1beta3.KeyRangeLocation.verify(message.keyRanges[i]); + if (error) + return "keyRanges." + error; + } + } + if (message.inputs != null && message.hasOwnProperty("inputs")) { + if (!Array.isArray(message.inputs)) + return "inputs: array expected"; + for (var i = 0; i < message.inputs.length; ++i) { + var error = $root.google.dataflow.v1beta3.StreamLocation.verify(message.inputs[i]); + if (error) + return "inputs." + error; + } + } + if (message.outputs != null && message.hasOwnProperty("outputs")) { + if (!Array.isArray(message.outputs)) + return "outputs: array expected"; + for (var i = 0; i < message.outputs.length; ++i) { + var error = $root.google.dataflow.v1beta3.StreamLocation.verify(message.outputs[i]); + if (error) + return "outputs." + error; + } + } + if (message.stateFamilies != null && message.hasOwnProperty("stateFamilies")) { + if (!Array.isArray(message.stateFamilies)) + return "stateFamilies: array expected"; + for (var i = 0; i < message.stateFamilies.length; ++i) { + var error = $root.google.dataflow.v1beta3.StateFamilyConfig.verify(message.stateFamilies[i]); + if (error) + return "stateFamilies." + error; + } + } + return null; + }; + + /** + * Creates a ComputationTopology message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.dataflow.v1beta3.ComputationTopology + * @static + * @param {Object.} object Plain object + * @returns {google.dataflow.v1beta3.ComputationTopology} ComputationTopology + */ + ComputationTopology.fromObject = function fromObject(object) { + if (object instanceof $root.google.dataflow.v1beta3.ComputationTopology) + return object; + var message = new $root.google.dataflow.v1beta3.ComputationTopology(); + if (object.systemStageName != null) + message.systemStageName = String(object.systemStageName); + if (object.computationId != null) + message.computationId = String(object.computationId); + if (object.keyRanges) { + if (!Array.isArray(object.keyRanges)) + throw TypeError(".google.dataflow.v1beta3.ComputationTopology.keyRanges: array expected"); + message.keyRanges = []; + for (var i = 0; i < object.keyRanges.length; ++i) { + if (typeof object.keyRanges[i] !== "object") + throw TypeError(".google.dataflow.v1beta3.ComputationTopology.keyRanges: object expected"); + message.keyRanges[i] = $root.google.dataflow.v1beta3.KeyRangeLocation.fromObject(object.keyRanges[i]); + } + } + if (object.inputs) { + if (!Array.isArray(object.inputs)) + throw TypeError(".google.dataflow.v1beta3.ComputationTopology.inputs: array expected"); + message.inputs = []; + for (var i = 0; i < object.inputs.length; ++i) { + if (typeof object.inputs[i] !== "object") + throw TypeError(".google.dataflow.v1beta3.ComputationTopology.inputs: object expected"); + message.inputs[i] = $root.google.dataflow.v1beta3.StreamLocation.fromObject(object.inputs[i]); + } + } + if (object.outputs) { + if (!Array.isArray(object.outputs)) + throw TypeError(".google.dataflow.v1beta3.ComputationTopology.outputs: array expected"); + message.outputs = []; + for (var i = 0; i < object.outputs.length; ++i) { + if (typeof object.outputs[i] !== "object") + throw TypeError(".google.dataflow.v1beta3.ComputationTopology.outputs: object expected"); + message.outputs[i] = $root.google.dataflow.v1beta3.StreamLocation.fromObject(object.outputs[i]); + } + } + if (object.stateFamilies) { + if (!Array.isArray(object.stateFamilies)) + throw TypeError(".google.dataflow.v1beta3.ComputationTopology.stateFamilies: array expected"); + message.stateFamilies = []; + for (var i = 0; i < object.stateFamilies.length; ++i) { + if (typeof object.stateFamilies[i] !== "object") + throw TypeError(".google.dataflow.v1beta3.ComputationTopology.stateFamilies: object expected"); + message.stateFamilies[i] = $root.google.dataflow.v1beta3.StateFamilyConfig.fromObject(object.stateFamilies[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ComputationTopology message. Also converts values to other types if specified. + * @function toObject + * @memberof google.dataflow.v1beta3.ComputationTopology + * @static + * @param {google.dataflow.v1beta3.ComputationTopology} message ComputationTopology + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ComputationTopology.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.keyRanges = []; + object.inputs = []; + object.outputs = []; + object.stateFamilies = []; + } + if (options.defaults) { + object.systemStageName = ""; + object.computationId = ""; + } + if (message.systemStageName != null && message.hasOwnProperty("systemStageName")) + object.systemStageName = message.systemStageName; + if (message.keyRanges && message.keyRanges.length) { + object.keyRanges = []; + for (var j = 0; j < message.keyRanges.length; ++j) + object.keyRanges[j] = $root.google.dataflow.v1beta3.KeyRangeLocation.toObject(message.keyRanges[j], options); + } + if (message.inputs && message.inputs.length) { + object.inputs = []; + for (var j = 0; j < message.inputs.length; ++j) + object.inputs[j] = $root.google.dataflow.v1beta3.StreamLocation.toObject(message.inputs[j], options); + } + if (message.outputs && message.outputs.length) { + object.outputs = []; + for (var j = 0; j < message.outputs.length; ++j) + object.outputs[j] = $root.google.dataflow.v1beta3.StreamLocation.toObject(message.outputs[j], options); + } + if (message.computationId != null && message.hasOwnProperty("computationId")) + object.computationId = message.computationId; + if (message.stateFamilies && message.stateFamilies.length) { + object.stateFamilies = []; + for (var j = 0; j < message.stateFamilies.length; ++j) + object.stateFamilies[j] = $root.google.dataflow.v1beta3.StateFamilyConfig.toObject(message.stateFamilies[j], options); + } + return object; + }; + + /** + * Converts this ComputationTopology to JSON. + * @function toJSON + * @memberof google.dataflow.v1beta3.ComputationTopology + * @instance + * @returns {Object.} JSON object + */ + ComputationTopology.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ComputationTopology + * @function getTypeUrl + * @memberof google.dataflow.v1beta3.ComputationTopology + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ComputationTopology.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.dataflow.v1beta3.ComputationTopology"; + }; + + return ComputationTopology; + })(); + + v1beta3.KeyRangeLocation = (function() { + + /** + * Properties of a KeyRangeLocation. + * @memberof google.dataflow.v1beta3 + * @interface IKeyRangeLocation + * @property {string|null} [start] KeyRangeLocation start + * @property {string|null} [end] KeyRangeLocation end + * @property {string|null} [deliveryEndpoint] KeyRangeLocation deliveryEndpoint + * @property {string|null} [dataDisk] KeyRangeLocation dataDisk + * @property {string|null} [deprecatedPersistentDirectory] KeyRangeLocation deprecatedPersistentDirectory + */ + + /** + * Constructs a new KeyRangeLocation. + * @memberof google.dataflow.v1beta3 + * @classdesc Represents a KeyRangeLocation. + * @implements IKeyRangeLocation + * @constructor + * @param {google.dataflow.v1beta3.IKeyRangeLocation=} [properties] Properties to set + */ + function KeyRangeLocation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * KeyRangeLocation start. + * @member {string} start + * @memberof google.dataflow.v1beta3.KeyRangeLocation + * @instance + */ + KeyRangeLocation.prototype.start = ""; + + /** + * KeyRangeLocation end. + * @member {string} end + * @memberof google.dataflow.v1beta3.KeyRangeLocation + * @instance + */ + KeyRangeLocation.prototype.end = ""; + + /** + * KeyRangeLocation deliveryEndpoint. + * @member {string} deliveryEndpoint + * @memberof google.dataflow.v1beta3.KeyRangeLocation + * @instance + */ + KeyRangeLocation.prototype.deliveryEndpoint = ""; + + /** + * KeyRangeLocation dataDisk. + * @member {string} dataDisk + * @memberof google.dataflow.v1beta3.KeyRangeLocation + * @instance + */ + KeyRangeLocation.prototype.dataDisk = ""; + + /** + * KeyRangeLocation deprecatedPersistentDirectory. + * @member {string} deprecatedPersistentDirectory + * @memberof google.dataflow.v1beta3.KeyRangeLocation + * @instance + */ + KeyRangeLocation.prototype.deprecatedPersistentDirectory = ""; + + /** + * Creates a new KeyRangeLocation instance using the specified properties. + * @function create + * @memberof google.dataflow.v1beta3.KeyRangeLocation + * @static + * @param {google.dataflow.v1beta3.IKeyRangeLocation=} [properties] Properties to set + * @returns {google.dataflow.v1beta3.KeyRangeLocation} KeyRangeLocation instance + */ + KeyRangeLocation.create = function create(properties) { + return new KeyRangeLocation(properties); + }; + + /** + * Encodes the specified KeyRangeLocation message. Does not implicitly {@link google.dataflow.v1beta3.KeyRangeLocation.verify|verify} messages. + * @function encode + * @memberof google.dataflow.v1beta3.KeyRangeLocation + * @static + * @param {google.dataflow.v1beta3.IKeyRangeLocation} message KeyRangeLocation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KeyRangeLocation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.end); + if (message.deliveryEndpoint != null && Object.hasOwnProperty.call(message, "deliveryEndpoint")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.deliveryEndpoint); + if (message.deprecatedPersistentDirectory != null && Object.hasOwnProperty.call(message, "deprecatedPersistentDirectory")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.deprecatedPersistentDirectory); + if (message.dataDisk != null && Object.hasOwnProperty.call(message, "dataDisk")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.dataDisk); + return writer; + }; + + /** + * Encodes the specified KeyRangeLocation message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.KeyRangeLocation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.dataflow.v1beta3.KeyRangeLocation + * @static + * @param {google.dataflow.v1beta3.IKeyRangeLocation} message KeyRangeLocation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KeyRangeLocation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a KeyRangeLocation message from the specified reader or buffer. + * @function decode + * @memberof google.dataflow.v1beta3.KeyRangeLocation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.dataflow.v1beta3.KeyRangeLocation} KeyRangeLocation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KeyRangeLocation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.dataflow.v1beta3.KeyRangeLocation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.start = reader.string(); + break; + } + case 2: { + message.end = reader.string(); + break; + } + case 3: { + message.deliveryEndpoint = reader.string(); + break; + } + case 5: { + message.dataDisk = reader.string(); + break; + } + case 4: { + message.deprecatedPersistentDirectory = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a KeyRangeLocation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.dataflow.v1beta3.KeyRangeLocation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.dataflow.v1beta3.KeyRangeLocation} KeyRangeLocation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KeyRangeLocation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a KeyRangeLocation message. + * @function verify + * @memberof google.dataflow.v1beta3.KeyRangeLocation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + KeyRangeLocation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isString(message.start)) + return "start: string expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isString(message.end)) + return "end: string expected"; + if (message.deliveryEndpoint != null && message.hasOwnProperty("deliveryEndpoint")) + if (!$util.isString(message.deliveryEndpoint)) + return "deliveryEndpoint: string expected"; + if (message.dataDisk != null && message.hasOwnProperty("dataDisk")) + if (!$util.isString(message.dataDisk)) + return "dataDisk: string expected"; + if (message.deprecatedPersistentDirectory != null && message.hasOwnProperty("deprecatedPersistentDirectory")) + if (!$util.isString(message.deprecatedPersistentDirectory)) + return "deprecatedPersistentDirectory: string expected"; + return null; + }; + + /** + * Creates a KeyRangeLocation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.dataflow.v1beta3.KeyRangeLocation + * @static + * @param {Object.} object Plain object + * @returns {google.dataflow.v1beta3.KeyRangeLocation} KeyRangeLocation + */ + KeyRangeLocation.fromObject = function fromObject(object) { + if (object instanceof $root.google.dataflow.v1beta3.KeyRangeLocation) + return object; + var message = new $root.google.dataflow.v1beta3.KeyRangeLocation(); + if (object.start != null) + message.start = String(object.start); + if (object.end != null) + message.end = String(object.end); + if (object.deliveryEndpoint != null) + message.deliveryEndpoint = String(object.deliveryEndpoint); + if (object.dataDisk != null) + message.dataDisk = String(object.dataDisk); + if (object.deprecatedPersistentDirectory != null) + message.deprecatedPersistentDirectory = String(object.deprecatedPersistentDirectory); + return message; + }; + + /** + * Creates a plain object from a KeyRangeLocation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.dataflow.v1beta3.KeyRangeLocation + * @static + * @param {google.dataflow.v1beta3.KeyRangeLocation} message KeyRangeLocation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + KeyRangeLocation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = ""; + object.end = ""; + object.deliveryEndpoint = ""; + object.deprecatedPersistentDirectory = ""; + object.dataDisk = ""; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + if (message.deliveryEndpoint != null && message.hasOwnProperty("deliveryEndpoint")) + object.deliveryEndpoint = message.deliveryEndpoint; + if (message.deprecatedPersistentDirectory != null && message.hasOwnProperty("deprecatedPersistentDirectory")) + object.deprecatedPersistentDirectory = message.deprecatedPersistentDirectory; + if (message.dataDisk != null && message.hasOwnProperty("dataDisk")) + object.dataDisk = message.dataDisk; + return object; + }; + + /** + * Converts this KeyRangeLocation to JSON. + * @function toJSON + * @memberof google.dataflow.v1beta3.KeyRangeLocation + * @instance + * @returns {Object.} JSON object + */ + KeyRangeLocation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for KeyRangeLocation + * @function getTypeUrl + * @memberof google.dataflow.v1beta3.KeyRangeLocation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + KeyRangeLocation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.dataflow.v1beta3.KeyRangeLocation"; + }; + + return KeyRangeLocation; + })(); + + v1beta3.MountedDataDisk = (function() { + + /** + * Properties of a MountedDataDisk. + * @memberof google.dataflow.v1beta3 + * @interface IMountedDataDisk + * @property {string|null} [dataDisk] MountedDataDisk dataDisk + */ + + /** + * Constructs a new MountedDataDisk. + * @memberof google.dataflow.v1beta3 + * @classdesc Represents a MountedDataDisk. + * @implements IMountedDataDisk + * @constructor + * @param {google.dataflow.v1beta3.IMountedDataDisk=} [properties] Properties to set + */ + function MountedDataDisk(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MountedDataDisk dataDisk. + * @member {string} dataDisk + * @memberof google.dataflow.v1beta3.MountedDataDisk + * @instance + */ + MountedDataDisk.prototype.dataDisk = ""; + + /** + * Creates a new MountedDataDisk instance using the specified properties. + * @function create + * @memberof google.dataflow.v1beta3.MountedDataDisk + * @static + * @param {google.dataflow.v1beta3.IMountedDataDisk=} [properties] Properties to set + * @returns {google.dataflow.v1beta3.MountedDataDisk} MountedDataDisk instance + */ + MountedDataDisk.create = function create(properties) { + return new MountedDataDisk(properties); + }; + + /** + * Encodes the specified MountedDataDisk message. Does not implicitly {@link google.dataflow.v1beta3.MountedDataDisk.verify|verify} messages. + * @function encode + * @memberof google.dataflow.v1beta3.MountedDataDisk + * @static + * @param {google.dataflow.v1beta3.IMountedDataDisk} message MountedDataDisk message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MountedDataDisk.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dataDisk != null && Object.hasOwnProperty.call(message, "dataDisk")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.dataDisk); + return writer; + }; + + /** + * Encodes the specified MountedDataDisk message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.MountedDataDisk.verify|verify} messages. + * @function encodeDelimited + * @memberof google.dataflow.v1beta3.MountedDataDisk + * @static + * @param {google.dataflow.v1beta3.IMountedDataDisk} message MountedDataDisk message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MountedDataDisk.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MountedDataDisk message from the specified reader or buffer. + * @function decode + * @memberof google.dataflow.v1beta3.MountedDataDisk + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.dataflow.v1beta3.MountedDataDisk} MountedDataDisk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MountedDataDisk.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.dataflow.v1beta3.MountedDataDisk(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.dataDisk = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MountedDataDisk message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.dataflow.v1beta3.MountedDataDisk + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.dataflow.v1beta3.MountedDataDisk} MountedDataDisk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MountedDataDisk.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MountedDataDisk message. + * @function verify + * @memberof google.dataflow.v1beta3.MountedDataDisk + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MountedDataDisk.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.dataDisk != null && message.hasOwnProperty("dataDisk")) + if (!$util.isString(message.dataDisk)) + return "dataDisk: string expected"; + return null; + }; + + /** + * Creates a MountedDataDisk message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.dataflow.v1beta3.MountedDataDisk + * @static + * @param {Object.} object Plain object + * @returns {google.dataflow.v1beta3.MountedDataDisk} MountedDataDisk + */ + MountedDataDisk.fromObject = function fromObject(object) { + if (object instanceof $root.google.dataflow.v1beta3.MountedDataDisk) + return object; + var message = new $root.google.dataflow.v1beta3.MountedDataDisk(); + if (object.dataDisk != null) + message.dataDisk = String(object.dataDisk); + return message; + }; + + /** + * Creates a plain object from a MountedDataDisk message. Also converts values to other types if specified. + * @function toObject + * @memberof google.dataflow.v1beta3.MountedDataDisk + * @static + * @param {google.dataflow.v1beta3.MountedDataDisk} message MountedDataDisk + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MountedDataDisk.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.dataDisk = ""; + if (message.dataDisk != null && message.hasOwnProperty("dataDisk")) + object.dataDisk = message.dataDisk; + return object; + }; + + /** + * Converts this MountedDataDisk to JSON. + * @function toJSON + * @memberof google.dataflow.v1beta3.MountedDataDisk + * @instance + * @returns {Object.} JSON object + */ + MountedDataDisk.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MountedDataDisk + * @function getTypeUrl + * @memberof google.dataflow.v1beta3.MountedDataDisk + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MountedDataDisk.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.dataflow.v1beta3.MountedDataDisk"; + }; + + return MountedDataDisk; + })(); + + v1beta3.DataDiskAssignment = (function() { + + /** + * Properties of a DataDiskAssignment. + * @memberof google.dataflow.v1beta3 + * @interface IDataDiskAssignment + * @property {string|null} [vmInstance] DataDiskAssignment vmInstance + * @property {Array.|null} [dataDisks] DataDiskAssignment dataDisks + */ + + /** + * Constructs a new DataDiskAssignment. + * @memberof google.dataflow.v1beta3 + * @classdesc Represents a DataDiskAssignment. + * @implements IDataDiskAssignment + * @constructor + * @param {google.dataflow.v1beta3.IDataDiskAssignment=} [properties] Properties to set + */ + function DataDiskAssignment(properties) { + this.dataDisks = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DataDiskAssignment vmInstance. + * @member {string} vmInstance + * @memberof google.dataflow.v1beta3.DataDiskAssignment + * @instance + */ + DataDiskAssignment.prototype.vmInstance = ""; + + /** + * DataDiskAssignment dataDisks. + * @member {Array.} dataDisks + * @memberof google.dataflow.v1beta3.DataDiskAssignment + * @instance + */ + DataDiskAssignment.prototype.dataDisks = $util.emptyArray; + + /** + * Creates a new DataDiskAssignment instance using the specified properties. + * @function create + * @memberof google.dataflow.v1beta3.DataDiskAssignment + * @static + * @param {google.dataflow.v1beta3.IDataDiskAssignment=} [properties] Properties to set + * @returns {google.dataflow.v1beta3.DataDiskAssignment} DataDiskAssignment instance + */ + DataDiskAssignment.create = function create(properties) { + return new DataDiskAssignment(properties); + }; + + /** + * Encodes the specified DataDiskAssignment message. Does not implicitly {@link google.dataflow.v1beta3.DataDiskAssignment.verify|verify} messages. + * @function encode + * @memberof google.dataflow.v1beta3.DataDiskAssignment + * @static + * @param {google.dataflow.v1beta3.IDataDiskAssignment} message DataDiskAssignment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataDiskAssignment.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.vmInstance != null && Object.hasOwnProperty.call(message, "vmInstance")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.vmInstance); + if (message.dataDisks != null && message.dataDisks.length) + for (var i = 0; i < message.dataDisks.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.dataDisks[i]); + return writer; + }; + + /** + * Encodes the specified DataDiskAssignment message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.DataDiskAssignment.verify|verify} messages. + * @function encodeDelimited + * @memberof google.dataflow.v1beta3.DataDiskAssignment + * @static + * @param {google.dataflow.v1beta3.IDataDiskAssignment} message DataDiskAssignment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataDiskAssignment.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DataDiskAssignment message from the specified reader or buffer. + * @function decode + * @memberof google.dataflow.v1beta3.DataDiskAssignment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.dataflow.v1beta3.DataDiskAssignment} DataDiskAssignment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataDiskAssignment.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.dataflow.v1beta3.DataDiskAssignment(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.vmInstance = reader.string(); + break; + } + case 2: { + if (!(message.dataDisks && message.dataDisks.length)) + message.dataDisks = []; + message.dataDisks.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DataDiskAssignment message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.dataflow.v1beta3.DataDiskAssignment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.dataflow.v1beta3.DataDiskAssignment} DataDiskAssignment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataDiskAssignment.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DataDiskAssignment message. + * @function verify + * @memberof google.dataflow.v1beta3.DataDiskAssignment + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DataDiskAssignment.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.vmInstance != null && message.hasOwnProperty("vmInstance")) + if (!$util.isString(message.vmInstance)) + return "vmInstance: string expected"; + if (message.dataDisks != null && message.hasOwnProperty("dataDisks")) { + if (!Array.isArray(message.dataDisks)) + return "dataDisks: array expected"; + for (var i = 0; i < message.dataDisks.length; ++i) + if (!$util.isString(message.dataDisks[i])) + return "dataDisks: string[] expected"; + } + return null; + }; + + /** + * Creates a DataDiskAssignment message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.dataflow.v1beta3.DataDiskAssignment + * @static + * @param {Object.} object Plain object + * @returns {google.dataflow.v1beta3.DataDiskAssignment} DataDiskAssignment + */ + DataDiskAssignment.fromObject = function fromObject(object) { + if (object instanceof $root.google.dataflow.v1beta3.DataDiskAssignment) + return object; + var message = new $root.google.dataflow.v1beta3.DataDiskAssignment(); + if (object.vmInstance != null) + message.vmInstance = String(object.vmInstance); + if (object.dataDisks) { + if (!Array.isArray(object.dataDisks)) + throw TypeError(".google.dataflow.v1beta3.DataDiskAssignment.dataDisks: array expected"); + message.dataDisks = []; + for (var i = 0; i < object.dataDisks.length; ++i) + message.dataDisks[i] = String(object.dataDisks[i]); + } + return message; + }; + + /** + * Creates a plain object from a DataDiskAssignment message. Also converts values to other types if specified. + * @function toObject + * @memberof google.dataflow.v1beta3.DataDiskAssignment + * @static + * @param {google.dataflow.v1beta3.DataDiskAssignment} message DataDiskAssignment + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DataDiskAssignment.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.dataDisks = []; + if (options.defaults) + object.vmInstance = ""; + if (message.vmInstance != null && message.hasOwnProperty("vmInstance")) + object.vmInstance = message.vmInstance; + if (message.dataDisks && message.dataDisks.length) { + object.dataDisks = []; + for (var j = 0; j < message.dataDisks.length; ++j) + object.dataDisks[j] = message.dataDisks[j]; + } + return object; + }; + + /** + * Converts this DataDiskAssignment to JSON. + * @function toJSON + * @memberof google.dataflow.v1beta3.DataDiskAssignment + * @instance + * @returns {Object.} JSON object + */ + DataDiskAssignment.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DataDiskAssignment + * @function getTypeUrl + * @memberof google.dataflow.v1beta3.DataDiskAssignment + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DataDiskAssignment.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.dataflow.v1beta3.DataDiskAssignment"; + }; + + return DataDiskAssignment; + })(); + + v1beta3.KeyRangeDataDiskAssignment = (function() { + + /** + * Properties of a KeyRangeDataDiskAssignment. + * @memberof google.dataflow.v1beta3 + * @interface IKeyRangeDataDiskAssignment + * @property {string|null} [start] KeyRangeDataDiskAssignment start + * @property {string|null} [end] KeyRangeDataDiskAssignment end + * @property {string|null} [dataDisk] KeyRangeDataDiskAssignment dataDisk + */ + + /** + * Constructs a new KeyRangeDataDiskAssignment. + * @memberof google.dataflow.v1beta3 + * @classdesc Represents a KeyRangeDataDiskAssignment. + * @implements IKeyRangeDataDiskAssignment + * @constructor + * @param {google.dataflow.v1beta3.IKeyRangeDataDiskAssignment=} [properties] Properties to set + */ + function KeyRangeDataDiskAssignment(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * KeyRangeDataDiskAssignment start. + * @member {string} start + * @memberof google.dataflow.v1beta3.KeyRangeDataDiskAssignment + * @instance + */ + KeyRangeDataDiskAssignment.prototype.start = ""; + + /** + * KeyRangeDataDiskAssignment end. + * @member {string} end + * @memberof google.dataflow.v1beta3.KeyRangeDataDiskAssignment + * @instance + */ + KeyRangeDataDiskAssignment.prototype.end = ""; + + /** + * KeyRangeDataDiskAssignment dataDisk. + * @member {string} dataDisk + * @memberof google.dataflow.v1beta3.KeyRangeDataDiskAssignment + * @instance + */ + KeyRangeDataDiskAssignment.prototype.dataDisk = ""; + + /** + * Creates a new KeyRangeDataDiskAssignment instance using the specified properties. + * @function create + * @memberof google.dataflow.v1beta3.KeyRangeDataDiskAssignment + * @static + * @param {google.dataflow.v1beta3.IKeyRangeDataDiskAssignment=} [properties] Properties to set + * @returns {google.dataflow.v1beta3.KeyRangeDataDiskAssignment} KeyRangeDataDiskAssignment instance + */ + KeyRangeDataDiskAssignment.create = function create(properties) { + return new KeyRangeDataDiskAssignment(properties); + }; + + /** + * Encodes the specified KeyRangeDataDiskAssignment message. Does not implicitly {@link google.dataflow.v1beta3.KeyRangeDataDiskAssignment.verify|verify} messages. + * @function encode + * @memberof google.dataflow.v1beta3.KeyRangeDataDiskAssignment + * @static + * @param {google.dataflow.v1beta3.IKeyRangeDataDiskAssignment} message KeyRangeDataDiskAssignment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KeyRangeDataDiskAssignment.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.end); + if (message.dataDisk != null && Object.hasOwnProperty.call(message, "dataDisk")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.dataDisk); + return writer; + }; + + /** + * Encodes the specified KeyRangeDataDiskAssignment message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.KeyRangeDataDiskAssignment.verify|verify} messages. + * @function encodeDelimited + * @memberof google.dataflow.v1beta3.KeyRangeDataDiskAssignment + * @static + * @param {google.dataflow.v1beta3.IKeyRangeDataDiskAssignment} message KeyRangeDataDiskAssignment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KeyRangeDataDiskAssignment.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a KeyRangeDataDiskAssignment message from the specified reader or buffer. + * @function decode + * @memberof google.dataflow.v1beta3.KeyRangeDataDiskAssignment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.dataflow.v1beta3.KeyRangeDataDiskAssignment} KeyRangeDataDiskAssignment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KeyRangeDataDiskAssignment.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.dataflow.v1beta3.KeyRangeDataDiskAssignment(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.start = reader.string(); + break; + } + case 2: { + message.end = reader.string(); + break; + } + case 3: { + message.dataDisk = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a KeyRangeDataDiskAssignment message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.dataflow.v1beta3.KeyRangeDataDiskAssignment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.dataflow.v1beta3.KeyRangeDataDiskAssignment} KeyRangeDataDiskAssignment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KeyRangeDataDiskAssignment.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a KeyRangeDataDiskAssignment message. + * @function verify + * @memberof google.dataflow.v1beta3.KeyRangeDataDiskAssignment + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + KeyRangeDataDiskAssignment.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isString(message.start)) + return "start: string expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isString(message.end)) + return "end: string expected"; + if (message.dataDisk != null && message.hasOwnProperty("dataDisk")) + if (!$util.isString(message.dataDisk)) + return "dataDisk: string expected"; + return null; + }; + + /** + * Creates a KeyRangeDataDiskAssignment message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.dataflow.v1beta3.KeyRangeDataDiskAssignment + * @static + * @param {Object.} object Plain object + * @returns {google.dataflow.v1beta3.KeyRangeDataDiskAssignment} KeyRangeDataDiskAssignment + */ + KeyRangeDataDiskAssignment.fromObject = function fromObject(object) { + if (object instanceof $root.google.dataflow.v1beta3.KeyRangeDataDiskAssignment) + return object; + var message = new $root.google.dataflow.v1beta3.KeyRangeDataDiskAssignment(); + if (object.start != null) + message.start = String(object.start); + if (object.end != null) + message.end = String(object.end); + if (object.dataDisk != null) + message.dataDisk = String(object.dataDisk); + return message; + }; + + /** + * Creates a plain object from a KeyRangeDataDiskAssignment message. Also converts values to other types if specified. + * @function toObject + * @memberof google.dataflow.v1beta3.KeyRangeDataDiskAssignment + * @static + * @param {google.dataflow.v1beta3.KeyRangeDataDiskAssignment} message KeyRangeDataDiskAssignment + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + KeyRangeDataDiskAssignment.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = ""; + object.end = ""; + object.dataDisk = ""; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + if (message.dataDisk != null && message.hasOwnProperty("dataDisk")) + object.dataDisk = message.dataDisk; + return object; + }; + + /** + * Converts this KeyRangeDataDiskAssignment to JSON. + * @function toJSON + * @memberof google.dataflow.v1beta3.KeyRangeDataDiskAssignment + * @instance + * @returns {Object.} JSON object + */ + KeyRangeDataDiskAssignment.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for KeyRangeDataDiskAssignment + * @function getTypeUrl + * @memberof google.dataflow.v1beta3.KeyRangeDataDiskAssignment + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + KeyRangeDataDiskAssignment.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.dataflow.v1beta3.KeyRangeDataDiskAssignment"; + }; + + return KeyRangeDataDiskAssignment; + })(); + + v1beta3.StreamingComputationRanges = (function() { + + /** + * Properties of a StreamingComputationRanges. + * @memberof google.dataflow.v1beta3 + * @interface IStreamingComputationRanges + * @property {string|null} [computationId] StreamingComputationRanges computationId + * @property {Array.|null} [rangeAssignments] StreamingComputationRanges rangeAssignments + */ + + /** + * Constructs a new StreamingComputationRanges. + * @memberof google.dataflow.v1beta3 + * @classdesc Represents a StreamingComputationRanges. + * @implements IStreamingComputationRanges + * @constructor + * @param {google.dataflow.v1beta3.IStreamingComputationRanges=} [properties] Properties to set + */ + function StreamingComputationRanges(properties) { + this.rangeAssignments = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StreamingComputationRanges computationId. + * @member {string} computationId + * @memberof google.dataflow.v1beta3.StreamingComputationRanges + * @instance + */ + StreamingComputationRanges.prototype.computationId = ""; + + /** + * StreamingComputationRanges rangeAssignments. + * @member {Array.} rangeAssignments + * @memberof google.dataflow.v1beta3.StreamingComputationRanges + * @instance + */ + StreamingComputationRanges.prototype.rangeAssignments = $util.emptyArray; + + /** + * Creates a new StreamingComputationRanges instance using the specified properties. + * @function create + * @memberof google.dataflow.v1beta3.StreamingComputationRanges + * @static + * @param {google.dataflow.v1beta3.IStreamingComputationRanges=} [properties] Properties to set + * @returns {google.dataflow.v1beta3.StreamingComputationRanges} StreamingComputationRanges instance + */ + StreamingComputationRanges.create = function create(properties) { + return new StreamingComputationRanges(properties); + }; + + /** + * Encodes the specified StreamingComputationRanges message. Does not implicitly {@link google.dataflow.v1beta3.StreamingComputationRanges.verify|verify} messages. + * @function encode + * @memberof google.dataflow.v1beta3.StreamingComputationRanges + * @static + * @param {google.dataflow.v1beta3.IStreamingComputationRanges} message StreamingComputationRanges message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamingComputationRanges.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.computationId != null && Object.hasOwnProperty.call(message, "computationId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.computationId); + if (message.rangeAssignments != null && message.rangeAssignments.length) + for (var i = 0; i < message.rangeAssignments.length; ++i) + $root.google.dataflow.v1beta3.KeyRangeDataDiskAssignment.encode(message.rangeAssignments[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified StreamingComputationRanges message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.StreamingComputationRanges.verify|verify} messages. + * @function encodeDelimited + * @memberof google.dataflow.v1beta3.StreamingComputationRanges + * @static + * @param {google.dataflow.v1beta3.IStreamingComputationRanges} message StreamingComputationRanges message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamingComputationRanges.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StreamingComputationRanges message from the specified reader or buffer. + * @function decode + * @memberof google.dataflow.v1beta3.StreamingComputationRanges + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.dataflow.v1beta3.StreamingComputationRanges} StreamingComputationRanges + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamingComputationRanges.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.dataflow.v1beta3.StreamingComputationRanges(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.computationId = reader.string(); + break; + } + case 2: { + if (!(message.rangeAssignments && message.rangeAssignments.length)) + message.rangeAssignments = []; + message.rangeAssignments.push($root.google.dataflow.v1beta3.KeyRangeDataDiskAssignment.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StreamingComputationRanges message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.dataflow.v1beta3.StreamingComputationRanges + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.dataflow.v1beta3.StreamingComputationRanges} StreamingComputationRanges + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamingComputationRanges.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StreamingComputationRanges message. + * @function verify + * @memberof google.dataflow.v1beta3.StreamingComputationRanges + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StreamingComputationRanges.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.computationId != null && message.hasOwnProperty("computationId")) + if (!$util.isString(message.computationId)) + return "computationId: string expected"; + if (message.rangeAssignments != null && message.hasOwnProperty("rangeAssignments")) { + if (!Array.isArray(message.rangeAssignments)) + return "rangeAssignments: array expected"; + for (var i = 0; i < message.rangeAssignments.length; ++i) { + var error = $root.google.dataflow.v1beta3.KeyRangeDataDiskAssignment.verify(message.rangeAssignments[i]); + if (error) + return "rangeAssignments." + error; + } + } + return null; + }; + + /** + * Creates a StreamingComputationRanges message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.dataflow.v1beta3.StreamingComputationRanges + * @static + * @param {Object.} object Plain object + * @returns {google.dataflow.v1beta3.StreamingComputationRanges} StreamingComputationRanges + */ + StreamingComputationRanges.fromObject = function fromObject(object) { + if (object instanceof $root.google.dataflow.v1beta3.StreamingComputationRanges) + return object; + var message = new $root.google.dataflow.v1beta3.StreamingComputationRanges(); + if (object.computationId != null) + message.computationId = String(object.computationId); + if (object.rangeAssignments) { + if (!Array.isArray(object.rangeAssignments)) + throw TypeError(".google.dataflow.v1beta3.StreamingComputationRanges.rangeAssignments: array expected"); + message.rangeAssignments = []; + for (var i = 0; i < object.rangeAssignments.length; ++i) { + if (typeof object.rangeAssignments[i] !== "object") + throw TypeError(".google.dataflow.v1beta3.StreamingComputationRanges.rangeAssignments: object expected"); + message.rangeAssignments[i] = $root.google.dataflow.v1beta3.KeyRangeDataDiskAssignment.fromObject(object.rangeAssignments[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a StreamingComputationRanges message. Also converts values to other types if specified. + * @function toObject + * @memberof google.dataflow.v1beta3.StreamingComputationRanges + * @static + * @param {google.dataflow.v1beta3.StreamingComputationRanges} message StreamingComputationRanges + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StreamingComputationRanges.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.rangeAssignments = []; + if (options.defaults) + object.computationId = ""; + if (message.computationId != null && message.hasOwnProperty("computationId")) + object.computationId = message.computationId; + if (message.rangeAssignments && message.rangeAssignments.length) { + object.rangeAssignments = []; + for (var j = 0; j < message.rangeAssignments.length; ++j) + object.rangeAssignments[j] = $root.google.dataflow.v1beta3.KeyRangeDataDiskAssignment.toObject(message.rangeAssignments[j], options); + } + return object; + }; + + /** + * Converts this StreamingComputationRanges to JSON. + * @function toJSON + * @memberof google.dataflow.v1beta3.StreamingComputationRanges + * @instance + * @returns {Object.} JSON object + */ + StreamingComputationRanges.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StreamingComputationRanges + * @function getTypeUrl + * @memberof google.dataflow.v1beta3.StreamingComputationRanges + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StreamingComputationRanges.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.dataflow.v1beta3.StreamingComputationRanges"; + }; + + return StreamingComputationRanges; + })(); + + v1beta3.StreamingApplianceSnapshotConfig = (function() { + + /** + * Properties of a StreamingApplianceSnapshotConfig. + * @memberof google.dataflow.v1beta3 + * @interface IStreamingApplianceSnapshotConfig + * @property {string|null} [snapshotId] StreamingApplianceSnapshotConfig snapshotId + * @property {string|null} [importStateEndpoint] StreamingApplianceSnapshotConfig importStateEndpoint + */ + + /** + * Constructs a new StreamingApplianceSnapshotConfig. + * @memberof google.dataflow.v1beta3 + * @classdesc Represents a StreamingApplianceSnapshotConfig. + * @implements IStreamingApplianceSnapshotConfig + * @constructor + * @param {google.dataflow.v1beta3.IStreamingApplianceSnapshotConfig=} [properties] Properties to set + */ + function StreamingApplianceSnapshotConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StreamingApplianceSnapshotConfig snapshotId. + * @member {string} snapshotId + * @memberof google.dataflow.v1beta3.StreamingApplianceSnapshotConfig + * @instance + */ + StreamingApplianceSnapshotConfig.prototype.snapshotId = ""; + + /** + * StreamingApplianceSnapshotConfig importStateEndpoint. + * @member {string} importStateEndpoint + * @memberof google.dataflow.v1beta3.StreamingApplianceSnapshotConfig + * @instance + */ + StreamingApplianceSnapshotConfig.prototype.importStateEndpoint = ""; + + /** + * Creates a new StreamingApplianceSnapshotConfig instance using the specified properties. + * @function create + * @memberof google.dataflow.v1beta3.StreamingApplianceSnapshotConfig + * @static + * @param {google.dataflow.v1beta3.IStreamingApplianceSnapshotConfig=} [properties] Properties to set + * @returns {google.dataflow.v1beta3.StreamingApplianceSnapshotConfig} StreamingApplianceSnapshotConfig instance + */ + StreamingApplianceSnapshotConfig.create = function create(properties) { + return new StreamingApplianceSnapshotConfig(properties); + }; + + /** + * Encodes the specified StreamingApplianceSnapshotConfig message. Does not implicitly {@link google.dataflow.v1beta3.StreamingApplianceSnapshotConfig.verify|verify} messages. + * @function encode + * @memberof google.dataflow.v1beta3.StreamingApplianceSnapshotConfig + * @static + * @param {google.dataflow.v1beta3.IStreamingApplianceSnapshotConfig} message StreamingApplianceSnapshotConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamingApplianceSnapshotConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.snapshotId != null && Object.hasOwnProperty.call(message, "snapshotId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.snapshotId); + if (message.importStateEndpoint != null && Object.hasOwnProperty.call(message, "importStateEndpoint")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.importStateEndpoint); + return writer; + }; + + /** + * Encodes the specified StreamingApplianceSnapshotConfig message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.StreamingApplianceSnapshotConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.dataflow.v1beta3.StreamingApplianceSnapshotConfig + * @static + * @param {google.dataflow.v1beta3.IStreamingApplianceSnapshotConfig} message StreamingApplianceSnapshotConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamingApplianceSnapshotConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StreamingApplianceSnapshotConfig message from the specified reader or buffer. + * @function decode + * @memberof google.dataflow.v1beta3.StreamingApplianceSnapshotConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.dataflow.v1beta3.StreamingApplianceSnapshotConfig} StreamingApplianceSnapshotConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamingApplianceSnapshotConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.dataflow.v1beta3.StreamingApplianceSnapshotConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.snapshotId = reader.string(); + break; + } + case 2: { + message.importStateEndpoint = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StreamingApplianceSnapshotConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.dataflow.v1beta3.StreamingApplianceSnapshotConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.dataflow.v1beta3.StreamingApplianceSnapshotConfig} StreamingApplianceSnapshotConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamingApplianceSnapshotConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StreamingApplianceSnapshotConfig message. + * @function verify + * @memberof google.dataflow.v1beta3.StreamingApplianceSnapshotConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StreamingApplianceSnapshotConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.snapshotId != null && message.hasOwnProperty("snapshotId")) + if (!$util.isString(message.snapshotId)) + return "snapshotId: string expected"; + if (message.importStateEndpoint != null && message.hasOwnProperty("importStateEndpoint")) + if (!$util.isString(message.importStateEndpoint)) + return "importStateEndpoint: string expected"; + return null; + }; + + /** + * Creates a StreamingApplianceSnapshotConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.dataflow.v1beta3.StreamingApplianceSnapshotConfig + * @static + * @param {Object.} object Plain object + * @returns {google.dataflow.v1beta3.StreamingApplianceSnapshotConfig} StreamingApplianceSnapshotConfig + */ + StreamingApplianceSnapshotConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.dataflow.v1beta3.StreamingApplianceSnapshotConfig) + return object; + var message = new $root.google.dataflow.v1beta3.StreamingApplianceSnapshotConfig(); + if (object.snapshotId != null) + message.snapshotId = String(object.snapshotId); + if (object.importStateEndpoint != null) + message.importStateEndpoint = String(object.importStateEndpoint); + return message; + }; + + /** + * Creates a plain object from a StreamingApplianceSnapshotConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.dataflow.v1beta3.StreamingApplianceSnapshotConfig + * @static + * @param {google.dataflow.v1beta3.StreamingApplianceSnapshotConfig} message StreamingApplianceSnapshotConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StreamingApplianceSnapshotConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.snapshotId = ""; + object.importStateEndpoint = ""; + } + if (message.snapshotId != null && message.hasOwnProperty("snapshotId")) + object.snapshotId = message.snapshotId; + if (message.importStateEndpoint != null && message.hasOwnProperty("importStateEndpoint")) + object.importStateEndpoint = message.importStateEndpoint; + return object; + }; + + /** + * Converts this StreamingApplianceSnapshotConfig to JSON. + * @function toJSON + * @memberof google.dataflow.v1beta3.StreamingApplianceSnapshotConfig + * @instance + * @returns {Object.} JSON object + */ + StreamingApplianceSnapshotConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StreamingApplianceSnapshotConfig + * @function getTypeUrl + * @memberof google.dataflow.v1beta3.StreamingApplianceSnapshotConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StreamingApplianceSnapshotConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.dataflow.v1beta3.StreamingApplianceSnapshotConfig"; + }; + + return StreamingApplianceSnapshotConfig; + })(); + + v1beta3.TemplatesService = (function() { + + /** + * Constructs a new TemplatesService service. + * @memberof google.dataflow.v1beta3 + * @classdesc Represents a TemplatesService + * @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 TemplatesService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (TemplatesService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = TemplatesService; + + /** + * Creates new TemplatesService service using the specified rpc implementation. + * @function create + * @memberof google.dataflow.v1beta3.TemplatesService + * @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 {TemplatesService} RPC service. Useful where requests and/or responses are streamed. + */ + TemplatesService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.dataflow.v1beta3.TemplatesService|createJobFromTemplate}. + * @memberof google.dataflow.v1beta3.TemplatesService + * @typedef CreateJobFromTemplateCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.dataflow.v1beta3.Job} [response] Job + */ + + /** + * Calls CreateJobFromTemplate. + * @function createJobFromTemplate + * @memberof google.dataflow.v1beta3.TemplatesService + * @instance + * @param {google.dataflow.v1beta3.ICreateJobFromTemplateRequest} request CreateJobFromTemplateRequest message or plain object + * @param {google.dataflow.v1beta3.TemplatesService.CreateJobFromTemplateCallback} callback Node-style callback called with the error, if any, and Job + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TemplatesService.prototype.createJobFromTemplate = function createJobFromTemplate(request, callback) { + return this.rpcCall(createJobFromTemplate, $root.google.dataflow.v1beta3.CreateJobFromTemplateRequest, $root.google.dataflow.v1beta3.Job, request, callback); + }, "name", { value: "CreateJobFromTemplate" }); + + /** + * Calls CreateJobFromTemplate. + * @function createJobFromTemplate + * @memberof google.dataflow.v1beta3.TemplatesService + * @instance + * @param {google.dataflow.v1beta3.ICreateJobFromTemplateRequest} request CreateJobFromTemplateRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.dataflow.v1beta3.TemplatesService|launchTemplate}. + * @memberof google.dataflow.v1beta3.TemplatesService + * @typedef LaunchTemplateCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.dataflow.v1beta3.LaunchTemplateResponse} [response] LaunchTemplateResponse + */ + + /** + * Calls LaunchTemplate. + * @function launchTemplate + * @memberof google.dataflow.v1beta3.TemplatesService + * @instance + * @param {google.dataflow.v1beta3.ILaunchTemplateRequest} request LaunchTemplateRequest message or plain object + * @param {google.dataflow.v1beta3.TemplatesService.LaunchTemplateCallback} callback Node-style callback called with the error, if any, and LaunchTemplateResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TemplatesService.prototype.launchTemplate = function launchTemplate(request, callback) { + return this.rpcCall(launchTemplate, $root.google.dataflow.v1beta3.LaunchTemplateRequest, $root.google.dataflow.v1beta3.LaunchTemplateResponse, request, callback); + }, "name", { value: "LaunchTemplate" }); + + /** + * Calls LaunchTemplate. + * @function launchTemplate + * @memberof google.dataflow.v1beta3.TemplatesService + * @instance + * @param {google.dataflow.v1beta3.ILaunchTemplateRequest} request LaunchTemplateRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.dataflow.v1beta3.TemplatesService|getTemplate}. + * @memberof google.dataflow.v1beta3.TemplatesService + * @typedef GetTemplateCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.dataflow.v1beta3.GetTemplateResponse} [response] GetTemplateResponse + */ + + /** + * Calls GetTemplate. + * @function getTemplate + * @memberof google.dataflow.v1beta3.TemplatesService + * @instance + * @param {google.dataflow.v1beta3.IGetTemplateRequest} request GetTemplateRequest message or plain object + * @param {google.dataflow.v1beta3.TemplatesService.GetTemplateCallback} callback Node-style callback called with the error, if any, and GetTemplateResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TemplatesService.prototype.getTemplate = function getTemplate(request, callback) { + return this.rpcCall(getTemplate, $root.google.dataflow.v1beta3.GetTemplateRequest, $root.google.dataflow.v1beta3.GetTemplateResponse, request, callback); + }, "name", { value: "GetTemplate" }); + + /** + * Calls GetTemplate. + * @function getTemplate + * @memberof google.dataflow.v1beta3.TemplatesService + * @instance + * @param {google.dataflow.v1beta3.IGetTemplateRequest} request GetTemplateRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return TemplatesService; + })(); + + v1beta3.FlexTemplatesService = (function() { + + /** + * Constructs a new FlexTemplatesService service. + * @memberof google.dataflow.v1beta3 + * @classdesc Represents a FlexTemplatesService + * @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 FlexTemplatesService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (FlexTemplatesService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = FlexTemplatesService; + + /** + * Creates new FlexTemplatesService service using the specified rpc implementation. + * @function create + * @memberof google.dataflow.v1beta3.FlexTemplatesService + * @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 {FlexTemplatesService} RPC service. Useful where requests and/or responses are streamed. + */ + FlexTemplatesService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.dataflow.v1beta3.FlexTemplatesService|launchFlexTemplate}. + * @memberof google.dataflow.v1beta3.FlexTemplatesService + * @typedef LaunchFlexTemplateCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.dataflow.v1beta3.LaunchFlexTemplateResponse} [response] LaunchFlexTemplateResponse + */ + + /** + * Calls LaunchFlexTemplate. + * @function launchFlexTemplate + * @memberof google.dataflow.v1beta3.FlexTemplatesService + * @instance + * @param {google.dataflow.v1beta3.ILaunchFlexTemplateRequest} request LaunchFlexTemplateRequest message or plain object + * @param {google.dataflow.v1beta3.FlexTemplatesService.LaunchFlexTemplateCallback} callback Node-style callback called with the error, if any, and LaunchFlexTemplateResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(FlexTemplatesService.prototype.launchFlexTemplate = function launchFlexTemplate(request, callback) { + return this.rpcCall(launchFlexTemplate, $root.google.dataflow.v1beta3.LaunchFlexTemplateRequest, $root.google.dataflow.v1beta3.LaunchFlexTemplateResponse, request, callback); + }, "name", { value: "LaunchFlexTemplate" }); + + /** + * Calls LaunchFlexTemplate. + * @function launchFlexTemplate + * @memberof google.dataflow.v1beta3.FlexTemplatesService + * @instance + * @param {google.dataflow.v1beta3.ILaunchFlexTemplateRequest} request LaunchFlexTemplateRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return FlexTemplatesService; + })(); + + v1beta3.LaunchFlexTemplateResponse = (function() { + + /** + * Properties of a LaunchFlexTemplateResponse. + * @memberof google.dataflow.v1beta3 + * @interface ILaunchFlexTemplateResponse + * @property {google.dataflow.v1beta3.IJob|null} [job] LaunchFlexTemplateResponse job + */ + + /** + * Constructs a new LaunchFlexTemplateResponse. + * @memberof google.dataflow.v1beta3 + * @classdesc Represents a LaunchFlexTemplateResponse. + * @implements ILaunchFlexTemplateResponse + * @constructor + * @param {google.dataflow.v1beta3.ILaunchFlexTemplateResponse=} [properties] Properties to set + */ + function LaunchFlexTemplateResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LaunchFlexTemplateResponse job. + * @member {google.dataflow.v1beta3.IJob|null|undefined} job + * @memberof google.dataflow.v1beta3.LaunchFlexTemplateResponse + * @instance + */ + LaunchFlexTemplateResponse.prototype.job = null; + + /** + * Creates a new LaunchFlexTemplateResponse instance using the specified properties. + * @function create + * @memberof google.dataflow.v1beta3.LaunchFlexTemplateResponse + * @static + * @param {google.dataflow.v1beta3.ILaunchFlexTemplateResponse=} [properties] Properties to set + * @returns {google.dataflow.v1beta3.LaunchFlexTemplateResponse} LaunchFlexTemplateResponse instance + */ + LaunchFlexTemplateResponse.create = function create(properties) { + return new LaunchFlexTemplateResponse(properties); + }; + + /** + * Encodes the specified LaunchFlexTemplateResponse message. Does not implicitly {@link google.dataflow.v1beta3.LaunchFlexTemplateResponse.verify|verify} messages. + * @function encode + * @memberof google.dataflow.v1beta3.LaunchFlexTemplateResponse + * @static + * @param {google.dataflow.v1beta3.ILaunchFlexTemplateResponse} message LaunchFlexTemplateResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LaunchFlexTemplateResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.job != null && Object.hasOwnProperty.call(message, "job")) + $root.google.dataflow.v1beta3.Job.encode(message.job, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified LaunchFlexTemplateResponse message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.LaunchFlexTemplateResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.dataflow.v1beta3.LaunchFlexTemplateResponse + * @static + * @param {google.dataflow.v1beta3.ILaunchFlexTemplateResponse} message LaunchFlexTemplateResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LaunchFlexTemplateResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LaunchFlexTemplateResponse message from the specified reader or buffer. + * @function decode + * @memberof google.dataflow.v1beta3.LaunchFlexTemplateResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.dataflow.v1beta3.LaunchFlexTemplateResponse} LaunchFlexTemplateResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LaunchFlexTemplateResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.dataflow.v1beta3.LaunchFlexTemplateResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.job = $root.google.dataflow.v1beta3.Job.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LaunchFlexTemplateResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.dataflow.v1beta3.LaunchFlexTemplateResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.dataflow.v1beta3.LaunchFlexTemplateResponse} LaunchFlexTemplateResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LaunchFlexTemplateResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LaunchFlexTemplateResponse message. + * @function verify + * @memberof google.dataflow.v1beta3.LaunchFlexTemplateResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LaunchFlexTemplateResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.job != null && message.hasOwnProperty("job")) { + var error = $root.google.dataflow.v1beta3.Job.verify(message.job); + if (error) + return "job." + error; + } + return null; + }; + + /** + * Creates a LaunchFlexTemplateResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.dataflow.v1beta3.LaunchFlexTemplateResponse + * @static + * @param {Object.} object Plain object + * @returns {google.dataflow.v1beta3.LaunchFlexTemplateResponse} LaunchFlexTemplateResponse + */ + LaunchFlexTemplateResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.dataflow.v1beta3.LaunchFlexTemplateResponse) + return object; + var message = new $root.google.dataflow.v1beta3.LaunchFlexTemplateResponse(); + if (object.job != null) { + if (typeof object.job !== "object") + throw TypeError(".google.dataflow.v1beta3.LaunchFlexTemplateResponse.job: object expected"); + message.job = $root.google.dataflow.v1beta3.Job.fromObject(object.job); + } + return message; + }; + + /** + * Creates a plain object from a LaunchFlexTemplateResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.dataflow.v1beta3.LaunchFlexTemplateResponse + * @static + * @param {google.dataflow.v1beta3.LaunchFlexTemplateResponse} message LaunchFlexTemplateResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LaunchFlexTemplateResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.job = null; + if (message.job != null && message.hasOwnProperty("job")) + object.job = $root.google.dataflow.v1beta3.Job.toObject(message.job, options); + return object; + }; + + /** + * Converts this LaunchFlexTemplateResponse to JSON. + * @function toJSON + * @memberof google.dataflow.v1beta3.LaunchFlexTemplateResponse + * @instance + * @returns {Object.} JSON object + */ + LaunchFlexTemplateResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LaunchFlexTemplateResponse + * @function getTypeUrl + * @memberof google.dataflow.v1beta3.LaunchFlexTemplateResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LaunchFlexTemplateResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.dataflow.v1beta3.LaunchFlexTemplateResponse"; + }; + + return LaunchFlexTemplateResponse; + })(); + + v1beta3.ContainerSpec = (function() { + + /** + * Properties of a ContainerSpec. + * @memberof google.dataflow.v1beta3 + * @interface IContainerSpec + * @property {string|null} [image] ContainerSpec image + * @property {google.dataflow.v1beta3.ITemplateMetadata|null} [metadata] ContainerSpec metadata + * @property {google.dataflow.v1beta3.ISDKInfo|null} [sdkInfo] ContainerSpec sdkInfo + * @property {google.dataflow.v1beta3.IFlexTemplateRuntimeEnvironment|null} [defaultEnvironment] ContainerSpec defaultEnvironment + */ + + /** + * Constructs a new ContainerSpec. + * @memberof google.dataflow.v1beta3 + * @classdesc Represents a ContainerSpec. + * @implements IContainerSpec + * @constructor + * @param {google.dataflow.v1beta3.IContainerSpec=} [properties] Properties to set + */ + function ContainerSpec(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ContainerSpec image. + * @member {string} image + * @memberof google.dataflow.v1beta3.ContainerSpec + * @instance + */ + ContainerSpec.prototype.image = ""; + + /** + * ContainerSpec metadata. + * @member {google.dataflow.v1beta3.ITemplateMetadata|null|undefined} metadata + * @memberof google.dataflow.v1beta3.ContainerSpec + * @instance + */ + ContainerSpec.prototype.metadata = null; + + /** + * ContainerSpec sdkInfo. + * @member {google.dataflow.v1beta3.ISDKInfo|null|undefined} sdkInfo + * @memberof google.dataflow.v1beta3.ContainerSpec + * @instance + */ + ContainerSpec.prototype.sdkInfo = null; + + /** + * ContainerSpec defaultEnvironment. + * @member {google.dataflow.v1beta3.IFlexTemplateRuntimeEnvironment|null|undefined} defaultEnvironment + * @memberof google.dataflow.v1beta3.ContainerSpec + * @instance + */ + ContainerSpec.prototype.defaultEnvironment = null; + + /** + * Creates a new ContainerSpec instance using the specified properties. + * @function create + * @memberof google.dataflow.v1beta3.ContainerSpec + * @static + * @param {google.dataflow.v1beta3.IContainerSpec=} [properties] Properties to set + * @returns {google.dataflow.v1beta3.ContainerSpec} ContainerSpec instance + */ + ContainerSpec.create = function create(properties) { + return new ContainerSpec(properties); + }; + + /** + * Encodes the specified ContainerSpec message. Does not implicitly {@link google.dataflow.v1beta3.ContainerSpec.verify|verify} messages. + * @function encode + * @memberof google.dataflow.v1beta3.ContainerSpec + * @static + * @param {google.dataflow.v1beta3.IContainerSpec} message ContainerSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContainerSpec.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.image != null && Object.hasOwnProperty.call(message, "image")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.image); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.google.dataflow.v1beta3.TemplateMetadata.encode(message.metadata, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.sdkInfo != null && Object.hasOwnProperty.call(message, "sdkInfo")) + $root.google.dataflow.v1beta3.SDKInfo.encode(message.sdkInfo, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.defaultEnvironment != null && Object.hasOwnProperty.call(message, "defaultEnvironment")) + $root.google.dataflow.v1beta3.FlexTemplateRuntimeEnvironment.encode(message.defaultEnvironment, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ContainerSpec message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.ContainerSpec.verify|verify} messages. + * @function encodeDelimited + * @memberof google.dataflow.v1beta3.ContainerSpec + * @static + * @param {google.dataflow.v1beta3.IContainerSpec} message ContainerSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContainerSpec.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ContainerSpec message from the specified reader or buffer. + * @function decode + * @memberof google.dataflow.v1beta3.ContainerSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.dataflow.v1beta3.ContainerSpec} ContainerSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContainerSpec.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.dataflow.v1beta3.ContainerSpec(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.image = reader.string(); + break; + } + case 2: { + message.metadata = $root.google.dataflow.v1beta3.TemplateMetadata.decode(reader, reader.uint32()); + break; + } + case 3: { + message.sdkInfo = $root.google.dataflow.v1beta3.SDKInfo.decode(reader, reader.uint32()); + break; + } + case 4: { + message.defaultEnvironment = $root.google.dataflow.v1beta3.FlexTemplateRuntimeEnvironment.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ContainerSpec message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.dataflow.v1beta3.ContainerSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.dataflow.v1beta3.ContainerSpec} ContainerSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContainerSpec.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ContainerSpec message. + * @function verify + * @memberof google.dataflow.v1beta3.ContainerSpec + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ContainerSpec.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.image != null && message.hasOwnProperty("image")) + if (!$util.isString(message.image)) + return "image: string expected"; + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.google.dataflow.v1beta3.TemplateMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + if (message.sdkInfo != null && message.hasOwnProperty("sdkInfo")) { + var error = $root.google.dataflow.v1beta3.SDKInfo.verify(message.sdkInfo); + if (error) + return "sdkInfo." + error; + } + if (message.defaultEnvironment != null && message.hasOwnProperty("defaultEnvironment")) { + var error = $root.google.dataflow.v1beta3.FlexTemplateRuntimeEnvironment.verify(message.defaultEnvironment); + if (error) + return "defaultEnvironment." + error; + } + return null; + }; + + /** + * Creates a ContainerSpec message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.dataflow.v1beta3.ContainerSpec + * @static + * @param {Object.} object Plain object + * @returns {google.dataflow.v1beta3.ContainerSpec} ContainerSpec + */ + ContainerSpec.fromObject = function fromObject(object) { + if (object instanceof $root.google.dataflow.v1beta3.ContainerSpec) + return object; + var message = new $root.google.dataflow.v1beta3.ContainerSpec(); + if (object.image != null) + message.image = String(object.image); + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".google.dataflow.v1beta3.ContainerSpec.metadata: object expected"); + message.metadata = $root.google.dataflow.v1beta3.TemplateMetadata.fromObject(object.metadata); + } + if (object.sdkInfo != null) { + if (typeof object.sdkInfo !== "object") + throw TypeError(".google.dataflow.v1beta3.ContainerSpec.sdkInfo: object expected"); + message.sdkInfo = $root.google.dataflow.v1beta3.SDKInfo.fromObject(object.sdkInfo); + } + if (object.defaultEnvironment != null) { + if (typeof object.defaultEnvironment !== "object") + throw TypeError(".google.dataflow.v1beta3.ContainerSpec.defaultEnvironment: object expected"); + message.defaultEnvironment = $root.google.dataflow.v1beta3.FlexTemplateRuntimeEnvironment.fromObject(object.defaultEnvironment); + } + return message; + }; + + /** + * Creates a plain object from a ContainerSpec message. Also converts values to other types if specified. + * @function toObject + * @memberof google.dataflow.v1beta3.ContainerSpec + * @static + * @param {google.dataflow.v1beta3.ContainerSpec} message ContainerSpec + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ContainerSpec.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.image = ""; + object.metadata = null; + object.sdkInfo = null; + object.defaultEnvironment = null; + } + if (message.image != null && message.hasOwnProperty("image")) + object.image = message.image; + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.google.dataflow.v1beta3.TemplateMetadata.toObject(message.metadata, options); + if (message.sdkInfo != null && message.hasOwnProperty("sdkInfo")) + object.sdkInfo = $root.google.dataflow.v1beta3.SDKInfo.toObject(message.sdkInfo, options); + if (message.defaultEnvironment != null && message.hasOwnProperty("defaultEnvironment")) + object.defaultEnvironment = $root.google.dataflow.v1beta3.FlexTemplateRuntimeEnvironment.toObject(message.defaultEnvironment, options); + return object; + }; + + /** + * Converts this ContainerSpec to JSON. + * @function toJSON + * @memberof google.dataflow.v1beta3.ContainerSpec + * @instance + * @returns {Object.} JSON object + */ + ContainerSpec.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ContainerSpec + * @function getTypeUrl + * @memberof google.dataflow.v1beta3.ContainerSpec + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ContainerSpec.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.dataflow.v1beta3.ContainerSpec"; + }; + + return ContainerSpec; + })(); + + v1beta3.LaunchFlexTemplateParameter = (function() { + + /** + * Properties of a LaunchFlexTemplateParameter. + * @memberof google.dataflow.v1beta3 + * @interface ILaunchFlexTemplateParameter + * @property {string|null} [jobName] LaunchFlexTemplateParameter jobName + * @property {google.dataflow.v1beta3.IContainerSpec|null} [containerSpec] LaunchFlexTemplateParameter containerSpec + * @property {string|null} [containerSpecGcsPath] LaunchFlexTemplateParameter containerSpecGcsPath + * @property {Object.|null} [parameters] LaunchFlexTemplateParameter parameters + * @property {Object.|null} [launchOptions] LaunchFlexTemplateParameter launchOptions + * @property {google.dataflow.v1beta3.IFlexTemplateRuntimeEnvironment|null} [environment] LaunchFlexTemplateParameter environment + * @property {boolean|null} [update] LaunchFlexTemplateParameter update + * @property {Object.|null} [transformNameMappings] LaunchFlexTemplateParameter transformNameMappings + */ + + /** + * Constructs a new LaunchFlexTemplateParameter. + * @memberof google.dataflow.v1beta3 + * @classdesc Represents a LaunchFlexTemplateParameter. + * @implements ILaunchFlexTemplateParameter + * @constructor + * @param {google.dataflow.v1beta3.ILaunchFlexTemplateParameter=} [properties] Properties to set + */ + function LaunchFlexTemplateParameter(properties) { + this.parameters = {}; + this.launchOptions = {}; + this.transformNameMappings = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LaunchFlexTemplateParameter jobName. + * @member {string} jobName + * @memberof google.dataflow.v1beta3.LaunchFlexTemplateParameter + * @instance + */ + LaunchFlexTemplateParameter.prototype.jobName = ""; + + /** + * LaunchFlexTemplateParameter containerSpec. + * @member {google.dataflow.v1beta3.IContainerSpec|null|undefined} containerSpec + * @memberof google.dataflow.v1beta3.LaunchFlexTemplateParameter + * @instance + */ + LaunchFlexTemplateParameter.prototype.containerSpec = null; + + /** + * LaunchFlexTemplateParameter containerSpecGcsPath. + * @member {string|null|undefined} containerSpecGcsPath + * @memberof google.dataflow.v1beta3.LaunchFlexTemplateParameter + * @instance + */ + LaunchFlexTemplateParameter.prototype.containerSpecGcsPath = null; + + /** + * LaunchFlexTemplateParameter parameters. + * @member {Object.} parameters + * @memberof google.dataflow.v1beta3.LaunchFlexTemplateParameter + * @instance + */ + LaunchFlexTemplateParameter.prototype.parameters = $util.emptyObject; + + /** + * LaunchFlexTemplateParameter launchOptions. + * @member {Object.} launchOptions + * @memberof google.dataflow.v1beta3.LaunchFlexTemplateParameter + * @instance + */ + LaunchFlexTemplateParameter.prototype.launchOptions = $util.emptyObject; + + /** + * LaunchFlexTemplateParameter environment. + * @member {google.dataflow.v1beta3.IFlexTemplateRuntimeEnvironment|null|undefined} environment + * @memberof google.dataflow.v1beta3.LaunchFlexTemplateParameter + * @instance + */ + LaunchFlexTemplateParameter.prototype.environment = null; + + /** + * LaunchFlexTemplateParameter update. + * @member {boolean} update + * @memberof google.dataflow.v1beta3.LaunchFlexTemplateParameter + * @instance + */ + LaunchFlexTemplateParameter.prototype.update = false; + + /** + * LaunchFlexTemplateParameter transformNameMappings. + * @member {Object.} transformNameMappings + * @memberof google.dataflow.v1beta3.LaunchFlexTemplateParameter + * @instance + */ + LaunchFlexTemplateParameter.prototype.transformNameMappings = $util.emptyObject; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * LaunchFlexTemplateParameter template. + * @member {"containerSpec"|"containerSpecGcsPath"|undefined} template + * @memberof google.dataflow.v1beta3.LaunchFlexTemplateParameter + * @instance + */ + Object.defineProperty(LaunchFlexTemplateParameter.prototype, "template", { + get: $util.oneOfGetter($oneOfFields = ["containerSpec", "containerSpecGcsPath"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new LaunchFlexTemplateParameter instance using the specified properties. + * @function create + * @memberof google.dataflow.v1beta3.LaunchFlexTemplateParameter + * @static + * @param {google.dataflow.v1beta3.ILaunchFlexTemplateParameter=} [properties] Properties to set + * @returns {google.dataflow.v1beta3.LaunchFlexTemplateParameter} LaunchFlexTemplateParameter instance + */ + LaunchFlexTemplateParameter.create = function create(properties) { + return new LaunchFlexTemplateParameter(properties); + }; + + /** + * Encodes the specified LaunchFlexTemplateParameter message. Does not implicitly {@link google.dataflow.v1beta3.LaunchFlexTemplateParameter.verify|verify} messages. + * @function encode + * @memberof google.dataflow.v1beta3.LaunchFlexTemplateParameter + * @static + * @param {google.dataflow.v1beta3.ILaunchFlexTemplateParameter} message LaunchFlexTemplateParameter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LaunchFlexTemplateParameter.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.parameters != null && Object.hasOwnProperty.call(message, "parameters")) + for (var keys = Object.keys(message.parameters), i = 0; i < keys.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.parameters[keys[i]]).ldelim(); + if (message.containerSpec != null && Object.hasOwnProperty.call(message, "containerSpec")) + $root.google.dataflow.v1beta3.ContainerSpec.encode(message.containerSpec, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.containerSpecGcsPath != null && Object.hasOwnProperty.call(message, "containerSpecGcsPath")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.containerSpecGcsPath); + if (message.launchOptions != null && Object.hasOwnProperty.call(message, "launchOptions")) + for (var keys = Object.keys(message.launchOptions), i = 0; i < keys.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.launchOptions[keys[i]]).ldelim(); + if (message.environment != null && Object.hasOwnProperty.call(message, "environment")) + $root.google.dataflow.v1beta3.FlexTemplateRuntimeEnvironment.encode(message.environment, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.update != null && Object.hasOwnProperty.call(message, "update")) + writer.uint32(/* id 8, wireType 0 =*/64).bool(message.update); + if (message.transformNameMappings != null && Object.hasOwnProperty.call(message, "transformNameMappings")) + for (var keys = Object.keys(message.transformNameMappings), i = 0; i < keys.length; ++i) + writer.uint32(/* id 9, wireType 2 =*/74).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.transformNameMappings[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified LaunchFlexTemplateParameter message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.LaunchFlexTemplateParameter.verify|verify} messages. + * @function encodeDelimited + * @memberof google.dataflow.v1beta3.LaunchFlexTemplateParameter + * @static + * @param {google.dataflow.v1beta3.ILaunchFlexTemplateParameter} message LaunchFlexTemplateParameter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LaunchFlexTemplateParameter.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LaunchFlexTemplateParameter message from the specified reader or buffer. + * @function decode + * @memberof google.dataflow.v1beta3.LaunchFlexTemplateParameter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.dataflow.v1beta3.LaunchFlexTemplateParameter} LaunchFlexTemplateParameter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LaunchFlexTemplateParameter.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.dataflow.v1beta3.LaunchFlexTemplateParameter(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.jobName = reader.string(); + break; + } + case 4: { + message.containerSpec = $root.google.dataflow.v1beta3.ContainerSpec.decode(reader, reader.uint32()); + break; + } + case 5: { + message.containerSpecGcsPath = reader.string(); + break; + } + case 2: { + if (message.parameters === $util.emptyObject) + message.parameters = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.parameters[key] = value; + break; + } + case 6: { + if (message.launchOptions === $util.emptyObject) + message.launchOptions = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.launchOptions[key] = value; + break; + } + case 7: { + message.environment = $root.google.dataflow.v1beta3.FlexTemplateRuntimeEnvironment.decode(reader, reader.uint32()); + break; + } + case 8: { + message.update = reader.bool(); + break; + } + case 9: { + if (message.transformNameMappings === $util.emptyObject) + message.transformNameMappings = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.transformNameMappings[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LaunchFlexTemplateParameter message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.dataflow.v1beta3.LaunchFlexTemplateParameter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.dataflow.v1beta3.LaunchFlexTemplateParameter} LaunchFlexTemplateParameter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LaunchFlexTemplateParameter.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LaunchFlexTemplateParameter message. + * @function verify + * @memberof google.dataflow.v1beta3.LaunchFlexTemplateParameter + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LaunchFlexTemplateParameter.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.jobName != null && message.hasOwnProperty("jobName")) + if (!$util.isString(message.jobName)) + return "jobName: string expected"; + if (message.containerSpec != null && message.hasOwnProperty("containerSpec")) { + properties.template = 1; + { + var error = $root.google.dataflow.v1beta3.ContainerSpec.verify(message.containerSpec); + if (error) + return "containerSpec." + error; + } + } + if (message.containerSpecGcsPath != null && message.hasOwnProperty("containerSpecGcsPath")) { + if (properties.template === 1) + return "template: multiple values"; + properties.template = 1; + if (!$util.isString(message.containerSpecGcsPath)) + return "containerSpecGcsPath: string expected"; + } + if (message.parameters != null && message.hasOwnProperty("parameters")) { + if (!$util.isObject(message.parameters)) + return "parameters: object expected"; + var key = Object.keys(message.parameters); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.parameters[key[i]])) + return "parameters: string{k:string} expected"; + } + if (message.launchOptions != null && message.hasOwnProperty("launchOptions")) { + if (!$util.isObject(message.launchOptions)) + return "launchOptions: object expected"; + var key = Object.keys(message.launchOptions); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.launchOptions[key[i]])) + return "launchOptions: string{k:string} expected"; + } + if (message.environment != null && message.hasOwnProperty("environment")) { + var error = $root.google.dataflow.v1beta3.FlexTemplateRuntimeEnvironment.verify(message.environment); + if (error) + return "environment." + error; + } + if (message.update != null && message.hasOwnProperty("update")) + if (typeof message.update !== "boolean") + return "update: boolean expected"; + if (message.transformNameMappings != null && message.hasOwnProperty("transformNameMappings")) { + if (!$util.isObject(message.transformNameMappings)) + return "transformNameMappings: object expected"; + var key = Object.keys(message.transformNameMappings); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.transformNameMappings[key[i]])) + return "transformNameMappings: string{k:string} expected"; + } + return null; + }; + + /** + * Creates a LaunchFlexTemplateParameter message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.dataflow.v1beta3.LaunchFlexTemplateParameter + * @static + * @param {Object.} object Plain object + * @returns {google.dataflow.v1beta3.LaunchFlexTemplateParameter} LaunchFlexTemplateParameter + */ + LaunchFlexTemplateParameter.fromObject = function fromObject(object) { + if (object instanceof $root.google.dataflow.v1beta3.LaunchFlexTemplateParameter) + return object; + var message = new $root.google.dataflow.v1beta3.LaunchFlexTemplateParameter(); + if (object.jobName != null) + message.jobName = String(object.jobName); + if (object.containerSpec != null) { + if (typeof object.containerSpec !== "object") + throw TypeError(".google.dataflow.v1beta3.LaunchFlexTemplateParameter.containerSpec: object expected"); + message.containerSpec = $root.google.dataflow.v1beta3.ContainerSpec.fromObject(object.containerSpec); + } + if (object.containerSpecGcsPath != null) + message.containerSpecGcsPath = String(object.containerSpecGcsPath); + if (object.parameters) { + if (typeof object.parameters !== "object") + throw TypeError(".google.dataflow.v1beta3.LaunchFlexTemplateParameter.parameters: object expected"); + message.parameters = {}; + for (var keys = Object.keys(object.parameters), i = 0; i < keys.length; ++i) + message.parameters[keys[i]] = String(object.parameters[keys[i]]); + } + if (object.launchOptions) { + if (typeof object.launchOptions !== "object") + throw TypeError(".google.dataflow.v1beta3.LaunchFlexTemplateParameter.launchOptions: object expected"); + message.launchOptions = {}; + for (var keys = Object.keys(object.launchOptions), i = 0; i < keys.length; ++i) + message.launchOptions[keys[i]] = String(object.launchOptions[keys[i]]); + } + if (object.environment != null) { + if (typeof object.environment !== "object") + throw TypeError(".google.dataflow.v1beta3.LaunchFlexTemplateParameter.environment: object expected"); + message.environment = $root.google.dataflow.v1beta3.FlexTemplateRuntimeEnvironment.fromObject(object.environment); + } + if (object.update != null) + message.update = Boolean(object.update); + if (object.transformNameMappings) { + if (typeof object.transformNameMappings !== "object") + throw TypeError(".google.dataflow.v1beta3.LaunchFlexTemplateParameter.transformNameMappings: object expected"); + message.transformNameMappings = {}; + for (var keys = Object.keys(object.transformNameMappings), i = 0; i < keys.length; ++i) + message.transformNameMappings[keys[i]] = String(object.transformNameMappings[keys[i]]); + } + return message; + }; + + /** + * Creates a plain object from a LaunchFlexTemplateParameter message. Also converts values to other types if specified. + * @function toObject + * @memberof google.dataflow.v1beta3.LaunchFlexTemplateParameter + * @static + * @param {google.dataflow.v1beta3.LaunchFlexTemplateParameter} message LaunchFlexTemplateParameter + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LaunchFlexTemplateParameter.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) { + object.parameters = {}; + object.launchOptions = {}; + object.transformNameMappings = {}; + } + if (options.defaults) { + object.jobName = ""; + object.environment = null; + object.update = false; + } + if (message.jobName != null && message.hasOwnProperty("jobName")) + object.jobName = message.jobName; + var keys2; + if (message.parameters && (keys2 = Object.keys(message.parameters)).length) { + object.parameters = {}; + for (var j = 0; j < keys2.length; ++j) + object.parameters[keys2[j]] = message.parameters[keys2[j]]; + } + if (message.containerSpec != null && message.hasOwnProperty("containerSpec")) { + object.containerSpec = $root.google.dataflow.v1beta3.ContainerSpec.toObject(message.containerSpec, options); + if (options.oneofs) + object.template = "containerSpec"; + } + if (message.containerSpecGcsPath != null && message.hasOwnProperty("containerSpecGcsPath")) { + object.containerSpecGcsPath = message.containerSpecGcsPath; + if (options.oneofs) + object.template = "containerSpecGcsPath"; + } + if (message.launchOptions && (keys2 = Object.keys(message.launchOptions)).length) { + object.launchOptions = {}; + for (var j = 0; j < keys2.length; ++j) + object.launchOptions[keys2[j]] = message.launchOptions[keys2[j]]; + } + if (message.environment != null && message.hasOwnProperty("environment")) + object.environment = $root.google.dataflow.v1beta3.FlexTemplateRuntimeEnvironment.toObject(message.environment, options); + if (message.update != null && message.hasOwnProperty("update")) + object.update = message.update; + if (message.transformNameMappings && (keys2 = Object.keys(message.transformNameMappings)).length) { + object.transformNameMappings = {}; + for (var j = 0; j < keys2.length; ++j) + object.transformNameMappings[keys2[j]] = message.transformNameMappings[keys2[j]]; + } + return object; + }; + + /** + * Converts this LaunchFlexTemplateParameter to JSON. + * @function toJSON + * @memberof google.dataflow.v1beta3.LaunchFlexTemplateParameter + * @instance + * @returns {Object.} JSON object + */ + LaunchFlexTemplateParameter.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LaunchFlexTemplateParameter + * @function getTypeUrl + * @memberof google.dataflow.v1beta3.LaunchFlexTemplateParameter + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LaunchFlexTemplateParameter.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.dataflow.v1beta3.LaunchFlexTemplateParameter"; + }; + + return LaunchFlexTemplateParameter; + })(); + + v1beta3.FlexTemplateRuntimeEnvironment = (function() { + + /** + * Properties of a FlexTemplateRuntimeEnvironment. + * @memberof google.dataflow.v1beta3 + * @interface IFlexTemplateRuntimeEnvironment + * @property {number|null} [numWorkers] FlexTemplateRuntimeEnvironment numWorkers + * @property {number|null} [maxWorkers] FlexTemplateRuntimeEnvironment maxWorkers + * @property {string|null} [zone] FlexTemplateRuntimeEnvironment zone + * @property {string|null} [serviceAccountEmail] FlexTemplateRuntimeEnvironment serviceAccountEmail + * @property {string|null} [tempLocation] FlexTemplateRuntimeEnvironment tempLocation + * @property {string|null} [machineType] FlexTemplateRuntimeEnvironment machineType + * @property {Array.|null} [additionalExperiments] FlexTemplateRuntimeEnvironment additionalExperiments + * @property {string|null} [network] FlexTemplateRuntimeEnvironment network + * @property {string|null} [subnetwork] FlexTemplateRuntimeEnvironment subnetwork + * @property {Object.|null} [additionalUserLabels] FlexTemplateRuntimeEnvironment additionalUserLabels + * @property {string|null} [kmsKeyName] FlexTemplateRuntimeEnvironment kmsKeyName + * @property {google.dataflow.v1beta3.WorkerIPAddressConfiguration|null} [ipConfiguration] FlexTemplateRuntimeEnvironment ipConfiguration + * @property {string|null} [workerRegion] FlexTemplateRuntimeEnvironment workerRegion + * @property {string|null} [workerZone] FlexTemplateRuntimeEnvironment workerZone + * @property {boolean|null} [enableStreamingEngine] FlexTemplateRuntimeEnvironment enableStreamingEngine + * @property {google.dataflow.v1beta3.FlexResourceSchedulingGoal|null} [flexrsGoal] FlexTemplateRuntimeEnvironment flexrsGoal + * @property {string|null} [stagingLocation] FlexTemplateRuntimeEnvironment stagingLocation + * @property {string|null} [sdkContainerImage] FlexTemplateRuntimeEnvironment sdkContainerImage + * @property {number|null} [diskSizeGb] FlexTemplateRuntimeEnvironment diskSizeGb + * @property {google.dataflow.v1beta3.AutoscalingAlgorithm|null} [autoscalingAlgorithm] FlexTemplateRuntimeEnvironment autoscalingAlgorithm + * @property {boolean|null} [dumpHeapOnOom] FlexTemplateRuntimeEnvironment dumpHeapOnOom + * @property {string|null} [saveHeapDumpsToGcsPath] FlexTemplateRuntimeEnvironment saveHeapDumpsToGcsPath + * @property {string|null} [launcherMachineType] FlexTemplateRuntimeEnvironment launcherMachineType + */ + + /** + * Constructs a new FlexTemplateRuntimeEnvironment. + * @memberof google.dataflow.v1beta3 + * @classdesc Represents a FlexTemplateRuntimeEnvironment. + * @implements IFlexTemplateRuntimeEnvironment + * @constructor + * @param {google.dataflow.v1beta3.IFlexTemplateRuntimeEnvironment=} [properties] Properties to set + */ + function FlexTemplateRuntimeEnvironment(properties) { + this.additionalExperiments = []; + this.additionalUserLabels = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FlexTemplateRuntimeEnvironment numWorkers. + * @member {number} numWorkers + * @memberof google.dataflow.v1beta3.FlexTemplateRuntimeEnvironment + * @instance + */ + FlexTemplateRuntimeEnvironment.prototype.numWorkers = 0; + + /** + * FlexTemplateRuntimeEnvironment maxWorkers. + * @member {number} maxWorkers + * @memberof google.dataflow.v1beta3.FlexTemplateRuntimeEnvironment + * @instance + */ + FlexTemplateRuntimeEnvironment.prototype.maxWorkers = 0; + + /** + * FlexTemplateRuntimeEnvironment zone. + * @member {string} zone + * @memberof google.dataflow.v1beta3.FlexTemplateRuntimeEnvironment + * @instance + */ + FlexTemplateRuntimeEnvironment.prototype.zone = ""; + + /** + * FlexTemplateRuntimeEnvironment serviceAccountEmail. + * @member {string} serviceAccountEmail + * @memberof google.dataflow.v1beta3.FlexTemplateRuntimeEnvironment + * @instance + */ + FlexTemplateRuntimeEnvironment.prototype.serviceAccountEmail = ""; + + /** + * FlexTemplateRuntimeEnvironment tempLocation. + * @member {string} tempLocation + * @memberof google.dataflow.v1beta3.FlexTemplateRuntimeEnvironment + * @instance + */ + FlexTemplateRuntimeEnvironment.prototype.tempLocation = ""; + + /** + * FlexTemplateRuntimeEnvironment machineType. + * @member {string} machineType + * @memberof google.dataflow.v1beta3.FlexTemplateRuntimeEnvironment + * @instance + */ + FlexTemplateRuntimeEnvironment.prototype.machineType = ""; + + /** + * FlexTemplateRuntimeEnvironment additionalExperiments. + * @member {Array.} additionalExperiments + * @memberof google.dataflow.v1beta3.FlexTemplateRuntimeEnvironment + * @instance + */ + FlexTemplateRuntimeEnvironment.prototype.additionalExperiments = $util.emptyArray; + + /** + * FlexTemplateRuntimeEnvironment network. + * @member {string} network + * @memberof google.dataflow.v1beta3.FlexTemplateRuntimeEnvironment + * @instance + */ + FlexTemplateRuntimeEnvironment.prototype.network = ""; + + /** + * FlexTemplateRuntimeEnvironment subnetwork. + * @member {string} subnetwork + * @memberof google.dataflow.v1beta3.FlexTemplateRuntimeEnvironment + * @instance + */ + FlexTemplateRuntimeEnvironment.prototype.subnetwork = ""; + + /** + * FlexTemplateRuntimeEnvironment additionalUserLabels. + * @member {Object.} additionalUserLabels + * @memberof google.dataflow.v1beta3.FlexTemplateRuntimeEnvironment + * @instance + */ + FlexTemplateRuntimeEnvironment.prototype.additionalUserLabels = $util.emptyObject; + + /** + * FlexTemplateRuntimeEnvironment kmsKeyName. + * @member {string} kmsKeyName + * @memberof google.dataflow.v1beta3.FlexTemplateRuntimeEnvironment + * @instance + */ + FlexTemplateRuntimeEnvironment.prototype.kmsKeyName = ""; + + /** + * FlexTemplateRuntimeEnvironment ipConfiguration. + * @member {google.dataflow.v1beta3.WorkerIPAddressConfiguration} ipConfiguration + * @memberof google.dataflow.v1beta3.FlexTemplateRuntimeEnvironment + * @instance + */ + FlexTemplateRuntimeEnvironment.prototype.ipConfiguration = 0; + + /** + * FlexTemplateRuntimeEnvironment workerRegion. + * @member {string} workerRegion + * @memberof google.dataflow.v1beta3.FlexTemplateRuntimeEnvironment + * @instance + */ + FlexTemplateRuntimeEnvironment.prototype.workerRegion = ""; + + /** + * FlexTemplateRuntimeEnvironment workerZone. + * @member {string} workerZone + * @memberof google.dataflow.v1beta3.FlexTemplateRuntimeEnvironment + * @instance + */ + FlexTemplateRuntimeEnvironment.prototype.workerZone = ""; + + /** + * FlexTemplateRuntimeEnvironment enableStreamingEngine. + * @member {boolean} enableStreamingEngine + * @memberof google.dataflow.v1beta3.FlexTemplateRuntimeEnvironment + * @instance + */ + FlexTemplateRuntimeEnvironment.prototype.enableStreamingEngine = false; + + /** + * FlexTemplateRuntimeEnvironment flexrsGoal. + * @member {google.dataflow.v1beta3.FlexResourceSchedulingGoal} flexrsGoal + * @memberof google.dataflow.v1beta3.FlexTemplateRuntimeEnvironment + * @instance + */ + FlexTemplateRuntimeEnvironment.prototype.flexrsGoal = 0; + + /** + * FlexTemplateRuntimeEnvironment stagingLocation. + * @member {string} stagingLocation + * @memberof google.dataflow.v1beta3.FlexTemplateRuntimeEnvironment + * @instance + */ + FlexTemplateRuntimeEnvironment.prototype.stagingLocation = ""; + + /** + * FlexTemplateRuntimeEnvironment sdkContainerImage. + * @member {string} sdkContainerImage + * @memberof google.dataflow.v1beta3.FlexTemplateRuntimeEnvironment + * @instance + */ + FlexTemplateRuntimeEnvironment.prototype.sdkContainerImage = ""; + + /** + * FlexTemplateRuntimeEnvironment diskSizeGb. + * @member {number} diskSizeGb + * @memberof google.dataflow.v1beta3.FlexTemplateRuntimeEnvironment + * @instance + */ + FlexTemplateRuntimeEnvironment.prototype.diskSizeGb = 0; + + /** + * FlexTemplateRuntimeEnvironment autoscalingAlgorithm. + * @member {google.dataflow.v1beta3.AutoscalingAlgorithm} autoscalingAlgorithm + * @memberof google.dataflow.v1beta3.FlexTemplateRuntimeEnvironment + * @instance + */ + FlexTemplateRuntimeEnvironment.prototype.autoscalingAlgorithm = 0; + + /** + * FlexTemplateRuntimeEnvironment dumpHeapOnOom. + * @member {boolean} dumpHeapOnOom + * @memberof google.dataflow.v1beta3.FlexTemplateRuntimeEnvironment + * @instance + */ + FlexTemplateRuntimeEnvironment.prototype.dumpHeapOnOom = false; + + /** + * FlexTemplateRuntimeEnvironment saveHeapDumpsToGcsPath. + * @member {string} saveHeapDumpsToGcsPath + * @memberof google.dataflow.v1beta3.FlexTemplateRuntimeEnvironment + * @instance + */ + FlexTemplateRuntimeEnvironment.prototype.saveHeapDumpsToGcsPath = ""; + + /** + * FlexTemplateRuntimeEnvironment launcherMachineType. + * @member {string} launcherMachineType + * @memberof google.dataflow.v1beta3.FlexTemplateRuntimeEnvironment + * @instance + */ + FlexTemplateRuntimeEnvironment.prototype.launcherMachineType = ""; + + /** + * Creates a new FlexTemplateRuntimeEnvironment instance using the specified properties. + * @function create + * @memberof google.dataflow.v1beta3.FlexTemplateRuntimeEnvironment + * @static + * @param {google.dataflow.v1beta3.IFlexTemplateRuntimeEnvironment=} [properties] Properties to set + * @returns {google.dataflow.v1beta3.FlexTemplateRuntimeEnvironment} FlexTemplateRuntimeEnvironment instance + */ + FlexTemplateRuntimeEnvironment.create = function create(properties) { + return new FlexTemplateRuntimeEnvironment(properties); + }; + + /** + * Encodes the specified FlexTemplateRuntimeEnvironment message. Does not implicitly {@link google.dataflow.v1beta3.FlexTemplateRuntimeEnvironment.verify|verify} messages. + * @function encode + * @memberof google.dataflow.v1beta3.FlexTemplateRuntimeEnvironment + * @static + * @param {google.dataflow.v1beta3.IFlexTemplateRuntimeEnvironment} message FlexTemplateRuntimeEnvironment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FlexTemplateRuntimeEnvironment.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.numWorkers != null && Object.hasOwnProperty.call(message, "numWorkers")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.numWorkers); + if (message.maxWorkers != null && Object.hasOwnProperty.call(message, "maxWorkers")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.maxWorkers); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.zone); + if (message.serviceAccountEmail != null && Object.hasOwnProperty.call(message, "serviceAccountEmail")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.serviceAccountEmail); + if (message.tempLocation != null && Object.hasOwnProperty.call(message, "tempLocation")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.tempLocation); + if (message.machineType != null && Object.hasOwnProperty.call(message, "machineType")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.machineType); + if (message.additionalExperiments != null && message.additionalExperiments.length) + for (var i = 0; i < message.additionalExperiments.length; ++i) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.additionalExperiments[i]); + if (message.network != null && Object.hasOwnProperty.call(message, "network")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.network); + if (message.subnetwork != null && Object.hasOwnProperty.call(message, "subnetwork")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.subnetwork); + if (message.additionalUserLabels != null && Object.hasOwnProperty.call(message, "additionalUserLabels")) + for (var keys = Object.keys(message.additionalUserLabels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 10, wireType 2 =*/82).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.additionalUserLabels[keys[i]]).ldelim(); + if (message.kmsKeyName != null && Object.hasOwnProperty.call(message, "kmsKeyName")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.kmsKeyName); + if (message.ipConfiguration != null && Object.hasOwnProperty.call(message, "ipConfiguration")) + writer.uint32(/* id 12, wireType 0 =*/96).int32(message.ipConfiguration); + if (message.workerRegion != null && Object.hasOwnProperty.call(message, "workerRegion")) + writer.uint32(/* id 13, wireType 2 =*/106).string(message.workerRegion); + if (message.workerZone != null && Object.hasOwnProperty.call(message, "workerZone")) + writer.uint32(/* id 14, wireType 2 =*/114).string(message.workerZone); + if (message.enableStreamingEngine != null && Object.hasOwnProperty.call(message, "enableStreamingEngine")) + writer.uint32(/* id 15, wireType 0 =*/120).bool(message.enableStreamingEngine); + if (message.flexrsGoal != null && Object.hasOwnProperty.call(message, "flexrsGoal")) + writer.uint32(/* id 16, wireType 0 =*/128).int32(message.flexrsGoal); + if (message.stagingLocation != null && Object.hasOwnProperty.call(message, "stagingLocation")) + writer.uint32(/* id 17, wireType 2 =*/138).string(message.stagingLocation); + if (message.sdkContainerImage != null && Object.hasOwnProperty.call(message, "sdkContainerImage")) + writer.uint32(/* id 18, wireType 2 =*/146).string(message.sdkContainerImage); + if (message.diskSizeGb != null && Object.hasOwnProperty.call(message, "diskSizeGb")) + writer.uint32(/* id 20, wireType 0 =*/160).int32(message.diskSizeGb); + if (message.autoscalingAlgorithm != null && Object.hasOwnProperty.call(message, "autoscalingAlgorithm")) + writer.uint32(/* id 21, wireType 0 =*/168).int32(message.autoscalingAlgorithm); + if (message.dumpHeapOnOom != null && Object.hasOwnProperty.call(message, "dumpHeapOnOom")) + writer.uint32(/* id 22, wireType 0 =*/176).bool(message.dumpHeapOnOom); + if (message.saveHeapDumpsToGcsPath != null && Object.hasOwnProperty.call(message, "saveHeapDumpsToGcsPath")) + writer.uint32(/* id 23, wireType 2 =*/186).string(message.saveHeapDumpsToGcsPath); + if (message.launcherMachineType != null && Object.hasOwnProperty.call(message, "launcherMachineType")) + writer.uint32(/* id 24, wireType 2 =*/194).string(message.launcherMachineType); + return writer; + }; + + /** + * Encodes the specified FlexTemplateRuntimeEnvironment message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.FlexTemplateRuntimeEnvironment.verify|verify} messages. + * @function encodeDelimited + * @memberof google.dataflow.v1beta3.FlexTemplateRuntimeEnvironment + * @static + * @param {google.dataflow.v1beta3.IFlexTemplateRuntimeEnvironment} message FlexTemplateRuntimeEnvironment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FlexTemplateRuntimeEnvironment.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FlexTemplateRuntimeEnvironment message from the specified reader or buffer. + * @function decode + * @memberof google.dataflow.v1beta3.FlexTemplateRuntimeEnvironment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.dataflow.v1beta3.FlexTemplateRuntimeEnvironment} FlexTemplateRuntimeEnvironment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FlexTemplateRuntimeEnvironment.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.dataflow.v1beta3.FlexTemplateRuntimeEnvironment(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.numWorkers = reader.int32(); + break; + } + case 2: { + message.maxWorkers = reader.int32(); + break; + } + case 3: { + message.zone = reader.string(); + break; + } + case 4: { + message.serviceAccountEmail = reader.string(); + break; + } + case 5: { + message.tempLocation = reader.string(); + break; + } + case 6: { + message.machineType = reader.string(); + break; + } + case 7: { + if (!(message.additionalExperiments && message.additionalExperiments.length)) + message.additionalExperiments = []; + message.additionalExperiments.push(reader.string()); + break; + } + case 8: { + message.network = reader.string(); + break; + } + case 9: { + message.subnetwork = reader.string(); + break; + } + case 10: { + if (message.additionalUserLabels === $util.emptyObject) + message.additionalUserLabels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.additionalUserLabels[key] = value; + break; + } + case 11: { + message.kmsKeyName = reader.string(); + break; + } + case 12: { + message.ipConfiguration = reader.int32(); + break; + } + case 13: { + message.workerRegion = reader.string(); + break; + } + case 14: { + message.workerZone = reader.string(); + break; + } + case 15: { + message.enableStreamingEngine = reader.bool(); + break; + } + case 16: { + message.flexrsGoal = reader.int32(); + break; + } + case 17: { + message.stagingLocation = reader.string(); + break; + } + case 18: { + message.sdkContainerImage = reader.string(); + break; + } + case 20: { + message.diskSizeGb = reader.int32(); + break; + } + case 21: { + message.autoscalingAlgorithm = reader.int32(); + break; + } + case 22: { + message.dumpHeapOnOom = reader.bool(); + break; + } + case 23: { + message.saveHeapDumpsToGcsPath = reader.string(); + break; + } + case 24: { + message.launcherMachineType = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FlexTemplateRuntimeEnvironment message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.dataflow.v1beta3.FlexTemplateRuntimeEnvironment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.dataflow.v1beta3.FlexTemplateRuntimeEnvironment} FlexTemplateRuntimeEnvironment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FlexTemplateRuntimeEnvironment.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FlexTemplateRuntimeEnvironment message. + * @function verify + * @memberof google.dataflow.v1beta3.FlexTemplateRuntimeEnvironment + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FlexTemplateRuntimeEnvironment.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.numWorkers != null && message.hasOwnProperty("numWorkers")) + if (!$util.isInteger(message.numWorkers)) + return "numWorkers: integer expected"; + if (message.maxWorkers != null && message.hasOwnProperty("maxWorkers")) + if (!$util.isInteger(message.maxWorkers)) + return "maxWorkers: integer expected"; + if (message.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: string expected"; + if (message.serviceAccountEmail != null && message.hasOwnProperty("serviceAccountEmail")) + if (!$util.isString(message.serviceAccountEmail)) + return "serviceAccountEmail: string expected"; + if (message.tempLocation != null && message.hasOwnProperty("tempLocation")) + if (!$util.isString(message.tempLocation)) + return "tempLocation: string expected"; + if (message.machineType != null && message.hasOwnProperty("machineType")) + if (!$util.isString(message.machineType)) + return "machineType: string expected"; + if (message.additionalExperiments != null && message.hasOwnProperty("additionalExperiments")) { + if (!Array.isArray(message.additionalExperiments)) + return "additionalExperiments: array expected"; + for (var i = 0; i < message.additionalExperiments.length; ++i) + if (!$util.isString(message.additionalExperiments[i])) + return "additionalExperiments: string[] expected"; + } + if (message.network != null && message.hasOwnProperty("network")) + if (!$util.isString(message.network)) + return "network: string expected"; + if (message.subnetwork != null && message.hasOwnProperty("subnetwork")) + if (!$util.isString(message.subnetwork)) + return "subnetwork: string expected"; + if (message.additionalUserLabels != null && message.hasOwnProperty("additionalUserLabels")) { + if (!$util.isObject(message.additionalUserLabels)) + return "additionalUserLabels: object expected"; + var key = Object.keys(message.additionalUserLabels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.additionalUserLabels[key[i]])) + return "additionalUserLabels: string{k:string} expected"; + } + if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) + if (!$util.isString(message.kmsKeyName)) + return "kmsKeyName: string expected"; + if (message.ipConfiguration != null && message.hasOwnProperty("ipConfiguration")) + switch (message.ipConfiguration) { + default: + return "ipConfiguration: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.workerRegion != null && message.hasOwnProperty("workerRegion")) + if (!$util.isString(message.workerRegion)) + return "workerRegion: string expected"; + if (message.workerZone != null && message.hasOwnProperty("workerZone")) + if (!$util.isString(message.workerZone)) + return "workerZone: string expected"; + if (message.enableStreamingEngine != null && message.hasOwnProperty("enableStreamingEngine")) + if (typeof message.enableStreamingEngine !== "boolean") + return "enableStreamingEngine: boolean expected"; + if (message.flexrsGoal != null && message.hasOwnProperty("flexrsGoal")) + switch (message.flexrsGoal) { + default: + return "flexrsGoal: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.stagingLocation != null && message.hasOwnProperty("stagingLocation")) + if (!$util.isString(message.stagingLocation)) + return "stagingLocation: string expected"; + if (message.sdkContainerImage != null && message.hasOwnProperty("sdkContainerImage")) + if (!$util.isString(message.sdkContainerImage)) + return "sdkContainerImage: string expected"; + if (message.diskSizeGb != null && message.hasOwnProperty("diskSizeGb")) + if (!$util.isInteger(message.diskSizeGb)) + return "diskSizeGb: integer expected"; + if (message.autoscalingAlgorithm != null && message.hasOwnProperty("autoscalingAlgorithm")) + switch (message.autoscalingAlgorithm) { + default: + return "autoscalingAlgorithm: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.dumpHeapOnOom != null && message.hasOwnProperty("dumpHeapOnOom")) + if (typeof message.dumpHeapOnOom !== "boolean") + return "dumpHeapOnOom: boolean expected"; + if (message.saveHeapDumpsToGcsPath != null && message.hasOwnProperty("saveHeapDumpsToGcsPath")) + if (!$util.isString(message.saveHeapDumpsToGcsPath)) + return "saveHeapDumpsToGcsPath: string expected"; + if (message.launcherMachineType != null && message.hasOwnProperty("launcherMachineType")) + if (!$util.isString(message.launcherMachineType)) + return "launcherMachineType: string expected"; + return null; + }; + + /** + * Creates a FlexTemplateRuntimeEnvironment message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.dataflow.v1beta3.FlexTemplateRuntimeEnvironment + * @static + * @param {Object.} object Plain object + * @returns {google.dataflow.v1beta3.FlexTemplateRuntimeEnvironment} FlexTemplateRuntimeEnvironment + */ + FlexTemplateRuntimeEnvironment.fromObject = function fromObject(object) { + if (object instanceof $root.google.dataflow.v1beta3.FlexTemplateRuntimeEnvironment) + return object; + var message = new $root.google.dataflow.v1beta3.FlexTemplateRuntimeEnvironment(); + if (object.numWorkers != null) + message.numWorkers = object.numWorkers | 0; + if (object.maxWorkers != null) + message.maxWorkers = object.maxWorkers | 0; + if (object.zone != null) + message.zone = String(object.zone); + if (object.serviceAccountEmail != null) + message.serviceAccountEmail = String(object.serviceAccountEmail); + if (object.tempLocation != null) + message.tempLocation = String(object.tempLocation); + if (object.machineType != null) + message.machineType = String(object.machineType); + if (object.additionalExperiments) { + if (!Array.isArray(object.additionalExperiments)) + throw TypeError(".google.dataflow.v1beta3.FlexTemplateRuntimeEnvironment.additionalExperiments: array expected"); + message.additionalExperiments = []; + for (var i = 0; i < object.additionalExperiments.length; ++i) + message.additionalExperiments[i] = String(object.additionalExperiments[i]); + } + if (object.network != null) + message.network = String(object.network); + if (object.subnetwork != null) + message.subnetwork = String(object.subnetwork); + if (object.additionalUserLabels) { + if (typeof object.additionalUserLabels !== "object") + throw TypeError(".google.dataflow.v1beta3.FlexTemplateRuntimeEnvironment.additionalUserLabels: object expected"); + message.additionalUserLabels = {}; + for (var keys = Object.keys(object.additionalUserLabels), i = 0; i < keys.length; ++i) + message.additionalUserLabels[keys[i]] = String(object.additionalUserLabels[keys[i]]); + } + if (object.kmsKeyName != null) + message.kmsKeyName = String(object.kmsKeyName); + switch (object.ipConfiguration) { + default: + if (typeof object.ipConfiguration === "number") { + message.ipConfiguration = object.ipConfiguration; + break; + } + break; + case "WORKER_IP_UNSPECIFIED": + case 0: + message.ipConfiguration = 0; + break; + case "WORKER_IP_PUBLIC": + case 1: + message.ipConfiguration = 1; + break; + case "WORKER_IP_PRIVATE": + case 2: + message.ipConfiguration = 2; + break; + } + if (object.workerRegion != null) + message.workerRegion = String(object.workerRegion); + if (object.workerZone != null) + message.workerZone = String(object.workerZone); + if (object.enableStreamingEngine != null) + message.enableStreamingEngine = Boolean(object.enableStreamingEngine); + switch (object.flexrsGoal) { + default: + if (typeof object.flexrsGoal === "number") { + message.flexrsGoal = object.flexrsGoal; + break; + } + break; + case "FLEXRS_UNSPECIFIED": + case 0: + message.flexrsGoal = 0; + break; + case "FLEXRS_SPEED_OPTIMIZED": + case 1: + message.flexrsGoal = 1; + break; + case "FLEXRS_COST_OPTIMIZED": + case 2: + message.flexrsGoal = 2; + break; + } + if (object.stagingLocation != null) + message.stagingLocation = String(object.stagingLocation); + if (object.sdkContainerImage != null) + message.sdkContainerImage = String(object.sdkContainerImage); + if (object.diskSizeGb != null) + message.diskSizeGb = object.diskSizeGb | 0; + switch (object.autoscalingAlgorithm) { + default: + if (typeof object.autoscalingAlgorithm === "number") { + message.autoscalingAlgorithm = object.autoscalingAlgorithm; + break; + } + break; + case "AUTOSCALING_ALGORITHM_UNKNOWN": + case 0: + message.autoscalingAlgorithm = 0; + break; + case "AUTOSCALING_ALGORITHM_NONE": + case 1: + message.autoscalingAlgorithm = 1; + break; + case "AUTOSCALING_ALGORITHM_BASIC": + case 2: + message.autoscalingAlgorithm = 2; + break; + } + if (object.dumpHeapOnOom != null) + message.dumpHeapOnOom = Boolean(object.dumpHeapOnOom); + if (object.saveHeapDumpsToGcsPath != null) + message.saveHeapDumpsToGcsPath = String(object.saveHeapDumpsToGcsPath); + if (object.launcherMachineType != null) + message.launcherMachineType = String(object.launcherMachineType); + return message; + }; + + /** + * Creates a plain object from a FlexTemplateRuntimeEnvironment message. Also converts values to other types if specified. + * @function toObject + * @memberof google.dataflow.v1beta3.FlexTemplateRuntimeEnvironment + * @static + * @param {google.dataflow.v1beta3.FlexTemplateRuntimeEnvironment} message FlexTemplateRuntimeEnvironment + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FlexTemplateRuntimeEnvironment.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.additionalExperiments = []; + if (options.objects || options.defaults) + object.additionalUserLabels = {}; + if (options.defaults) { + object.numWorkers = 0; + object.maxWorkers = 0; + object.zone = ""; + object.serviceAccountEmail = ""; + object.tempLocation = ""; + object.machineType = ""; + object.network = ""; + object.subnetwork = ""; + object.kmsKeyName = ""; + object.ipConfiguration = options.enums === String ? "WORKER_IP_UNSPECIFIED" : 0; + object.workerRegion = ""; + object.workerZone = ""; + object.enableStreamingEngine = false; + object.flexrsGoal = options.enums === String ? "FLEXRS_UNSPECIFIED" : 0; + object.stagingLocation = ""; + object.sdkContainerImage = ""; + object.diskSizeGb = 0; + object.autoscalingAlgorithm = options.enums === String ? "AUTOSCALING_ALGORITHM_UNKNOWN" : 0; + object.dumpHeapOnOom = false; + object.saveHeapDumpsToGcsPath = ""; + object.launcherMachineType = ""; + } + if (message.numWorkers != null && message.hasOwnProperty("numWorkers")) + object.numWorkers = message.numWorkers; + if (message.maxWorkers != null && message.hasOwnProperty("maxWorkers")) + object.maxWorkers = message.maxWorkers; + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + if (message.serviceAccountEmail != null && message.hasOwnProperty("serviceAccountEmail")) + object.serviceAccountEmail = message.serviceAccountEmail; + if (message.tempLocation != null && message.hasOwnProperty("tempLocation")) + object.tempLocation = message.tempLocation; + if (message.machineType != null && message.hasOwnProperty("machineType")) + object.machineType = message.machineType; + if (message.additionalExperiments && message.additionalExperiments.length) { + object.additionalExperiments = []; + for (var j = 0; j < message.additionalExperiments.length; ++j) + object.additionalExperiments[j] = message.additionalExperiments[j]; + } + if (message.network != null && message.hasOwnProperty("network")) + object.network = message.network; + if (message.subnetwork != null && message.hasOwnProperty("subnetwork")) + object.subnetwork = message.subnetwork; + var keys2; + if (message.additionalUserLabels && (keys2 = Object.keys(message.additionalUserLabels)).length) { + object.additionalUserLabels = {}; + for (var j = 0; j < keys2.length; ++j) + object.additionalUserLabels[keys2[j]] = message.additionalUserLabels[keys2[j]]; + } + if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) + object.kmsKeyName = message.kmsKeyName; + if (message.ipConfiguration != null && message.hasOwnProperty("ipConfiguration")) + object.ipConfiguration = options.enums === String ? $root.google.dataflow.v1beta3.WorkerIPAddressConfiguration[message.ipConfiguration] === undefined ? message.ipConfiguration : $root.google.dataflow.v1beta3.WorkerIPAddressConfiguration[message.ipConfiguration] : message.ipConfiguration; + if (message.workerRegion != null && message.hasOwnProperty("workerRegion")) + object.workerRegion = message.workerRegion; + if (message.workerZone != null && message.hasOwnProperty("workerZone")) + object.workerZone = message.workerZone; + if (message.enableStreamingEngine != null && message.hasOwnProperty("enableStreamingEngine")) + object.enableStreamingEngine = message.enableStreamingEngine; + if (message.flexrsGoal != null && message.hasOwnProperty("flexrsGoal")) + object.flexrsGoal = options.enums === String ? $root.google.dataflow.v1beta3.FlexResourceSchedulingGoal[message.flexrsGoal] === undefined ? message.flexrsGoal : $root.google.dataflow.v1beta3.FlexResourceSchedulingGoal[message.flexrsGoal] : message.flexrsGoal; + if (message.stagingLocation != null && message.hasOwnProperty("stagingLocation")) + object.stagingLocation = message.stagingLocation; + if (message.sdkContainerImage != null && message.hasOwnProperty("sdkContainerImage")) + object.sdkContainerImage = message.sdkContainerImage; + if (message.diskSizeGb != null && message.hasOwnProperty("diskSizeGb")) + object.diskSizeGb = message.diskSizeGb; + if (message.autoscalingAlgorithm != null && message.hasOwnProperty("autoscalingAlgorithm")) + object.autoscalingAlgorithm = options.enums === String ? $root.google.dataflow.v1beta3.AutoscalingAlgorithm[message.autoscalingAlgorithm] === undefined ? message.autoscalingAlgorithm : $root.google.dataflow.v1beta3.AutoscalingAlgorithm[message.autoscalingAlgorithm] : message.autoscalingAlgorithm; + if (message.dumpHeapOnOom != null && message.hasOwnProperty("dumpHeapOnOom")) + object.dumpHeapOnOom = message.dumpHeapOnOom; + if (message.saveHeapDumpsToGcsPath != null && message.hasOwnProperty("saveHeapDumpsToGcsPath")) + object.saveHeapDumpsToGcsPath = message.saveHeapDumpsToGcsPath; + if (message.launcherMachineType != null && message.hasOwnProperty("launcherMachineType")) + object.launcherMachineType = message.launcherMachineType; + return object; + }; + + /** + * Converts this FlexTemplateRuntimeEnvironment to JSON. + * @function toJSON + * @memberof google.dataflow.v1beta3.FlexTemplateRuntimeEnvironment + * @instance + * @returns {Object.} JSON object + */ + FlexTemplateRuntimeEnvironment.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FlexTemplateRuntimeEnvironment + * @function getTypeUrl + * @memberof google.dataflow.v1beta3.FlexTemplateRuntimeEnvironment + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FlexTemplateRuntimeEnvironment.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.dataflow.v1beta3.FlexTemplateRuntimeEnvironment"; + }; + + return FlexTemplateRuntimeEnvironment; + })(); + + v1beta3.LaunchFlexTemplateRequest = (function() { + + /** + * Properties of a LaunchFlexTemplateRequest. + * @memberof google.dataflow.v1beta3 + * @interface ILaunchFlexTemplateRequest + * @property {string|null} [projectId] LaunchFlexTemplateRequest projectId + * @property {google.dataflow.v1beta3.ILaunchFlexTemplateParameter|null} [launchParameter] LaunchFlexTemplateRequest launchParameter + * @property {string|null} [location] LaunchFlexTemplateRequest location + * @property {boolean|null} [validateOnly] LaunchFlexTemplateRequest validateOnly + */ + + /** + * Constructs a new LaunchFlexTemplateRequest. + * @memberof google.dataflow.v1beta3 + * @classdesc Represents a LaunchFlexTemplateRequest. + * @implements ILaunchFlexTemplateRequest + * @constructor + * @param {google.dataflow.v1beta3.ILaunchFlexTemplateRequest=} [properties] Properties to set + */ + function LaunchFlexTemplateRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LaunchFlexTemplateRequest projectId. + * @member {string} projectId + * @memberof google.dataflow.v1beta3.LaunchFlexTemplateRequest + * @instance + */ + LaunchFlexTemplateRequest.prototype.projectId = ""; + + /** + * LaunchFlexTemplateRequest launchParameter. + * @member {google.dataflow.v1beta3.ILaunchFlexTemplateParameter|null|undefined} launchParameter + * @memberof google.dataflow.v1beta3.LaunchFlexTemplateRequest + * @instance + */ + LaunchFlexTemplateRequest.prototype.launchParameter = null; + + /** + * LaunchFlexTemplateRequest location. + * @member {string} location + * @memberof google.dataflow.v1beta3.LaunchFlexTemplateRequest + * @instance + */ + LaunchFlexTemplateRequest.prototype.location = ""; + + /** + * LaunchFlexTemplateRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.dataflow.v1beta3.LaunchFlexTemplateRequest + * @instance + */ + LaunchFlexTemplateRequest.prototype.validateOnly = false; + + /** + * Creates a new LaunchFlexTemplateRequest instance using the specified properties. + * @function create + * @memberof google.dataflow.v1beta3.LaunchFlexTemplateRequest + * @static + * @param {google.dataflow.v1beta3.ILaunchFlexTemplateRequest=} [properties] Properties to set + * @returns {google.dataflow.v1beta3.LaunchFlexTemplateRequest} LaunchFlexTemplateRequest instance + */ + LaunchFlexTemplateRequest.create = function create(properties) { + return new LaunchFlexTemplateRequest(properties); + }; + + /** + * Encodes the specified LaunchFlexTemplateRequest message. Does not implicitly {@link google.dataflow.v1beta3.LaunchFlexTemplateRequest.verify|verify} messages. + * @function encode + * @memberof google.dataflow.v1beta3.LaunchFlexTemplateRequest + * @static + * @param {google.dataflow.v1beta3.ILaunchFlexTemplateRequest} message LaunchFlexTemplateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LaunchFlexTemplateRequest.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.launchParameter != null && Object.hasOwnProperty.call(message, "launchParameter")) + $root.google.dataflow.v1beta3.LaunchFlexTemplateParameter.encode(message.launchParameter, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.location); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.validateOnly); + return writer; + }; + + /** + * Encodes the specified LaunchFlexTemplateRequest message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.LaunchFlexTemplateRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.dataflow.v1beta3.LaunchFlexTemplateRequest + * @static + * @param {google.dataflow.v1beta3.ILaunchFlexTemplateRequest} message LaunchFlexTemplateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LaunchFlexTemplateRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LaunchFlexTemplateRequest message from the specified reader or buffer. + * @function decode + * @memberof google.dataflow.v1beta3.LaunchFlexTemplateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.dataflow.v1beta3.LaunchFlexTemplateRequest} LaunchFlexTemplateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LaunchFlexTemplateRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.dataflow.v1beta3.LaunchFlexTemplateRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.projectId = reader.string(); + break; + } + case 2: { + message.launchParameter = $root.google.dataflow.v1beta3.LaunchFlexTemplateParameter.decode(reader, reader.uint32()); + break; + } + case 3: { + message.location = reader.string(); + break; + } + case 4: { + message.validateOnly = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LaunchFlexTemplateRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.dataflow.v1beta3.LaunchFlexTemplateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.dataflow.v1beta3.LaunchFlexTemplateRequest} LaunchFlexTemplateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LaunchFlexTemplateRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LaunchFlexTemplateRequest message. + * @function verify + * @memberof google.dataflow.v1beta3.LaunchFlexTemplateRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LaunchFlexTemplateRequest.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.launchParameter != null && message.hasOwnProperty("launchParameter")) { + var error = $root.google.dataflow.v1beta3.LaunchFlexTemplateParameter.verify(message.launchParameter); + if (error) + return "launchParameter." + error; + } + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isString(message.location)) + return "location: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + return null; + }; + + /** + * Creates a LaunchFlexTemplateRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.dataflow.v1beta3.LaunchFlexTemplateRequest + * @static + * @param {Object.} object Plain object + * @returns {google.dataflow.v1beta3.LaunchFlexTemplateRequest} LaunchFlexTemplateRequest + */ + LaunchFlexTemplateRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.dataflow.v1beta3.LaunchFlexTemplateRequest) + return object; + var message = new $root.google.dataflow.v1beta3.LaunchFlexTemplateRequest(); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.launchParameter != null) { + if (typeof object.launchParameter !== "object") + throw TypeError(".google.dataflow.v1beta3.LaunchFlexTemplateRequest.launchParameter: object expected"); + message.launchParameter = $root.google.dataflow.v1beta3.LaunchFlexTemplateParameter.fromObject(object.launchParameter); + } + if (object.location != null) + message.location = String(object.location); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + return message; + }; + + /** + * Creates a plain object from a LaunchFlexTemplateRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.dataflow.v1beta3.LaunchFlexTemplateRequest + * @static + * @param {google.dataflow.v1beta3.LaunchFlexTemplateRequest} message LaunchFlexTemplateRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LaunchFlexTemplateRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.projectId = ""; + object.launchParameter = null; + object.location = ""; + object.validateOnly = false; + } + if (message.projectId != null && message.hasOwnProperty("projectId")) + object.projectId = message.projectId; + if (message.launchParameter != null && message.hasOwnProperty("launchParameter")) + object.launchParameter = $root.google.dataflow.v1beta3.LaunchFlexTemplateParameter.toObject(message.launchParameter, options); + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + return object; + }; + + /** + * Converts this LaunchFlexTemplateRequest to JSON. + * @function toJSON + * @memberof google.dataflow.v1beta3.LaunchFlexTemplateRequest + * @instance + * @returns {Object.} JSON object + */ + LaunchFlexTemplateRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LaunchFlexTemplateRequest + * @function getTypeUrl + * @memberof google.dataflow.v1beta3.LaunchFlexTemplateRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LaunchFlexTemplateRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.dataflow.v1beta3.LaunchFlexTemplateRequest"; + }; + + return LaunchFlexTemplateRequest; + })(); + + v1beta3.RuntimeEnvironment = (function() { + + /** + * Properties of a RuntimeEnvironment. + * @memberof google.dataflow.v1beta3 + * @interface IRuntimeEnvironment + * @property {number|null} [numWorkers] RuntimeEnvironment numWorkers + * @property {number|null} [maxWorkers] RuntimeEnvironment maxWorkers + * @property {string|null} [zone] RuntimeEnvironment zone + * @property {string|null} [serviceAccountEmail] RuntimeEnvironment serviceAccountEmail + * @property {string|null} [tempLocation] RuntimeEnvironment tempLocation + * @property {boolean|null} [bypassTempDirValidation] RuntimeEnvironment bypassTempDirValidation + * @property {string|null} [machineType] RuntimeEnvironment machineType + * @property {Array.|null} [additionalExperiments] RuntimeEnvironment additionalExperiments + * @property {string|null} [network] RuntimeEnvironment network + * @property {string|null} [subnetwork] RuntimeEnvironment subnetwork + * @property {Object.|null} [additionalUserLabels] RuntimeEnvironment additionalUserLabels + * @property {string|null} [kmsKeyName] RuntimeEnvironment kmsKeyName + * @property {google.dataflow.v1beta3.WorkerIPAddressConfiguration|null} [ipConfiguration] RuntimeEnvironment ipConfiguration + * @property {string|null} [workerRegion] RuntimeEnvironment workerRegion + * @property {string|null} [workerZone] RuntimeEnvironment workerZone + * @property {boolean|null} [enableStreamingEngine] RuntimeEnvironment enableStreamingEngine + */ + + /** + * Constructs a new RuntimeEnvironment. + * @memberof google.dataflow.v1beta3 + * @classdesc Represents a RuntimeEnvironment. + * @implements IRuntimeEnvironment + * @constructor + * @param {google.dataflow.v1beta3.IRuntimeEnvironment=} [properties] Properties to set + */ + function RuntimeEnvironment(properties) { + this.additionalExperiments = []; + this.additionalUserLabels = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RuntimeEnvironment numWorkers. + * @member {number} numWorkers + * @memberof google.dataflow.v1beta3.RuntimeEnvironment + * @instance + */ + RuntimeEnvironment.prototype.numWorkers = 0; + + /** + * RuntimeEnvironment maxWorkers. + * @member {number} maxWorkers + * @memberof google.dataflow.v1beta3.RuntimeEnvironment + * @instance + */ + RuntimeEnvironment.prototype.maxWorkers = 0; + + /** + * RuntimeEnvironment zone. + * @member {string} zone + * @memberof google.dataflow.v1beta3.RuntimeEnvironment + * @instance + */ + RuntimeEnvironment.prototype.zone = ""; + + /** + * RuntimeEnvironment serviceAccountEmail. + * @member {string} serviceAccountEmail + * @memberof google.dataflow.v1beta3.RuntimeEnvironment + * @instance + */ + RuntimeEnvironment.prototype.serviceAccountEmail = ""; + + /** + * RuntimeEnvironment tempLocation. + * @member {string} tempLocation + * @memberof google.dataflow.v1beta3.RuntimeEnvironment + * @instance + */ + RuntimeEnvironment.prototype.tempLocation = ""; + + /** + * RuntimeEnvironment bypassTempDirValidation. + * @member {boolean} bypassTempDirValidation + * @memberof google.dataflow.v1beta3.RuntimeEnvironment + * @instance + */ + RuntimeEnvironment.prototype.bypassTempDirValidation = false; + + /** + * RuntimeEnvironment machineType. + * @member {string} machineType + * @memberof google.dataflow.v1beta3.RuntimeEnvironment + * @instance + */ + RuntimeEnvironment.prototype.machineType = ""; + + /** + * RuntimeEnvironment additionalExperiments. + * @member {Array.} additionalExperiments + * @memberof google.dataflow.v1beta3.RuntimeEnvironment + * @instance + */ + RuntimeEnvironment.prototype.additionalExperiments = $util.emptyArray; + + /** + * RuntimeEnvironment network. + * @member {string} network + * @memberof google.dataflow.v1beta3.RuntimeEnvironment + * @instance + */ + RuntimeEnvironment.prototype.network = ""; + + /** + * RuntimeEnvironment subnetwork. + * @member {string} subnetwork + * @memberof google.dataflow.v1beta3.RuntimeEnvironment + * @instance + */ + RuntimeEnvironment.prototype.subnetwork = ""; + + /** + * RuntimeEnvironment additionalUserLabels. + * @member {Object.} additionalUserLabels + * @memberof google.dataflow.v1beta3.RuntimeEnvironment + * @instance + */ + RuntimeEnvironment.prototype.additionalUserLabels = $util.emptyObject; + + /** + * RuntimeEnvironment kmsKeyName. + * @member {string} kmsKeyName + * @memberof google.dataflow.v1beta3.RuntimeEnvironment + * @instance + */ + RuntimeEnvironment.prototype.kmsKeyName = ""; + + /** + * RuntimeEnvironment ipConfiguration. + * @member {google.dataflow.v1beta3.WorkerIPAddressConfiguration} ipConfiguration + * @memberof google.dataflow.v1beta3.RuntimeEnvironment + * @instance + */ + RuntimeEnvironment.prototype.ipConfiguration = 0; + + /** + * RuntimeEnvironment workerRegion. + * @member {string} workerRegion + * @memberof google.dataflow.v1beta3.RuntimeEnvironment + * @instance + */ + RuntimeEnvironment.prototype.workerRegion = ""; + + /** + * RuntimeEnvironment workerZone. + * @member {string} workerZone + * @memberof google.dataflow.v1beta3.RuntimeEnvironment + * @instance + */ + RuntimeEnvironment.prototype.workerZone = ""; + + /** + * RuntimeEnvironment enableStreamingEngine. + * @member {boolean} enableStreamingEngine + * @memberof google.dataflow.v1beta3.RuntimeEnvironment + * @instance + */ + RuntimeEnvironment.prototype.enableStreamingEngine = false; + + /** + * Creates a new RuntimeEnvironment instance using the specified properties. + * @function create + * @memberof google.dataflow.v1beta3.RuntimeEnvironment + * @static + * @param {google.dataflow.v1beta3.IRuntimeEnvironment=} [properties] Properties to set + * @returns {google.dataflow.v1beta3.RuntimeEnvironment} RuntimeEnvironment instance + */ + RuntimeEnvironment.create = function create(properties) { + return new RuntimeEnvironment(properties); + }; + + /** + * Encodes the specified RuntimeEnvironment message. Does not implicitly {@link google.dataflow.v1beta3.RuntimeEnvironment.verify|verify} messages. + * @function encode + * @memberof google.dataflow.v1beta3.RuntimeEnvironment + * @static + * @param {google.dataflow.v1beta3.IRuntimeEnvironment} message RuntimeEnvironment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RuntimeEnvironment.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.maxWorkers != null && Object.hasOwnProperty.call(message, "maxWorkers")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.maxWorkers); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.zone); + if (message.serviceAccountEmail != null && Object.hasOwnProperty.call(message, "serviceAccountEmail")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.serviceAccountEmail); + if (message.tempLocation != null && Object.hasOwnProperty.call(message, "tempLocation")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.tempLocation); + if (message.bypassTempDirValidation != null && Object.hasOwnProperty.call(message, "bypassTempDirValidation")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.bypassTempDirValidation); + if (message.machineType != null && Object.hasOwnProperty.call(message, "machineType")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.machineType); + if (message.additionalExperiments != null && message.additionalExperiments.length) + for (var i = 0; i < message.additionalExperiments.length; ++i) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.additionalExperiments[i]); + if (message.network != null && Object.hasOwnProperty.call(message, "network")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.network); + if (message.subnetwork != null && Object.hasOwnProperty.call(message, "subnetwork")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.subnetwork); + if (message.additionalUserLabels != null && Object.hasOwnProperty.call(message, "additionalUserLabels")) + for (var keys = Object.keys(message.additionalUserLabels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 10, wireType 2 =*/82).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.additionalUserLabels[keys[i]]).ldelim(); + if (message.numWorkers != null && Object.hasOwnProperty.call(message, "numWorkers")) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.numWorkers); + if (message.kmsKeyName != null && Object.hasOwnProperty.call(message, "kmsKeyName")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.kmsKeyName); + if (message.ipConfiguration != null && Object.hasOwnProperty.call(message, "ipConfiguration")) + writer.uint32(/* id 14, wireType 0 =*/112).int32(message.ipConfiguration); + if (message.workerRegion != null && Object.hasOwnProperty.call(message, "workerRegion")) + writer.uint32(/* id 15, wireType 2 =*/122).string(message.workerRegion); + if (message.workerZone != null && Object.hasOwnProperty.call(message, "workerZone")) + writer.uint32(/* id 16, wireType 2 =*/130).string(message.workerZone); + if (message.enableStreamingEngine != null && Object.hasOwnProperty.call(message, "enableStreamingEngine")) + writer.uint32(/* id 17, wireType 0 =*/136).bool(message.enableStreamingEngine); + return writer; + }; + + /** + * Encodes the specified RuntimeEnvironment message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.RuntimeEnvironment.verify|verify} messages. + * @function encodeDelimited + * @memberof google.dataflow.v1beta3.RuntimeEnvironment + * @static + * @param {google.dataflow.v1beta3.IRuntimeEnvironment} message RuntimeEnvironment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RuntimeEnvironment.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RuntimeEnvironment message from the specified reader or buffer. + * @function decode + * @memberof google.dataflow.v1beta3.RuntimeEnvironment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.dataflow.v1beta3.RuntimeEnvironment} RuntimeEnvironment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RuntimeEnvironment.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.dataflow.v1beta3.RuntimeEnvironment(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 11: { + message.numWorkers = reader.int32(); + break; + } + case 1: { + message.maxWorkers = reader.int32(); + break; + } + case 2: { + message.zone = reader.string(); + break; + } + case 3: { + message.serviceAccountEmail = reader.string(); + break; + } + case 4: { + message.tempLocation = reader.string(); + break; + } + case 5: { + message.bypassTempDirValidation = reader.bool(); + break; + } + case 6: { + message.machineType = reader.string(); + break; + } + case 7: { + if (!(message.additionalExperiments && message.additionalExperiments.length)) + message.additionalExperiments = []; + message.additionalExperiments.push(reader.string()); + break; + } + case 8: { + message.network = reader.string(); + break; + } + case 9: { + message.subnetwork = reader.string(); + break; + } + case 10: { + if (message.additionalUserLabels === $util.emptyObject) + message.additionalUserLabels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.additionalUserLabels[key] = value; + break; + } + case 12: { + message.kmsKeyName = reader.string(); + break; + } + case 14: { + message.ipConfiguration = reader.int32(); + break; + } + case 15: { + message.workerRegion = reader.string(); + break; + } + case 16: { + message.workerZone = reader.string(); + break; + } + case 17: { + message.enableStreamingEngine = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RuntimeEnvironment message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.dataflow.v1beta3.RuntimeEnvironment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.dataflow.v1beta3.RuntimeEnvironment} RuntimeEnvironment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RuntimeEnvironment.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RuntimeEnvironment message. + * @function verify + * @memberof google.dataflow.v1beta3.RuntimeEnvironment + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RuntimeEnvironment.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.numWorkers != null && message.hasOwnProperty("numWorkers")) + if (!$util.isInteger(message.numWorkers)) + return "numWorkers: integer expected"; + if (message.maxWorkers != null && message.hasOwnProperty("maxWorkers")) + if (!$util.isInteger(message.maxWorkers)) + return "maxWorkers: integer expected"; + if (message.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: string expected"; + if (message.serviceAccountEmail != null && message.hasOwnProperty("serviceAccountEmail")) + if (!$util.isString(message.serviceAccountEmail)) + return "serviceAccountEmail: string expected"; + if (message.tempLocation != null && message.hasOwnProperty("tempLocation")) + if (!$util.isString(message.tempLocation)) + return "tempLocation: string expected"; + if (message.bypassTempDirValidation != null && message.hasOwnProperty("bypassTempDirValidation")) + if (typeof message.bypassTempDirValidation !== "boolean") + return "bypassTempDirValidation: boolean expected"; + if (message.machineType != null && message.hasOwnProperty("machineType")) + if (!$util.isString(message.machineType)) + return "machineType: string expected"; + if (message.additionalExperiments != null && message.hasOwnProperty("additionalExperiments")) { + if (!Array.isArray(message.additionalExperiments)) + return "additionalExperiments: array expected"; + for (var i = 0; i < message.additionalExperiments.length; ++i) + if (!$util.isString(message.additionalExperiments[i])) + return "additionalExperiments: string[] expected"; + } + if (message.network != null && message.hasOwnProperty("network")) + if (!$util.isString(message.network)) + return "network: string expected"; + if (message.subnetwork != null && message.hasOwnProperty("subnetwork")) + if (!$util.isString(message.subnetwork)) + return "subnetwork: string expected"; + if (message.additionalUserLabels != null && message.hasOwnProperty("additionalUserLabels")) { + if (!$util.isObject(message.additionalUserLabels)) + return "additionalUserLabels: object expected"; + var key = Object.keys(message.additionalUserLabels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.additionalUserLabels[key[i]])) + return "additionalUserLabels: string{k:string} expected"; + } + if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) + if (!$util.isString(message.kmsKeyName)) + return "kmsKeyName: string expected"; + if (message.ipConfiguration != null && message.hasOwnProperty("ipConfiguration")) + switch (message.ipConfiguration) { + default: + return "ipConfiguration: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.workerRegion != null && message.hasOwnProperty("workerRegion")) + if (!$util.isString(message.workerRegion)) + return "workerRegion: string expected"; + if (message.workerZone != null && message.hasOwnProperty("workerZone")) + if (!$util.isString(message.workerZone)) + return "workerZone: string expected"; + if (message.enableStreamingEngine != null && message.hasOwnProperty("enableStreamingEngine")) + if (typeof message.enableStreamingEngine !== "boolean") + return "enableStreamingEngine: boolean expected"; + return null; + }; + + /** + * Creates a RuntimeEnvironment message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.dataflow.v1beta3.RuntimeEnvironment + * @static + * @param {Object.} object Plain object + * @returns {google.dataflow.v1beta3.RuntimeEnvironment} RuntimeEnvironment + */ + RuntimeEnvironment.fromObject = function fromObject(object) { + if (object instanceof $root.google.dataflow.v1beta3.RuntimeEnvironment) + return object; + var message = new $root.google.dataflow.v1beta3.RuntimeEnvironment(); + if (object.numWorkers != null) + message.numWorkers = object.numWorkers | 0; + if (object.maxWorkers != null) + message.maxWorkers = object.maxWorkers | 0; + if (object.zone != null) + message.zone = String(object.zone); + if (object.serviceAccountEmail != null) + message.serviceAccountEmail = String(object.serviceAccountEmail); + if (object.tempLocation != null) + message.tempLocation = String(object.tempLocation); + if (object.bypassTempDirValidation != null) + message.bypassTempDirValidation = Boolean(object.bypassTempDirValidation); + if (object.machineType != null) + message.machineType = String(object.machineType); + if (object.additionalExperiments) { + if (!Array.isArray(object.additionalExperiments)) + throw TypeError(".google.dataflow.v1beta3.RuntimeEnvironment.additionalExperiments: array expected"); + message.additionalExperiments = []; + for (var i = 0; i < object.additionalExperiments.length; ++i) + message.additionalExperiments[i] = String(object.additionalExperiments[i]); + } + if (object.network != null) + message.network = String(object.network); + if (object.subnetwork != null) + message.subnetwork = String(object.subnetwork); + if (object.additionalUserLabels) { + if (typeof object.additionalUserLabels !== "object") + throw TypeError(".google.dataflow.v1beta3.RuntimeEnvironment.additionalUserLabels: object expected"); + message.additionalUserLabels = {}; + for (var keys = Object.keys(object.additionalUserLabels), i = 0; i < keys.length; ++i) + message.additionalUserLabels[keys[i]] = String(object.additionalUserLabels[keys[i]]); + } + if (object.kmsKeyName != null) + message.kmsKeyName = String(object.kmsKeyName); + switch (object.ipConfiguration) { + default: + if (typeof object.ipConfiguration === "number") { + message.ipConfiguration = object.ipConfiguration; + break; + } + break; + case "WORKER_IP_UNSPECIFIED": + case 0: + message.ipConfiguration = 0; + break; + case "WORKER_IP_PUBLIC": + case 1: + message.ipConfiguration = 1; + break; + case "WORKER_IP_PRIVATE": + case 2: + message.ipConfiguration = 2; + break; + } + if (object.workerRegion != null) + message.workerRegion = String(object.workerRegion); + if (object.workerZone != null) + message.workerZone = String(object.workerZone); + if (object.enableStreamingEngine != null) + message.enableStreamingEngine = Boolean(object.enableStreamingEngine); + return message; + }; + + /** + * Creates a plain object from a RuntimeEnvironment message. Also converts values to other types if specified. + * @function toObject + * @memberof google.dataflow.v1beta3.RuntimeEnvironment + * @static + * @param {google.dataflow.v1beta3.RuntimeEnvironment} message RuntimeEnvironment + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RuntimeEnvironment.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.additionalExperiments = []; + if (options.objects || options.defaults) + object.additionalUserLabels = {}; + if (options.defaults) { + object.maxWorkers = 0; + object.zone = ""; + object.serviceAccountEmail = ""; + object.tempLocation = ""; + object.bypassTempDirValidation = false; + object.machineType = ""; + object.network = ""; + object.subnetwork = ""; + object.numWorkers = 0; + object.kmsKeyName = ""; + object.ipConfiguration = options.enums === String ? "WORKER_IP_UNSPECIFIED" : 0; + object.workerRegion = ""; + object.workerZone = ""; + object.enableStreamingEngine = false; + } + if (message.maxWorkers != null && message.hasOwnProperty("maxWorkers")) + object.maxWorkers = message.maxWorkers; + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + if (message.serviceAccountEmail != null && message.hasOwnProperty("serviceAccountEmail")) + object.serviceAccountEmail = message.serviceAccountEmail; + if (message.tempLocation != null && message.hasOwnProperty("tempLocation")) + object.tempLocation = message.tempLocation; + if (message.bypassTempDirValidation != null && message.hasOwnProperty("bypassTempDirValidation")) + object.bypassTempDirValidation = message.bypassTempDirValidation; + if (message.machineType != null && message.hasOwnProperty("machineType")) + object.machineType = message.machineType; + if (message.additionalExperiments && message.additionalExperiments.length) { + object.additionalExperiments = []; + for (var j = 0; j < message.additionalExperiments.length; ++j) + object.additionalExperiments[j] = message.additionalExperiments[j]; + } + if (message.network != null && message.hasOwnProperty("network")) + object.network = message.network; + if (message.subnetwork != null && message.hasOwnProperty("subnetwork")) + object.subnetwork = message.subnetwork; + var keys2; + if (message.additionalUserLabels && (keys2 = Object.keys(message.additionalUserLabels)).length) { + object.additionalUserLabels = {}; + for (var j = 0; j < keys2.length; ++j) + object.additionalUserLabels[keys2[j]] = message.additionalUserLabels[keys2[j]]; + } + if (message.numWorkers != null && message.hasOwnProperty("numWorkers")) + object.numWorkers = message.numWorkers; + if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) + object.kmsKeyName = message.kmsKeyName; + if (message.ipConfiguration != null && message.hasOwnProperty("ipConfiguration")) + object.ipConfiguration = options.enums === String ? $root.google.dataflow.v1beta3.WorkerIPAddressConfiguration[message.ipConfiguration] === undefined ? message.ipConfiguration : $root.google.dataflow.v1beta3.WorkerIPAddressConfiguration[message.ipConfiguration] : message.ipConfiguration; + if (message.workerRegion != null && message.hasOwnProperty("workerRegion")) + object.workerRegion = message.workerRegion; + if (message.workerZone != null && message.hasOwnProperty("workerZone")) + object.workerZone = message.workerZone; + if (message.enableStreamingEngine != null && message.hasOwnProperty("enableStreamingEngine")) + object.enableStreamingEngine = message.enableStreamingEngine; + return object; + }; + + /** + * Converts this RuntimeEnvironment to JSON. + * @function toJSON + * @memberof google.dataflow.v1beta3.RuntimeEnvironment + * @instance + * @returns {Object.} JSON object + */ + RuntimeEnvironment.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RuntimeEnvironment + * @function getTypeUrl + * @memberof google.dataflow.v1beta3.RuntimeEnvironment + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RuntimeEnvironment.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.dataflow.v1beta3.RuntimeEnvironment"; + }; + + return RuntimeEnvironment; + })(); + + v1beta3.ParameterMetadata = (function() { + + /** + * Properties of a ParameterMetadata. + * @memberof google.dataflow.v1beta3 + * @interface IParameterMetadata + * @property {string|null} [name] ParameterMetadata name + * @property {string|null} [label] ParameterMetadata label + * @property {string|null} [helpText] ParameterMetadata helpText + * @property {boolean|null} [isOptional] ParameterMetadata isOptional + * @property {Array.|null} [regexes] ParameterMetadata regexes + * @property {google.dataflow.v1beta3.ParameterType|null} [paramType] ParameterMetadata paramType + * @property {Object.|null} [customMetadata] ParameterMetadata customMetadata + */ + + /** + * Constructs a new ParameterMetadata. + * @memberof google.dataflow.v1beta3 + * @classdesc Represents a ParameterMetadata. + * @implements IParameterMetadata + * @constructor + * @param {google.dataflow.v1beta3.IParameterMetadata=} [properties] Properties to set + */ + function ParameterMetadata(properties) { + this.regexes = []; + this.customMetadata = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ParameterMetadata name. + * @member {string} name + * @memberof google.dataflow.v1beta3.ParameterMetadata + * @instance + */ + ParameterMetadata.prototype.name = ""; + + /** + * ParameterMetadata label. + * @member {string} label + * @memberof google.dataflow.v1beta3.ParameterMetadata + * @instance + */ + ParameterMetadata.prototype.label = ""; + + /** + * ParameterMetadata helpText. + * @member {string} helpText + * @memberof google.dataflow.v1beta3.ParameterMetadata + * @instance + */ + ParameterMetadata.prototype.helpText = ""; + + /** + * ParameterMetadata isOptional. + * @member {boolean} isOptional + * @memberof google.dataflow.v1beta3.ParameterMetadata + * @instance + */ + ParameterMetadata.prototype.isOptional = false; + + /** + * ParameterMetadata regexes. + * @member {Array.} regexes + * @memberof google.dataflow.v1beta3.ParameterMetadata + * @instance + */ + ParameterMetadata.prototype.regexes = $util.emptyArray; + + /** + * ParameterMetadata paramType. + * @member {google.dataflow.v1beta3.ParameterType} paramType + * @memberof google.dataflow.v1beta3.ParameterMetadata + * @instance + */ + ParameterMetadata.prototype.paramType = 0; + + /** + * ParameterMetadata customMetadata. + * @member {Object.} customMetadata + * @memberof google.dataflow.v1beta3.ParameterMetadata + * @instance + */ + ParameterMetadata.prototype.customMetadata = $util.emptyObject; + + /** + * Creates a new ParameterMetadata instance using the specified properties. + * @function create + * @memberof google.dataflow.v1beta3.ParameterMetadata + * @static + * @param {google.dataflow.v1beta3.IParameterMetadata=} [properties] Properties to set + * @returns {google.dataflow.v1beta3.ParameterMetadata} ParameterMetadata instance + */ + ParameterMetadata.create = function create(properties) { + return new ParameterMetadata(properties); + }; + + /** + * Encodes the specified ParameterMetadata message. Does not implicitly {@link google.dataflow.v1beta3.ParameterMetadata.verify|verify} messages. + * @function encode + * @memberof google.dataflow.v1beta3.ParameterMetadata + * @static + * @param {google.dataflow.v1beta3.IParameterMetadata} message ParameterMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ParameterMetadata.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.label != null && Object.hasOwnProperty.call(message, "label")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.label); + if (message.helpText != null && Object.hasOwnProperty.call(message, "helpText")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.helpText); + if (message.isOptional != null && Object.hasOwnProperty.call(message, "isOptional")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.isOptional); + if (message.regexes != null && message.regexes.length) + for (var i = 0; i < message.regexes.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.regexes[i]); + if (message.paramType != null && Object.hasOwnProperty.call(message, "paramType")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.paramType); + if (message.customMetadata != null && Object.hasOwnProperty.call(message, "customMetadata")) + for (var keys = Object.keys(message.customMetadata), i = 0; i < keys.length; ++i) + writer.uint32(/* id 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.customMetadata[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified ParameterMetadata message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.ParameterMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.dataflow.v1beta3.ParameterMetadata + * @static + * @param {google.dataflow.v1beta3.IParameterMetadata} message ParameterMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ParameterMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ParameterMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.dataflow.v1beta3.ParameterMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.dataflow.v1beta3.ParameterMetadata} ParameterMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ParameterMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.dataflow.v1beta3.ParameterMetadata(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.label = reader.string(); + break; + } + case 3: { + message.helpText = reader.string(); + break; + } + case 4: { + message.isOptional = reader.bool(); + break; + } + case 5: { + if (!(message.regexes && message.regexes.length)) + message.regexes = []; + message.regexes.push(reader.string()); + break; + } + case 6: { + message.paramType = reader.int32(); + break; + } + case 7: { + if (message.customMetadata === $util.emptyObject) + message.customMetadata = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.customMetadata[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ParameterMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.dataflow.v1beta3.ParameterMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.dataflow.v1beta3.ParameterMetadata} ParameterMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ParameterMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ParameterMetadata message. + * @function verify + * @memberof google.dataflow.v1beta3.ParameterMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ParameterMetadata.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.label != null && message.hasOwnProperty("label")) + if (!$util.isString(message.label)) + return "label: string expected"; + if (message.helpText != null && message.hasOwnProperty("helpText")) + if (!$util.isString(message.helpText)) + return "helpText: string expected"; + if (message.isOptional != null && message.hasOwnProperty("isOptional")) + if (typeof message.isOptional !== "boolean") + return "isOptional: boolean expected"; + if (message.regexes != null && message.hasOwnProperty("regexes")) { + if (!Array.isArray(message.regexes)) + return "regexes: array expected"; + for (var i = 0; i < message.regexes.length; ++i) + if (!$util.isString(message.regexes[i])) + return "regexes: string[] expected"; + } + if (message.paramType != null && message.hasOwnProperty("paramType")) + switch (message.paramType) { + default: + return "paramType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + break; + } + if (message.customMetadata != null && message.hasOwnProperty("customMetadata")) { + if (!$util.isObject(message.customMetadata)) + return "customMetadata: object expected"; + var key = Object.keys(message.customMetadata); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.customMetadata[key[i]])) + return "customMetadata: string{k:string} expected"; + } + return null; + }; + + /** + * Creates a ParameterMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.dataflow.v1beta3.ParameterMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.dataflow.v1beta3.ParameterMetadata} ParameterMetadata + */ + ParameterMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.dataflow.v1beta3.ParameterMetadata) + return object; + var message = new $root.google.dataflow.v1beta3.ParameterMetadata(); + if (object.name != null) + message.name = String(object.name); + if (object.label != null) + message.label = String(object.label); + if (object.helpText != null) + message.helpText = String(object.helpText); + if (object.isOptional != null) + message.isOptional = Boolean(object.isOptional); + if (object.regexes) { + if (!Array.isArray(object.regexes)) + throw TypeError(".google.dataflow.v1beta3.ParameterMetadata.regexes: array expected"); + message.regexes = []; + for (var i = 0; i < object.regexes.length; ++i) + message.regexes[i] = String(object.regexes[i]); + } + switch (object.paramType) { + default: + if (typeof object.paramType === "number") { + message.paramType = object.paramType; + break; + } + break; + case "DEFAULT": + case 0: + message.paramType = 0; + break; + case "TEXT": + case 1: + message.paramType = 1; + break; + case "GCS_READ_BUCKET": + case 2: + message.paramType = 2; + break; + case "GCS_WRITE_BUCKET": + case 3: + message.paramType = 3; + break; + case "GCS_READ_FILE": + case 4: + message.paramType = 4; + break; + case "GCS_WRITE_FILE": + case 5: + message.paramType = 5; + break; + case "GCS_READ_FOLDER": + case 6: + message.paramType = 6; + break; + case "GCS_WRITE_FOLDER": + case 7: + message.paramType = 7; + break; + case "PUBSUB_TOPIC": + case 8: + message.paramType = 8; + break; + case "PUBSUB_SUBSCRIPTION": + case 9: + message.paramType = 9; + break; + } + if (object.customMetadata) { + if (typeof object.customMetadata !== "object") + throw TypeError(".google.dataflow.v1beta3.ParameterMetadata.customMetadata: object expected"); + message.customMetadata = {}; + for (var keys = Object.keys(object.customMetadata), i = 0; i < keys.length; ++i) + message.customMetadata[keys[i]] = String(object.customMetadata[keys[i]]); + } + return message; + }; + + /** + * Creates a plain object from a ParameterMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.dataflow.v1beta3.ParameterMetadata + * @static + * @param {google.dataflow.v1beta3.ParameterMetadata} message ParameterMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ParameterMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.regexes = []; + if (options.objects || options.defaults) + object.customMetadata = {}; + if (options.defaults) { + object.name = ""; + object.label = ""; + object.helpText = ""; + object.isOptional = false; + object.paramType = options.enums === String ? "DEFAULT" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.label != null && message.hasOwnProperty("label")) + object.label = message.label; + if (message.helpText != null && message.hasOwnProperty("helpText")) + object.helpText = message.helpText; + if (message.isOptional != null && message.hasOwnProperty("isOptional")) + object.isOptional = message.isOptional; + if (message.regexes && message.regexes.length) { + object.regexes = []; + for (var j = 0; j < message.regexes.length; ++j) + object.regexes[j] = message.regexes[j]; + } + if (message.paramType != null && message.hasOwnProperty("paramType")) + object.paramType = options.enums === String ? $root.google.dataflow.v1beta3.ParameterType[message.paramType] === undefined ? message.paramType : $root.google.dataflow.v1beta3.ParameterType[message.paramType] : message.paramType; + var keys2; + if (message.customMetadata && (keys2 = Object.keys(message.customMetadata)).length) { + object.customMetadata = {}; + for (var j = 0; j < keys2.length; ++j) + object.customMetadata[keys2[j]] = message.customMetadata[keys2[j]]; + } + return object; + }; + + /** + * Converts this ParameterMetadata to JSON. + * @function toJSON + * @memberof google.dataflow.v1beta3.ParameterMetadata + * @instance + * @returns {Object.} JSON object + */ + ParameterMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ParameterMetadata + * @function getTypeUrl + * @memberof google.dataflow.v1beta3.ParameterMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ParameterMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.dataflow.v1beta3.ParameterMetadata"; + }; + + return ParameterMetadata; + })(); + + /** + * ParameterType enum. + * @name google.dataflow.v1beta3.ParameterType + * @enum {number} + * @property {number} DEFAULT=0 DEFAULT value + * @property {number} TEXT=1 TEXT value + * @property {number} GCS_READ_BUCKET=2 GCS_READ_BUCKET value + * @property {number} GCS_WRITE_BUCKET=3 GCS_WRITE_BUCKET value + * @property {number} GCS_READ_FILE=4 GCS_READ_FILE value + * @property {number} GCS_WRITE_FILE=5 GCS_WRITE_FILE value + * @property {number} GCS_READ_FOLDER=6 GCS_READ_FOLDER value + * @property {number} GCS_WRITE_FOLDER=7 GCS_WRITE_FOLDER value + * @property {number} PUBSUB_TOPIC=8 PUBSUB_TOPIC value + * @property {number} PUBSUB_SUBSCRIPTION=9 PUBSUB_SUBSCRIPTION value + */ + v1beta3.ParameterType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DEFAULT"] = 0; + values[valuesById[1] = "TEXT"] = 1; + values[valuesById[2] = "GCS_READ_BUCKET"] = 2; + values[valuesById[3] = "GCS_WRITE_BUCKET"] = 3; + values[valuesById[4] = "GCS_READ_FILE"] = 4; + values[valuesById[5] = "GCS_WRITE_FILE"] = 5; + values[valuesById[6] = "GCS_READ_FOLDER"] = 6; + values[valuesById[7] = "GCS_WRITE_FOLDER"] = 7; + values[valuesById[8] = "PUBSUB_TOPIC"] = 8; + values[valuesById[9] = "PUBSUB_SUBSCRIPTION"] = 9; + return values; + })(); + + v1beta3.TemplateMetadata = (function() { + + /** + * Properties of a TemplateMetadata. + * @memberof google.dataflow.v1beta3 + * @interface ITemplateMetadata + * @property {string|null} [name] TemplateMetadata name + * @property {string|null} [description] TemplateMetadata description + * @property {Array.|null} [parameters] TemplateMetadata parameters + */ + + /** + * Constructs a new TemplateMetadata. + * @memberof google.dataflow.v1beta3 + * @classdesc Represents a TemplateMetadata. + * @implements ITemplateMetadata + * @constructor + * @param {google.dataflow.v1beta3.ITemplateMetadata=} [properties] Properties to set + */ + function TemplateMetadata(properties) { + this.parameters = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TemplateMetadata name. + * @member {string} name + * @memberof google.dataflow.v1beta3.TemplateMetadata + * @instance + */ + TemplateMetadata.prototype.name = ""; + + /** + * TemplateMetadata description. + * @member {string} description + * @memberof google.dataflow.v1beta3.TemplateMetadata + * @instance + */ + TemplateMetadata.prototype.description = ""; + + /** + * TemplateMetadata parameters. + * @member {Array.} parameters + * @memberof google.dataflow.v1beta3.TemplateMetadata + * @instance + */ + TemplateMetadata.prototype.parameters = $util.emptyArray; + + /** + * Creates a new TemplateMetadata instance using the specified properties. + * @function create + * @memberof google.dataflow.v1beta3.TemplateMetadata + * @static + * @param {google.dataflow.v1beta3.ITemplateMetadata=} [properties] Properties to set + * @returns {google.dataflow.v1beta3.TemplateMetadata} TemplateMetadata instance + */ + TemplateMetadata.create = function create(properties) { + return new TemplateMetadata(properties); + }; + + /** + * Encodes the specified TemplateMetadata message. Does not implicitly {@link google.dataflow.v1beta3.TemplateMetadata.verify|verify} messages. + * @function encode + * @memberof google.dataflow.v1beta3.TemplateMetadata + * @static + * @param {google.dataflow.v1beta3.ITemplateMetadata} message TemplateMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TemplateMetadata.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.parameters != null && message.parameters.length) + for (var i = 0; i < message.parameters.length; ++i) + $root.google.dataflow.v1beta3.ParameterMetadata.encode(message.parameters[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TemplateMetadata message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.TemplateMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.dataflow.v1beta3.TemplateMetadata + * @static + * @param {google.dataflow.v1beta3.ITemplateMetadata} message TemplateMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TemplateMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TemplateMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.dataflow.v1beta3.TemplateMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.dataflow.v1beta3.TemplateMetadata} TemplateMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TemplateMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.dataflow.v1beta3.TemplateMetadata(); + 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: { + if (!(message.parameters && message.parameters.length)) + message.parameters = []; + message.parameters.push($root.google.dataflow.v1beta3.ParameterMetadata.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TemplateMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.dataflow.v1beta3.TemplateMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.dataflow.v1beta3.TemplateMetadata} TemplateMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TemplateMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TemplateMetadata message. + * @function verify + * @memberof google.dataflow.v1beta3.TemplateMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TemplateMetadata.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.parameters != null && message.hasOwnProperty("parameters")) { + if (!Array.isArray(message.parameters)) + return "parameters: array expected"; + for (var i = 0; i < message.parameters.length; ++i) { + var error = $root.google.dataflow.v1beta3.ParameterMetadata.verify(message.parameters[i]); + if (error) + return "parameters." + error; + } + } + return null; + }; + + /** + * Creates a TemplateMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.dataflow.v1beta3.TemplateMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.dataflow.v1beta3.TemplateMetadata} TemplateMetadata + */ + TemplateMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.dataflow.v1beta3.TemplateMetadata) + return object; + var message = new $root.google.dataflow.v1beta3.TemplateMetadata(); + if (object.name != null) + message.name = String(object.name); + if (object.description != null) + message.description = String(object.description); + if (object.parameters) { + if (!Array.isArray(object.parameters)) + throw TypeError(".google.dataflow.v1beta3.TemplateMetadata.parameters: array expected"); + message.parameters = []; + for (var i = 0; i < object.parameters.length; ++i) { + if (typeof object.parameters[i] !== "object") + throw TypeError(".google.dataflow.v1beta3.TemplateMetadata.parameters: object expected"); + message.parameters[i] = $root.google.dataflow.v1beta3.ParameterMetadata.fromObject(object.parameters[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a TemplateMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.dataflow.v1beta3.TemplateMetadata + * @static + * @param {google.dataflow.v1beta3.TemplateMetadata} message TemplateMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TemplateMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.parameters = []; + if (options.defaults) { + object.name = ""; + object.description = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.parameters && message.parameters.length) { + object.parameters = []; + for (var j = 0; j < message.parameters.length; ++j) + object.parameters[j] = $root.google.dataflow.v1beta3.ParameterMetadata.toObject(message.parameters[j], options); + } + return object; + }; + + /** + * Converts this TemplateMetadata to JSON. + * @function toJSON + * @memberof google.dataflow.v1beta3.TemplateMetadata + * @instance + * @returns {Object.} JSON object + */ + TemplateMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TemplateMetadata + * @function getTypeUrl + * @memberof google.dataflow.v1beta3.TemplateMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TemplateMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.dataflow.v1beta3.TemplateMetadata"; + }; + + return TemplateMetadata; + })(); + + v1beta3.SDKInfo = (function() { + + /** + * Properties of a SDKInfo. + * @memberof google.dataflow.v1beta3 + * @interface ISDKInfo + * @property {google.dataflow.v1beta3.SDKInfo.Language|null} [language] SDKInfo language + * @property {string|null} [version] SDKInfo version + */ + + /** + * Constructs a new SDKInfo. + * @memberof google.dataflow.v1beta3 + * @classdesc Represents a SDKInfo. + * @implements ISDKInfo + * @constructor + * @param {google.dataflow.v1beta3.ISDKInfo=} [properties] Properties to set + */ + function SDKInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SDKInfo language. + * @member {google.dataflow.v1beta3.SDKInfo.Language} language + * @memberof google.dataflow.v1beta3.SDKInfo + * @instance + */ + SDKInfo.prototype.language = 0; + + /** + * SDKInfo version. + * @member {string} version + * @memberof google.dataflow.v1beta3.SDKInfo + * @instance + */ + SDKInfo.prototype.version = ""; + + /** + * Creates a new SDKInfo instance using the specified properties. + * @function create + * @memberof google.dataflow.v1beta3.SDKInfo + * @static + * @param {google.dataflow.v1beta3.ISDKInfo=} [properties] Properties to set + * @returns {google.dataflow.v1beta3.SDKInfo} SDKInfo instance + */ + SDKInfo.create = function create(properties) { + return new SDKInfo(properties); + }; + + /** + * Encodes the specified SDKInfo message. Does not implicitly {@link google.dataflow.v1beta3.SDKInfo.verify|verify} messages. + * @function encode + * @memberof google.dataflow.v1beta3.SDKInfo + * @static + * @param {google.dataflow.v1beta3.ISDKInfo} message SDKInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SDKInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.language != null && Object.hasOwnProperty.call(message, "language")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.language); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.version); + return writer; + }; + + /** + * Encodes the specified SDKInfo message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.SDKInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.dataflow.v1beta3.SDKInfo + * @static + * @param {google.dataflow.v1beta3.ISDKInfo} message SDKInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SDKInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SDKInfo message from the specified reader or buffer. + * @function decode + * @memberof google.dataflow.v1beta3.SDKInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.dataflow.v1beta3.SDKInfo} SDKInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SDKInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.dataflow.v1beta3.SDKInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.language = reader.int32(); + break; + } + case 2: { + message.version = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SDKInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.dataflow.v1beta3.SDKInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.dataflow.v1beta3.SDKInfo} SDKInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SDKInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SDKInfo message. + * @function verify + * @memberof google.dataflow.v1beta3.SDKInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SDKInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.language != null && message.hasOwnProperty("language")) + switch (message.language) { + default: + return "language: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isString(message.version)) + return "version: string expected"; + return null; + }; + + /** + * Creates a SDKInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.dataflow.v1beta3.SDKInfo + * @static + * @param {Object.} object Plain object + * @returns {google.dataflow.v1beta3.SDKInfo} SDKInfo + */ + SDKInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.dataflow.v1beta3.SDKInfo) + return object; + var message = new $root.google.dataflow.v1beta3.SDKInfo(); + switch (object.language) { + default: + if (typeof object.language === "number") { + message.language = object.language; + break; + } + break; + case "UNKNOWN": + case 0: + message.language = 0; + break; + case "JAVA": + case 1: + message.language = 1; + break; + case "PYTHON": + case 2: + message.language = 2; + break; + } + if (object.version != null) + message.version = String(object.version); + return message; + }; + + /** + * Creates a plain object from a SDKInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.dataflow.v1beta3.SDKInfo + * @static + * @param {google.dataflow.v1beta3.SDKInfo} message SDKInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SDKInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.language = options.enums === String ? "UNKNOWN" : 0; + object.version = ""; + } + if (message.language != null && message.hasOwnProperty("language")) + object.language = options.enums === String ? $root.google.dataflow.v1beta3.SDKInfo.Language[message.language] === undefined ? message.language : $root.google.dataflow.v1beta3.SDKInfo.Language[message.language] : message.language; + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + return object; + }; + + /** + * Converts this SDKInfo to JSON. + * @function toJSON + * @memberof google.dataflow.v1beta3.SDKInfo + * @instance + * @returns {Object.} JSON object + */ + SDKInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SDKInfo + * @function getTypeUrl + * @memberof google.dataflow.v1beta3.SDKInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SDKInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.dataflow.v1beta3.SDKInfo"; + }; + + /** + * Language enum. + * @name google.dataflow.v1beta3.SDKInfo.Language + * @enum {number} + * @property {number} UNKNOWN=0 UNKNOWN value + * @property {number} JAVA=1 JAVA value + * @property {number} PYTHON=2 PYTHON value + */ + SDKInfo.Language = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNKNOWN"] = 0; + values[valuesById[1] = "JAVA"] = 1; + values[valuesById[2] = "PYTHON"] = 2; + return values; + })(); + + return SDKInfo; + })(); + + v1beta3.RuntimeMetadata = (function() { + + /** + * Properties of a RuntimeMetadata. + * @memberof google.dataflow.v1beta3 + * @interface IRuntimeMetadata + * @property {google.dataflow.v1beta3.ISDKInfo|null} [sdkInfo] RuntimeMetadata sdkInfo + * @property {Array.|null} [parameters] RuntimeMetadata parameters + */ + + /** + * Constructs a new RuntimeMetadata. + * @memberof google.dataflow.v1beta3 + * @classdesc Represents a RuntimeMetadata. + * @implements IRuntimeMetadata + * @constructor + * @param {google.dataflow.v1beta3.IRuntimeMetadata=} [properties] Properties to set + */ + function RuntimeMetadata(properties) { + this.parameters = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RuntimeMetadata sdkInfo. + * @member {google.dataflow.v1beta3.ISDKInfo|null|undefined} sdkInfo + * @memberof google.dataflow.v1beta3.RuntimeMetadata + * @instance + */ + RuntimeMetadata.prototype.sdkInfo = null; + + /** + * RuntimeMetadata parameters. + * @member {Array.} parameters + * @memberof google.dataflow.v1beta3.RuntimeMetadata + * @instance + */ + RuntimeMetadata.prototype.parameters = $util.emptyArray; + + /** + * Creates a new RuntimeMetadata instance using the specified properties. + * @function create + * @memberof google.dataflow.v1beta3.RuntimeMetadata + * @static + * @param {google.dataflow.v1beta3.IRuntimeMetadata=} [properties] Properties to set + * @returns {google.dataflow.v1beta3.RuntimeMetadata} RuntimeMetadata instance + */ + RuntimeMetadata.create = function create(properties) { + return new RuntimeMetadata(properties); + }; + + /** + * Encodes the specified RuntimeMetadata message. Does not implicitly {@link google.dataflow.v1beta3.RuntimeMetadata.verify|verify} messages. + * @function encode + * @memberof google.dataflow.v1beta3.RuntimeMetadata + * @static + * @param {google.dataflow.v1beta3.IRuntimeMetadata} message RuntimeMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RuntimeMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sdkInfo != null && Object.hasOwnProperty.call(message, "sdkInfo")) + $root.google.dataflow.v1beta3.SDKInfo.encode(message.sdkInfo, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.parameters != null && message.parameters.length) + for (var i = 0; i < message.parameters.length; ++i) + $root.google.dataflow.v1beta3.ParameterMetadata.encode(message.parameters[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RuntimeMetadata message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.RuntimeMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.dataflow.v1beta3.RuntimeMetadata + * @static + * @param {google.dataflow.v1beta3.IRuntimeMetadata} message RuntimeMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RuntimeMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RuntimeMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.dataflow.v1beta3.RuntimeMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.dataflow.v1beta3.RuntimeMetadata} RuntimeMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RuntimeMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.dataflow.v1beta3.RuntimeMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.sdkInfo = $root.google.dataflow.v1beta3.SDKInfo.decode(reader, reader.uint32()); + break; + } + case 2: { + if (!(message.parameters && message.parameters.length)) + message.parameters = []; + message.parameters.push($root.google.dataflow.v1beta3.ParameterMetadata.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RuntimeMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.dataflow.v1beta3.RuntimeMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.dataflow.v1beta3.RuntimeMetadata} RuntimeMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RuntimeMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RuntimeMetadata message. + * @function verify + * @memberof google.dataflow.v1beta3.RuntimeMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RuntimeMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.sdkInfo != null && message.hasOwnProperty("sdkInfo")) { + var error = $root.google.dataflow.v1beta3.SDKInfo.verify(message.sdkInfo); + if (error) + return "sdkInfo." + error; + } + if (message.parameters != null && message.hasOwnProperty("parameters")) { + if (!Array.isArray(message.parameters)) + return "parameters: array expected"; + for (var i = 0; i < message.parameters.length; ++i) { + var error = $root.google.dataflow.v1beta3.ParameterMetadata.verify(message.parameters[i]); + if (error) + return "parameters." + error; + } + } + return null; + }; + + /** + * Creates a RuntimeMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.dataflow.v1beta3.RuntimeMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.dataflow.v1beta3.RuntimeMetadata} RuntimeMetadata + */ + RuntimeMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.dataflow.v1beta3.RuntimeMetadata) + return object; + var message = new $root.google.dataflow.v1beta3.RuntimeMetadata(); + if (object.sdkInfo != null) { + if (typeof object.sdkInfo !== "object") + throw TypeError(".google.dataflow.v1beta3.RuntimeMetadata.sdkInfo: object expected"); + message.sdkInfo = $root.google.dataflow.v1beta3.SDKInfo.fromObject(object.sdkInfo); + } + if (object.parameters) { + if (!Array.isArray(object.parameters)) + throw TypeError(".google.dataflow.v1beta3.RuntimeMetadata.parameters: array expected"); + message.parameters = []; + for (var i = 0; i < object.parameters.length; ++i) { + if (typeof object.parameters[i] !== "object") + throw TypeError(".google.dataflow.v1beta3.RuntimeMetadata.parameters: object expected"); + message.parameters[i] = $root.google.dataflow.v1beta3.ParameterMetadata.fromObject(object.parameters[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a RuntimeMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.dataflow.v1beta3.RuntimeMetadata + * @static + * @param {google.dataflow.v1beta3.RuntimeMetadata} message RuntimeMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RuntimeMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.parameters = []; + if (options.defaults) + object.sdkInfo = null; + if (message.sdkInfo != null && message.hasOwnProperty("sdkInfo")) + object.sdkInfo = $root.google.dataflow.v1beta3.SDKInfo.toObject(message.sdkInfo, options); + if (message.parameters && message.parameters.length) { + object.parameters = []; + for (var j = 0; j < message.parameters.length; ++j) + object.parameters[j] = $root.google.dataflow.v1beta3.ParameterMetadata.toObject(message.parameters[j], options); + } + return object; + }; + + /** + * Converts this RuntimeMetadata to JSON. + * @function toJSON + * @memberof google.dataflow.v1beta3.RuntimeMetadata + * @instance + * @returns {Object.} JSON object + */ + RuntimeMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RuntimeMetadata + * @function getTypeUrl + * @memberof google.dataflow.v1beta3.RuntimeMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RuntimeMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.dataflow.v1beta3.RuntimeMetadata"; + }; + + return RuntimeMetadata; + })(); + + v1beta3.CreateJobFromTemplateRequest = (function() { + + /** + * Properties of a CreateJobFromTemplateRequest. + * @memberof google.dataflow.v1beta3 + * @interface ICreateJobFromTemplateRequest + * @property {string|null} [projectId] CreateJobFromTemplateRequest projectId + * @property {string|null} [jobName] CreateJobFromTemplateRequest jobName + * @property {string|null} [gcsPath] CreateJobFromTemplateRequest gcsPath + * @property {Object.|null} [parameters] CreateJobFromTemplateRequest parameters + * @property {google.dataflow.v1beta3.IRuntimeEnvironment|null} [environment] CreateJobFromTemplateRequest environment + * @property {string|null} [location] CreateJobFromTemplateRequest location + */ + + /** + * Constructs a new CreateJobFromTemplateRequest. + * @memberof google.dataflow.v1beta3 + * @classdesc Represents a CreateJobFromTemplateRequest. + * @implements ICreateJobFromTemplateRequest + * @constructor + * @param {google.dataflow.v1beta3.ICreateJobFromTemplateRequest=} [properties] Properties to set + */ + function CreateJobFromTemplateRequest(properties) { + this.parameters = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateJobFromTemplateRequest projectId. + * @member {string} projectId + * @memberof google.dataflow.v1beta3.CreateJobFromTemplateRequest + * @instance + */ + CreateJobFromTemplateRequest.prototype.projectId = ""; + + /** + * CreateJobFromTemplateRequest jobName. + * @member {string} jobName + * @memberof google.dataflow.v1beta3.CreateJobFromTemplateRequest + * @instance + */ + CreateJobFromTemplateRequest.prototype.jobName = ""; + + /** + * CreateJobFromTemplateRequest gcsPath. + * @member {string|null|undefined} gcsPath + * @memberof google.dataflow.v1beta3.CreateJobFromTemplateRequest + * @instance + */ + CreateJobFromTemplateRequest.prototype.gcsPath = null; + + /** + * CreateJobFromTemplateRequest parameters. + * @member {Object.} parameters + * @memberof google.dataflow.v1beta3.CreateJobFromTemplateRequest + * @instance + */ + CreateJobFromTemplateRequest.prototype.parameters = $util.emptyObject; + + /** + * CreateJobFromTemplateRequest environment. + * @member {google.dataflow.v1beta3.IRuntimeEnvironment|null|undefined} environment + * @memberof google.dataflow.v1beta3.CreateJobFromTemplateRequest + * @instance + */ + CreateJobFromTemplateRequest.prototype.environment = null; + + /** + * CreateJobFromTemplateRequest location. + * @member {string} location + * @memberof google.dataflow.v1beta3.CreateJobFromTemplateRequest + * @instance + */ + CreateJobFromTemplateRequest.prototype.location = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * CreateJobFromTemplateRequest template. + * @member {"gcsPath"|undefined} template + * @memberof google.dataflow.v1beta3.CreateJobFromTemplateRequest + * @instance + */ + Object.defineProperty(CreateJobFromTemplateRequest.prototype, "template", { + get: $util.oneOfGetter($oneOfFields = ["gcsPath"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new CreateJobFromTemplateRequest instance using the specified properties. + * @function create + * @memberof google.dataflow.v1beta3.CreateJobFromTemplateRequest + * @static + * @param {google.dataflow.v1beta3.ICreateJobFromTemplateRequest=} [properties] Properties to set + * @returns {google.dataflow.v1beta3.CreateJobFromTemplateRequest} CreateJobFromTemplateRequest instance + */ + CreateJobFromTemplateRequest.create = function create(properties) { + return new CreateJobFromTemplateRequest(properties); + }; + + /** + * Encodes the specified CreateJobFromTemplateRequest message. Does not implicitly {@link google.dataflow.v1beta3.CreateJobFromTemplateRequest.verify|verify} messages. + * @function encode + * @memberof google.dataflow.v1beta3.CreateJobFromTemplateRequest + * @static + * @param {google.dataflow.v1beta3.ICreateJobFromTemplateRequest} message CreateJobFromTemplateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateJobFromTemplateRequest.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.gcsPath != null && Object.hasOwnProperty.call(message, "gcsPath")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.gcsPath); + if (message.parameters != null && Object.hasOwnProperty.call(message, "parameters")) + for (var keys = Object.keys(message.parameters), i = 0; i < keys.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.parameters[keys[i]]).ldelim(); + if (message.jobName != null && Object.hasOwnProperty.call(message, "jobName")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.jobName); + if (message.environment != null && Object.hasOwnProperty.call(message, "environment")) + $root.google.dataflow.v1beta3.RuntimeEnvironment.encode(message.environment, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.location); + return writer; + }; + + /** + * Encodes the specified CreateJobFromTemplateRequest message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.CreateJobFromTemplateRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.dataflow.v1beta3.CreateJobFromTemplateRequest + * @static + * @param {google.dataflow.v1beta3.ICreateJobFromTemplateRequest} message CreateJobFromTemplateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateJobFromTemplateRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateJobFromTemplateRequest message from the specified reader or buffer. + * @function decode + * @memberof google.dataflow.v1beta3.CreateJobFromTemplateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.dataflow.v1beta3.CreateJobFromTemplateRequest} CreateJobFromTemplateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateJobFromTemplateRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.dataflow.v1beta3.CreateJobFromTemplateRequest(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.projectId = reader.string(); + break; + } + case 4: { + message.jobName = reader.string(); + break; + } + case 2: { + message.gcsPath = reader.string(); + break; + } + case 3: { + if (message.parameters === $util.emptyObject) + message.parameters = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.parameters[key] = value; + break; + } + case 5: { + message.environment = $root.google.dataflow.v1beta3.RuntimeEnvironment.decode(reader, reader.uint32()); + break; + } + case 6: { + message.location = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateJobFromTemplateRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.dataflow.v1beta3.CreateJobFromTemplateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.dataflow.v1beta3.CreateJobFromTemplateRequest} CreateJobFromTemplateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateJobFromTemplateRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateJobFromTemplateRequest message. + * @function verify + * @memberof google.dataflow.v1beta3.CreateJobFromTemplateRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateJobFromTemplateRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.projectId != null && message.hasOwnProperty("projectId")) + if (!$util.isString(message.projectId)) + return "projectId: string expected"; + if (message.jobName != null && message.hasOwnProperty("jobName")) + if (!$util.isString(message.jobName)) + return "jobName: string expected"; + if (message.gcsPath != null && message.hasOwnProperty("gcsPath")) { + properties.template = 1; + if (!$util.isString(message.gcsPath)) + return "gcsPath: string expected"; + } + if (message.parameters != null && message.hasOwnProperty("parameters")) { + if (!$util.isObject(message.parameters)) + return "parameters: object expected"; + var key = Object.keys(message.parameters); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.parameters[key[i]])) + return "parameters: string{k:string} expected"; + } + if (message.environment != null && message.hasOwnProperty("environment")) { + var error = $root.google.dataflow.v1beta3.RuntimeEnvironment.verify(message.environment); + if (error) + return "environment." + error; + } + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isString(message.location)) + return "location: string expected"; + return null; + }; + + /** + * Creates a CreateJobFromTemplateRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.dataflow.v1beta3.CreateJobFromTemplateRequest + * @static + * @param {Object.} object Plain object + * @returns {google.dataflow.v1beta3.CreateJobFromTemplateRequest} CreateJobFromTemplateRequest + */ + CreateJobFromTemplateRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.dataflow.v1beta3.CreateJobFromTemplateRequest) + return object; + var message = new $root.google.dataflow.v1beta3.CreateJobFromTemplateRequest(); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.jobName != null) + message.jobName = String(object.jobName); + if (object.gcsPath != null) + message.gcsPath = String(object.gcsPath); + if (object.parameters) { + if (typeof object.parameters !== "object") + throw TypeError(".google.dataflow.v1beta3.CreateJobFromTemplateRequest.parameters: object expected"); + message.parameters = {}; + for (var keys = Object.keys(object.parameters), i = 0; i < keys.length; ++i) + message.parameters[keys[i]] = String(object.parameters[keys[i]]); + } + if (object.environment != null) { + if (typeof object.environment !== "object") + throw TypeError(".google.dataflow.v1beta3.CreateJobFromTemplateRequest.environment: object expected"); + message.environment = $root.google.dataflow.v1beta3.RuntimeEnvironment.fromObject(object.environment); + } + if (object.location != null) + message.location = String(object.location); + return message; + }; + + /** + * Creates a plain object from a CreateJobFromTemplateRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.dataflow.v1beta3.CreateJobFromTemplateRequest + * @static + * @param {google.dataflow.v1beta3.CreateJobFromTemplateRequest} message CreateJobFromTemplateRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateJobFromTemplateRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.parameters = {}; + if (options.defaults) { + object.projectId = ""; + object.jobName = ""; + object.environment = null; + object.location = ""; + } + if (message.projectId != null && message.hasOwnProperty("projectId")) + object.projectId = message.projectId; + if (message.gcsPath != null && message.hasOwnProperty("gcsPath")) { + object.gcsPath = message.gcsPath; + if (options.oneofs) + object.template = "gcsPath"; + } + var keys2; + if (message.parameters && (keys2 = Object.keys(message.parameters)).length) { + object.parameters = {}; + for (var j = 0; j < keys2.length; ++j) + object.parameters[keys2[j]] = message.parameters[keys2[j]]; + } + if (message.jobName != null && message.hasOwnProperty("jobName")) + object.jobName = message.jobName; + if (message.environment != null && message.hasOwnProperty("environment")) + object.environment = $root.google.dataflow.v1beta3.RuntimeEnvironment.toObject(message.environment, options); + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + return object; + }; + + /** + * Converts this CreateJobFromTemplateRequest to JSON. + * @function toJSON + * @memberof google.dataflow.v1beta3.CreateJobFromTemplateRequest + * @instance + * @returns {Object.} JSON object + */ + CreateJobFromTemplateRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateJobFromTemplateRequest + * @function getTypeUrl + * @memberof google.dataflow.v1beta3.CreateJobFromTemplateRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateJobFromTemplateRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.dataflow.v1beta3.CreateJobFromTemplateRequest"; + }; + + return CreateJobFromTemplateRequest; + })(); + + v1beta3.GetTemplateRequest = (function() { + + /** + * Properties of a GetTemplateRequest. + * @memberof google.dataflow.v1beta3 + * @interface IGetTemplateRequest + * @property {string|null} [projectId] GetTemplateRequest projectId + * @property {string|null} [gcsPath] GetTemplateRequest gcsPath + * @property {google.dataflow.v1beta3.GetTemplateRequest.TemplateView|null} [view] GetTemplateRequest view + * @property {string|null} [location] GetTemplateRequest location + */ + + /** + * Constructs a new GetTemplateRequest. + * @memberof google.dataflow.v1beta3 + * @classdesc Represents a GetTemplateRequest. + * @implements IGetTemplateRequest + * @constructor + * @param {google.dataflow.v1beta3.IGetTemplateRequest=} [properties] Properties to set + */ + function GetTemplateRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetTemplateRequest projectId. + * @member {string} projectId + * @memberof google.dataflow.v1beta3.GetTemplateRequest + * @instance + */ + GetTemplateRequest.prototype.projectId = ""; + + /** + * GetTemplateRequest gcsPath. + * @member {string|null|undefined} gcsPath + * @memberof google.dataflow.v1beta3.GetTemplateRequest + * @instance + */ + GetTemplateRequest.prototype.gcsPath = null; + + /** + * GetTemplateRequest view. + * @member {google.dataflow.v1beta3.GetTemplateRequest.TemplateView} view + * @memberof google.dataflow.v1beta3.GetTemplateRequest + * @instance + */ + GetTemplateRequest.prototype.view = 0; + + /** + * GetTemplateRequest location. + * @member {string} location + * @memberof google.dataflow.v1beta3.GetTemplateRequest + * @instance + */ + GetTemplateRequest.prototype.location = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetTemplateRequest template. + * @member {"gcsPath"|undefined} template + * @memberof google.dataflow.v1beta3.GetTemplateRequest + * @instance + */ + Object.defineProperty(GetTemplateRequest.prototype, "template", { + get: $util.oneOfGetter($oneOfFields = ["gcsPath"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetTemplateRequest instance using the specified properties. + * @function create + * @memberof google.dataflow.v1beta3.GetTemplateRequest + * @static + * @param {google.dataflow.v1beta3.IGetTemplateRequest=} [properties] Properties to set + * @returns {google.dataflow.v1beta3.GetTemplateRequest} GetTemplateRequest instance + */ + GetTemplateRequest.create = function create(properties) { + return new GetTemplateRequest(properties); + }; + + /** + * Encodes the specified GetTemplateRequest message. Does not implicitly {@link google.dataflow.v1beta3.GetTemplateRequest.verify|verify} messages. + * @function encode + * @memberof google.dataflow.v1beta3.GetTemplateRequest + * @static + * @param {google.dataflow.v1beta3.IGetTemplateRequest} message GetTemplateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTemplateRequest.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.gcsPath != null && Object.hasOwnProperty.call(message, "gcsPath")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.gcsPath); + if (message.view != null && Object.hasOwnProperty.call(message, "view")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.view); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.location); + return writer; + }; + + /** + * Encodes the specified GetTemplateRequest message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.GetTemplateRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.dataflow.v1beta3.GetTemplateRequest + * @static + * @param {google.dataflow.v1beta3.IGetTemplateRequest} message GetTemplateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTemplateRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetTemplateRequest message from the specified reader or buffer. + * @function decode + * @memberof google.dataflow.v1beta3.GetTemplateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.dataflow.v1beta3.GetTemplateRequest} GetTemplateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTemplateRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.dataflow.v1beta3.GetTemplateRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.projectId = reader.string(); + break; + } + case 2: { + message.gcsPath = reader.string(); + break; + } + case 3: { + message.view = reader.int32(); + break; + } + case 4: { + message.location = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetTemplateRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.dataflow.v1beta3.GetTemplateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.dataflow.v1beta3.GetTemplateRequest} GetTemplateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTemplateRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetTemplateRequest message. + * @function verify + * @memberof google.dataflow.v1beta3.GetTemplateRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetTemplateRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.projectId != null && message.hasOwnProperty("projectId")) + if (!$util.isString(message.projectId)) + return "projectId: string expected"; + if (message.gcsPath != null && message.hasOwnProperty("gcsPath")) { + properties.template = 1; + if (!$util.isString(message.gcsPath)) + return "gcsPath: string expected"; + } + if (message.view != null && message.hasOwnProperty("view")) + switch (message.view) { + default: + return "view: enum value expected"; + case 0: + break; + } + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isString(message.location)) + return "location: string expected"; + return null; + }; + + /** + * Creates a GetTemplateRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.dataflow.v1beta3.GetTemplateRequest + * @static + * @param {Object.} object Plain object + * @returns {google.dataflow.v1beta3.GetTemplateRequest} GetTemplateRequest + */ + GetTemplateRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.dataflow.v1beta3.GetTemplateRequest) + return object; + var message = new $root.google.dataflow.v1beta3.GetTemplateRequest(); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.gcsPath != null) + message.gcsPath = String(object.gcsPath); + switch (object.view) { + default: + if (typeof object.view === "number") { + message.view = object.view; + break; + } + break; + case "METADATA_ONLY": + case 0: + message.view = 0; + break; + } + if (object.location != null) + message.location = String(object.location); + return message; + }; + + /** + * Creates a plain object from a GetTemplateRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.dataflow.v1beta3.GetTemplateRequest + * @static + * @param {google.dataflow.v1beta3.GetTemplateRequest} message GetTemplateRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetTemplateRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.projectId = ""; + object.view = options.enums === String ? "METADATA_ONLY" : 0; + object.location = ""; + } + if (message.projectId != null && message.hasOwnProperty("projectId")) + object.projectId = message.projectId; + if (message.gcsPath != null && message.hasOwnProperty("gcsPath")) { + object.gcsPath = message.gcsPath; + if (options.oneofs) + object.template = "gcsPath"; + } + if (message.view != null && message.hasOwnProperty("view")) + object.view = options.enums === String ? $root.google.dataflow.v1beta3.GetTemplateRequest.TemplateView[message.view] === undefined ? message.view : $root.google.dataflow.v1beta3.GetTemplateRequest.TemplateView[message.view] : message.view; + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + return object; + }; + + /** + * Converts this GetTemplateRequest to JSON. + * @function toJSON + * @memberof google.dataflow.v1beta3.GetTemplateRequest + * @instance + * @returns {Object.} JSON object + */ + GetTemplateRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetTemplateRequest + * @function getTypeUrl + * @memberof google.dataflow.v1beta3.GetTemplateRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetTemplateRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.dataflow.v1beta3.GetTemplateRequest"; + }; + + /** + * TemplateView enum. + * @name google.dataflow.v1beta3.GetTemplateRequest.TemplateView + * @enum {number} + * @property {number} METADATA_ONLY=0 METADATA_ONLY value + */ + GetTemplateRequest.TemplateView = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "METADATA_ONLY"] = 0; + return values; + })(); + + return GetTemplateRequest; + })(); + + v1beta3.GetTemplateResponse = (function() { + + /** + * Properties of a GetTemplateResponse. + * @memberof google.dataflow.v1beta3 + * @interface IGetTemplateResponse + * @property {google.rpc.IStatus|null} [status] GetTemplateResponse status + * @property {google.dataflow.v1beta3.ITemplateMetadata|null} [metadata] GetTemplateResponse metadata + * @property {google.dataflow.v1beta3.GetTemplateResponse.TemplateType|null} [templateType] GetTemplateResponse templateType + * @property {google.dataflow.v1beta3.IRuntimeMetadata|null} [runtimeMetadata] GetTemplateResponse runtimeMetadata + */ + + /** + * Constructs a new GetTemplateResponse. + * @memberof google.dataflow.v1beta3 + * @classdesc Represents a GetTemplateResponse. + * @implements IGetTemplateResponse + * @constructor + * @param {google.dataflow.v1beta3.IGetTemplateResponse=} [properties] Properties to set + */ + function GetTemplateResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetTemplateResponse status. + * @member {google.rpc.IStatus|null|undefined} status + * @memberof google.dataflow.v1beta3.GetTemplateResponse + * @instance + */ + GetTemplateResponse.prototype.status = null; + + /** + * GetTemplateResponse metadata. + * @member {google.dataflow.v1beta3.ITemplateMetadata|null|undefined} metadata + * @memberof google.dataflow.v1beta3.GetTemplateResponse + * @instance + */ + GetTemplateResponse.prototype.metadata = null; + + /** + * GetTemplateResponse templateType. + * @member {google.dataflow.v1beta3.GetTemplateResponse.TemplateType} templateType + * @memberof google.dataflow.v1beta3.GetTemplateResponse + * @instance + */ + GetTemplateResponse.prototype.templateType = 0; + + /** + * GetTemplateResponse runtimeMetadata. + * @member {google.dataflow.v1beta3.IRuntimeMetadata|null|undefined} runtimeMetadata + * @memberof google.dataflow.v1beta3.GetTemplateResponse + * @instance + */ + GetTemplateResponse.prototype.runtimeMetadata = null; + + /** + * Creates a new GetTemplateResponse instance using the specified properties. + * @function create + * @memberof google.dataflow.v1beta3.GetTemplateResponse + * @static + * @param {google.dataflow.v1beta3.IGetTemplateResponse=} [properties] Properties to set + * @returns {google.dataflow.v1beta3.GetTemplateResponse} GetTemplateResponse instance + */ + GetTemplateResponse.create = function create(properties) { + return new GetTemplateResponse(properties); + }; + + /** + * Encodes the specified GetTemplateResponse message. Does not implicitly {@link google.dataflow.v1beta3.GetTemplateResponse.verify|verify} messages. + * @function encode + * @memberof google.dataflow.v1beta3.GetTemplateResponse + * @static + * @param {google.dataflow.v1beta3.IGetTemplateResponse} message GetTemplateResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTemplateResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + $root.google.rpc.Status.encode(message.status, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.google.dataflow.v1beta3.TemplateMetadata.encode(message.metadata, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.templateType != null && Object.hasOwnProperty.call(message, "templateType")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.templateType); + if (message.runtimeMetadata != null && Object.hasOwnProperty.call(message, "runtimeMetadata")) + $root.google.dataflow.v1beta3.RuntimeMetadata.encode(message.runtimeMetadata, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetTemplateResponse message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.GetTemplateResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.dataflow.v1beta3.GetTemplateResponse + * @static + * @param {google.dataflow.v1beta3.IGetTemplateResponse} message GetTemplateResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTemplateResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetTemplateResponse message from the specified reader or buffer. + * @function decode + * @memberof google.dataflow.v1beta3.GetTemplateResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.dataflow.v1beta3.GetTemplateResponse} GetTemplateResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTemplateResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.dataflow.v1beta3.GetTemplateResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.status = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + } + case 2: { + message.metadata = $root.google.dataflow.v1beta3.TemplateMetadata.decode(reader, reader.uint32()); + break; + } + case 3: { + message.templateType = reader.int32(); + break; + } + case 4: { + message.runtimeMetadata = $root.google.dataflow.v1beta3.RuntimeMetadata.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetTemplateResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.dataflow.v1beta3.GetTemplateResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.dataflow.v1beta3.GetTemplateResponse} GetTemplateResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTemplateResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetTemplateResponse message. + * @function verify + * @memberof google.dataflow.v1beta3.GetTemplateResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetTemplateResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.status != null && message.hasOwnProperty("status")) { + var error = $root.google.rpc.Status.verify(message.status); + if (error) + return "status." + error; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.google.dataflow.v1beta3.TemplateMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + if (message.templateType != null && message.hasOwnProperty("templateType")) + switch (message.templateType) { + default: + return "templateType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.runtimeMetadata != null && message.hasOwnProperty("runtimeMetadata")) { + var error = $root.google.dataflow.v1beta3.RuntimeMetadata.verify(message.runtimeMetadata); + if (error) + return "runtimeMetadata." + error; + } + return null; + }; + + /** + * Creates a GetTemplateResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.dataflow.v1beta3.GetTemplateResponse + * @static + * @param {Object.} object Plain object + * @returns {google.dataflow.v1beta3.GetTemplateResponse} GetTemplateResponse + */ + GetTemplateResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.dataflow.v1beta3.GetTemplateResponse) + return object; + var message = new $root.google.dataflow.v1beta3.GetTemplateResponse(); + if (object.status != null) { + if (typeof object.status !== "object") + throw TypeError(".google.dataflow.v1beta3.GetTemplateResponse.status: object expected"); + message.status = $root.google.rpc.Status.fromObject(object.status); + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".google.dataflow.v1beta3.GetTemplateResponse.metadata: object expected"); + message.metadata = $root.google.dataflow.v1beta3.TemplateMetadata.fromObject(object.metadata); + } + switch (object.templateType) { + default: + if (typeof object.templateType === "number") { + message.templateType = object.templateType; + break; + } + break; + case "UNKNOWN": + case 0: + message.templateType = 0; + break; + case "LEGACY": + case 1: + message.templateType = 1; + break; + case "FLEX": + case 2: + message.templateType = 2; + break; + } + if (object.runtimeMetadata != null) { + if (typeof object.runtimeMetadata !== "object") + throw TypeError(".google.dataflow.v1beta3.GetTemplateResponse.runtimeMetadata: object expected"); + message.runtimeMetadata = $root.google.dataflow.v1beta3.RuntimeMetadata.fromObject(object.runtimeMetadata); + } + return message; + }; + + /** + * Creates a plain object from a GetTemplateResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.dataflow.v1beta3.GetTemplateResponse + * @static + * @param {google.dataflow.v1beta3.GetTemplateResponse} message GetTemplateResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetTemplateResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.status = null; + object.metadata = null; + object.templateType = options.enums === String ? "UNKNOWN" : 0; + object.runtimeMetadata = null; + } + if (message.status != null && message.hasOwnProperty("status")) + object.status = $root.google.rpc.Status.toObject(message.status, options); + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.google.dataflow.v1beta3.TemplateMetadata.toObject(message.metadata, options); + if (message.templateType != null && message.hasOwnProperty("templateType")) + object.templateType = options.enums === String ? $root.google.dataflow.v1beta3.GetTemplateResponse.TemplateType[message.templateType] === undefined ? message.templateType : $root.google.dataflow.v1beta3.GetTemplateResponse.TemplateType[message.templateType] : message.templateType; + if (message.runtimeMetadata != null && message.hasOwnProperty("runtimeMetadata")) + object.runtimeMetadata = $root.google.dataflow.v1beta3.RuntimeMetadata.toObject(message.runtimeMetadata, options); + return object; + }; + + /** + * Converts this GetTemplateResponse to JSON. + * @function toJSON + * @memberof google.dataflow.v1beta3.GetTemplateResponse + * @instance + * @returns {Object.} JSON object + */ + GetTemplateResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetTemplateResponse + * @function getTypeUrl + * @memberof google.dataflow.v1beta3.GetTemplateResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetTemplateResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.dataflow.v1beta3.GetTemplateResponse"; + }; + + /** + * TemplateType enum. + * @name google.dataflow.v1beta3.GetTemplateResponse.TemplateType + * @enum {number} + * @property {number} UNKNOWN=0 UNKNOWN value + * @property {number} LEGACY=1 LEGACY value + * @property {number} FLEX=2 FLEX value + */ + GetTemplateResponse.TemplateType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNKNOWN"] = 0; + values[valuesById[1] = "LEGACY"] = 1; + values[valuesById[2] = "FLEX"] = 2; + return values; + })(); + + return GetTemplateResponse; + })(); + + v1beta3.LaunchTemplateParameters = (function() { + + /** + * Properties of a LaunchTemplateParameters. + * @memberof google.dataflow.v1beta3 + * @interface ILaunchTemplateParameters + * @property {string|null} [jobName] LaunchTemplateParameters jobName + * @property {Object.|null} [parameters] LaunchTemplateParameters parameters + * @property {google.dataflow.v1beta3.IRuntimeEnvironment|null} [environment] LaunchTemplateParameters environment + * @property {boolean|null} [update] LaunchTemplateParameters update + * @property {Object.|null} [transformNameMapping] LaunchTemplateParameters transformNameMapping + */ + + /** + * Constructs a new LaunchTemplateParameters. + * @memberof google.dataflow.v1beta3 + * @classdesc Represents a LaunchTemplateParameters. + * @implements ILaunchTemplateParameters + * @constructor + * @param {google.dataflow.v1beta3.ILaunchTemplateParameters=} [properties] Properties to set + */ + function LaunchTemplateParameters(properties) { + this.parameters = {}; + this.transformNameMapping = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LaunchTemplateParameters jobName. + * @member {string} jobName + * @memberof google.dataflow.v1beta3.LaunchTemplateParameters + * @instance + */ + LaunchTemplateParameters.prototype.jobName = ""; + + /** + * LaunchTemplateParameters parameters. + * @member {Object.} parameters + * @memberof google.dataflow.v1beta3.LaunchTemplateParameters + * @instance + */ + LaunchTemplateParameters.prototype.parameters = $util.emptyObject; + + /** + * LaunchTemplateParameters environment. + * @member {google.dataflow.v1beta3.IRuntimeEnvironment|null|undefined} environment + * @memberof google.dataflow.v1beta3.LaunchTemplateParameters + * @instance + */ + LaunchTemplateParameters.prototype.environment = null; + + /** + * LaunchTemplateParameters update. + * @member {boolean} update + * @memberof google.dataflow.v1beta3.LaunchTemplateParameters + * @instance + */ + LaunchTemplateParameters.prototype.update = false; + + /** + * LaunchTemplateParameters transformNameMapping. + * @member {Object.} transformNameMapping + * @memberof google.dataflow.v1beta3.LaunchTemplateParameters + * @instance + */ + LaunchTemplateParameters.prototype.transformNameMapping = $util.emptyObject; + + /** + * Creates a new LaunchTemplateParameters instance using the specified properties. + * @function create + * @memberof google.dataflow.v1beta3.LaunchTemplateParameters + * @static + * @param {google.dataflow.v1beta3.ILaunchTemplateParameters=} [properties] Properties to set + * @returns {google.dataflow.v1beta3.LaunchTemplateParameters} LaunchTemplateParameters instance + */ + LaunchTemplateParameters.create = function create(properties) { + return new LaunchTemplateParameters(properties); + }; + + /** + * Encodes the specified LaunchTemplateParameters message. Does not implicitly {@link google.dataflow.v1beta3.LaunchTemplateParameters.verify|verify} messages. + * @function encode + * @memberof google.dataflow.v1beta3.LaunchTemplateParameters + * @static + * @param {google.dataflow.v1beta3.ILaunchTemplateParameters} message LaunchTemplateParameters message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LaunchTemplateParameters.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.parameters != null && Object.hasOwnProperty.call(message, "parameters")) + for (var keys = Object.keys(message.parameters), i = 0; i < keys.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.parameters[keys[i]]).ldelim(); + if (message.environment != null && Object.hasOwnProperty.call(message, "environment")) + $root.google.dataflow.v1beta3.RuntimeEnvironment.encode(message.environment, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.update != null && Object.hasOwnProperty.call(message, "update")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.update); + if (message.transformNameMapping != null && Object.hasOwnProperty.call(message, "transformNameMapping")) + for (var keys = Object.keys(message.transformNameMapping), i = 0; i < keys.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.transformNameMapping[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified LaunchTemplateParameters message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.LaunchTemplateParameters.verify|verify} messages. + * @function encodeDelimited + * @memberof google.dataflow.v1beta3.LaunchTemplateParameters + * @static + * @param {google.dataflow.v1beta3.ILaunchTemplateParameters} message LaunchTemplateParameters message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LaunchTemplateParameters.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LaunchTemplateParameters message from the specified reader or buffer. + * @function decode + * @memberof google.dataflow.v1beta3.LaunchTemplateParameters + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.dataflow.v1beta3.LaunchTemplateParameters} LaunchTemplateParameters + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LaunchTemplateParameters.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.dataflow.v1beta3.LaunchTemplateParameters(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.jobName = reader.string(); + break; + } + case 2: { + if (message.parameters === $util.emptyObject) + message.parameters = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.parameters[key] = value; + break; + } + case 3: { + message.environment = $root.google.dataflow.v1beta3.RuntimeEnvironment.decode(reader, reader.uint32()); + break; + } + case 4: { + message.update = reader.bool(); + break; + } + case 5: { + if (message.transformNameMapping === $util.emptyObject) + message.transformNameMapping = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.transformNameMapping[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LaunchTemplateParameters message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.dataflow.v1beta3.LaunchTemplateParameters + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.dataflow.v1beta3.LaunchTemplateParameters} LaunchTemplateParameters + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LaunchTemplateParameters.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LaunchTemplateParameters message. + * @function verify + * @memberof google.dataflow.v1beta3.LaunchTemplateParameters + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LaunchTemplateParameters.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.parameters != null && message.hasOwnProperty("parameters")) { + if (!$util.isObject(message.parameters)) + return "parameters: object expected"; + var key = Object.keys(message.parameters); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.parameters[key[i]])) + return "parameters: string{k:string} expected"; + } + if (message.environment != null && message.hasOwnProperty("environment")) { + var error = $root.google.dataflow.v1beta3.RuntimeEnvironment.verify(message.environment); + if (error) + return "environment." + error; + } + if (message.update != null && message.hasOwnProperty("update")) + if (typeof message.update !== "boolean") + return "update: boolean expected"; + if (message.transformNameMapping != null && message.hasOwnProperty("transformNameMapping")) { + if (!$util.isObject(message.transformNameMapping)) + return "transformNameMapping: object expected"; + var key = Object.keys(message.transformNameMapping); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.transformNameMapping[key[i]])) + return "transformNameMapping: string{k:string} expected"; + } + return null; + }; + + /** + * Creates a LaunchTemplateParameters message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.dataflow.v1beta3.LaunchTemplateParameters + * @static + * @param {Object.} object Plain object + * @returns {google.dataflow.v1beta3.LaunchTemplateParameters} LaunchTemplateParameters + */ + LaunchTemplateParameters.fromObject = function fromObject(object) { + if (object instanceof $root.google.dataflow.v1beta3.LaunchTemplateParameters) + return object; + var message = new $root.google.dataflow.v1beta3.LaunchTemplateParameters(); + if (object.jobName != null) + message.jobName = String(object.jobName); + if (object.parameters) { + if (typeof object.parameters !== "object") + throw TypeError(".google.dataflow.v1beta3.LaunchTemplateParameters.parameters: object expected"); + message.parameters = {}; + for (var keys = Object.keys(object.parameters), i = 0; i < keys.length; ++i) + message.parameters[keys[i]] = String(object.parameters[keys[i]]); + } + if (object.environment != null) { + if (typeof object.environment !== "object") + throw TypeError(".google.dataflow.v1beta3.LaunchTemplateParameters.environment: object expected"); + message.environment = $root.google.dataflow.v1beta3.RuntimeEnvironment.fromObject(object.environment); + } + if (object.update != null) + message.update = Boolean(object.update); + if (object.transformNameMapping) { + if (typeof object.transformNameMapping !== "object") + throw TypeError(".google.dataflow.v1beta3.LaunchTemplateParameters.transformNameMapping: object expected"); + message.transformNameMapping = {}; + for (var keys = Object.keys(object.transformNameMapping), i = 0; i < keys.length; ++i) + message.transformNameMapping[keys[i]] = String(object.transformNameMapping[keys[i]]); + } + return message; + }; + + /** + * Creates a plain object from a LaunchTemplateParameters message. Also converts values to other types if specified. + * @function toObject + * @memberof google.dataflow.v1beta3.LaunchTemplateParameters + * @static + * @param {google.dataflow.v1beta3.LaunchTemplateParameters} message LaunchTemplateParameters + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LaunchTemplateParameters.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) { + object.parameters = {}; + object.transformNameMapping = {}; + } + if (options.defaults) { + object.jobName = ""; + object.environment = null; + object.update = false; + } + if (message.jobName != null && message.hasOwnProperty("jobName")) + object.jobName = message.jobName; + var keys2; + if (message.parameters && (keys2 = Object.keys(message.parameters)).length) { + object.parameters = {}; + for (var j = 0; j < keys2.length; ++j) + object.parameters[keys2[j]] = message.parameters[keys2[j]]; + } + if (message.environment != null && message.hasOwnProperty("environment")) + object.environment = $root.google.dataflow.v1beta3.RuntimeEnvironment.toObject(message.environment, options); + if (message.update != null && message.hasOwnProperty("update")) + object.update = message.update; + if (message.transformNameMapping && (keys2 = Object.keys(message.transformNameMapping)).length) { + object.transformNameMapping = {}; + for (var j = 0; j < keys2.length; ++j) + object.transformNameMapping[keys2[j]] = message.transformNameMapping[keys2[j]]; + } + return object; + }; + + /** + * Converts this LaunchTemplateParameters to JSON. + * @function toJSON + * @memberof google.dataflow.v1beta3.LaunchTemplateParameters + * @instance + * @returns {Object.} JSON object + */ + LaunchTemplateParameters.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LaunchTemplateParameters + * @function getTypeUrl + * @memberof google.dataflow.v1beta3.LaunchTemplateParameters + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LaunchTemplateParameters.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.dataflow.v1beta3.LaunchTemplateParameters"; + }; + + return LaunchTemplateParameters; + })(); + + v1beta3.LaunchTemplateRequest = (function() { + + /** + * Properties of a LaunchTemplateRequest. + * @memberof google.dataflow.v1beta3 + * @interface ILaunchTemplateRequest + * @property {string|null} [projectId] LaunchTemplateRequest projectId + * @property {boolean|null} [validateOnly] LaunchTemplateRequest validateOnly + * @property {string|null} [gcsPath] LaunchTemplateRequest gcsPath + * @property {google.dataflow.v1beta3.IDynamicTemplateLaunchParams|null} [dynamicTemplate] LaunchTemplateRequest dynamicTemplate + * @property {google.dataflow.v1beta3.ILaunchTemplateParameters|null} [launchParameters] LaunchTemplateRequest launchParameters + * @property {string|null} [location] LaunchTemplateRequest location + */ + + /** + * Constructs a new LaunchTemplateRequest. + * @memberof google.dataflow.v1beta3 + * @classdesc Represents a LaunchTemplateRequest. + * @implements ILaunchTemplateRequest + * @constructor + * @param {google.dataflow.v1beta3.ILaunchTemplateRequest=} [properties] Properties to set + */ + function LaunchTemplateRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LaunchTemplateRequest projectId. + * @member {string} projectId + * @memberof google.dataflow.v1beta3.LaunchTemplateRequest + * @instance + */ + LaunchTemplateRequest.prototype.projectId = ""; + + /** + * LaunchTemplateRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.dataflow.v1beta3.LaunchTemplateRequest + * @instance + */ + LaunchTemplateRequest.prototype.validateOnly = false; + + /** + * LaunchTemplateRequest gcsPath. + * @member {string|null|undefined} gcsPath + * @memberof google.dataflow.v1beta3.LaunchTemplateRequest + * @instance + */ + LaunchTemplateRequest.prototype.gcsPath = null; + + /** + * LaunchTemplateRequest dynamicTemplate. + * @member {google.dataflow.v1beta3.IDynamicTemplateLaunchParams|null|undefined} dynamicTemplate + * @memberof google.dataflow.v1beta3.LaunchTemplateRequest + * @instance + */ + LaunchTemplateRequest.prototype.dynamicTemplate = null; + + /** + * LaunchTemplateRequest launchParameters. + * @member {google.dataflow.v1beta3.ILaunchTemplateParameters|null|undefined} launchParameters + * @memberof google.dataflow.v1beta3.LaunchTemplateRequest + * @instance + */ + LaunchTemplateRequest.prototype.launchParameters = null; + + /** + * LaunchTemplateRequest location. + * @member {string} location + * @memberof google.dataflow.v1beta3.LaunchTemplateRequest + * @instance + */ + LaunchTemplateRequest.prototype.location = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * LaunchTemplateRequest template. + * @member {"gcsPath"|"dynamicTemplate"|undefined} template + * @memberof google.dataflow.v1beta3.LaunchTemplateRequest + * @instance + */ + Object.defineProperty(LaunchTemplateRequest.prototype, "template", { + get: $util.oneOfGetter($oneOfFields = ["gcsPath", "dynamicTemplate"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new LaunchTemplateRequest instance using the specified properties. + * @function create + * @memberof google.dataflow.v1beta3.LaunchTemplateRequest + * @static + * @param {google.dataflow.v1beta3.ILaunchTemplateRequest=} [properties] Properties to set + * @returns {google.dataflow.v1beta3.LaunchTemplateRequest} LaunchTemplateRequest instance + */ + LaunchTemplateRequest.create = function create(properties) { + return new LaunchTemplateRequest(properties); + }; + + /** + * Encodes the specified LaunchTemplateRequest message. Does not implicitly {@link google.dataflow.v1beta3.LaunchTemplateRequest.verify|verify} messages. + * @function encode + * @memberof google.dataflow.v1beta3.LaunchTemplateRequest + * @static + * @param {google.dataflow.v1beta3.ILaunchTemplateRequest} message LaunchTemplateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LaunchTemplateRequest.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.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.validateOnly); + if (message.gcsPath != null && Object.hasOwnProperty.call(message, "gcsPath")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.gcsPath); + if (message.launchParameters != null && Object.hasOwnProperty.call(message, "launchParameters")) + $root.google.dataflow.v1beta3.LaunchTemplateParameters.encode(message.launchParameters, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.location); + if (message.dynamicTemplate != null && Object.hasOwnProperty.call(message, "dynamicTemplate")) + $root.google.dataflow.v1beta3.DynamicTemplateLaunchParams.encode(message.dynamicTemplate, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified LaunchTemplateRequest message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.LaunchTemplateRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.dataflow.v1beta3.LaunchTemplateRequest + * @static + * @param {google.dataflow.v1beta3.ILaunchTemplateRequest} message LaunchTemplateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LaunchTemplateRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LaunchTemplateRequest message from the specified reader or buffer. + * @function decode + * @memberof google.dataflow.v1beta3.LaunchTemplateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.dataflow.v1beta3.LaunchTemplateRequest} LaunchTemplateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LaunchTemplateRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.dataflow.v1beta3.LaunchTemplateRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.projectId = reader.string(); + break; + } + case 2: { + message.validateOnly = reader.bool(); + break; + } + case 3: { + message.gcsPath = reader.string(); + break; + } + case 6: { + message.dynamicTemplate = $root.google.dataflow.v1beta3.DynamicTemplateLaunchParams.decode(reader, reader.uint32()); + break; + } + case 4: { + message.launchParameters = $root.google.dataflow.v1beta3.LaunchTemplateParameters.decode(reader, reader.uint32()); + break; + } + case 5: { + message.location = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LaunchTemplateRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.dataflow.v1beta3.LaunchTemplateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.dataflow.v1beta3.LaunchTemplateRequest} LaunchTemplateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LaunchTemplateRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LaunchTemplateRequest message. + * @function verify + * @memberof google.dataflow.v1beta3.LaunchTemplateRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LaunchTemplateRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.projectId != null && message.hasOwnProperty("projectId")) + if (!$util.isString(message.projectId)) + return "projectId: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + if (message.gcsPath != null && message.hasOwnProperty("gcsPath")) { + properties.template = 1; + if (!$util.isString(message.gcsPath)) + return "gcsPath: string expected"; + } + if (message.dynamicTemplate != null && message.hasOwnProperty("dynamicTemplate")) { + if (properties.template === 1) + return "template: multiple values"; + properties.template = 1; + { + var error = $root.google.dataflow.v1beta3.DynamicTemplateLaunchParams.verify(message.dynamicTemplate); + if (error) + return "dynamicTemplate." + error; + } + } + if (message.launchParameters != null && message.hasOwnProperty("launchParameters")) { + var error = $root.google.dataflow.v1beta3.LaunchTemplateParameters.verify(message.launchParameters); + if (error) + return "launchParameters." + error; + } + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isString(message.location)) + return "location: string expected"; + return null; + }; + + /** + * Creates a LaunchTemplateRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.dataflow.v1beta3.LaunchTemplateRequest + * @static + * @param {Object.} object Plain object + * @returns {google.dataflow.v1beta3.LaunchTemplateRequest} LaunchTemplateRequest + */ + LaunchTemplateRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.dataflow.v1beta3.LaunchTemplateRequest) + return object; + var message = new $root.google.dataflow.v1beta3.LaunchTemplateRequest(); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + if (object.gcsPath != null) + message.gcsPath = String(object.gcsPath); + if (object.dynamicTemplate != null) { + if (typeof object.dynamicTemplate !== "object") + throw TypeError(".google.dataflow.v1beta3.LaunchTemplateRequest.dynamicTemplate: object expected"); + message.dynamicTemplate = $root.google.dataflow.v1beta3.DynamicTemplateLaunchParams.fromObject(object.dynamicTemplate); + } + if (object.launchParameters != null) { + if (typeof object.launchParameters !== "object") + throw TypeError(".google.dataflow.v1beta3.LaunchTemplateRequest.launchParameters: object expected"); + message.launchParameters = $root.google.dataflow.v1beta3.LaunchTemplateParameters.fromObject(object.launchParameters); + } + if (object.location != null) + message.location = String(object.location); + return message; + }; + + /** + * Creates a plain object from a LaunchTemplateRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.dataflow.v1beta3.LaunchTemplateRequest + * @static + * @param {google.dataflow.v1beta3.LaunchTemplateRequest} message LaunchTemplateRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LaunchTemplateRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.projectId = ""; + object.validateOnly = false; + object.launchParameters = null; + object.location = ""; + } + if (message.projectId != null && message.hasOwnProperty("projectId")) + object.projectId = message.projectId; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + if (message.gcsPath != null && message.hasOwnProperty("gcsPath")) { + object.gcsPath = message.gcsPath; + if (options.oneofs) + object.template = "gcsPath"; + } + if (message.launchParameters != null && message.hasOwnProperty("launchParameters")) + object.launchParameters = $root.google.dataflow.v1beta3.LaunchTemplateParameters.toObject(message.launchParameters, options); + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + if (message.dynamicTemplate != null && message.hasOwnProperty("dynamicTemplate")) { + object.dynamicTemplate = $root.google.dataflow.v1beta3.DynamicTemplateLaunchParams.toObject(message.dynamicTemplate, options); + if (options.oneofs) + object.template = "dynamicTemplate"; + } + return object; + }; + + /** + * Converts this LaunchTemplateRequest to JSON. + * @function toJSON + * @memberof google.dataflow.v1beta3.LaunchTemplateRequest + * @instance + * @returns {Object.} JSON object + */ + LaunchTemplateRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LaunchTemplateRequest + * @function getTypeUrl + * @memberof google.dataflow.v1beta3.LaunchTemplateRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LaunchTemplateRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.dataflow.v1beta3.LaunchTemplateRequest"; + }; + + return LaunchTemplateRequest; + })(); + + v1beta3.LaunchTemplateResponse = (function() { + + /** + * Properties of a LaunchTemplateResponse. + * @memberof google.dataflow.v1beta3 + * @interface ILaunchTemplateResponse + * @property {google.dataflow.v1beta3.IJob|null} [job] LaunchTemplateResponse job + */ + + /** + * Constructs a new LaunchTemplateResponse. + * @memberof google.dataflow.v1beta3 + * @classdesc Represents a LaunchTemplateResponse. + * @implements ILaunchTemplateResponse + * @constructor + * @param {google.dataflow.v1beta3.ILaunchTemplateResponse=} [properties] Properties to set + */ + function LaunchTemplateResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LaunchTemplateResponse job. + * @member {google.dataflow.v1beta3.IJob|null|undefined} job + * @memberof google.dataflow.v1beta3.LaunchTemplateResponse + * @instance + */ + LaunchTemplateResponse.prototype.job = null; + + /** + * Creates a new LaunchTemplateResponse instance using the specified properties. + * @function create + * @memberof google.dataflow.v1beta3.LaunchTemplateResponse + * @static + * @param {google.dataflow.v1beta3.ILaunchTemplateResponse=} [properties] Properties to set + * @returns {google.dataflow.v1beta3.LaunchTemplateResponse} LaunchTemplateResponse instance + */ + LaunchTemplateResponse.create = function create(properties) { + return new LaunchTemplateResponse(properties); + }; + + /** + * Encodes the specified LaunchTemplateResponse message. Does not implicitly {@link google.dataflow.v1beta3.LaunchTemplateResponse.verify|verify} messages. + * @function encode + * @memberof google.dataflow.v1beta3.LaunchTemplateResponse + * @static + * @param {google.dataflow.v1beta3.ILaunchTemplateResponse} message LaunchTemplateResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LaunchTemplateResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.job != null && Object.hasOwnProperty.call(message, "job")) + $root.google.dataflow.v1beta3.Job.encode(message.job, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified LaunchTemplateResponse message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.LaunchTemplateResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.dataflow.v1beta3.LaunchTemplateResponse + * @static + * @param {google.dataflow.v1beta3.ILaunchTemplateResponse} message LaunchTemplateResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LaunchTemplateResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LaunchTemplateResponse message from the specified reader or buffer. + * @function decode + * @memberof google.dataflow.v1beta3.LaunchTemplateResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.dataflow.v1beta3.LaunchTemplateResponse} LaunchTemplateResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LaunchTemplateResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.dataflow.v1beta3.LaunchTemplateResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.job = $root.google.dataflow.v1beta3.Job.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LaunchTemplateResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.dataflow.v1beta3.LaunchTemplateResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.dataflow.v1beta3.LaunchTemplateResponse} LaunchTemplateResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LaunchTemplateResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LaunchTemplateResponse message. + * @function verify + * @memberof google.dataflow.v1beta3.LaunchTemplateResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LaunchTemplateResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.job != null && message.hasOwnProperty("job")) { + var error = $root.google.dataflow.v1beta3.Job.verify(message.job); + if (error) + return "job." + error; + } + return null; + }; + + /** + * Creates a LaunchTemplateResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.dataflow.v1beta3.LaunchTemplateResponse + * @static + * @param {Object.} object Plain object + * @returns {google.dataflow.v1beta3.LaunchTemplateResponse} LaunchTemplateResponse + */ + LaunchTemplateResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.dataflow.v1beta3.LaunchTemplateResponse) + return object; + var message = new $root.google.dataflow.v1beta3.LaunchTemplateResponse(); + if (object.job != null) { + if (typeof object.job !== "object") + throw TypeError(".google.dataflow.v1beta3.LaunchTemplateResponse.job: object expected"); + message.job = $root.google.dataflow.v1beta3.Job.fromObject(object.job); + } + return message; + }; + + /** + * Creates a plain object from a LaunchTemplateResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.dataflow.v1beta3.LaunchTemplateResponse + * @static + * @param {google.dataflow.v1beta3.LaunchTemplateResponse} message LaunchTemplateResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LaunchTemplateResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.job = null; + if (message.job != null && message.hasOwnProperty("job")) + object.job = $root.google.dataflow.v1beta3.Job.toObject(message.job, options); + return object; + }; + + /** + * Converts this LaunchTemplateResponse to JSON. + * @function toJSON + * @memberof google.dataflow.v1beta3.LaunchTemplateResponse + * @instance + * @returns {Object.} JSON object + */ + LaunchTemplateResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LaunchTemplateResponse + * @function getTypeUrl + * @memberof google.dataflow.v1beta3.LaunchTemplateResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LaunchTemplateResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.dataflow.v1beta3.LaunchTemplateResponse"; + }; + + return LaunchTemplateResponse; + })(); + + v1beta3.InvalidTemplateParameters = (function() { + + /** + * Properties of an InvalidTemplateParameters. + * @memberof google.dataflow.v1beta3 + * @interface IInvalidTemplateParameters + * @property {Array.|null} [parameterViolations] InvalidTemplateParameters parameterViolations + */ + + /** + * Constructs a new InvalidTemplateParameters. + * @memberof google.dataflow.v1beta3 + * @classdesc Represents an InvalidTemplateParameters. + * @implements IInvalidTemplateParameters + * @constructor + * @param {google.dataflow.v1beta3.IInvalidTemplateParameters=} [properties] Properties to set + */ + function InvalidTemplateParameters(properties) { + this.parameterViolations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InvalidTemplateParameters parameterViolations. + * @member {Array.} parameterViolations + * @memberof google.dataflow.v1beta3.InvalidTemplateParameters + * @instance + */ + InvalidTemplateParameters.prototype.parameterViolations = $util.emptyArray; + + /** + * Creates a new InvalidTemplateParameters instance using the specified properties. + * @function create + * @memberof google.dataflow.v1beta3.InvalidTemplateParameters + * @static + * @param {google.dataflow.v1beta3.IInvalidTemplateParameters=} [properties] Properties to set + * @returns {google.dataflow.v1beta3.InvalidTemplateParameters} InvalidTemplateParameters instance + */ + InvalidTemplateParameters.create = function create(properties) { + return new InvalidTemplateParameters(properties); + }; + + /** + * Encodes the specified InvalidTemplateParameters message. Does not implicitly {@link google.dataflow.v1beta3.InvalidTemplateParameters.verify|verify} messages. + * @function encode + * @memberof google.dataflow.v1beta3.InvalidTemplateParameters + * @static + * @param {google.dataflow.v1beta3.IInvalidTemplateParameters} message InvalidTemplateParameters message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InvalidTemplateParameters.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parameterViolations != null && message.parameterViolations.length) + for (var i = 0; i < message.parameterViolations.length; ++i) + $root.google.dataflow.v1beta3.InvalidTemplateParameters.ParameterViolation.encode(message.parameterViolations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified InvalidTemplateParameters message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.InvalidTemplateParameters.verify|verify} messages. + * @function encodeDelimited + * @memberof google.dataflow.v1beta3.InvalidTemplateParameters + * @static + * @param {google.dataflow.v1beta3.IInvalidTemplateParameters} message InvalidTemplateParameters message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InvalidTemplateParameters.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InvalidTemplateParameters message from the specified reader or buffer. + * @function decode + * @memberof google.dataflow.v1beta3.InvalidTemplateParameters + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.dataflow.v1beta3.InvalidTemplateParameters} InvalidTemplateParameters + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InvalidTemplateParameters.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.dataflow.v1beta3.InvalidTemplateParameters(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.parameterViolations && message.parameterViolations.length)) + message.parameterViolations = []; + message.parameterViolations.push($root.google.dataflow.v1beta3.InvalidTemplateParameters.ParameterViolation.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InvalidTemplateParameters message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.dataflow.v1beta3.InvalidTemplateParameters + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.dataflow.v1beta3.InvalidTemplateParameters} InvalidTemplateParameters + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InvalidTemplateParameters.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InvalidTemplateParameters message. + * @function verify + * @memberof google.dataflow.v1beta3.InvalidTemplateParameters + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InvalidTemplateParameters.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parameterViolations != null && message.hasOwnProperty("parameterViolations")) { + if (!Array.isArray(message.parameterViolations)) + return "parameterViolations: array expected"; + for (var i = 0; i < message.parameterViolations.length; ++i) { + var error = $root.google.dataflow.v1beta3.InvalidTemplateParameters.ParameterViolation.verify(message.parameterViolations[i]); + if (error) + return "parameterViolations." + error; + } + } + return null; + }; + + /** + * Creates an InvalidTemplateParameters message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.dataflow.v1beta3.InvalidTemplateParameters + * @static + * @param {Object.} object Plain object + * @returns {google.dataflow.v1beta3.InvalidTemplateParameters} InvalidTemplateParameters + */ + InvalidTemplateParameters.fromObject = function fromObject(object) { + if (object instanceof $root.google.dataflow.v1beta3.InvalidTemplateParameters) + return object; + var message = new $root.google.dataflow.v1beta3.InvalidTemplateParameters(); + if (object.parameterViolations) { + if (!Array.isArray(object.parameterViolations)) + throw TypeError(".google.dataflow.v1beta3.InvalidTemplateParameters.parameterViolations: array expected"); + message.parameterViolations = []; + for (var i = 0; i < object.parameterViolations.length; ++i) { + if (typeof object.parameterViolations[i] !== "object") + throw TypeError(".google.dataflow.v1beta3.InvalidTemplateParameters.parameterViolations: object expected"); + message.parameterViolations[i] = $root.google.dataflow.v1beta3.InvalidTemplateParameters.ParameterViolation.fromObject(object.parameterViolations[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an InvalidTemplateParameters message. Also converts values to other types if specified. + * @function toObject + * @memberof google.dataflow.v1beta3.InvalidTemplateParameters + * @static + * @param {google.dataflow.v1beta3.InvalidTemplateParameters} message InvalidTemplateParameters + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InvalidTemplateParameters.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.parameterViolations = []; + if (message.parameterViolations && message.parameterViolations.length) { + object.parameterViolations = []; + for (var j = 0; j < message.parameterViolations.length; ++j) + object.parameterViolations[j] = $root.google.dataflow.v1beta3.InvalidTemplateParameters.ParameterViolation.toObject(message.parameterViolations[j], options); + } + return object; + }; + + /** + * Converts this InvalidTemplateParameters to JSON. + * @function toJSON + * @memberof google.dataflow.v1beta3.InvalidTemplateParameters + * @instance + * @returns {Object.} JSON object + */ + InvalidTemplateParameters.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for InvalidTemplateParameters + * @function getTypeUrl + * @memberof google.dataflow.v1beta3.InvalidTemplateParameters + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + InvalidTemplateParameters.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.dataflow.v1beta3.InvalidTemplateParameters"; + }; + + InvalidTemplateParameters.ParameterViolation = (function() { + + /** + * Properties of a ParameterViolation. + * @memberof google.dataflow.v1beta3.InvalidTemplateParameters + * @interface IParameterViolation + * @property {string|null} [parameter] ParameterViolation parameter + * @property {string|null} [description] ParameterViolation description + */ + + /** + * Constructs a new ParameterViolation. + * @memberof google.dataflow.v1beta3.InvalidTemplateParameters + * @classdesc Represents a ParameterViolation. + * @implements IParameterViolation + * @constructor + * @param {google.dataflow.v1beta3.InvalidTemplateParameters.IParameterViolation=} [properties] Properties to set + */ + function ParameterViolation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ParameterViolation parameter. + * @member {string} parameter + * @memberof google.dataflow.v1beta3.InvalidTemplateParameters.ParameterViolation + * @instance + */ + ParameterViolation.prototype.parameter = ""; + + /** + * ParameterViolation description. + * @member {string} description + * @memberof google.dataflow.v1beta3.InvalidTemplateParameters.ParameterViolation + * @instance + */ + ParameterViolation.prototype.description = ""; + + /** + * Creates a new ParameterViolation instance using the specified properties. + * @function create + * @memberof google.dataflow.v1beta3.InvalidTemplateParameters.ParameterViolation + * @static + * @param {google.dataflow.v1beta3.InvalidTemplateParameters.IParameterViolation=} [properties] Properties to set + * @returns {google.dataflow.v1beta3.InvalidTemplateParameters.ParameterViolation} ParameterViolation instance + */ + ParameterViolation.create = function create(properties) { + return new ParameterViolation(properties); + }; + + /** + * Encodes the specified ParameterViolation message. Does not implicitly {@link google.dataflow.v1beta3.InvalidTemplateParameters.ParameterViolation.verify|verify} messages. + * @function encode + * @memberof google.dataflow.v1beta3.InvalidTemplateParameters.ParameterViolation + * @static + * @param {google.dataflow.v1beta3.InvalidTemplateParameters.IParameterViolation} message ParameterViolation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ParameterViolation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parameter != null && Object.hasOwnProperty.call(message, "parameter")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parameter); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); + return writer; + }; + + /** + * Encodes the specified ParameterViolation message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.InvalidTemplateParameters.ParameterViolation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.dataflow.v1beta3.InvalidTemplateParameters.ParameterViolation + * @static + * @param {google.dataflow.v1beta3.InvalidTemplateParameters.IParameterViolation} message ParameterViolation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ParameterViolation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ParameterViolation message from the specified reader or buffer. + * @function decode + * @memberof google.dataflow.v1beta3.InvalidTemplateParameters.ParameterViolation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.dataflow.v1beta3.InvalidTemplateParameters.ParameterViolation} ParameterViolation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ParameterViolation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.dataflow.v1beta3.InvalidTemplateParameters.ParameterViolation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parameter = reader.string(); + break; + } + case 2: { + message.description = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ParameterViolation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.dataflow.v1beta3.InvalidTemplateParameters.ParameterViolation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.dataflow.v1beta3.InvalidTemplateParameters.ParameterViolation} ParameterViolation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ParameterViolation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ParameterViolation message. + * @function verify + * @memberof google.dataflow.v1beta3.InvalidTemplateParameters.ParameterViolation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ParameterViolation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parameter != null && message.hasOwnProperty("parameter")) + if (!$util.isString(message.parameter)) + return "parameter: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + return null; + }; + + /** + * Creates a ParameterViolation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.dataflow.v1beta3.InvalidTemplateParameters.ParameterViolation + * @static + * @param {Object.} object Plain object + * @returns {google.dataflow.v1beta3.InvalidTemplateParameters.ParameterViolation} ParameterViolation + */ + ParameterViolation.fromObject = function fromObject(object) { + if (object instanceof $root.google.dataflow.v1beta3.InvalidTemplateParameters.ParameterViolation) + return object; + var message = new $root.google.dataflow.v1beta3.InvalidTemplateParameters.ParameterViolation(); + if (object.parameter != null) + message.parameter = String(object.parameter); + if (object.description != null) + message.description = String(object.description); + return message; + }; + + /** + * Creates a plain object from a ParameterViolation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.dataflow.v1beta3.InvalidTemplateParameters.ParameterViolation + * @static + * @param {google.dataflow.v1beta3.InvalidTemplateParameters.ParameterViolation} message ParameterViolation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ParameterViolation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parameter = ""; + object.description = ""; + } + if (message.parameter != null && message.hasOwnProperty("parameter")) + object.parameter = message.parameter; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + return object; + }; + + /** + * Converts this ParameterViolation to JSON. + * @function toJSON + * @memberof google.dataflow.v1beta3.InvalidTemplateParameters.ParameterViolation + * @instance + * @returns {Object.} JSON object + */ + ParameterViolation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ParameterViolation + * @function getTypeUrl + * @memberof google.dataflow.v1beta3.InvalidTemplateParameters.ParameterViolation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ParameterViolation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.dataflow.v1beta3.InvalidTemplateParameters.ParameterViolation"; + }; + + return ParameterViolation; + })(); + + return InvalidTemplateParameters; + })(); + + v1beta3.DynamicTemplateLaunchParams = (function() { + + /** + * Properties of a DynamicTemplateLaunchParams. + * @memberof google.dataflow.v1beta3 + * @interface IDynamicTemplateLaunchParams + * @property {string|null} [gcsPath] DynamicTemplateLaunchParams gcsPath + * @property {string|null} [stagingLocation] DynamicTemplateLaunchParams stagingLocation + */ + + /** + * Constructs a new DynamicTemplateLaunchParams. + * @memberof google.dataflow.v1beta3 + * @classdesc Represents a DynamicTemplateLaunchParams. + * @implements IDynamicTemplateLaunchParams + * @constructor + * @param {google.dataflow.v1beta3.IDynamicTemplateLaunchParams=} [properties] Properties to set + */ + function DynamicTemplateLaunchParams(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DynamicTemplateLaunchParams gcsPath. + * @member {string} gcsPath + * @memberof google.dataflow.v1beta3.DynamicTemplateLaunchParams + * @instance + */ + DynamicTemplateLaunchParams.prototype.gcsPath = ""; + + /** + * DynamicTemplateLaunchParams stagingLocation. + * @member {string} stagingLocation + * @memberof google.dataflow.v1beta3.DynamicTemplateLaunchParams + * @instance + */ + DynamicTemplateLaunchParams.prototype.stagingLocation = ""; + + /** + * Creates a new DynamicTemplateLaunchParams instance using the specified properties. + * @function create + * @memberof google.dataflow.v1beta3.DynamicTemplateLaunchParams + * @static + * @param {google.dataflow.v1beta3.IDynamicTemplateLaunchParams=} [properties] Properties to set + * @returns {google.dataflow.v1beta3.DynamicTemplateLaunchParams} DynamicTemplateLaunchParams instance + */ + DynamicTemplateLaunchParams.create = function create(properties) { + return new DynamicTemplateLaunchParams(properties); + }; + + /** + * Encodes the specified DynamicTemplateLaunchParams message. Does not implicitly {@link google.dataflow.v1beta3.DynamicTemplateLaunchParams.verify|verify} messages. + * @function encode + * @memberof google.dataflow.v1beta3.DynamicTemplateLaunchParams + * @static + * @param {google.dataflow.v1beta3.IDynamicTemplateLaunchParams} message DynamicTemplateLaunchParams message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DynamicTemplateLaunchParams.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gcsPath != null && Object.hasOwnProperty.call(message, "gcsPath")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.gcsPath); + if (message.stagingLocation != null && Object.hasOwnProperty.call(message, "stagingLocation")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.stagingLocation); + return writer; + }; + + /** + * Encodes the specified DynamicTemplateLaunchParams message, length delimited. Does not implicitly {@link google.dataflow.v1beta3.DynamicTemplateLaunchParams.verify|verify} messages. + * @function encodeDelimited + * @memberof google.dataflow.v1beta3.DynamicTemplateLaunchParams + * @static + * @param {google.dataflow.v1beta3.IDynamicTemplateLaunchParams} message DynamicTemplateLaunchParams message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DynamicTemplateLaunchParams.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DynamicTemplateLaunchParams message from the specified reader or buffer. + * @function decode + * @memberof google.dataflow.v1beta3.DynamicTemplateLaunchParams + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.dataflow.v1beta3.DynamicTemplateLaunchParams} DynamicTemplateLaunchParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DynamicTemplateLaunchParams.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.dataflow.v1beta3.DynamicTemplateLaunchParams(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.gcsPath = reader.string(); + break; + } + case 2: { + message.stagingLocation = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DynamicTemplateLaunchParams message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.dataflow.v1beta3.DynamicTemplateLaunchParams + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.dataflow.v1beta3.DynamicTemplateLaunchParams} DynamicTemplateLaunchParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DynamicTemplateLaunchParams.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DynamicTemplateLaunchParams message. + * @function verify + * @memberof google.dataflow.v1beta3.DynamicTemplateLaunchParams + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DynamicTemplateLaunchParams.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.gcsPath != null && message.hasOwnProperty("gcsPath")) + if (!$util.isString(message.gcsPath)) + return "gcsPath: string expected"; + if (message.stagingLocation != null && message.hasOwnProperty("stagingLocation")) + if (!$util.isString(message.stagingLocation)) + return "stagingLocation: string expected"; + return null; + }; + + /** + * Creates a DynamicTemplateLaunchParams message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.dataflow.v1beta3.DynamicTemplateLaunchParams + * @static + * @param {Object.} object Plain object + * @returns {google.dataflow.v1beta3.DynamicTemplateLaunchParams} DynamicTemplateLaunchParams + */ + DynamicTemplateLaunchParams.fromObject = function fromObject(object) { + if (object instanceof $root.google.dataflow.v1beta3.DynamicTemplateLaunchParams) + return object; + var message = new $root.google.dataflow.v1beta3.DynamicTemplateLaunchParams(); + if (object.gcsPath != null) + message.gcsPath = String(object.gcsPath); + if (object.stagingLocation != null) + message.stagingLocation = String(object.stagingLocation); + return message; + }; + + /** + * Creates a plain object from a DynamicTemplateLaunchParams message. Also converts values to other types if specified. + * @function toObject + * @memberof google.dataflow.v1beta3.DynamicTemplateLaunchParams + * @static + * @param {google.dataflow.v1beta3.DynamicTemplateLaunchParams} message DynamicTemplateLaunchParams + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DynamicTemplateLaunchParams.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.gcsPath = ""; + object.stagingLocation = ""; + } + if (message.gcsPath != null && message.hasOwnProperty("gcsPath")) + object.gcsPath = message.gcsPath; + if (message.stagingLocation != null && message.hasOwnProperty("stagingLocation")) + object.stagingLocation = message.stagingLocation; + return object; + }; + + /** + * Converts this DynamicTemplateLaunchParams to JSON. + * @function toJSON + * @memberof google.dataflow.v1beta3.DynamicTemplateLaunchParams + * @instance + * @returns {Object.} JSON object + */ + DynamicTemplateLaunchParams.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DynamicTemplateLaunchParams + * @function getTypeUrl + * @memberof google.dataflow.v1beta3.DynamicTemplateLaunchParams + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DynamicTemplateLaunchParams.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.dataflow.v1beta3.DynamicTemplateLaunchParams"; + }; + + return DynamicTemplateLaunchParams; + })(); + + return v1beta3; + })(); + + return dataflow; + })(); + + google.api = (function() { + + /** + * Namespace api. + * @memberof google + * @namespace + */ + var api = {}; + + /** + * FieldBehavior enum. + * @name google.api.FieldBehavior + * @enum {number} + * @property {number} FIELD_BEHAVIOR_UNSPECIFIED=0 FIELD_BEHAVIOR_UNSPECIFIED value + * @property {number} OPTIONAL=1 OPTIONAL value + * @property {number} REQUIRED=2 REQUIRED value + * @property {number} OUTPUT_ONLY=3 OUTPUT_ONLY value + * @property {number} INPUT_ONLY=4 INPUT_ONLY value + * @property {number} IMMUTABLE=5 IMMUTABLE value + * @property {number} UNORDERED_LIST=6 UNORDERED_LIST value + * @property {number} NON_EMPTY_DEFAULT=7 NON_EMPTY_DEFAULT value + */ + api.FieldBehavior = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FIELD_BEHAVIOR_UNSPECIFIED"] = 0; + values[valuesById[1] = "OPTIONAL"] = 1; + values[valuesById[2] = "REQUIRED"] = 2; + values[valuesById[3] = "OUTPUT_ONLY"] = 3; + values[valuesById[4] = "INPUT_ONLY"] = 4; + values[valuesById[5] = "IMMUTABLE"] = 5; + values[valuesById[6] = "UNORDERED_LIST"] = 6; + values[valuesById[7] = "NON_EMPTY_DEFAULT"] = 7; + return values; + })(); + + api.Http = (function() { + + /** + * Properties of a Http. + * @memberof google.api + * @interface IHttp + * @property {Array.|null} [rules] Http rules + * @property {boolean|null} [fullyDecodeReservedExpansion] Http fullyDecodeReservedExpansion + */ + + /** + * Constructs a new Http. + * @memberof google.api + * @classdesc Represents a Http. + * @implements IHttp + * @constructor + * @param {google.api.IHttp=} [properties] Properties to set + */ + function Http(properties) { + this.rules = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Http rules. + * @member {Array.} rules + * @memberof google.api.Http + * @instance + */ + Http.prototype.rules = $util.emptyArray; + + /** + * Http fullyDecodeReservedExpansion. + * @member {boolean} fullyDecodeReservedExpansion + * @memberof google.api.Http + * @instance + */ + Http.prototype.fullyDecodeReservedExpansion = false; + + /** + * Creates a new Http instance using the specified properties. + * @function create + * @memberof google.api.Http + * @static + * @param {google.api.IHttp=} [properties] Properties to set + * @returns {google.api.Http} Http instance + */ + Http.create = function create(properties) { + return new Http(properties); + }; + + /** + * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @function encode + * @memberof google.api.Http + * @static + * @param {google.api.IHttp} message Http message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Http.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rules != null && message.rules.length) + for (var i = 0; i < message.rules.length; ++i) + $root.google.api.HttpRule.encode(message.rules[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.fullyDecodeReservedExpansion != null && Object.hasOwnProperty.call(message, "fullyDecodeReservedExpansion")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.fullyDecodeReservedExpansion); + return writer; + }; + + /** + * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.Http + * @static + * @param {google.api.IHttp} message Http message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Http.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Http message from the specified reader or buffer. + * @function decode + * @memberof google.api.Http + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.Http} Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Http.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Http(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.rules && message.rules.length)) + message.rules = []; + message.rules.push($root.google.api.HttpRule.decode(reader, reader.uint32())); + break; + } + case 2: { + message.fullyDecodeReservedExpansion = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Http message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.Http + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.Http} Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Http.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Http message. + * @function verify + * @memberof google.api.Http + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Http.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.rules != null && message.hasOwnProperty("rules")) { + if (!Array.isArray(message.rules)) + return "rules: array expected"; + for (var i = 0; i < message.rules.length; ++i) { + var error = $root.google.api.HttpRule.verify(message.rules[i]); + if (error) + return "rules." + error; + } + } + if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) + if (typeof message.fullyDecodeReservedExpansion !== "boolean") + return "fullyDecodeReservedExpansion: boolean expected"; + return null; + }; + + /** + * Creates a Http message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.Http + * @static + * @param {Object.} object Plain object + * @returns {google.api.Http} Http + */ + Http.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.Http) + return object; + var message = new $root.google.api.Http(); + if (object.rules) { + if (!Array.isArray(object.rules)) + throw TypeError(".google.api.Http.rules: array expected"); + message.rules = []; + for (var i = 0; i < object.rules.length; ++i) { + if (typeof object.rules[i] !== "object") + throw TypeError(".google.api.Http.rules: object expected"); + message.rules[i] = $root.google.api.HttpRule.fromObject(object.rules[i]); + } + } + if (object.fullyDecodeReservedExpansion != null) + message.fullyDecodeReservedExpansion = Boolean(object.fullyDecodeReservedExpansion); + return message; + }; + + /** + * Creates a plain object from a Http message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.Http + * @static + * @param {google.api.Http} message Http + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Http.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.rules = []; + if (options.defaults) + object.fullyDecodeReservedExpansion = false; + if (message.rules && message.rules.length) { + object.rules = []; + for (var j = 0; j < message.rules.length; ++j) + object.rules[j] = $root.google.api.HttpRule.toObject(message.rules[j], options); + } + if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) + object.fullyDecodeReservedExpansion = message.fullyDecodeReservedExpansion; + return object; + }; + + /** + * Converts this Http to JSON. + * @function toJSON + * @memberof google.api.Http + * @instance + * @returns {Object.} JSON object + */ + Http.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Http + * @function getTypeUrl + * @memberof google.api.Http + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Http.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.Http"; + }; + + return Http; + })(); + + api.HttpRule = (function() { + + /** + * Properties of a HttpRule. + * @memberof google.api + * @interface IHttpRule + * @property {string|null} [selector] HttpRule selector + * @property {string|null} [get] HttpRule get + * @property {string|null} [put] HttpRule put + * @property {string|null} [post] HttpRule post + * @property {string|null} ["delete"] HttpRule delete + * @property {string|null} [patch] HttpRule patch + * @property {google.api.ICustomHttpPattern|null} [custom] HttpRule custom + * @property {string|null} [body] HttpRule body + * @property {string|null} [responseBody] HttpRule responseBody + * @property {Array.|null} [additionalBindings] HttpRule additionalBindings + */ + + /** + * Constructs a new HttpRule. + * @memberof google.api + * @classdesc Represents a HttpRule. + * @implements IHttpRule + * @constructor + * @param {google.api.IHttpRule=} [properties] Properties to set + */ + function HttpRule(properties) { + this.additionalBindings = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HttpRule selector. + * @member {string} selector + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.selector = ""; + + /** + * HttpRule get. + * @member {string|null|undefined} get + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.get = null; + + /** + * HttpRule put. + * @member {string|null|undefined} put + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.put = null; + + /** + * HttpRule post. + * @member {string|null|undefined} post + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.post = null; + + /** + * HttpRule delete. + * @member {string|null|undefined} delete + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype["delete"] = null; + + /** + * HttpRule patch. + * @member {string|null|undefined} patch + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.patch = null; + + /** + * HttpRule custom. + * @member {google.api.ICustomHttpPattern|null|undefined} custom + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.custom = null; + + /** + * HttpRule body. + * @member {string} body + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.body = ""; + + /** + * HttpRule responseBody. + * @member {string} responseBody + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.responseBody = ""; + + /** + * HttpRule additionalBindings. + * @member {Array.} additionalBindings + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.additionalBindings = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * HttpRule pattern. + * @member {"get"|"put"|"post"|"delete"|"patch"|"custom"|undefined} pattern + * @memberof google.api.HttpRule + * @instance + */ + Object.defineProperty(HttpRule.prototype, "pattern", { + get: $util.oneOfGetter($oneOfFields = ["get", "put", "post", "delete", "patch", "custom"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new HttpRule instance using the specified properties. + * @function create + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule=} [properties] Properties to set + * @returns {google.api.HttpRule} HttpRule instance + */ + HttpRule.create = function create(properties) { + return new HttpRule(properties); + }; + + /** + * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @function encode + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpRule.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); + if (message.get != null && Object.hasOwnProperty.call(message, "get")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.get); + if (message.put != null && Object.hasOwnProperty.call(message, "put")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.put); + if (message.post != null && Object.hasOwnProperty.call(message, "post")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.post); + if (message["delete"] != null && Object.hasOwnProperty.call(message, "delete")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message["delete"]); + if (message.patch != null && Object.hasOwnProperty.call(message, "patch")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.patch); + if (message.body != null && Object.hasOwnProperty.call(message, "body")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.body); + if (message.custom != null && Object.hasOwnProperty.call(message, "custom")) + $root.google.api.CustomHttpPattern.encode(message.custom, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.additionalBindings != null && message.additionalBindings.length) + for (var i = 0; i < message.additionalBindings.length; ++i) + $root.google.api.HttpRule.encode(message.additionalBindings[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.responseBody != null && Object.hasOwnProperty.call(message, "responseBody")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.responseBody); + return writer; + }; + + /** + * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpRule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HttpRule message from the specified reader or buffer. + * @function decode + * @memberof google.api.HttpRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.HttpRule} HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpRule.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.HttpRule(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.selector = reader.string(); + break; + } + case 2: { + message.get = reader.string(); + break; + } + case 3: { + message.put = reader.string(); + break; + } + case 4: { + message.post = reader.string(); + break; + } + case 5: { + message["delete"] = reader.string(); + break; + } + case 6: { + message.patch = reader.string(); + break; + } + case 8: { + message.custom = $root.google.api.CustomHttpPattern.decode(reader, reader.uint32()); + break; + } + case 7: { + message.body = reader.string(); + break; + } + case 12: { + message.responseBody = reader.string(); + break; + } + case 11: { + if (!(message.additionalBindings && message.additionalBindings.length)) + message.additionalBindings = []; + message.additionalBindings.push($root.google.api.HttpRule.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HttpRule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.HttpRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.HttpRule} HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpRule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HttpRule message. + * @function verify + * @memberof google.api.HttpRule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HttpRule.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.selector != null && message.hasOwnProperty("selector")) + if (!$util.isString(message.selector)) + return "selector: string expected"; + if (message.get != null && message.hasOwnProperty("get")) { + properties.pattern = 1; + if (!$util.isString(message.get)) + return "get: string expected"; + } + if (message.put != null && message.hasOwnProperty("put")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.put)) + return "put: string expected"; + } + if (message.post != null && message.hasOwnProperty("post")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.post)) + return "post: string expected"; + } + if (message["delete"] != null && message.hasOwnProperty("delete")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message["delete"])) + return "delete: string expected"; + } + if (message.patch != null && message.hasOwnProperty("patch")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.patch)) + return "patch: string expected"; + } + if (message.custom != null && message.hasOwnProperty("custom")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + { + var error = $root.google.api.CustomHttpPattern.verify(message.custom); + if (error) + return "custom." + error; + } + } + if (message.body != null && message.hasOwnProperty("body")) + if (!$util.isString(message.body)) + return "body: string expected"; + if (message.responseBody != null && message.hasOwnProperty("responseBody")) + if (!$util.isString(message.responseBody)) + return "responseBody: string expected"; + if (message.additionalBindings != null && message.hasOwnProperty("additionalBindings")) { + if (!Array.isArray(message.additionalBindings)) + return "additionalBindings: array expected"; + for (var i = 0; i < message.additionalBindings.length; ++i) { + var error = $root.google.api.HttpRule.verify(message.additionalBindings[i]); + if (error) + return "additionalBindings." + error; + } + } + return null; + }; + + /** + * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.HttpRule + * @static + * @param {Object.} object Plain object + * @returns {google.api.HttpRule} HttpRule + */ + HttpRule.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.HttpRule) + return object; + var message = new $root.google.api.HttpRule(); + if (object.selector != null) + message.selector = String(object.selector); + if (object.get != null) + message.get = String(object.get); + if (object.put != null) + message.put = String(object.put); + if (object.post != null) + message.post = String(object.post); + if (object["delete"] != null) + message["delete"] = String(object["delete"]); + if (object.patch != null) + message.patch = String(object.patch); + if (object.custom != null) { + if (typeof object.custom !== "object") + throw TypeError(".google.api.HttpRule.custom: object expected"); + message.custom = $root.google.api.CustomHttpPattern.fromObject(object.custom); + } + if (object.body != null) + message.body = String(object.body); + if (object.responseBody != null) + message.responseBody = String(object.responseBody); + if (object.additionalBindings) { + if (!Array.isArray(object.additionalBindings)) + throw TypeError(".google.api.HttpRule.additionalBindings: array expected"); + message.additionalBindings = []; + for (var i = 0; i < object.additionalBindings.length; ++i) { + if (typeof object.additionalBindings[i] !== "object") + throw TypeError(".google.api.HttpRule.additionalBindings: object expected"); + message.additionalBindings[i] = $root.google.api.HttpRule.fromObject(object.additionalBindings[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a HttpRule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.HttpRule + * @static + * @param {google.api.HttpRule} message HttpRule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HttpRule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.additionalBindings = []; + if (options.defaults) { + object.selector = ""; + object.body = ""; + object.responseBody = ""; + } + if (message.selector != null && message.hasOwnProperty("selector")) + object.selector = message.selector; + if (message.get != null && message.hasOwnProperty("get")) { + object.get = message.get; + if (options.oneofs) + object.pattern = "get"; + } + if (message.put != null && message.hasOwnProperty("put")) { + object.put = message.put; + if (options.oneofs) + object.pattern = "put"; + } + if (message.post != null && message.hasOwnProperty("post")) { + object.post = message.post; + if (options.oneofs) + object.pattern = "post"; + } + if (message["delete"] != null && message.hasOwnProperty("delete")) { + object["delete"] = message["delete"]; + if (options.oneofs) + object.pattern = "delete"; + } + if (message.patch != null && message.hasOwnProperty("patch")) { + object.patch = message.patch; + if (options.oneofs) + object.pattern = "patch"; + } + if (message.body != null && message.hasOwnProperty("body")) + object.body = message.body; + if (message.custom != null && message.hasOwnProperty("custom")) { + object.custom = $root.google.api.CustomHttpPattern.toObject(message.custom, options); + if (options.oneofs) + object.pattern = "custom"; + } + if (message.additionalBindings && message.additionalBindings.length) { + object.additionalBindings = []; + for (var j = 0; j < message.additionalBindings.length; ++j) + object.additionalBindings[j] = $root.google.api.HttpRule.toObject(message.additionalBindings[j], options); + } + if (message.responseBody != null && message.hasOwnProperty("responseBody")) + object.responseBody = message.responseBody; + return object; + }; + + /** + * Converts this HttpRule to JSON. + * @function toJSON + * @memberof google.api.HttpRule + * @instance + * @returns {Object.} JSON object + */ + HttpRule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for HttpRule + * @function getTypeUrl + * @memberof google.api.HttpRule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + HttpRule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.HttpRule"; + }; + + return HttpRule; + })(); + + api.CustomHttpPattern = (function() { + + /** + * Properties of a CustomHttpPattern. + * @memberof google.api + * @interface ICustomHttpPattern + * @property {string|null} [kind] CustomHttpPattern kind + * @property {string|null} [path] CustomHttpPattern path + */ + + /** + * Constructs a new CustomHttpPattern. + * @memberof google.api + * @classdesc Represents a CustomHttpPattern. + * @implements ICustomHttpPattern + * @constructor + * @param {google.api.ICustomHttpPattern=} [properties] Properties to set + */ + function CustomHttpPattern(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CustomHttpPattern kind. + * @member {string} kind + * @memberof google.api.CustomHttpPattern + * @instance + */ + CustomHttpPattern.prototype.kind = ""; + + /** + * CustomHttpPattern path. + * @member {string} path + * @memberof google.api.CustomHttpPattern + * @instance + */ + CustomHttpPattern.prototype.path = ""; + + /** + * Creates a new CustomHttpPattern instance using the specified properties. + * @function create + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern=} [properties] Properties to set + * @returns {google.api.CustomHttpPattern} CustomHttpPattern instance + */ + CustomHttpPattern.create = function create(properties) { + return new CustomHttpPattern(properties); + }; + + /** + * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @function encode + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomHttpPattern.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.kind); + if (message.path != null && Object.hasOwnProperty.call(message, "path")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.path); + return writer; + }; + + /** + * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomHttpPattern.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer. + * @function decode + * @memberof google.api.CustomHttpPattern + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomHttpPattern.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CustomHttpPattern(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.kind = reader.string(); + break; + } + case 2: { + message.path = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.CustomHttpPattern + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomHttpPattern.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CustomHttpPattern message. + * @function verify + * @memberof google.api.CustomHttpPattern + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CustomHttpPattern.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.kind != null && message.hasOwnProperty("kind")) + if (!$util.isString(message.kind)) + return "kind: string expected"; + if (message.path != null && message.hasOwnProperty("path")) + if (!$util.isString(message.path)) + return "path: string expected"; + return null; + }; + + /** + * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.CustomHttpPattern + * @static + * @param {Object.} object Plain object + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + */ + CustomHttpPattern.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.CustomHttpPattern) + return object; + var message = new $root.google.api.CustomHttpPattern(); + if (object.kind != null) + message.kind = String(object.kind); + if (object.path != null) + message.path = String(object.path); + return message; + }; + + /** + * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.CustomHttpPattern} message CustomHttpPattern + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CustomHttpPattern.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.kind = ""; + object.path = ""; + } + if (message.kind != null && message.hasOwnProperty("kind")) + object.kind = message.kind; + if (message.path != null && message.hasOwnProperty("path")) + object.path = message.path; + return object; + }; + + /** + * Converts this CustomHttpPattern to JSON. + * @function toJSON + * @memberof google.api.CustomHttpPattern + * @instance + * @returns {Object.} JSON object + */ + CustomHttpPattern.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CustomHttpPattern + * @function getTypeUrl + * @memberof google.api.CustomHttpPattern + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomHttpPattern.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.CustomHttpPattern"; + }; + + return CustomHttpPattern; + })(); + + return api; + })(); + + google.protobuf = (function() { + + /** + * Namespace protobuf. + * @memberof google + * @namespace + */ + var protobuf = {}; + + protobuf.FileDescriptorSet = (function() { + + /** + * Properties of a FileDescriptorSet. + * @memberof google.protobuf + * @interface IFileDescriptorSet + * @property {Array.|null} [file] FileDescriptorSet file + */ + + /** + * Constructs a new FileDescriptorSet. + * @memberof google.protobuf + * @classdesc Represents a FileDescriptorSet. + * @implements IFileDescriptorSet + * @constructor + * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set + */ + function FileDescriptorSet(properties) { + this.file = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileDescriptorSet file. + * @member {Array.} file + * @memberof google.protobuf.FileDescriptorSet + * @instance + */ + FileDescriptorSet.prototype.file = $util.emptyArray; + + /** + * Creates a new FileDescriptorSet instance using the specified properties. + * @function create + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet instance + */ + FileDescriptorSet.create = function create(properties) { + return new FileDescriptorSet(properties); + }; + + /** + * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorSet.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.file != null && message.file.length) + for (var i = 0; i < message.file.length; ++i) + $root.google.protobuf.FileDescriptorProto.encode(message.file[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorSet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorSet.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorSet(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.file && message.file.length)) + message.file = []; + message.file.push($root.google.protobuf.FileDescriptorProto.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorSet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileDescriptorSet message. + * @function verify + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileDescriptorSet.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.file != null && message.hasOwnProperty("file")) { + if (!Array.isArray(message.file)) + return "file: array expected"; + for (var i = 0; i < message.file.length; ++i) { + var error = $root.google.protobuf.FileDescriptorProto.verify(message.file[i]); + if (error) + return "file." + error; + } + } + return null; + }; + + /** + * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + */ + FileDescriptorSet.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileDescriptorSet) + return object; + var message = new $root.google.protobuf.FileDescriptorSet(); + if (object.file) { + if (!Array.isArray(object.file)) + throw TypeError(".google.protobuf.FileDescriptorSet.file: array expected"); + message.file = []; + for (var i = 0; i < object.file.length; ++i) { + if (typeof object.file[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorSet.file: object expected"); + message.file[i] = $root.google.protobuf.FileDescriptorProto.fromObject(object.file[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.FileDescriptorSet} message FileDescriptorSet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileDescriptorSet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.file = []; + if (message.file && message.file.length) { + object.file = []; + for (var j = 0; j < message.file.length; ++j) + object.file[j] = $root.google.protobuf.FileDescriptorProto.toObject(message.file[j], options); + } + return object; + }; + + /** + * Converts this FileDescriptorSet to JSON. + * @function toJSON + * @memberof google.protobuf.FileDescriptorSet + * @instance + * @returns {Object.} JSON object + */ + FileDescriptorSet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FileDescriptorSet + * @function getTypeUrl + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileDescriptorSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileDescriptorSet"; + }; + + return FileDescriptorSet; + })(); + + protobuf.FileDescriptorProto = (function() { + + /** + * Properties of a FileDescriptorProto. + * @memberof google.protobuf + * @interface IFileDescriptorProto + * @property {string|null} [name] FileDescriptorProto name + * @property {string|null} ["package"] FileDescriptorProto package + * @property {Array.|null} [dependency] FileDescriptorProto dependency + * @property {Array.|null} [publicDependency] FileDescriptorProto publicDependency + * @property {Array.|null} [weakDependency] FileDescriptorProto weakDependency + * @property {Array.|null} [messageType] FileDescriptorProto messageType + * @property {Array.|null} [enumType] FileDescriptorProto enumType + * @property {Array.|null} [service] FileDescriptorProto service + * @property {Array.|null} [extension] FileDescriptorProto extension + * @property {google.protobuf.IFileOptions|null} [options] FileDescriptorProto options + * @property {google.protobuf.ISourceCodeInfo|null} [sourceCodeInfo] FileDescriptorProto sourceCodeInfo + * @property {string|null} [syntax] FileDescriptorProto syntax + * @property {string|null} [edition] FileDescriptorProto edition + */ + + /** + * Constructs a new FileDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a FileDescriptorProto. + * @implements IFileDescriptorProto + * @constructor + * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set + */ + function FileDescriptorProto(properties) { + this.dependency = []; + this.publicDependency = []; + this.weakDependency = []; + this.messageType = []; + this.enumType = []; + this.service = []; + this.extension = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.name = ""; + + /** + * FileDescriptorProto package. + * @member {string} package + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype["package"] = ""; + + /** + * FileDescriptorProto dependency. + * @member {Array.} dependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.dependency = $util.emptyArray; + + /** + * FileDescriptorProto publicDependency. + * @member {Array.} publicDependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.publicDependency = $util.emptyArray; + + /** + * FileDescriptorProto weakDependency. + * @member {Array.} weakDependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.weakDependency = $util.emptyArray; + + /** + * FileDescriptorProto messageType. + * @member {Array.} messageType + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.messageType = $util.emptyArray; + + /** + * FileDescriptorProto enumType. + * @member {Array.} enumType + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.enumType = $util.emptyArray; + + /** + * FileDescriptorProto service. + * @member {Array.} service + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.service = $util.emptyArray; + + /** + * FileDescriptorProto extension. + * @member {Array.} extension + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.extension = $util.emptyArray; + + /** + * FileDescriptorProto options. + * @member {google.protobuf.IFileOptions|null|undefined} options + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.options = null; + + /** + * FileDescriptorProto sourceCodeInfo. + * @member {google.protobuf.ISourceCodeInfo|null|undefined} sourceCodeInfo + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.sourceCodeInfo = null; + + /** + * FileDescriptorProto syntax. + * @member {string} syntax + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.syntax = ""; + + /** + * FileDescriptorProto edition. + * @member {string} edition + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.edition = ""; + + /** + * Creates a new FileDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto instance + */ + FileDescriptorProto.create = function create(properties) { + return new FileDescriptorProto(properties); + }; + + /** + * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message["package"] != null && Object.hasOwnProperty.call(message, "package")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message["package"]); + if (message.dependency != null && message.dependency.length) + for (var i = 0; i < message.dependency.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.dependency[i]); + if (message.messageType != null && message.messageType.length) + for (var i = 0; i < message.messageType.length; ++i) + $root.google.protobuf.DescriptorProto.encode(message.messageType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.enumType != null && message.enumType.length) + for (var i = 0; i < message.enumType.length; ++i) + $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.service != null && message.service.length) + for (var i = 0; i < message.service.length; ++i) + $root.google.protobuf.ServiceDescriptorProto.encode(message.service[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.extension != null && message.extension.length) + for (var i = 0; i < message.extension.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.FileOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.sourceCodeInfo != null && Object.hasOwnProperty.call(message, "sourceCodeInfo")) + $root.google.protobuf.SourceCodeInfo.encode(message.sourceCodeInfo, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.publicDependency != null && message.publicDependency.length) + for (var i = 0; i < message.publicDependency.length; ++i) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.publicDependency[i]); + if (message.weakDependency != null && message.weakDependency.length) + for (var i = 0; i < message.weakDependency.length; ++i) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.weakDependency[i]); + if (message.syntax != null && Object.hasOwnProperty.call(message, "syntax")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.syntax); + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) + writer.uint32(/* id 13, wireType 2 =*/106).string(message.edition); + return writer; + }; + + /** + * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message["package"] = reader.string(); + break; + } + case 3: { + if (!(message.dependency && message.dependency.length)) + message.dependency = []; + message.dependency.push(reader.string()); + break; + } + case 10: { + if (!(message.publicDependency && message.publicDependency.length)) + message.publicDependency = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.publicDependency.push(reader.int32()); + } else + message.publicDependency.push(reader.int32()); + break; + } + case 11: { + if (!(message.weakDependency && message.weakDependency.length)) + message.weakDependency = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.weakDependency.push(reader.int32()); + } else + message.weakDependency.push(reader.int32()); + break; + } + case 4: { + if (!(message.messageType && message.messageType.length)) + message.messageType = []; + message.messageType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.enumType && message.enumType.length)) + message.enumType = []; + message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.service && message.service.length)) + message.service = []; + message.service.push($root.google.protobuf.ServiceDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 7: { + if (!(message.extension && message.extension.length)) + message.extension = []; + message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 8: { + message.options = $root.google.protobuf.FileOptions.decode(reader, reader.uint32()); + break; + } + case 9: { + message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.decode(reader, reader.uint32()); + break; + } + case 12: { + message.syntax = reader.string(); + break; + } + case 13: { + message.edition = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileDescriptorProto message. + * @function verify + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message["package"] != null && message.hasOwnProperty("package")) + if (!$util.isString(message["package"])) + return "package: string expected"; + if (message.dependency != null && message.hasOwnProperty("dependency")) { + if (!Array.isArray(message.dependency)) + return "dependency: array expected"; + for (var i = 0; i < message.dependency.length; ++i) + if (!$util.isString(message.dependency[i])) + return "dependency: string[] expected"; + } + if (message.publicDependency != null && message.hasOwnProperty("publicDependency")) { + if (!Array.isArray(message.publicDependency)) + return "publicDependency: array expected"; + for (var i = 0; i < message.publicDependency.length; ++i) + if (!$util.isInteger(message.publicDependency[i])) + return "publicDependency: integer[] expected"; + } + if (message.weakDependency != null && message.hasOwnProperty("weakDependency")) { + if (!Array.isArray(message.weakDependency)) + return "weakDependency: array expected"; + for (var i = 0; i < message.weakDependency.length; ++i) + if (!$util.isInteger(message.weakDependency[i])) + return "weakDependency: integer[] expected"; + } + if (message.messageType != null && message.hasOwnProperty("messageType")) { + if (!Array.isArray(message.messageType)) + return "messageType: array expected"; + for (var i = 0; i < message.messageType.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.verify(message.messageType[i]); + if (error) + return "messageType." + error; + } + } + if (message.enumType != null && message.hasOwnProperty("enumType")) { + if (!Array.isArray(message.enumType)) + return "enumType: array expected"; + for (var i = 0; i < message.enumType.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); + if (error) + return "enumType." + error; + } + } + if (message.service != null && message.hasOwnProperty("service")) { + if (!Array.isArray(message.service)) + return "service: array expected"; + for (var i = 0; i < message.service.length; ++i) { + var error = $root.google.protobuf.ServiceDescriptorProto.verify(message.service[i]); + if (error) + return "service." + error; + } + } + if (message.extension != null && message.hasOwnProperty("extension")) { + if (!Array.isArray(message.extension)) + return "extension: array expected"; + for (var i = 0; i < message.extension.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); + if (error) + return "extension." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.FileOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) { + var error = $root.google.protobuf.SourceCodeInfo.verify(message.sourceCodeInfo); + if (error) + return "sourceCodeInfo." + error; + } + if (message.syntax != null && message.hasOwnProperty("syntax")) + if (!$util.isString(message.syntax)) + return "syntax: string expected"; + if (message.edition != null && message.hasOwnProperty("edition")) + if (!$util.isString(message.edition)) + return "edition: string expected"; + return null; + }; + + /** + * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + */ + FileDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileDescriptorProto) + return object; + var message = new $root.google.protobuf.FileDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object["package"] != null) + message["package"] = String(object["package"]); + if (object.dependency) { + if (!Array.isArray(object.dependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.dependency: array expected"); + message.dependency = []; + for (var i = 0; i < object.dependency.length; ++i) + message.dependency[i] = String(object.dependency[i]); + } + if (object.publicDependency) { + if (!Array.isArray(object.publicDependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.publicDependency: array expected"); + message.publicDependency = []; + for (var i = 0; i < object.publicDependency.length; ++i) + message.publicDependency[i] = object.publicDependency[i] | 0; + } + if (object.weakDependency) { + if (!Array.isArray(object.weakDependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.weakDependency: array expected"); + message.weakDependency = []; + for (var i = 0; i < object.weakDependency.length; ++i) + message.weakDependency[i] = object.weakDependency[i] | 0; + } + if (object.messageType) { + if (!Array.isArray(object.messageType)) + throw TypeError(".google.protobuf.FileDescriptorProto.messageType: array expected"); + message.messageType = []; + for (var i = 0; i < object.messageType.length; ++i) { + if (typeof object.messageType[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.messageType: object expected"); + message.messageType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.messageType[i]); + } + } + if (object.enumType) { + if (!Array.isArray(object.enumType)) + throw TypeError(".google.protobuf.FileDescriptorProto.enumType: array expected"); + message.enumType = []; + for (var i = 0; i < object.enumType.length; ++i) { + if (typeof object.enumType[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.enumType: object expected"); + message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); + } + } + if (object.service) { + if (!Array.isArray(object.service)) + throw TypeError(".google.protobuf.FileDescriptorProto.service: array expected"); + message.service = []; + for (var i = 0; i < object.service.length; ++i) { + if (typeof object.service[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.service: object expected"); + message.service[i] = $root.google.protobuf.ServiceDescriptorProto.fromObject(object.service[i]); + } + } + if (object.extension) { + if (!Array.isArray(object.extension)) + throw TypeError(".google.protobuf.FileDescriptorProto.extension: array expected"); + message.extension = []; + for (var i = 0; i < object.extension.length; ++i) { + if (typeof object.extension[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.extension: object expected"); + message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.FileOptions.fromObject(object.options); + } + if (object.sourceCodeInfo != null) { + if (typeof object.sourceCodeInfo !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.sourceCodeInfo: object expected"); + message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.fromObject(object.sourceCodeInfo); + } + if (object.syntax != null) + message.syntax = String(object.syntax); + if (object.edition != null) + message.edition = String(object.edition); + return message; + }; + + /** + * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.FileDescriptorProto} message FileDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.dependency = []; + object.messageType = []; + object.enumType = []; + object.service = []; + object.extension = []; + object.publicDependency = []; + object.weakDependency = []; + } + if (options.defaults) { + object.name = ""; + object["package"] = ""; + object.options = null; + object.sourceCodeInfo = null; + object.syntax = ""; + object.edition = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message["package"] != null && message.hasOwnProperty("package")) + object["package"] = message["package"]; + if (message.dependency && message.dependency.length) { + object.dependency = []; + for (var j = 0; j < message.dependency.length; ++j) + object.dependency[j] = message.dependency[j]; + } + if (message.messageType && message.messageType.length) { + object.messageType = []; + for (var j = 0; j < message.messageType.length; ++j) + object.messageType[j] = $root.google.protobuf.DescriptorProto.toObject(message.messageType[j], options); + } + if (message.enumType && message.enumType.length) { + object.enumType = []; + for (var j = 0; j < message.enumType.length; ++j) + object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); + } + if (message.service && message.service.length) { + object.service = []; + for (var j = 0; j < message.service.length; ++j) + object.service[j] = $root.google.protobuf.ServiceDescriptorProto.toObject(message.service[j], options); + } + if (message.extension && message.extension.length) { + object.extension = []; + for (var j = 0; j < message.extension.length; ++j) + object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.FileOptions.toObject(message.options, options); + if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) + object.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.toObject(message.sourceCodeInfo, options); + if (message.publicDependency && message.publicDependency.length) { + object.publicDependency = []; + for (var j = 0; j < message.publicDependency.length; ++j) + object.publicDependency[j] = message.publicDependency[j]; + } + if (message.weakDependency && message.weakDependency.length) { + object.weakDependency = []; + for (var j = 0; j < message.weakDependency.length; ++j) + object.weakDependency[j] = message.weakDependency[j]; + } + if (message.syntax != null && message.hasOwnProperty("syntax")) + object.syntax = message.syntax; + if (message.edition != null && message.hasOwnProperty("edition")) + object.edition = message.edition; + return object; + }; + + /** + * Converts this FileDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.FileDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + FileDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FileDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileDescriptorProto"; + }; + + return FileDescriptorProto; + })(); + + protobuf.DescriptorProto = (function() { + + /** + * Properties of a DescriptorProto. + * @memberof google.protobuf + * @interface IDescriptorProto + * @property {string|null} [name] DescriptorProto name + * @property {Array.|null} [field] DescriptorProto field + * @property {Array.|null} [extension] DescriptorProto extension + * @property {Array.|null} [nestedType] DescriptorProto nestedType + * @property {Array.|null} [enumType] DescriptorProto enumType + * @property {Array.|null} [extensionRange] DescriptorProto extensionRange + * @property {Array.|null} [oneofDecl] DescriptorProto oneofDecl + * @property {google.protobuf.IMessageOptions|null} [options] DescriptorProto options + * @property {Array.|null} [reservedRange] DescriptorProto reservedRange + * @property {Array.|null} [reservedName] DescriptorProto reservedName + */ + + /** + * Constructs a new DescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a DescriptorProto. + * @implements IDescriptorProto + * @constructor + * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set + */ + function DescriptorProto(properties) { + this.field = []; + this.extension = []; + this.nestedType = []; + this.enumType = []; + this.extensionRange = []; + this.oneofDecl = []; + this.reservedRange = []; + this.reservedName = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DescriptorProto name. + * @member {string} name + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.name = ""; + + /** + * DescriptorProto field. + * @member {Array.} field + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.field = $util.emptyArray; + + /** + * DescriptorProto extension. + * @member {Array.} extension + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.extension = $util.emptyArray; + + /** + * DescriptorProto nestedType. + * @member {Array.} nestedType + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.nestedType = $util.emptyArray; + + /** + * DescriptorProto enumType. + * @member {Array.} enumType + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.enumType = $util.emptyArray; + + /** + * DescriptorProto extensionRange. + * @member {Array.} extensionRange + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.extensionRange = $util.emptyArray; + + /** + * DescriptorProto oneofDecl. + * @member {Array.} oneofDecl + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.oneofDecl = $util.emptyArray; + + /** + * DescriptorProto options. + * @member {google.protobuf.IMessageOptions|null|undefined} options + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.options = null; + + /** + * DescriptorProto reservedRange. + * @member {Array.} reservedRange + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.reservedRange = $util.emptyArray; + + /** + * DescriptorProto reservedName. + * @member {Array.} reservedName + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.reservedName = $util.emptyArray; + + /** + * Creates a new DescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto} DescriptorProto instance + */ + DescriptorProto.create = function create(properties) { + return new DescriptorProto(properties); + }; + + /** + * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.field != null && message.field.length) + for (var i = 0; i < message.field.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.field[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.nestedType != null && message.nestedType.length) + for (var i = 0; i < message.nestedType.length; ++i) + $root.google.protobuf.DescriptorProto.encode(message.nestedType[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.enumType != null && message.enumType.length) + for (var i = 0; i < message.enumType.length; ++i) + $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.extensionRange != null && message.extensionRange.length) + for (var i = 0; i < message.extensionRange.length; ++i) + $root.google.protobuf.DescriptorProto.ExtensionRange.encode(message.extensionRange[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.extension != null && message.extension.length) + for (var i = 0; i < message.extension.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.MessageOptions.encode(message.options, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.oneofDecl != null && message.oneofDecl.length) + for (var i = 0; i < message.oneofDecl.length; ++i) + $root.google.protobuf.OneofDescriptorProto.encode(message.oneofDecl[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.reservedRange != null && message.reservedRange.length) + for (var i = 0; i < message.reservedRange.length; ++i) + $root.google.protobuf.DescriptorProto.ReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.reservedName != null && message.reservedName.length) + for (var i = 0; i < message.reservedName.length; ++i) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.reservedName[i]); + return writer; + }; + + /** + * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto} DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.field && message.field.length)) + message.field = []; + message.field.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.extension && message.extension.length)) + message.extension = []; + message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.nestedType && message.nestedType.length)) + message.nestedType = []; + message.nestedType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); + break; + } + case 4: { + if (!(message.enumType && message.enumType.length)) + message.enumType = []; + message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.extensionRange && message.extensionRange.length)) + message.extensionRange = []; + message.extensionRange.push($root.google.protobuf.DescriptorProto.ExtensionRange.decode(reader, reader.uint32())); + break; + } + case 8: { + if (!(message.oneofDecl && message.oneofDecl.length)) + message.oneofDecl = []; + message.oneofDecl.push($root.google.protobuf.OneofDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 7: { + message.options = $root.google.protobuf.MessageOptions.decode(reader, reader.uint32()); + break; + } + case 9: { + if (!(message.reservedRange && message.reservedRange.length)) + message.reservedRange = []; + message.reservedRange.push($root.google.protobuf.DescriptorProto.ReservedRange.decode(reader, reader.uint32())); + break; + } + case 10: { + if (!(message.reservedName && message.reservedName.length)) + message.reservedName = []; + message.reservedName.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto} DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DescriptorProto message. + * @function verify + * @memberof google.protobuf.DescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.field != null && message.hasOwnProperty("field")) { + if (!Array.isArray(message.field)) + return "field: array expected"; + for (var i = 0; i < message.field.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.field[i]); + if (error) + return "field." + error; + } + } + if (message.extension != null && message.hasOwnProperty("extension")) { + if (!Array.isArray(message.extension)) + return "extension: array expected"; + for (var i = 0; i < message.extension.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); + if (error) + return "extension." + error; + } + } + if (message.nestedType != null && message.hasOwnProperty("nestedType")) { + if (!Array.isArray(message.nestedType)) + return "nestedType: array expected"; + for (var i = 0; i < message.nestedType.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.verify(message.nestedType[i]); + if (error) + return "nestedType." + error; + } + } + if (message.enumType != null && message.hasOwnProperty("enumType")) { + if (!Array.isArray(message.enumType)) + return "enumType: array expected"; + for (var i = 0; i < message.enumType.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); + if (error) + return "enumType." + error; + } + } + if (message.extensionRange != null && message.hasOwnProperty("extensionRange")) { + if (!Array.isArray(message.extensionRange)) + return "extensionRange: array expected"; + for (var i = 0; i < message.extensionRange.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.ExtensionRange.verify(message.extensionRange[i]); + if (error) + return "extensionRange." + error; + } + } + if (message.oneofDecl != null && message.hasOwnProperty("oneofDecl")) { + if (!Array.isArray(message.oneofDecl)) + return "oneofDecl: array expected"; + for (var i = 0; i < message.oneofDecl.length; ++i) { + var error = $root.google.protobuf.OneofDescriptorProto.verify(message.oneofDecl[i]); + if (error) + return "oneofDecl." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.MessageOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { + if (!Array.isArray(message.reservedRange)) + return "reservedRange: array expected"; + for (var i = 0; i < message.reservedRange.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.ReservedRange.verify(message.reservedRange[i]); + if (error) + return "reservedRange." + error; + } + } + if (message.reservedName != null && message.hasOwnProperty("reservedName")) { + if (!Array.isArray(message.reservedName)) + return "reservedName: array expected"; + for (var i = 0; i < message.reservedName.length; ++i) + if (!$util.isString(message.reservedName[i])) + return "reservedName: string[] expected"; + } + return null; + }; + + /** + * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto} DescriptorProto + */ + DescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto) + return object; + var message = new $root.google.protobuf.DescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.field) { + if (!Array.isArray(object.field)) + throw TypeError(".google.protobuf.DescriptorProto.field: array expected"); + message.field = []; + for (var i = 0; i < object.field.length; ++i) { + if (typeof object.field[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.field: object expected"); + message.field[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.field[i]); + } + } + if (object.extension) { + if (!Array.isArray(object.extension)) + throw TypeError(".google.protobuf.DescriptorProto.extension: array expected"); + message.extension = []; + for (var i = 0; i < object.extension.length; ++i) { + if (typeof object.extension[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.extension: object expected"); + message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); + } + } + if (object.nestedType) { + if (!Array.isArray(object.nestedType)) + throw TypeError(".google.protobuf.DescriptorProto.nestedType: array expected"); + message.nestedType = []; + for (var i = 0; i < object.nestedType.length; ++i) { + if (typeof object.nestedType[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.nestedType: object expected"); + message.nestedType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.nestedType[i]); + } + } + if (object.enumType) { + if (!Array.isArray(object.enumType)) + throw TypeError(".google.protobuf.DescriptorProto.enumType: array expected"); + message.enumType = []; + for (var i = 0; i < object.enumType.length; ++i) { + if (typeof object.enumType[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.enumType: object expected"); + message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); + } + } + if (object.extensionRange) { + if (!Array.isArray(object.extensionRange)) + throw TypeError(".google.protobuf.DescriptorProto.extensionRange: array expected"); + message.extensionRange = []; + for (var i = 0; i < object.extensionRange.length; ++i) { + if (typeof object.extensionRange[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.extensionRange: object expected"); + message.extensionRange[i] = $root.google.protobuf.DescriptorProto.ExtensionRange.fromObject(object.extensionRange[i]); + } + } + if (object.oneofDecl) { + if (!Array.isArray(object.oneofDecl)) + throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: array expected"); + message.oneofDecl = []; + for (var i = 0; i < object.oneofDecl.length; ++i) { + if (typeof object.oneofDecl[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: object expected"); + message.oneofDecl[i] = $root.google.protobuf.OneofDescriptorProto.fromObject(object.oneofDecl[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.DescriptorProto.options: object expected"); + message.options = $root.google.protobuf.MessageOptions.fromObject(object.options); + } + if (object.reservedRange) { + if (!Array.isArray(object.reservedRange)) + throw TypeError(".google.protobuf.DescriptorProto.reservedRange: array expected"); + message.reservedRange = []; + for (var i = 0; i < object.reservedRange.length; ++i) { + if (typeof object.reservedRange[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.reservedRange: object expected"); + message.reservedRange[i] = $root.google.protobuf.DescriptorProto.ReservedRange.fromObject(object.reservedRange[i]); + } + } + if (object.reservedName) { + if (!Array.isArray(object.reservedName)) + throw TypeError(".google.protobuf.DescriptorProto.reservedName: array expected"); + message.reservedName = []; + for (var i = 0; i < object.reservedName.length; ++i) + message.reservedName[i] = String(object.reservedName[i]); + } + return message; + }; + + /** + * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.DescriptorProto} message DescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.field = []; + object.nestedType = []; + object.enumType = []; + object.extensionRange = []; + object.extension = []; + object.oneofDecl = []; + object.reservedRange = []; + object.reservedName = []; + } + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.field && message.field.length) { + object.field = []; + for (var j = 0; j < message.field.length; ++j) + object.field[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.field[j], options); + } + if (message.nestedType && message.nestedType.length) { + object.nestedType = []; + for (var j = 0; j < message.nestedType.length; ++j) + object.nestedType[j] = $root.google.protobuf.DescriptorProto.toObject(message.nestedType[j], options); + } + if (message.enumType && message.enumType.length) { + object.enumType = []; + for (var j = 0; j < message.enumType.length; ++j) + object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); + } + if (message.extensionRange && message.extensionRange.length) { + object.extensionRange = []; + for (var j = 0; j < message.extensionRange.length; ++j) + object.extensionRange[j] = $root.google.protobuf.DescriptorProto.ExtensionRange.toObject(message.extensionRange[j], options); + } + if (message.extension && message.extension.length) { + object.extension = []; + for (var j = 0; j < message.extension.length; ++j) + object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.MessageOptions.toObject(message.options, options); + if (message.oneofDecl && message.oneofDecl.length) { + object.oneofDecl = []; + for (var j = 0; j < message.oneofDecl.length; ++j) + object.oneofDecl[j] = $root.google.protobuf.OneofDescriptorProto.toObject(message.oneofDecl[j], options); + } + if (message.reservedRange && message.reservedRange.length) { + object.reservedRange = []; + for (var j = 0; j < message.reservedRange.length; ++j) + object.reservedRange[j] = $root.google.protobuf.DescriptorProto.ReservedRange.toObject(message.reservedRange[j], options); + } + if (message.reservedName && message.reservedName.length) { + object.reservedName = []; + for (var j = 0; j < message.reservedName.length; ++j) + object.reservedName[j] = message.reservedName[j]; + } + return object; + }; + + /** + * Converts this DescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto + * @instance + * @returns {Object.} JSON object + */ + DescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto"; + }; + + DescriptorProto.ExtensionRange = (function() { + + /** + * Properties of an ExtensionRange. + * @memberof google.protobuf.DescriptorProto + * @interface IExtensionRange + * @property {number|null} [start] ExtensionRange start + * @property {number|null} [end] ExtensionRange end + * @property {google.protobuf.IExtensionRangeOptions|null} [options] ExtensionRange options + */ + + /** + * Constructs a new ExtensionRange. + * @memberof google.protobuf.DescriptorProto + * @classdesc Represents an ExtensionRange. + * @implements IExtensionRange + * @constructor + * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set + */ + function ExtensionRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExtensionRange start. + * @member {number} start + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.start = 0; + + /** + * ExtensionRange end. + * @member {number} end + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.end = 0; + + /** + * ExtensionRange options. + * @member {google.protobuf.IExtensionRangeOptions|null|undefined} options + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.options = null; + + /** + * Creates a new ExtensionRange instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange instance + */ + ExtensionRange.create = function create(properties) { + return new ExtensionRange(properties); + }; + + /** + * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.ExtensionRangeOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRange.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.start = reader.int32(); + break; + } + case 2: { + message.end = reader.int32(); + break; + } + case 3: { + message.options = $root.google.protobuf.ExtensionRangeOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExtensionRange message. + * @function verify + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExtensionRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.ExtensionRangeOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + */ + ExtensionRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto.ExtensionRange) + return object; + var message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.DescriptorProto.ExtensionRange.options: object expected"); + message.options = $root.google.protobuf.ExtensionRangeOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.ExtensionRange} message ExtensionRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExtensionRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + object.options = null; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.ExtensionRangeOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this ExtensionRange to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + * @returns {Object.} JSON object + */ + ExtensionRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExtensionRange + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExtensionRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto.ExtensionRange"; + }; + + return ExtensionRange; + })(); + + DescriptorProto.ReservedRange = (function() { + + /** + * Properties of a ReservedRange. + * @memberof google.protobuf.DescriptorProto + * @interface IReservedRange + * @property {number|null} [start] ReservedRange start + * @property {number|null} [end] ReservedRange end + */ + + /** + * Constructs a new ReservedRange. + * @memberof google.protobuf.DescriptorProto + * @classdesc Represents a ReservedRange. + * @implements IReservedRange + * @constructor + * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set + */ + function ReservedRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReservedRange start. + * @member {number} start + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + */ + ReservedRange.prototype.start = 0; + + /** + * ReservedRange end. + * @member {number} end + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + */ + ReservedRange.prototype.end = 0; + + /** + * Creates a new ReservedRange instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange instance + */ + ReservedRange.create = function create(properties) { + return new ReservedRange(properties); + }; + + /** + * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReservedRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + return writer; + }; + + /** + * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReservedRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReservedRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReservedRange.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ReservedRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.start = reader.int32(); + break; + } + case 2: { + message.end = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReservedRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReservedRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReservedRange message. + * @function verify + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReservedRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + return null; + }; + + /** + * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + */ + ReservedRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto.ReservedRange) + return object; + var message = new $root.google.protobuf.DescriptorProto.ReservedRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + return message; + }; + + /** + * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.ReservedRange} message ReservedRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReservedRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + return object; + }; + + /** + * Converts this ReservedRange to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + * @returns {Object.} JSON object + */ + ReservedRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReservedRange + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReservedRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto.ReservedRange"; + }; + + return ReservedRange; + })(); + + return DescriptorProto; + })(); + + protobuf.ExtensionRangeOptions = (function() { + + /** + * Properties of an ExtensionRangeOptions. + * @memberof google.protobuf + * @interface IExtensionRangeOptions + * @property {Array.|null} [uninterpretedOption] ExtensionRangeOptions uninterpretedOption + */ + + /** + * Constructs a new ExtensionRangeOptions. + * @memberof google.protobuf + * @classdesc Represents an ExtensionRangeOptions. + * @implements IExtensionRangeOptions + * @constructor + * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set + */ + function ExtensionRangeOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExtensionRangeOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new ExtensionRangeOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions instance + */ + ExtensionRangeOptions.create = function create(properties) { + return new ExtensionRangeOptions(properties); + }; + + /** + * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRangeOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRangeOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRangeOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ExtensionRangeOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRangeOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExtensionRangeOptions message. + * @function verify + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExtensionRangeOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + */ + ExtensionRangeOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ExtensionRangeOptions) + return object; + var message = new $root.google.protobuf.ExtensionRangeOptions(); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.ExtensionRangeOptions} message ExtensionRangeOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExtensionRangeOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this ExtensionRangeOptions to JSON. + * @function toJSON + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + * @returns {Object.} JSON object + */ + ExtensionRangeOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExtensionRangeOptions + * @function getTypeUrl + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExtensionRangeOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ExtensionRangeOptions"; + }; + + return ExtensionRangeOptions; + })(); + + protobuf.FieldDescriptorProto = (function() { + + /** + * Properties of a FieldDescriptorProto. + * @memberof google.protobuf + * @interface IFieldDescriptorProto + * @property {string|null} [name] FieldDescriptorProto name + * @property {number|null} [number] FieldDescriptorProto number + * @property {google.protobuf.FieldDescriptorProto.Label|null} [label] FieldDescriptorProto label + * @property {google.protobuf.FieldDescriptorProto.Type|null} [type] FieldDescriptorProto type + * @property {string|null} [typeName] FieldDescriptorProto typeName + * @property {string|null} [extendee] FieldDescriptorProto extendee + * @property {string|null} [defaultValue] FieldDescriptorProto defaultValue + * @property {number|null} [oneofIndex] FieldDescriptorProto oneofIndex + * @property {string|null} [jsonName] FieldDescriptorProto jsonName + * @property {google.protobuf.IFieldOptions|null} [options] FieldDescriptorProto options + * @property {boolean|null} [proto3Optional] FieldDescriptorProto proto3Optional + */ + + /** + * Constructs a new FieldDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a FieldDescriptorProto. + * @implements IFieldDescriptorProto + * @constructor + * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set + */ + function FieldDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.name = ""; + + /** + * FieldDescriptorProto number. + * @member {number} number + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.number = 0; + + /** + * FieldDescriptorProto label. + * @member {google.protobuf.FieldDescriptorProto.Label} label + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.label = 1; + + /** + * FieldDescriptorProto type. + * @member {google.protobuf.FieldDescriptorProto.Type} type + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.type = 1; + + /** + * FieldDescriptorProto typeName. + * @member {string} typeName + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.typeName = ""; + + /** + * FieldDescriptorProto extendee. + * @member {string} extendee + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.extendee = ""; + + /** + * FieldDescriptorProto defaultValue. + * @member {string} defaultValue + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.defaultValue = ""; + + /** + * FieldDescriptorProto oneofIndex. + * @member {number} oneofIndex + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.oneofIndex = 0; + + /** + * FieldDescriptorProto jsonName. + * @member {string} jsonName + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.jsonName = ""; + + /** + * FieldDescriptorProto options. + * @member {google.protobuf.IFieldOptions|null|undefined} options + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.options = null; + + /** + * FieldDescriptorProto proto3Optional. + * @member {boolean} proto3Optional + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.proto3Optional = false; + + /** + * Creates a new FieldDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto instance + */ + FieldDescriptorProto.create = function create(properties) { + return new FieldDescriptorProto(properties); + }; + + /** + * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.extendee != null && Object.hasOwnProperty.call(message, "extendee")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.extendee); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.number); + if (message.label != null && Object.hasOwnProperty.call(message, "label")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.label); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.type); + if (message.typeName != null && Object.hasOwnProperty.call(message, "typeName")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.typeName); + if (message.defaultValue != null && Object.hasOwnProperty.call(message, "defaultValue")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.defaultValue); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.FieldOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.oneofIndex != null && Object.hasOwnProperty.call(message, "oneofIndex")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.oneofIndex); + if (message.jsonName != null && Object.hasOwnProperty.call(message, "jsonName")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.jsonName); + if (message.proto3Optional != null && Object.hasOwnProperty.call(message, "proto3Optional")) + writer.uint32(/* id 17, wireType 0 =*/136).bool(message.proto3Optional); + return writer; + }; + + /** + * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 3: { + message.number = reader.int32(); + break; + } + case 4: { + message.label = reader.int32(); + break; + } + case 5: { + message.type = reader.int32(); + break; + } + case 6: { + message.typeName = reader.string(); + break; + } + case 2: { + message.extendee = reader.string(); + break; + } + case 7: { + message.defaultValue = reader.string(); + break; + } + case 9: { + message.oneofIndex = reader.int32(); + break; + } + case 10: { + message.jsonName = reader.string(); + break; + } + case 8: { + message.options = $root.google.protobuf.FieldOptions.decode(reader, reader.uint32()); + break; + } + case 17: { + message.proto3Optional = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldDescriptorProto message. + * @function verify + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.label != null && message.hasOwnProperty("label")) + switch (message.label) { + default: + return "label: enum value expected"; + case 1: + case 2: + case 3: + break; + } + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + case 17: + case 18: + break; + } + if (message.typeName != null && message.hasOwnProperty("typeName")) + if (!$util.isString(message.typeName)) + return "typeName: string expected"; + if (message.extendee != null && message.hasOwnProperty("extendee")) + if (!$util.isString(message.extendee)) + return "extendee: string expected"; + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + if (!$util.isString(message.defaultValue)) + return "defaultValue: string expected"; + if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) + if (!$util.isInteger(message.oneofIndex)) + return "oneofIndex: integer expected"; + if (message.jsonName != null && message.hasOwnProperty("jsonName")) + if (!$util.isString(message.jsonName)) + return "jsonName: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.FieldOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) + if (typeof message.proto3Optional !== "boolean") + return "proto3Optional: boolean expected"; + return null; + }; + + /** + * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + */ + FieldDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldDescriptorProto) + return object; + var message = new $root.google.protobuf.FieldDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.number != null) + message.number = object.number | 0; + switch (object.label) { + default: + if (typeof object.label === "number") { + message.label = object.label; + break; + } + break; + case "LABEL_OPTIONAL": + case 1: + message.label = 1; + break; + case "LABEL_REQUIRED": + case 2: + message.label = 2; + break; + case "LABEL_REPEATED": + case 3: + message.label = 3; + break; + } + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "TYPE_DOUBLE": + case 1: + message.type = 1; + break; + case "TYPE_FLOAT": + case 2: + message.type = 2; + break; + case "TYPE_INT64": + case 3: + message.type = 3; + break; + case "TYPE_UINT64": + case 4: + message.type = 4; + break; + case "TYPE_INT32": + case 5: + message.type = 5; + break; + case "TYPE_FIXED64": + case 6: + message.type = 6; + break; + case "TYPE_FIXED32": + case 7: + message.type = 7; + break; + case "TYPE_BOOL": + case 8: + message.type = 8; + break; + case "TYPE_STRING": + case 9: + message.type = 9; + break; + case "TYPE_GROUP": + case 10: + message.type = 10; + break; + case "TYPE_MESSAGE": + case 11: + message.type = 11; + break; + case "TYPE_BYTES": + case 12: + message.type = 12; + break; + case "TYPE_UINT32": + case 13: + message.type = 13; + break; + case "TYPE_ENUM": + case 14: + message.type = 14; + break; + case "TYPE_SFIXED32": + case 15: + message.type = 15; + break; + case "TYPE_SFIXED64": + case 16: + message.type = 16; + break; + case "TYPE_SINT32": + case 17: + message.type = 17; + break; + case "TYPE_SINT64": + case 18: + message.type = 18; + break; + } + if (object.typeName != null) + message.typeName = String(object.typeName); + if (object.extendee != null) + message.extendee = String(object.extendee); + if (object.defaultValue != null) + message.defaultValue = String(object.defaultValue); + if (object.oneofIndex != null) + message.oneofIndex = object.oneofIndex | 0; + if (object.jsonName != null) + message.jsonName = String(object.jsonName); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.FieldDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.FieldOptions.fromObject(object.options); + } + if (object.proto3Optional != null) + message.proto3Optional = Boolean(object.proto3Optional); + return message; + }; + + /** + * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.FieldDescriptorProto} message FieldDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.extendee = ""; + object.number = 0; + object.label = options.enums === String ? "LABEL_OPTIONAL" : 1; + object.type = options.enums === String ? "TYPE_DOUBLE" : 1; + object.typeName = ""; + object.defaultValue = ""; + object.options = null; + object.oneofIndex = 0; + object.jsonName = ""; + object.proto3Optional = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.extendee != null && message.hasOwnProperty("extendee")) + object.extendee = message.extendee; + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.label != null && message.hasOwnProperty("label")) + object.label = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Label[message.label] === undefined ? message.label : $root.google.protobuf.FieldDescriptorProto.Label[message.label] : message.label; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Type[message.type] === undefined ? message.type : $root.google.protobuf.FieldDescriptorProto.Type[message.type] : message.type; + if (message.typeName != null && message.hasOwnProperty("typeName")) + object.typeName = message.typeName; + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + object.defaultValue = message.defaultValue; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.FieldOptions.toObject(message.options, options); + if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) + object.oneofIndex = message.oneofIndex; + if (message.jsonName != null && message.hasOwnProperty("jsonName")) + object.jsonName = message.jsonName; + if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) + object.proto3Optional = message.proto3Optional; + return object; + }; + + /** + * Converts this FieldDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.FieldDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + FieldDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldDescriptorProto"; + }; + + /** + * Type enum. + * @name google.protobuf.FieldDescriptorProto.Type + * @enum {number} + * @property {number} TYPE_DOUBLE=1 TYPE_DOUBLE value + * @property {number} TYPE_FLOAT=2 TYPE_FLOAT value + * @property {number} TYPE_INT64=3 TYPE_INT64 value + * @property {number} TYPE_UINT64=4 TYPE_UINT64 value + * @property {number} TYPE_INT32=5 TYPE_INT32 value + * @property {number} TYPE_FIXED64=6 TYPE_FIXED64 value + * @property {number} TYPE_FIXED32=7 TYPE_FIXED32 value + * @property {number} TYPE_BOOL=8 TYPE_BOOL value + * @property {number} TYPE_STRING=9 TYPE_STRING value + * @property {number} TYPE_GROUP=10 TYPE_GROUP value + * @property {number} TYPE_MESSAGE=11 TYPE_MESSAGE value + * @property {number} TYPE_BYTES=12 TYPE_BYTES value + * @property {number} TYPE_UINT32=13 TYPE_UINT32 value + * @property {number} TYPE_ENUM=14 TYPE_ENUM value + * @property {number} TYPE_SFIXED32=15 TYPE_SFIXED32 value + * @property {number} TYPE_SFIXED64=16 TYPE_SFIXED64 value + * @property {number} TYPE_SINT32=17 TYPE_SINT32 value + * @property {number} TYPE_SINT64=18 TYPE_SINT64 value + */ + FieldDescriptorProto.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "TYPE_DOUBLE"] = 1; + values[valuesById[2] = "TYPE_FLOAT"] = 2; + values[valuesById[3] = "TYPE_INT64"] = 3; + values[valuesById[4] = "TYPE_UINT64"] = 4; + values[valuesById[5] = "TYPE_INT32"] = 5; + values[valuesById[6] = "TYPE_FIXED64"] = 6; + values[valuesById[7] = "TYPE_FIXED32"] = 7; + values[valuesById[8] = "TYPE_BOOL"] = 8; + values[valuesById[9] = "TYPE_STRING"] = 9; + values[valuesById[10] = "TYPE_GROUP"] = 10; + values[valuesById[11] = "TYPE_MESSAGE"] = 11; + values[valuesById[12] = "TYPE_BYTES"] = 12; + values[valuesById[13] = "TYPE_UINT32"] = 13; + values[valuesById[14] = "TYPE_ENUM"] = 14; + values[valuesById[15] = "TYPE_SFIXED32"] = 15; + values[valuesById[16] = "TYPE_SFIXED64"] = 16; + values[valuesById[17] = "TYPE_SINT32"] = 17; + values[valuesById[18] = "TYPE_SINT64"] = 18; + return values; + })(); + + /** + * Label enum. + * @name google.protobuf.FieldDescriptorProto.Label + * @enum {number} + * @property {number} LABEL_OPTIONAL=1 LABEL_OPTIONAL value + * @property {number} LABEL_REQUIRED=2 LABEL_REQUIRED value + * @property {number} LABEL_REPEATED=3 LABEL_REPEATED value + */ + FieldDescriptorProto.Label = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "LABEL_OPTIONAL"] = 1; + values[valuesById[2] = "LABEL_REQUIRED"] = 2; + values[valuesById[3] = "LABEL_REPEATED"] = 3; + return values; + })(); + + return FieldDescriptorProto; + })(); + + protobuf.OneofDescriptorProto = (function() { + + /** + * Properties of an OneofDescriptorProto. + * @memberof google.protobuf + * @interface IOneofDescriptorProto + * @property {string|null} [name] OneofDescriptorProto name + * @property {google.protobuf.IOneofOptions|null} [options] OneofDescriptorProto options + */ + + /** + * Constructs a new OneofDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an OneofDescriptorProto. + * @implements IOneofDescriptorProto + * @constructor + * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set + */ + function OneofDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OneofDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.OneofDescriptorProto + * @instance + */ + OneofDescriptorProto.prototype.name = ""; + + /** + * OneofDescriptorProto options. + * @member {google.protobuf.IOneofOptions|null|undefined} options + * @memberof google.protobuf.OneofDescriptorProto + * @instance + */ + OneofDescriptorProto.prototype.options = null; + + /** + * Creates a new OneofDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto instance + */ + OneofDescriptorProto.create = function create(properties) { + return new OneofDescriptorProto(properties); + }; + + /** + * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.OneofOptions.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.options = $root.google.protobuf.OneofOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OneofDescriptorProto message. + * @function verify + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OneofDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.OneofOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + */ + OneofDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.OneofDescriptorProto) + return object; + var message = new $root.google.protobuf.OneofDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.OneofDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.OneofOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.OneofDescriptorProto} message OneofDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OneofDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.OneofOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this OneofDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.OneofDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + OneofDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OneofDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OneofDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.OneofDescriptorProto"; + }; + + return OneofDescriptorProto; + })(); + + protobuf.EnumDescriptorProto = (function() { + + /** + * Properties of an EnumDescriptorProto. + * @memberof google.protobuf + * @interface IEnumDescriptorProto + * @property {string|null} [name] EnumDescriptorProto name + * @property {Array.|null} [value] EnumDescriptorProto value + * @property {google.protobuf.IEnumOptions|null} [options] EnumDescriptorProto options + * @property {Array.|null} [reservedRange] EnumDescriptorProto reservedRange + * @property {Array.|null} [reservedName] EnumDescriptorProto reservedName + */ + + /** + * Constructs a new EnumDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an EnumDescriptorProto. + * @implements IEnumDescriptorProto + * @constructor + * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set + */ + function EnumDescriptorProto(properties) { + this.value = []; + this.reservedRange = []; + this.reservedName = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.name = ""; + + /** + * EnumDescriptorProto value. + * @member {Array.} value + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.value = $util.emptyArray; + + /** + * EnumDescriptorProto options. + * @member {google.protobuf.IEnumOptions|null|undefined} options + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.options = null; + + /** + * EnumDescriptorProto reservedRange. + * @member {Array.} reservedRange + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.reservedRange = $util.emptyArray; + + /** + * EnumDescriptorProto reservedName. + * @member {Array.} reservedName + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.reservedName = $util.emptyArray; + + /** + * Creates a new EnumDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto instance + */ + EnumDescriptorProto.create = function create(properties) { + return new EnumDescriptorProto(properties); + }; + + /** + * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.value != null && message.value.length) + for (var i = 0; i < message.value.length; ++i) + $root.google.protobuf.EnumValueDescriptorProto.encode(message.value[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.EnumOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.reservedRange != null && message.reservedRange.length) + for (var i = 0; i < message.reservedRange.length; ++i) + $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.reservedName != null && message.reservedName.length) + for (var i = 0; i < message.reservedName.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.reservedName[i]); + return writer; + }; + + /** + * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.value && message.value.length)) + message.value = []; + message.value.push($root.google.protobuf.EnumValueDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 3: { + message.options = $root.google.protobuf.EnumOptions.decode(reader, reader.uint32()); + break; + } + case 4: { + if (!(message.reservedRange && message.reservedRange.length)) + message.reservedRange = []; + message.reservedRange.push($root.google.protobuf.EnumDescriptorProto.EnumReservedRange.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.reservedName && message.reservedName.length)) + message.reservedName = []; + message.reservedName.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumDescriptorProto message. + * @function verify + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.value != null && message.hasOwnProperty("value")) { + if (!Array.isArray(message.value)) + return "value: array expected"; + for (var i = 0; i < message.value.length; ++i) { + var error = $root.google.protobuf.EnumValueDescriptorProto.verify(message.value[i]); + if (error) + return "value." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.EnumOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { + if (!Array.isArray(message.reservedRange)) + return "reservedRange: array expected"; + for (var i = 0; i < message.reservedRange.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.verify(message.reservedRange[i]); + if (error) + return "reservedRange." + error; + } + } + if (message.reservedName != null && message.hasOwnProperty("reservedName")) { + if (!Array.isArray(message.reservedName)) + return "reservedName: array expected"; + for (var i = 0; i < message.reservedName.length; ++i) + if (!$util.isString(message.reservedName[i])) + return "reservedName: string[] expected"; + } + return null; + }; + + /** + * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + */ + EnumDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumDescriptorProto) + return object; + var message = new $root.google.protobuf.EnumDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.value) { + if (!Array.isArray(object.value)) + throw TypeError(".google.protobuf.EnumDescriptorProto.value: array expected"); + message.value = []; + for (var i = 0; i < object.value.length; ++i) { + if (typeof object.value[i] !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.value: object expected"); + message.value[i] = $root.google.protobuf.EnumValueDescriptorProto.fromObject(object.value[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.EnumOptions.fromObject(object.options); + } + if (object.reservedRange) { + if (!Array.isArray(object.reservedRange)) + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: array expected"); + message.reservedRange = []; + for (var i = 0; i < object.reservedRange.length; ++i) { + if (typeof object.reservedRange[i] !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: object expected"); + message.reservedRange[i] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.fromObject(object.reservedRange[i]); + } + } + if (object.reservedName) { + if (!Array.isArray(object.reservedName)) + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedName: array expected"); + message.reservedName = []; + for (var i = 0; i < object.reservedName.length; ++i) + message.reservedName[i] = String(object.reservedName[i]); + } + return message; + }; + + /** + * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.EnumDescriptorProto} message EnumDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.value = []; + object.reservedRange = []; + object.reservedName = []; + } + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.value && message.value.length) { + object.value = []; + for (var j = 0; j < message.value.length; ++j) + object.value[j] = $root.google.protobuf.EnumValueDescriptorProto.toObject(message.value[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.EnumOptions.toObject(message.options, options); + if (message.reservedRange && message.reservedRange.length) { + object.reservedRange = []; + for (var j = 0; j < message.reservedRange.length; ++j) + object.reservedRange[j] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.toObject(message.reservedRange[j], options); + } + if (message.reservedName && message.reservedName.length) { + object.reservedName = []; + for (var j = 0; j < message.reservedName.length; ++j) + object.reservedName[j] = message.reservedName[j]; + } + return object; + }; + + /** + * Converts this EnumDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.EnumDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + EnumDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumDescriptorProto"; + }; + + EnumDescriptorProto.EnumReservedRange = (function() { + + /** + * Properties of an EnumReservedRange. + * @memberof google.protobuf.EnumDescriptorProto + * @interface IEnumReservedRange + * @property {number|null} [start] EnumReservedRange start + * @property {number|null} [end] EnumReservedRange end + */ + + /** + * Constructs a new EnumReservedRange. + * @memberof google.protobuf.EnumDescriptorProto + * @classdesc Represents an EnumReservedRange. + * @implements IEnumReservedRange + * @constructor + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set + */ + function EnumReservedRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumReservedRange start. + * @member {number} start + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + */ + EnumReservedRange.prototype.start = 0; + + /** + * EnumReservedRange end. + * @member {number} end + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + */ + EnumReservedRange.prototype.end = 0; + + /** + * Creates a new EnumReservedRange instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange instance + */ + EnumReservedRange.create = function create(properties) { + return new EnumReservedRange(properties); + }; + + /** + * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumReservedRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + return writer; + }; + + /** + * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumReservedRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumReservedRange.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.start = reader.int32(); + break; + } + case 2: { + message.end = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumReservedRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumReservedRange message. + * @function verify + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumReservedRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + return null; + }; + + /** + * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + */ + EnumReservedRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumDescriptorProto.EnumReservedRange) + return object; + var message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + return message; + }; + + /** + * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.EnumReservedRange} message EnumReservedRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumReservedRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + return object; + }; + + /** + * Converts this EnumReservedRange to JSON. + * @function toJSON + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + * @returns {Object.} JSON object + */ + EnumReservedRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumReservedRange + * @function getTypeUrl + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumReservedRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumDescriptorProto.EnumReservedRange"; + }; + + return EnumReservedRange; + })(); + + return EnumDescriptorProto; + })(); + + protobuf.EnumValueDescriptorProto = (function() { + + /** + * Properties of an EnumValueDescriptorProto. + * @memberof google.protobuf + * @interface IEnumValueDescriptorProto + * @property {string|null} [name] EnumValueDescriptorProto name + * @property {number|null} [number] EnumValueDescriptorProto number + * @property {google.protobuf.IEnumValueOptions|null} [options] EnumValueDescriptorProto options + */ + + /** + * Constructs a new EnumValueDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an EnumValueDescriptorProto. + * @implements IEnumValueDescriptorProto + * @constructor + * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set + */ + function EnumValueDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumValueDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.name = ""; + + /** + * EnumValueDescriptorProto number. + * @member {number} number + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.number = 0; + + /** + * EnumValueDescriptorProto options. + * @member {google.protobuf.IEnumValueOptions|null|undefined} options + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.options = null; + + /** + * Creates a new EnumValueDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto instance + */ + EnumValueDescriptorProto.create = function create(properties) { + return new EnumValueDescriptorProto(properties); + }; + + /** + * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.number); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.EnumValueOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.number = reader.int32(); + break; + } + case 3: { + message.options = $root.google.protobuf.EnumValueOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumValueDescriptorProto message. + * @function verify + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumValueDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.EnumValueOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + */ + EnumValueDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumValueDescriptorProto) + return object; + var message = new $root.google.protobuf.EnumValueDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.number != null) + message.number = object.number | 0; + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.EnumValueDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.EnumValueOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.EnumValueDescriptorProto} message EnumValueDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumValueDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.number = 0; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.EnumValueOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this EnumValueDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + EnumValueDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumValueDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumValueDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumValueDescriptorProto"; + }; + + return EnumValueDescriptorProto; + })(); + + protobuf.ServiceDescriptorProto = (function() { + + /** + * Properties of a ServiceDescriptorProto. + * @memberof google.protobuf + * @interface IServiceDescriptorProto + * @property {string|null} [name] ServiceDescriptorProto name + * @property {Array.|null} [method] ServiceDescriptorProto method + * @property {google.protobuf.IServiceOptions|null} [options] ServiceDescriptorProto options + */ + + /** + * Constructs a new ServiceDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a ServiceDescriptorProto. + * @implements IServiceDescriptorProto + * @constructor + * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set + */ + function ServiceDescriptorProto(properties) { + this.method = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ServiceDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.name = ""; + + /** + * ServiceDescriptorProto method. + * @member {Array.} method + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.method = $util.emptyArray; + + /** + * ServiceDescriptorProto options. + * @member {google.protobuf.IServiceOptions|null|undefined} options + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.options = null; + + /** + * Creates a new ServiceDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto instance + */ + ServiceDescriptorProto.create = function create(properties) { + return new ServiceDescriptorProto(properties); + }; + + /** + * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.method != null && message.method.length) + for (var i = 0; i < message.method.length; ++i) + $root.google.protobuf.MethodDescriptorProto.encode(message.method[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.ServiceOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.method && message.method.length)) + message.method = []; + message.method.push($root.google.protobuf.MethodDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 3: { + message.options = $root.google.protobuf.ServiceOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceDescriptorProto message. + * @function verify + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.method != null && message.hasOwnProperty("method")) { + if (!Array.isArray(message.method)) + return "method: array expected"; + for (var i = 0; i < message.method.length; ++i) { + var error = $root.google.protobuf.MethodDescriptorProto.verify(message.method[i]); + if (error) + return "method." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.ServiceOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + */ + ServiceDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ServiceDescriptorProto) + return object; + var message = new $root.google.protobuf.ServiceDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.method) { + if (!Array.isArray(object.method)) + throw TypeError(".google.protobuf.ServiceDescriptorProto.method: array expected"); + message.method = []; + for (var i = 0; i < object.method.length; ++i) { + if (typeof object.method[i] !== "object") + throw TypeError(".google.protobuf.ServiceDescriptorProto.method: object expected"); + message.method[i] = $root.google.protobuf.MethodDescriptorProto.fromObject(object.method[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.ServiceDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.ServiceOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.ServiceDescriptorProto} message ServiceDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.method = []; + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.method && message.method.length) { + object.method = []; + for (var j = 0; j < message.method.length; ++j) + object.method[j] = $root.google.protobuf.MethodDescriptorProto.toObject(message.method[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.ServiceOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this ServiceDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + ServiceDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ServiceDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ServiceDescriptorProto"; + }; + + return ServiceDescriptorProto; + })(); + + protobuf.MethodDescriptorProto = (function() { + + /** + * Properties of a MethodDescriptorProto. + * @memberof google.protobuf + * @interface IMethodDescriptorProto + * @property {string|null} [name] MethodDescriptorProto name + * @property {string|null} [inputType] MethodDescriptorProto inputType + * @property {string|null} [outputType] MethodDescriptorProto outputType + * @property {google.protobuf.IMethodOptions|null} [options] MethodDescriptorProto options + * @property {boolean|null} [clientStreaming] MethodDescriptorProto clientStreaming + * @property {boolean|null} [serverStreaming] MethodDescriptorProto serverStreaming + */ + + /** + * Constructs a new MethodDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a MethodDescriptorProto. + * @implements IMethodDescriptorProto + * @constructor + * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set + */ + function MethodDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MethodDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.name = ""; + + /** + * MethodDescriptorProto inputType. + * @member {string} inputType + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.inputType = ""; + + /** + * MethodDescriptorProto outputType. + * @member {string} outputType + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.outputType = ""; + + /** + * MethodDescriptorProto options. + * @member {google.protobuf.IMethodOptions|null|undefined} options + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.options = null; + + /** + * MethodDescriptorProto clientStreaming. + * @member {boolean} clientStreaming + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.clientStreaming = false; + + /** + * MethodDescriptorProto serverStreaming. + * @member {boolean} serverStreaming + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.serverStreaming = false; + + /** + * Creates a new MethodDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto instance + */ + MethodDescriptorProto.create = function create(properties) { + return new MethodDescriptorProto(properties); + }; + + /** + * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.inputType != null && Object.hasOwnProperty.call(message, "inputType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.inputType); + if (message.outputType != null && Object.hasOwnProperty.call(message, "outputType")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.outputType); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.MethodOptions.encode(message.options, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.clientStreaming != null && Object.hasOwnProperty.call(message, "clientStreaming")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.clientStreaming); + if (message.serverStreaming != null && Object.hasOwnProperty.call(message, "serverStreaming")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.serverStreaming); + return writer; + }; + + /** + * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.inputType = reader.string(); + break; + } + case 3: { + message.outputType = reader.string(); + break; + } + case 4: { + message.options = $root.google.protobuf.MethodOptions.decode(reader, reader.uint32()); + break; + } + case 5: { + message.clientStreaming = reader.bool(); + break; + } + case 6: { + message.serverStreaming = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodDescriptorProto message. + * @function verify + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.inputType != null && message.hasOwnProperty("inputType")) + if (!$util.isString(message.inputType)) + return "inputType: string expected"; + if (message.outputType != null && message.hasOwnProperty("outputType")) + if (!$util.isString(message.outputType)) + return "outputType: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.MethodOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) + if (typeof message.clientStreaming !== "boolean") + return "clientStreaming: boolean expected"; + if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) + if (typeof message.serverStreaming !== "boolean") + return "serverStreaming: boolean expected"; + return null; + }; + + /** + * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + */ + MethodDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MethodDescriptorProto) + return object; + var message = new $root.google.protobuf.MethodDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.inputType != null) + message.inputType = String(object.inputType); + if (object.outputType != null) + message.outputType = String(object.outputType); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.MethodDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.MethodOptions.fromObject(object.options); + } + if (object.clientStreaming != null) + message.clientStreaming = Boolean(object.clientStreaming); + if (object.serverStreaming != null) + message.serverStreaming = Boolean(object.serverStreaming); + return message; + }; + + /** + * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.MethodDescriptorProto} message MethodDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.inputType = ""; + object.outputType = ""; + object.options = null; + object.clientStreaming = false; + object.serverStreaming = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.inputType != null && message.hasOwnProperty("inputType")) + object.inputType = message.inputType; + if (message.outputType != null && message.hasOwnProperty("outputType")) + object.outputType = message.outputType; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.MethodOptions.toObject(message.options, options); + if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) + object.clientStreaming = message.clientStreaming; + if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) + object.serverStreaming = message.serverStreaming; + return object; + }; + + /** + * Converts this MethodDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.MethodDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + MethodDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MethodDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MethodDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MethodDescriptorProto"; + }; + + return MethodDescriptorProto; + })(); + + protobuf.FileOptions = (function() { + + /** + * Properties of a FileOptions. + * @memberof google.protobuf + * @interface IFileOptions + * @property {string|null} [javaPackage] FileOptions javaPackage + * @property {string|null} [javaOuterClassname] FileOptions javaOuterClassname + * @property {boolean|null} [javaMultipleFiles] FileOptions javaMultipleFiles + * @property {boolean|null} [javaGenerateEqualsAndHash] FileOptions javaGenerateEqualsAndHash + * @property {boolean|null} [javaStringCheckUtf8] FileOptions javaStringCheckUtf8 + * @property {google.protobuf.FileOptions.OptimizeMode|null} [optimizeFor] FileOptions optimizeFor + * @property {string|null} [goPackage] FileOptions goPackage + * @property {boolean|null} [ccGenericServices] FileOptions ccGenericServices + * @property {boolean|null} [javaGenericServices] FileOptions javaGenericServices + * @property {boolean|null} [pyGenericServices] FileOptions pyGenericServices + * @property {boolean|null} [phpGenericServices] FileOptions phpGenericServices + * @property {boolean|null} [deprecated] FileOptions deprecated + * @property {boolean|null} [ccEnableArenas] FileOptions ccEnableArenas + * @property {string|null} [objcClassPrefix] FileOptions objcClassPrefix + * @property {string|null} [csharpNamespace] FileOptions csharpNamespace + * @property {string|null} [swiftPrefix] FileOptions swiftPrefix + * @property {string|null} [phpClassPrefix] FileOptions phpClassPrefix + * @property {string|null} [phpNamespace] FileOptions phpNamespace + * @property {string|null} [phpMetadataNamespace] FileOptions phpMetadataNamespace + * @property {string|null} [rubyPackage] FileOptions rubyPackage + * @property {Array.|null} [uninterpretedOption] FileOptions uninterpretedOption + */ + + /** + * 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 = []; + if (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; + + /** + * 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(); + 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; + } + 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; + } + } + 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]); + } + } + 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 = []; + 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); + } + 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 + */ + + /** + * 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; + + /** + * 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(); + 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; + } + 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; + } + } + 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]); + } + } + 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; + } + 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); + } + 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 + */ + + /** + * 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; + + /** + * 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(); + } + 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; + } + 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; + } + } + 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; + } + } + 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; + } + 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]; + } + return object; + }; + + /** + * Converts this FieldOptions to JSON. + * @function toJSON + * @memberof google.protobuf.FieldOptions + * @instance + * @returns {Object.} JSON object + */ + FieldOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldOptions + * @function getTypeUrl + * @memberof google.protobuf.FieldOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldOptions"; + }; + + /** + * CType enum. + * @name google.protobuf.FieldOptions.CType + * @enum {number} + * @property {number} STRING=0 STRING value + * @property {number} CORD=1 CORD value + * @property {number} STRING_PIECE=2 STRING_PIECE value + */ + FieldOptions.CType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STRING"] = 0; + values[valuesById[1] = "CORD"] = 1; + values[valuesById[2] = "STRING_PIECE"] = 2; + return values; + })(); + + /** + * JSType enum. + * @name google.protobuf.FieldOptions.JSType + * @enum {number} + * @property {number} JS_NORMAL=0 JS_NORMAL value + * @property {number} JS_STRING=1 JS_STRING value + * @property {number} JS_NUMBER=2 JS_NUMBER value + */ + FieldOptions.JSType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "JS_NORMAL"] = 0; + values[valuesById[1] = "JS_STRING"] = 1; + values[valuesById[2] = "JS_NUMBER"] = 2; + return values; + })(); + + return FieldOptions; + })(); + + protobuf.OneofOptions = (function() { + + /** + * Properties of an OneofOptions. + * @memberof google.protobuf + * @interface IOneofOptions + * @property {Array.|null} [uninterpretedOption] OneofOptions uninterpretedOption + */ + + /** + * Constructs a new OneofOptions. + * @memberof google.protobuf + * @classdesc Represents an OneofOptions. + * @implements IOneofOptions + * @constructor + * @param {google.protobuf.IOneofOptions=} [properties] Properties to set + */ + function OneofOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OneofOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.OneofOptions + * @instance + */ + OneofOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new OneofOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions=} [properties] Properties to set + * @returns {google.protobuf.OneofOptions} OneofOptions instance + */ + OneofOptions.create = function create(properties) { + return new OneofOptions(properties); + }; + + /** + * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OneofOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.OneofOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.OneofOptions} OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OneofOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.OneofOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.OneofOptions} OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OneofOptions message. + * @function verify + * @memberof google.protobuf.OneofOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OneofOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.OneofOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.OneofOptions} OneofOptions + */ + OneofOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.OneofOptions) + return object; + var message = new $root.google.protobuf.OneofOptions(); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.OneofOptions} message OneofOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OneofOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this OneofOptions to JSON. + * @function toJSON + * @memberof google.protobuf.OneofOptions + * @instance + * @returns {Object.} JSON object + */ + OneofOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OneofOptions + * @function getTypeUrl + * @memberof google.protobuf.OneofOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OneofOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.OneofOptions"; + }; + + return OneofOptions; + })(); + + protobuf.EnumOptions = (function() { + + /** + * Properties of an EnumOptions. + * @memberof google.protobuf + * @interface IEnumOptions + * @property {boolean|null} [allowAlias] EnumOptions allowAlias + * @property {boolean|null} [deprecated] EnumOptions deprecated + * @property {Array.|null} [uninterpretedOption] EnumOptions uninterpretedOption + */ + + /** + * Constructs a new EnumOptions. + * @memberof google.protobuf + * @classdesc Represents an EnumOptions. + * @implements IEnumOptions + * @constructor + * @param {google.protobuf.IEnumOptions=} [properties] Properties to set + */ + function EnumOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumOptions allowAlias. + * @member {boolean} allowAlias + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.allowAlias = false; + + /** + * EnumOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.deprecated = false; + + /** + * EnumOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new EnumOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions=} [properties] Properties to set + * @returns {google.protobuf.EnumOptions} EnumOptions instance + */ + EnumOptions.create = function create(properties) { + return new EnumOptions(properties); + }; + + /** + * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.allowAlias != null && Object.hasOwnProperty.call(message, "allowAlias")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowAlias); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumOptions} EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.allowAlias = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumOptions} EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumOptions message. + * @function verify + * @memberof google.protobuf.EnumOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + if (typeof message.allowAlias !== "boolean") + return "allowAlias: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumOptions} EnumOptions + */ + EnumOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumOptions) + return object; + var message = new $root.google.protobuf.EnumOptions(); + if (object.allowAlias != null) + message.allowAlias = Boolean(object.allowAlias); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.EnumOptions} message EnumOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.allowAlias = false; + object.deprecated = false; + } + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + object.allowAlias = message.allowAlias; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this EnumOptions to JSON. + * @function toJSON + * @memberof google.protobuf.EnumOptions + * @instance + * @returns {Object.} JSON object + */ + EnumOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumOptions + * @function getTypeUrl + * @memberof google.protobuf.EnumOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumOptions"; + }; + + return EnumOptions; + })(); + + protobuf.EnumValueOptions = (function() { + + /** + * Properties of an EnumValueOptions. + * @memberof google.protobuf + * @interface IEnumValueOptions + * @property {boolean|null} [deprecated] EnumValueOptions deprecated + * @property {Array.|null} [uninterpretedOption] EnumValueOptions uninterpretedOption + */ + + /** + * Constructs a new EnumValueOptions. + * @memberof google.protobuf + * @classdesc Represents an EnumValueOptions. + * @implements IEnumValueOptions + * @constructor + * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set + */ + function EnumValueOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumValueOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.deprecated = false; + + /** + * EnumValueOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new EnumValueOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions instance + */ + EnumValueOptions.create = function create(properties) { + return new EnumValueOptions(properties); + }; + + /** + * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.deprecated); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.deprecated = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumValueOptions message. + * @function verify + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumValueOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + */ + EnumValueOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumValueOptions) + return object; + var message = new $root.google.protobuf.EnumValueOptions(); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.EnumValueOptions} message EnumValueOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumValueOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) + object.deprecated = false; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this EnumValueOptions to JSON. + * @function toJSON + * @memberof google.protobuf.EnumValueOptions + * @instance + * @returns {Object.} JSON object + */ + EnumValueOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumValueOptions + * @function getTypeUrl + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumValueOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumValueOptions"; + }; + + return EnumValueOptions; + })(); + + protobuf.ServiceOptions = (function() { + + /** + * Properties of a ServiceOptions. + * @memberof google.protobuf + * @interface IServiceOptions + * @property {boolean|null} [deprecated] ServiceOptions deprecated + * @property {Array.|null} [uninterpretedOption] ServiceOptions uninterpretedOption + * @property {string|null} [".google.api.defaultHost"] ServiceOptions .google.api.defaultHost + * @property {string|null} [".google.api.oauthScopes"] ServiceOptions .google.api.oauthScopes + */ + + /** + * Constructs a new ServiceOptions. + * @memberof google.protobuf + * @classdesc Represents a ServiceOptions. + * @implements IServiceOptions + * @constructor + * @param {google.protobuf.IServiceOptions=} [properties] Properties to set + */ + function ServiceOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ServiceOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.deprecated = false; + + /** + * ServiceOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * ServiceOptions .google.api.defaultHost. + * @member {string} .google.api.defaultHost + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.defaultHost"] = ""; + + /** + * ServiceOptions .google.api.oauthScopes. + * @member {string} .google.api.oauthScopes + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.oauthScopes"] = ""; + + /** + * Creates a new ServiceOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions=} [properties] Properties to set + * @returns {google.protobuf.ServiceOptions} ServiceOptions instance + */ + ServiceOptions.create = function create(properties) { + return new ServiceOptions(properties); + }; + + /** + * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.defaultHost"] != null && Object.hasOwnProperty.call(message, ".google.api.defaultHost")) + writer.uint32(/* id 1049, wireType 2 =*/8394).string(message[".google.api.defaultHost"]); + if (message[".google.api.oauthScopes"] != null && Object.hasOwnProperty.call(message, ".google.api.oauthScopes")) + writer.uint32(/* id 1050, wireType 2 =*/8402).string(message[".google.api.oauthScopes"]); + return writer; + }; + + /** + * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ServiceOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 33: { + message.deprecated = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1049: { + message[".google.api.defaultHost"] = reader.string(); + break; + } + case 1050: { + message[".google.api.oauthScopes"] = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceOptions message. + * @function verify + * @memberof google.protobuf.ServiceOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + if (!$util.isString(message[".google.api.defaultHost"])) + return ".google.api.defaultHost: string expected"; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + if (!$util.isString(message[".google.api.oauthScopes"])) + return ".google.api.oauthScopes: string expected"; + return null; + }; + + /** + * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ServiceOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ServiceOptions} ServiceOptions + */ + ServiceOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ServiceOptions) + return object; + var message = new $root.google.protobuf.ServiceOptions(); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.defaultHost"] != null) + message[".google.api.defaultHost"] = String(object[".google.api.defaultHost"]); + if (object[".google.api.oauthScopes"] != null) + message[".google.api.oauthScopes"] = String(object[".google.api.oauthScopes"]); + return message; + }; + + /** + * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.ServiceOptions} message ServiceOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.deprecated = false; + object[".google.api.defaultHost"] = ""; + object[".google.api.oauthScopes"] = ""; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + object[".google.api.defaultHost"] = message[".google.api.defaultHost"]; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + object[".google.api.oauthScopes"] = message[".google.api.oauthScopes"]; + return object; + }; + + /** + * Converts this ServiceOptions to JSON. + * @function toJSON + * @memberof google.protobuf.ServiceOptions + * @instance + * @returns {Object.} JSON object + */ + ServiceOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ServiceOptions + * @function getTypeUrl + * @memberof google.protobuf.ServiceOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ServiceOptions"; + }; + + return ServiceOptions; + })(); + + protobuf.MethodOptions = (function() { + + /** + * Properties of a MethodOptions. + * @memberof google.protobuf + * @interface IMethodOptions + * @property {boolean|null} [deprecated] MethodOptions deprecated + * @property {google.protobuf.MethodOptions.IdempotencyLevel|null} [idempotencyLevel] MethodOptions idempotencyLevel + * @property {Array.|null} [uninterpretedOption] MethodOptions uninterpretedOption + * @property {google.api.IHttpRule|null} [".google.api.http"] MethodOptions .google.api.http + * @property {Array.|null} [".google.api.methodSignature"] MethodOptions .google.api.methodSignature + */ + + /** + * Constructs a new MethodOptions. + * @memberof google.protobuf + * @classdesc Represents a MethodOptions. + * @implements IMethodOptions + * @constructor + * @param {google.protobuf.IMethodOptions=} [properties] Properties to set + */ + function MethodOptions(properties) { + this.uninterpretedOption = []; + this[".google.api.methodSignature"] = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MethodOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.deprecated = false; + + /** + * MethodOptions idempotencyLevel. + * @member {google.protobuf.MethodOptions.IdempotencyLevel} idempotencyLevel + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.idempotencyLevel = 0; + + /** + * MethodOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * MethodOptions .google.api.http. + * @member {google.api.IHttpRule|null|undefined} .google.api.http + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.api.http"] = null; + + /** + * MethodOptions .google.api.methodSignature. + * @member {Array.} .google.api.methodSignature + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.api.methodSignature"] = $util.emptyArray; + + /** + * Creates a new MethodOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions=} [properties] Properties to set + * @returns {google.protobuf.MethodOptions} MethodOptions instance + */ + MethodOptions.create = function create(properties) { + return new MethodOptions(properties); + }; + + /** + * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); + if (message.idempotencyLevel != null && Object.hasOwnProperty.call(message, "idempotencyLevel")) + writer.uint32(/* id 34, wireType 0 =*/272).int32(message.idempotencyLevel); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.methodSignature"] != null && message[".google.api.methodSignature"].length) + for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) + writer.uint32(/* id 1051, wireType 2 =*/8410).string(message[".google.api.methodSignature"][i]); + if (message[".google.api.http"] != null && Object.hasOwnProperty.call(message, ".google.api.http")) + $root.google.api.HttpRule.encode(message[".google.api.http"], writer.uint32(/* id 72295728, wireType 2 =*/578365826).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MethodOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MethodOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MethodOptions} MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 33: { + message.deprecated = reader.bool(); + break; + } + case 34: { + message.idempotencyLevel = reader.int32(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 72295728: { + message[".google.api.http"] = $root.google.api.HttpRule.decode(reader, reader.uint32()); + break; + } + case 1051: { + if (!(message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length)) + message[".google.api.methodSignature"] = []; + message[".google.api.methodSignature"].push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MethodOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MethodOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MethodOptions} MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodOptions message. + * @function verify + * @memberof google.protobuf.MethodOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) + switch (message.idempotencyLevel) { + default: + return "idempotencyLevel: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) { + var error = $root.google.api.HttpRule.verify(message[".google.api.http"]); + if (error) + return ".google.api.http." + error; + } + if (message[".google.api.methodSignature"] != null && message.hasOwnProperty(".google.api.methodSignature")) { + if (!Array.isArray(message[".google.api.methodSignature"])) + return ".google.api.methodSignature: array expected"; + for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) + if (!$util.isString(message[".google.api.methodSignature"][i])) + return ".google.api.methodSignature: string[] expected"; + } + return null; + }; + + /** + * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MethodOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MethodOptions} MethodOptions + */ + MethodOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MethodOptions) + return object; + var message = new $root.google.protobuf.MethodOptions(); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + switch (object.idempotencyLevel) { + default: + if (typeof object.idempotencyLevel === "number") { + message.idempotencyLevel = object.idempotencyLevel; + break; + } + break; + case "IDEMPOTENCY_UNKNOWN": + case 0: + message.idempotencyLevel = 0; + break; + case "NO_SIDE_EFFECTS": + case 1: + message.idempotencyLevel = 1; + break; + case "IDEMPOTENT": + case 2: + message.idempotencyLevel = 2; + break; + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.http"] != null) { + if (typeof object[".google.api.http"] !== "object") + throw TypeError(".google.protobuf.MethodOptions..google.api.http: object expected"); + message[".google.api.http"] = $root.google.api.HttpRule.fromObject(object[".google.api.http"]); + } + if (object[".google.api.methodSignature"]) { + if (!Array.isArray(object[".google.api.methodSignature"])) + throw TypeError(".google.protobuf.MethodOptions..google.api.methodSignature: array expected"); + message[".google.api.methodSignature"] = []; + for (var i = 0; i < object[".google.api.methodSignature"].length; ++i) + message[".google.api.methodSignature"][i] = String(object[".google.api.methodSignature"][i]); + } + return message; + }; + + /** + * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.MethodOptions} message MethodOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.uninterpretedOption = []; + object[".google.api.methodSignature"] = []; + } + if (options.defaults) { + object.deprecated = false; + object.idempotencyLevel = options.enums === String ? "IDEMPOTENCY_UNKNOWN" : 0; + object[".google.api.http"] = null; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) + object.idempotencyLevel = options.enums === String ? $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] === undefined ? message.idempotencyLevel : $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] : message.idempotencyLevel; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length) { + object[".google.api.methodSignature"] = []; + for (var j = 0; j < message[".google.api.methodSignature"].length; ++j) + object[".google.api.methodSignature"][j] = message[".google.api.methodSignature"][j]; + } + if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) + object[".google.api.http"] = $root.google.api.HttpRule.toObject(message[".google.api.http"], options); + return object; + }; + + /** + * Converts this MethodOptions to JSON. + * @function toJSON + * @memberof google.protobuf.MethodOptions + * @instance + * @returns {Object.} JSON object + */ + MethodOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MethodOptions + * @function getTypeUrl + * @memberof google.protobuf.MethodOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MethodOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MethodOptions"; + }; + + /** + * IdempotencyLevel enum. + * @name google.protobuf.MethodOptions.IdempotencyLevel + * @enum {number} + * @property {number} IDEMPOTENCY_UNKNOWN=0 IDEMPOTENCY_UNKNOWN value + * @property {number} NO_SIDE_EFFECTS=1 NO_SIDE_EFFECTS value + * @property {number} IDEMPOTENT=2 IDEMPOTENT value + */ + MethodOptions.IdempotencyLevel = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "IDEMPOTENCY_UNKNOWN"] = 0; + values[valuesById[1] = "NO_SIDE_EFFECTS"] = 1; + values[valuesById[2] = "IDEMPOTENT"] = 2; + return values; + })(); + + return MethodOptions; + })(); + + protobuf.UninterpretedOption = (function() { + + /** + * Properties of an UninterpretedOption. + * @memberof google.protobuf + * @interface IUninterpretedOption + * @property {Array.|null} [name] UninterpretedOption name + * @property {string|null} [identifierValue] UninterpretedOption identifierValue + * @property {number|Long|null} [positiveIntValue] UninterpretedOption positiveIntValue + * @property {number|Long|null} [negativeIntValue] UninterpretedOption negativeIntValue + * @property {number|null} [doubleValue] UninterpretedOption doubleValue + * @property {Uint8Array|null} [stringValue] UninterpretedOption stringValue + * @property {string|null} [aggregateValue] UninterpretedOption aggregateValue + */ + + /** + * Constructs a new UninterpretedOption. + * @memberof google.protobuf + * @classdesc Represents an UninterpretedOption. + * @implements IUninterpretedOption + * @constructor + * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set + */ + function UninterpretedOption(properties) { + this.name = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UninterpretedOption name. + * @member {Array.} name + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.name = $util.emptyArray; + + /** + * UninterpretedOption identifierValue. + * @member {string} identifierValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.identifierValue = ""; + + /** + * UninterpretedOption positiveIntValue. + * @member {number|Long} positiveIntValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.positiveIntValue = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * UninterpretedOption negativeIntValue. + * @member {number|Long} negativeIntValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.negativeIntValue = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * UninterpretedOption doubleValue. + * @member {number} doubleValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.doubleValue = 0; + + /** + * UninterpretedOption stringValue. + * @member {Uint8Array} stringValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.stringValue = $util.newBuffer([]); + + /** + * UninterpretedOption aggregateValue. + * @member {string} aggregateValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.aggregateValue = ""; + + /** + * Creates a new UninterpretedOption instance using the specified properties. + * @function create + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption instance + */ + UninterpretedOption.create = function create(properties) { + return new UninterpretedOption(properties); + }; + + /** + * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UninterpretedOption.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.name.length) + for (var i = 0; i < message.name.length; ++i) + $root.google.protobuf.UninterpretedOption.NamePart.encode(message.name[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.identifierValue != null && Object.hasOwnProperty.call(message, "identifierValue")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.identifierValue); + if (message.positiveIntValue != null && Object.hasOwnProperty.call(message, "positiveIntValue")) + writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.positiveIntValue); + if (message.negativeIntValue != null && Object.hasOwnProperty.call(message, "negativeIntValue")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.negativeIntValue); + if (message.doubleValue != null && Object.hasOwnProperty.call(message, "doubleValue")) + writer.uint32(/* id 6, wireType 1 =*/49).double(message.doubleValue); + if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) + writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.stringValue); + if (message.aggregateValue != null && Object.hasOwnProperty.call(message, "aggregateValue")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.aggregateValue); + return writer; + }; + + /** + * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UninterpretedOption.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UninterpretedOption.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + if (!(message.name && message.name.length)) + message.name = []; + message.name.push($root.google.protobuf.UninterpretedOption.NamePart.decode(reader, reader.uint32())); + break; + } + case 3: { + message.identifierValue = reader.string(); + break; + } + case 4: { + message.positiveIntValue = reader.uint64(); + break; + } + case 5: { + message.negativeIntValue = reader.int64(); + break; + } + case 6: { + message.doubleValue = reader.double(); + break; + } + case 7: { + message.stringValue = reader.bytes(); + break; + } + case 8: { + message.aggregateValue = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UninterpretedOption.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UninterpretedOption message. + * @function verify + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UninterpretedOption.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) { + if (!Array.isArray(message.name)) + return "name: array expected"; + for (var i = 0; i < message.name.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.NamePart.verify(message.name[i]); + if (error) + return "name." + error; + } + } + if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) + if (!$util.isString(message.identifierValue)) + return "identifierValue: string expected"; + if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) + if (!$util.isInteger(message.positiveIntValue) && !(message.positiveIntValue && $util.isInteger(message.positiveIntValue.low) && $util.isInteger(message.positiveIntValue.high))) + return "positiveIntValue: integer|Long expected"; + if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) + if (!$util.isInteger(message.negativeIntValue) && !(message.negativeIntValue && $util.isInteger(message.negativeIntValue.low) && $util.isInteger(message.negativeIntValue.high))) + return "negativeIntValue: integer|Long expected"; + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) + if (typeof message.doubleValue !== "number") + return "doubleValue: number expected"; + if (message.stringValue != null && message.hasOwnProperty("stringValue")) + if (!(message.stringValue && typeof message.stringValue.length === "number" || $util.isString(message.stringValue))) + return "stringValue: buffer expected"; + if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) + if (!$util.isString(message.aggregateValue)) + return "aggregateValue: string expected"; + return null; + }; + + /** + * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + */ + UninterpretedOption.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UninterpretedOption) + return object; + var message = new $root.google.protobuf.UninterpretedOption(); + if (object.name) { + if (!Array.isArray(object.name)) + throw TypeError(".google.protobuf.UninterpretedOption.name: array expected"); + message.name = []; + for (var i = 0; i < object.name.length; ++i) { + if (typeof object.name[i] !== "object") + throw TypeError(".google.protobuf.UninterpretedOption.name: object expected"); + message.name[i] = $root.google.protobuf.UninterpretedOption.NamePart.fromObject(object.name[i]); + } + } + if (object.identifierValue != null) + message.identifierValue = String(object.identifierValue); + if (object.positiveIntValue != null) + if ($util.Long) + (message.positiveIntValue = $util.Long.fromValue(object.positiveIntValue)).unsigned = true; + else if (typeof object.positiveIntValue === "string") + message.positiveIntValue = parseInt(object.positiveIntValue, 10); + else if (typeof object.positiveIntValue === "number") + message.positiveIntValue = object.positiveIntValue; + else if (typeof object.positiveIntValue === "object") + message.positiveIntValue = new $util.LongBits(object.positiveIntValue.low >>> 0, object.positiveIntValue.high >>> 0).toNumber(true); + if (object.negativeIntValue != null) + if ($util.Long) + (message.negativeIntValue = $util.Long.fromValue(object.negativeIntValue)).unsigned = false; + else if (typeof object.negativeIntValue === "string") + message.negativeIntValue = parseInt(object.negativeIntValue, 10); + else if (typeof object.negativeIntValue === "number") + message.negativeIntValue = object.negativeIntValue; + else if (typeof object.negativeIntValue === "object") + message.negativeIntValue = new $util.LongBits(object.negativeIntValue.low >>> 0, object.negativeIntValue.high >>> 0).toNumber(); + if (object.doubleValue != null) + message.doubleValue = Number(object.doubleValue); + if (object.stringValue != null) + if (typeof object.stringValue === "string") + $util.base64.decode(object.stringValue, message.stringValue = $util.newBuffer($util.base64.length(object.stringValue)), 0); + else if (object.stringValue.length >= 0) + message.stringValue = object.stringValue; + if (object.aggregateValue != null) + message.aggregateValue = String(object.aggregateValue); + return message; + }; + + /** + * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.UninterpretedOption} message UninterpretedOption + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UninterpretedOption.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.name = []; + if (options.defaults) { + object.identifierValue = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.positiveIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.positiveIntValue = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.negativeIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.negativeIntValue = options.longs === String ? "0" : 0; + object.doubleValue = 0; + if (options.bytes === String) + object.stringValue = ""; + else { + object.stringValue = []; + if (options.bytes !== Array) + object.stringValue = $util.newBuffer(object.stringValue); + } + object.aggregateValue = ""; + } + if (message.name && message.name.length) { + object.name = []; + for (var j = 0; j < message.name.length; ++j) + object.name[j] = $root.google.protobuf.UninterpretedOption.NamePart.toObject(message.name[j], options); + } + if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) + object.identifierValue = message.identifierValue; + if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) + if (typeof message.positiveIntValue === "number") + object.positiveIntValue = options.longs === String ? String(message.positiveIntValue) : message.positiveIntValue; + else + object.positiveIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.positiveIntValue) : options.longs === Number ? new $util.LongBits(message.positiveIntValue.low >>> 0, message.positiveIntValue.high >>> 0).toNumber(true) : message.positiveIntValue; + if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) + if (typeof message.negativeIntValue === "number") + object.negativeIntValue = options.longs === String ? String(message.negativeIntValue) : message.negativeIntValue; + else + object.negativeIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.negativeIntValue) : options.longs === Number ? new $util.LongBits(message.negativeIntValue.low >>> 0, message.negativeIntValue.high >>> 0).toNumber() : message.negativeIntValue; + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) + object.doubleValue = options.json && !isFinite(message.doubleValue) ? String(message.doubleValue) : message.doubleValue; + if (message.stringValue != null && message.hasOwnProperty("stringValue")) + object.stringValue = options.bytes === String ? $util.base64.encode(message.stringValue, 0, message.stringValue.length) : options.bytes === Array ? Array.prototype.slice.call(message.stringValue) : message.stringValue; + if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) + object.aggregateValue = message.aggregateValue; + return object; + }; + + /** + * Converts this UninterpretedOption to JSON. + * @function toJSON + * @memberof google.protobuf.UninterpretedOption + * @instance + * @returns {Object.} JSON object + */ + UninterpretedOption.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UninterpretedOption + * @function getTypeUrl + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UninterpretedOption.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UninterpretedOption"; + }; + + UninterpretedOption.NamePart = (function() { + + /** + * Properties of a NamePart. + * @memberof google.protobuf.UninterpretedOption + * @interface INamePart + * @property {string} namePart NamePart namePart + * @property {boolean} isExtension NamePart isExtension + */ + + /** + * Constructs a new NamePart. + * @memberof google.protobuf.UninterpretedOption + * @classdesc Represents a NamePart. + * @implements INamePart + * @constructor + * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set + */ + function NamePart(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NamePart namePart. + * @member {string} namePart + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + */ + NamePart.prototype.namePart = ""; + + /** + * NamePart isExtension. + * @member {boolean} isExtension + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + */ + NamePart.prototype.isExtension = false; + + /** + * Creates a new NamePart instance using the specified properties. + * @function create + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart instance + */ + NamePart.create = function create(properties) { + return new NamePart(properties); + }; + + /** + * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NamePart.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + writer.uint32(/* id 1, wireType 2 =*/10).string(message.namePart); + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.isExtension); + return writer; + }; + + /** + * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NamePart.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NamePart message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NamePart.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption.NamePart(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.namePart = reader.string(); + break; + } + case 2: { + message.isExtension = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + if (!message.hasOwnProperty("namePart")) + throw $util.ProtocolError("missing required 'namePart'", { instance: message }); + if (!message.hasOwnProperty("isExtension")) + throw $util.ProtocolError("missing required 'isExtension'", { instance: message }); + return message; + }; + + /** + * Decodes a NamePart message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NamePart.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NamePart message. + * @function verify + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NamePart.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (!$util.isString(message.namePart)) + return "namePart: string expected"; + if (typeof message.isExtension !== "boolean") + return "isExtension: boolean expected"; + return null; + }; + + /** + * Creates a NamePart message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + */ + NamePart.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UninterpretedOption.NamePart) + return object; + var message = new $root.google.protobuf.UninterpretedOption.NamePart(); + if (object.namePart != null) + message.namePart = String(object.namePart); + if (object.isExtension != null) + message.isExtension = Boolean(object.isExtension); + return message; + }; + + /** + * Creates a plain object from a NamePart message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.NamePart} message NamePart + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NamePart.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.namePart = ""; + object.isExtension = false; + } + if (message.namePart != null && message.hasOwnProperty("namePart")) + object.namePart = message.namePart; + if (message.isExtension != null && message.hasOwnProperty("isExtension")) + object.isExtension = message.isExtension; + return object; + }; + + /** + * Converts this NamePart to JSON. + * @function toJSON + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + * @returns {Object.} JSON object + */ + NamePart.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NamePart + * @function getTypeUrl + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NamePart.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UninterpretedOption.NamePart"; + }; + + return NamePart; + })(); + + return UninterpretedOption; + })(); + + protobuf.SourceCodeInfo = (function() { + + /** + * Properties of a SourceCodeInfo. + * @memberof google.protobuf + * @interface ISourceCodeInfo + * @property {Array.|null} [location] SourceCodeInfo location + */ + + /** + * Constructs a new SourceCodeInfo. + * @memberof google.protobuf + * @classdesc Represents a SourceCodeInfo. + * @implements ISourceCodeInfo + * @constructor + * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set + */ + function SourceCodeInfo(properties) { + this.location = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SourceCodeInfo location. + * @member {Array.} location + * @memberof google.protobuf.SourceCodeInfo + * @instance + */ + SourceCodeInfo.prototype.location = $util.emptyArray; + + /** + * Creates a new SourceCodeInfo instance using the specified properties. + * @function create + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo instance + */ + SourceCodeInfo.create = function create(properties) { + return new SourceCodeInfo(properties); + }; + + /** + * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @function encode + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SourceCodeInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.location != null && message.location.length) + for (var i = 0; i < message.location.length; ++i) + $root.google.protobuf.SourceCodeInfo.Location.encode(message.location[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SourceCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SourceCodeInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.location && message.location.length)) + message.location = []; + message.location.push($root.google.protobuf.SourceCodeInfo.Location.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SourceCodeInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SourceCodeInfo message. + * @function verify + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SourceCodeInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.location != null && message.hasOwnProperty("location")) { + if (!Array.isArray(message.location)) + return "location: array expected"; + for (var i = 0; i < message.location.length; ++i) { + var error = $root.google.protobuf.SourceCodeInfo.Location.verify(message.location[i]); + if (error) + return "location." + error; + } + } + return null; + }; + + /** + * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + */ + SourceCodeInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.SourceCodeInfo) + return object; + var message = new $root.google.protobuf.SourceCodeInfo(); + if (object.location) { + if (!Array.isArray(object.location)) + throw TypeError(".google.protobuf.SourceCodeInfo.location: array expected"); + message.location = []; + for (var i = 0; i < object.location.length; ++i) { + if (typeof object.location[i] !== "object") + throw TypeError(".google.protobuf.SourceCodeInfo.location: object expected"); + message.location[i] = $root.google.protobuf.SourceCodeInfo.Location.fromObject(object.location[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.SourceCodeInfo} message SourceCodeInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SourceCodeInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.location = []; + if (message.location && message.location.length) { + object.location = []; + for (var j = 0; j < message.location.length; ++j) + object.location[j] = $root.google.protobuf.SourceCodeInfo.Location.toObject(message.location[j], options); + } + return object; + }; + + /** + * Converts this SourceCodeInfo to JSON. + * @function toJSON + * @memberof google.protobuf.SourceCodeInfo + * @instance + * @returns {Object.} JSON object + */ + SourceCodeInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SourceCodeInfo + * @function getTypeUrl + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SourceCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.SourceCodeInfo"; + }; + + SourceCodeInfo.Location = (function() { + + /** + * Properties of a Location. + * @memberof google.protobuf.SourceCodeInfo + * @interface ILocation + * @property {Array.|null} [path] Location path + * @property {Array.|null} [span] Location span + * @property {string|null} [leadingComments] Location leadingComments + * @property {string|null} [trailingComments] Location trailingComments + * @property {Array.|null} [leadingDetachedComments] Location leadingDetachedComments + */ + + /** + * Constructs a new Location. + * @memberof google.protobuf.SourceCodeInfo + * @classdesc Represents a Location. + * @implements ILocation + * @constructor + * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set + */ + function Location(properties) { + this.path = []; + this.span = []; + this.leadingDetachedComments = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Location path. + * @member {Array.} path + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.path = $util.emptyArray; + + /** + * Location span. + * @member {Array.} span + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.span = $util.emptyArray; + + /** + * Location leadingComments. + * @member {string} leadingComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.leadingComments = ""; + + /** + * Location trailingComments. + * @member {string} trailingComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.trailingComments = ""; + + /** + * Location leadingDetachedComments. + * @member {Array.} leadingDetachedComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.leadingDetachedComments = $util.emptyArray; + + /** + * Creates a new Location instance using the specified properties. + * @function create + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set + * @returns {google.protobuf.SourceCodeInfo.Location} Location instance + */ + Location.create = function create(properties) { + return new Location(properties); + }; + + /** + * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @function encode + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Location.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.path != null && message.path.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.path.length; ++i) + writer.int32(message.path[i]); + writer.ldelim(); + } + if (message.span != null && message.span.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.span.length; ++i) + writer.int32(message.span[i]); + writer.ldelim(); + } + if (message.leadingComments != null && Object.hasOwnProperty.call(message, "leadingComments")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.leadingComments); + if (message.trailingComments != null && Object.hasOwnProperty.call(message, "trailingComments")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.trailingComments); + if (message.leadingDetachedComments != null && message.leadingDetachedComments.length) + for (var i = 0; i < message.leadingDetachedComments.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.leadingDetachedComments[i]); + return writer; + }; + + /** + * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Location.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Location message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.SourceCodeInfo.Location} Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Location.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo.Location(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.path && message.path.length)) + message.path = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.path.push(reader.int32()); + } else + message.path.push(reader.int32()); + break; + } + case 2: { + if (!(message.span && message.span.length)) + message.span = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.span.push(reader.int32()); + } else + message.span.push(reader.int32()); + break; + } + case 3: { + message.leadingComments = reader.string(); + break; + } + case 4: { + message.trailingComments = reader.string(); + break; + } + case 6: { + if (!(message.leadingDetachedComments && message.leadingDetachedComments.length)) + message.leadingDetachedComments = []; + message.leadingDetachedComments.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Location message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.SourceCodeInfo.Location} Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Location.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Location message. + * @function verify + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Location.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.path != null && message.hasOwnProperty("path")) { + if (!Array.isArray(message.path)) + return "path: array expected"; + for (var i = 0; i < message.path.length; ++i) + if (!$util.isInteger(message.path[i])) + return "path: integer[] expected"; + } + if (message.span != null && message.hasOwnProperty("span")) { + if (!Array.isArray(message.span)) + return "span: array expected"; + for (var i = 0; i < message.span.length; ++i) + if (!$util.isInteger(message.span[i])) + return "span: integer[] expected"; + } + if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) + if (!$util.isString(message.leadingComments)) + return "leadingComments: string expected"; + if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) + if (!$util.isString(message.trailingComments)) + return "trailingComments: string expected"; + if (message.leadingDetachedComments != null && message.hasOwnProperty("leadingDetachedComments")) { + if (!Array.isArray(message.leadingDetachedComments)) + return "leadingDetachedComments: array expected"; + for (var i = 0; i < message.leadingDetachedComments.length; ++i) + if (!$util.isString(message.leadingDetachedComments[i])) + return "leadingDetachedComments: string[] expected"; + } + return null; + }; + + /** + * Creates a Location message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.SourceCodeInfo.Location} Location + */ + Location.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.SourceCodeInfo.Location) + return object; + var message = new $root.google.protobuf.SourceCodeInfo.Location(); + if (object.path) { + if (!Array.isArray(object.path)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.path: array expected"); + message.path = []; + for (var i = 0; i < object.path.length; ++i) + message.path[i] = object.path[i] | 0; + } + if (object.span) { + if (!Array.isArray(object.span)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.span: array expected"); + message.span = []; + for (var i = 0; i < object.span.length; ++i) + message.span[i] = object.span[i] | 0; + } + if (object.leadingComments != null) + message.leadingComments = String(object.leadingComments); + if (object.trailingComments != null) + message.trailingComments = String(object.trailingComments); + if (object.leadingDetachedComments) { + if (!Array.isArray(object.leadingDetachedComments)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.leadingDetachedComments: array expected"); + message.leadingDetachedComments = []; + for (var i = 0; i < object.leadingDetachedComments.length; ++i) + message.leadingDetachedComments[i] = String(object.leadingDetachedComments[i]); + } + return message; + }; + + /** + * Creates a plain object from a Location message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.Location} message Location + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Location.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.path = []; + object.span = []; + object.leadingDetachedComments = []; + } + if (options.defaults) { + object.leadingComments = ""; + object.trailingComments = ""; + } + if (message.path && message.path.length) { + object.path = []; + for (var j = 0; j < message.path.length; ++j) + object.path[j] = message.path[j]; + } + if (message.span && message.span.length) { + object.span = []; + for (var j = 0; j < message.span.length; ++j) + object.span[j] = message.span[j]; + } + if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) + object.leadingComments = message.leadingComments; + if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) + object.trailingComments = message.trailingComments; + if (message.leadingDetachedComments && message.leadingDetachedComments.length) { + object.leadingDetachedComments = []; + for (var j = 0; j < message.leadingDetachedComments.length; ++j) + object.leadingDetachedComments[j] = message.leadingDetachedComments[j]; + } + return object; + }; + + /** + * Converts this Location to JSON. + * @function toJSON + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + * @returns {Object.} JSON object + */ + Location.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Location + * @function getTypeUrl + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Location.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.SourceCodeInfo.Location"; + }; + + return Location; + })(); + + return SourceCodeInfo; + })(); + + protobuf.GeneratedCodeInfo = (function() { + + /** + * Properties of a GeneratedCodeInfo. + * @memberof google.protobuf + * @interface IGeneratedCodeInfo + * @property {Array.|null} [annotation] GeneratedCodeInfo annotation + */ + + /** + * Constructs a new GeneratedCodeInfo. + * @memberof google.protobuf + * @classdesc Represents a GeneratedCodeInfo. + * @implements IGeneratedCodeInfo + * @constructor + * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set + */ + function GeneratedCodeInfo(properties) { + this.annotation = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GeneratedCodeInfo annotation. + * @member {Array.} annotation + * @memberof google.protobuf.GeneratedCodeInfo + * @instance + */ + GeneratedCodeInfo.prototype.annotation = $util.emptyArray; + + /** + * Creates a new GeneratedCodeInfo instance using the specified properties. + * @function create + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo instance + */ + GeneratedCodeInfo.create = function create(properties) { + return new GeneratedCodeInfo(properties); + }; + + /** + * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @function encode + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GeneratedCodeInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.annotation != null && message.annotation.length) + for (var i = 0; i < message.annotation.length; ++i) + $root.google.protobuf.GeneratedCodeInfo.Annotation.encode(message.annotation[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GeneratedCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GeneratedCodeInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.annotation && message.annotation.length)) + message.annotation = []; + message.annotation.push($root.google.protobuf.GeneratedCodeInfo.Annotation.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GeneratedCodeInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GeneratedCodeInfo message. + * @function verify + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GeneratedCodeInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.annotation != null && message.hasOwnProperty("annotation")) { + if (!Array.isArray(message.annotation)) + return "annotation: array expected"; + for (var i = 0; i < message.annotation.length; ++i) { + var error = $root.google.protobuf.GeneratedCodeInfo.Annotation.verify(message.annotation[i]); + if (error) + return "annotation." + error; + } + } + return null; + }; + + /** + * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + */ + GeneratedCodeInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.GeneratedCodeInfo) + return object; + var message = new $root.google.protobuf.GeneratedCodeInfo(); + if (object.annotation) { + if (!Array.isArray(object.annotation)) + throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: array expected"); + message.annotation = []; + for (var i = 0; i < object.annotation.length; ++i) { + if (typeof object.annotation[i] !== "object") + throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: object expected"); + message.annotation[i] = $root.google.protobuf.GeneratedCodeInfo.Annotation.fromObject(object.annotation[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.GeneratedCodeInfo} message GeneratedCodeInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GeneratedCodeInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.annotation = []; + if (message.annotation && message.annotation.length) { + object.annotation = []; + for (var j = 0; j < message.annotation.length; ++j) + object.annotation[j] = $root.google.protobuf.GeneratedCodeInfo.Annotation.toObject(message.annotation[j], options); + } + return object; + }; + + /** + * Converts this GeneratedCodeInfo to JSON. + * @function toJSON + * @memberof google.protobuf.GeneratedCodeInfo + * @instance + * @returns {Object.} JSON object + */ + GeneratedCodeInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GeneratedCodeInfo + * @function getTypeUrl + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GeneratedCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo"; + }; + + GeneratedCodeInfo.Annotation = (function() { + + /** + * Properties of an Annotation. + * @memberof google.protobuf.GeneratedCodeInfo + * @interface IAnnotation + * @property {Array.|null} [path] Annotation path + * @property {string|null} [sourceFile] Annotation sourceFile + * @property {number|null} [begin] Annotation begin + * @property {number|null} [end] Annotation end + * @property {google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null} [semantic] Annotation semantic + */ + + /** + * Constructs a new Annotation. + * @memberof google.protobuf.GeneratedCodeInfo + * @classdesc Represents an Annotation. + * @implements IAnnotation + * @constructor + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set + */ + function Annotation(properties) { + this.path = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Annotation path. + * @member {Array.} path + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.path = $util.emptyArray; + + /** + * Annotation sourceFile. + * @member {string} sourceFile + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.sourceFile = ""; + + /** + * Annotation begin. + * @member {number} begin + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.begin = 0; + + /** + * Annotation end. + * @member {number} end + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.end = 0; + + /** + * Annotation semantic. + * @member {google.protobuf.GeneratedCodeInfo.Annotation.Semantic} semantic + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.semantic = 0; + + /** + * Creates a new Annotation instance using the specified properties. + * @function create + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation instance + */ + Annotation.create = function create(properties) { + return new Annotation(properties); + }; + + /** + * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @function encode + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Annotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.path != null && message.path.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.path.length; ++i) + writer.int32(message.path[i]); + writer.ldelim(); + } + if (message.sourceFile != null && Object.hasOwnProperty.call(message, "sourceFile")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceFile); + if (message.begin != null && Object.hasOwnProperty.call(message, "begin")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.begin); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.end); + if (message.semantic != null && Object.hasOwnProperty.call(message, "semantic")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.semantic); + return writer; + }; + + /** + * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Annotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Annotation message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Annotation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.path && message.path.length)) + message.path = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.path.push(reader.int32()); + } else + message.path.push(reader.int32()); + break; + } + case 2: { + message.sourceFile = reader.string(); + break; + } + case 3: { + message.begin = reader.int32(); + break; + } + case 4: { + message.end = reader.int32(); + break; + } + case 5: { + message.semantic = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Annotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Annotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Annotation message. + * @function verify + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Annotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.path != null && message.hasOwnProperty("path")) { + if (!Array.isArray(message.path)) + return "path: array expected"; + for (var i = 0; i < message.path.length; ++i) + if (!$util.isInteger(message.path[i])) + return "path: integer[] expected"; + } + if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) + if (!$util.isString(message.sourceFile)) + return "sourceFile: string expected"; + if (message.begin != null && message.hasOwnProperty("begin")) + if (!$util.isInteger(message.begin)) + return "begin: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + if (message.semantic != null && message.hasOwnProperty("semantic")) + switch (message.semantic) { + default: + return "semantic: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates an Annotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + */ + Annotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.GeneratedCodeInfo.Annotation) + return object; + var message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); + if (object.path) { + if (!Array.isArray(object.path)) + throw TypeError(".google.protobuf.GeneratedCodeInfo.Annotation.path: array expected"); + message.path = []; + for (var i = 0; i < object.path.length; ++i) + message.path[i] = object.path[i] | 0; + } + if (object.sourceFile != null) + message.sourceFile = String(object.sourceFile); + if (object.begin != null) + message.begin = object.begin | 0; + if (object.end != null) + message.end = object.end | 0; + switch (object.semantic) { + default: + if (typeof object.semantic === "number") { + message.semantic = object.semantic; + break; + } + break; + case "NONE": + case 0: + message.semantic = 0; + break; + case "SET": + case 1: + message.semantic = 1; + break; + case "ALIAS": + case 2: + message.semantic = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from an Annotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.Annotation} message Annotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Annotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.path = []; + if (options.defaults) { + object.sourceFile = ""; + object.begin = 0; + object.end = 0; + object.semantic = options.enums === String ? "NONE" : 0; + } + if (message.path && message.path.length) { + object.path = []; + for (var j = 0; j < message.path.length; ++j) + object.path[j] = message.path[j]; + } + if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) + object.sourceFile = message.sourceFile; + if (message.begin != null && message.hasOwnProperty("begin")) + object.begin = message.begin; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + if (message.semantic != null && message.hasOwnProperty("semantic")) + object.semantic = options.enums === String ? $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] === undefined ? message.semantic : $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] : message.semantic; + return object; + }; + + /** + * Converts this Annotation to JSON. + * @function toJSON + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + * @returns {Object.} JSON object + */ + Annotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Annotation + * @function getTypeUrl + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Annotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo.Annotation"; + }; + + /** + * Semantic enum. + * @name google.protobuf.GeneratedCodeInfo.Annotation.Semantic + * @enum {number} + * @property {number} NONE=0 NONE value + * @property {number} SET=1 SET value + * @property {number} ALIAS=2 ALIAS value + */ + Annotation.Semantic = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NONE"] = 0; + values[valuesById[1] = "SET"] = 1; + values[valuesById[2] = "ALIAS"] = 2; + return values; + })(); + + return Annotation; + })(); + + return GeneratedCodeInfo; + })(); + + protobuf.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.Struct = (function() { + + /** + * Properties of a Struct. + * @memberof google.protobuf + * @interface IStruct + * @property {Object.|null} [fields] Struct fields + */ + + /** + * Constructs a new Struct. + * @memberof google.protobuf + * @classdesc Represents a Struct. + * @implements IStruct + * @constructor + * @param {google.protobuf.IStruct=} [properties] Properties to set + */ + function Struct(properties) { + this.fields = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Struct fields. + * @member {Object.} fields + * @memberof google.protobuf.Struct + * @instance + */ + Struct.prototype.fields = $util.emptyObject; + + /** + * Creates a new Struct instance using the specified properties. + * @function create + * @memberof google.protobuf.Struct + * @static + * @param {google.protobuf.IStruct=} [properties] Properties to set + * @returns {google.protobuf.Struct} Struct instance + */ + Struct.create = function create(properties) { + return new Struct(properties); + }; + + /** + * Encodes the specified Struct message. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Struct + * @static + * @param {google.protobuf.IStruct} message Struct message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Struct.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fields != null && Object.hasOwnProperty.call(message, "fields")) + for (var keys = Object.keys(message.fields), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.protobuf.Value.encode(message.fields[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + return writer; + }; + + /** + * Encodes the specified Struct message, length delimited. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Struct + * @static + * @param {google.protobuf.IStruct} message Struct message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Struct.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Struct message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Struct + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Struct} Struct + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Struct.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Struct(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (message.fields === $util.emptyObject) + message.fields = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.protobuf.Value.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.fields[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Struct message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Struct + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Struct} Struct + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Struct.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Struct message. + * @function verify + * @memberof google.protobuf.Struct + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Struct.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.fields != null && message.hasOwnProperty("fields")) { + if (!$util.isObject(message.fields)) + return "fields: object expected"; + var key = Object.keys(message.fields); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.protobuf.Value.verify(message.fields[key[i]]); + if (error) + return "fields." + error; + } + } + return null; + }; + + /** + * Creates a Struct message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Struct + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Struct} Struct + */ + Struct.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Struct) + return object; + var message = new $root.google.protobuf.Struct(); + if (object.fields) { + if (typeof object.fields !== "object") + throw TypeError(".google.protobuf.Struct.fields: object expected"); + message.fields = {}; + for (var keys = Object.keys(object.fields), i = 0; i < keys.length; ++i) { + if (typeof object.fields[keys[i]] !== "object") + throw TypeError(".google.protobuf.Struct.fields: object expected"); + message.fields[keys[i]] = $root.google.protobuf.Value.fromObject(object.fields[keys[i]]); + } + } + return message; + }; + + /** + * Creates a plain object from a Struct message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Struct + * @static + * @param {google.protobuf.Struct} message Struct + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Struct.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.fields = {}; + var keys2; + if (message.fields && (keys2 = Object.keys(message.fields)).length) { + object.fields = {}; + for (var j = 0; j < keys2.length; ++j) + object.fields[keys2[j]] = $root.google.protobuf.Value.toObject(message.fields[keys2[j]], options); + } + return object; + }; + + /** + * Converts this Struct to JSON. + * @function toJSON + * @memberof google.protobuf.Struct + * @instance + * @returns {Object.} JSON object + */ + Struct.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Struct + * @function getTypeUrl + * @memberof google.protobuf.Struct + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Struct.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Struct"; + }; + + return Struct; + })(); + + protobuf.Value = (function() { + + /** + * Properties of a Value. + * @memberof google.protobuf + * @interface IValue + * @property {google.protobuf.NullValue|null} [nullValue] Value nullValue + * @property {number|null} [numberValue] Value numberValue + * @property {string|null} [stringValue] Value stringValue + * @property {boolean|null} [boolValue] Value boolValue + * @property {google.protobuf.IStruct|null} [structValue] Value structValue + * @property {google.protobuf.IListValue|null} [listValue] Value listValue + */ + + /** + * Constructs a new Value. + * @memberof google.protobuf + * @classdesc Represents a Value. + * @implements IValue + * @constructor + * @param {google.protobuf.IValue=} [properties] Properties to set + */ + function Value(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Value nullValue. + * @member {google.protobuf.NullValue|null|undefined} nullValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.nullValue = null; + + /** + * Value numberValue. + * @member {number|null|undefined} numberValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.numberValue = null; + + /** + * Value stringValue. + * @member {string|null|undefined} stringValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.stringValue = null; + + /** + * Value boolValue. + * @member {boolean|null|undefined} boolValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.boolValue = null; + + /** + * Value structValue. + * @member {google.protobuf.IStruct|null|undefined} structValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.structValue = null; + + /** + * Value listValue. + * @member {google.protobuf.IListValue|null|undefined} listValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.listValue = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Value kind. + * @member {"nullValue"|"numberValue"|"stringValue"|"boolValue"|"structValue"|"listValue"|undefined} kind + * @memberof google.protobuf.Value + * @instance + */ + Object.defineProperty(Value.prototype, "kind", { + get: $util.oneOfGetter($oneOfFields = ["nullValue", "numberValue", "stringValue", "boolValue", "structValue", "listValue"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Value + * @static + * @param {google.protobuf.IValue=} [properties] Properties to set + * @returns {google.protobuf.Value} Value instance + */ + Value.create = function create(properties) { + return new Value(properties); + }; + + /** + * Encodes the specified Value message. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Value + * @static + * @param {google.protobuf.IValue} message Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Value.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.nullValue != null && Object.hasOwnProperty.call(message, "nullValue")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.nullValue); + if (message.numberValue != null && Object.hasOwnProperty.call(message, "numberValue")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.numberValue); + if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.stringValue); + if (message.boolValue != null && Object.hasOwnProperty.call(message, "boolValue")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.boolValue); + if (message.structValue != null && Object.hasOwnProperty.call(message, "structValue")) + $root.google.protobuf.Struct.encode(message.structValue, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.listValue != null && Object.hasOwnProperty.call(message, "listValue")) + $root.google.protobuf.ListValue.encode(message.listValue, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Value message, length delimited. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Value + * @static + * @param {google.protobuf.IValue} message Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Value.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Value} Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Value.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Value(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.nullValue = reader.int32(); + break; + } + case 2: { + message.numberValue = reader.double(); + break; + } + case 3: { + message.stringValue = reader.string(); + break; + } + case 4: { + message.boolValue = reader.bool(); + break; + } + case 5: { + message.structValue = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + } + case 6: { + message.listValue = $root.google.protobuf.ListValue.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Value message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Value} Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Value.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Value message. + * @function verify + * @memberof google.protobuf.Value + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Value.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.nullValue != null && message.hasOwnProperty("nullValue")) { + properties.kind = 1; + switch (message.nullValue) { + default: + return "nullValue: enum value expected"; + case 0: + break; + } + } + if (message.numberValue != null && message.hasOwnProperty("numberValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + if (typeof message.numberValue !== "number") + return "numberValue: number expected"; + } + if (message.stringValue != null && message.hasOwnProperty("stringValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + if (!$util.isString(message.stringValue)) + return "stringValue: string expected"; + } + if (message.boolValue != null && message.hasOwnProperty("boolValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + if (typeof message.boolValue !== "boolean") + return "boolValue: boolean expected"; + } + if (message.structValue != null && message.hasOwnProperty("structValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + { + var error = $root.google.protobuf.Struct.verify(message.structValue); + if (error) + return "structValue." + error; + } + } + if (message.listValue != null && message.hasOwnProperty("listValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + { + var error = $root.google.protobuf.ListValue.verify(message.listValue); + if (error) + return "listValue." + error; + } + } + return null; + }; + + /** + * Creates a Value message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Value + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Value} Value + */ + Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Value) + return object; + var message = new $root.google.protobuf.Value(); + switch (object.nullValue) { + default: + if (typeof object.nullValue === "number") { + message.nullValue = object.nullValue; + break; + } + break; + case "NULL_VALUE": + case 0: + message.nullValue = 0; + break; + } + if (object.numberValue != null) + message.numberValue = Number(object.numberValue); + if (object.stringValue != null) + message.stringValue = String(object.stringValue); + if (object.boolValue != null) + message.boolValue = Boolean(object.boolValue); + if (object.structValue != null) { + if (typeof object.structValue !== "object") + throw TypeError(".google.protobuf.Value.structValue: object expected"); + message.structValue = $root.google.protobuf.Struct.fromObject(object.structValue); + } + if (object.listValue != null) { + if (typeof object.listValue !== "object") + throw TypeError(".google.protobuf.Value.listValue: object expected"); + message.listValue = $root.google.protobuf.ListValue.fromObject(object.listValue); + } + return message; + }; + + /** + * Creates a plain object from a Value message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Value + * @static + * @param {google.protobuf.Value} message Value + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Value.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.nullValue != null && message.hasOwnProperty("nullValue")) { + object.nullValue = options.enums === String ? $root.google.protobuf.NullValue[message.nullValue] === undefined ? message.nullValue : $root.google.protobuf.NullValue[message.nullValue] : message.nullValue; + if (options.oneofs) + object.kind = "nullValue"; + } + if (message.numberValue != null && message.hasOwnProperty("numberValue")) { + object.numberValue = options.json && !isFinite(message.numberValue) ? String(message.numberValue) : message.numberValue; + if (options.oneofs) + object.kind = "numberValue"; + } + if (message.stringValue != null && message.hasOwnProperty("stringValue")) { + object.stringValue = message.stringValue; + if (options.oneofs) + object.kind = "stringValue"; + } + if (message.boolValue != null && message.hasOwnProperty("boolValue")) { + object.boolValue = message.boolValue; + if (options.oneofs) + object.kind = "boolValue"; + } + if (message.structValue != null && message.hasOwnProperty("structValue")) { + object.structValue = $root.google.protobuf.Struct.toObject(message.structValue, options); + if (options.oneofs) + object.kind = "structValue"; + } + if (message.listValue != null && message.hasOwnProperty("listValue")) { + object.listValue = $root.google.protobuf.ListValue.toObject(message.listValue, options); + if (options.oneofs) + object.kind = "listValue"; + } + return object; + }; + + /** + * Converts this Value to JSON. + * @function toJSON + * @memberof google.protobuf.Value + * @instance + * @returns {Object.} JSON object + */ + Value.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Value + * @function getTypeUrl + * @memberof google.protobuf.Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Value"; + }; + + return Value; + })(); + + /** + * NullValue enum. + * @name google.protobuf.NullValue + * @enum {number} + * @property {number} NULL_VALUE=0 NULL_VALUE value + */ + protobuf.NullValue = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NULL_VALUE"] = 0; + return values; + })(); + + protobuf.ListValue = (function() { + + /** + * Properties of a ListValue. + * @memberof google.protobuf + * @interface IListValue + * @property {Array.|null} [values] ListValue values + */ + + /** + * Constructs a new ListValue. + * @memberof google.protobuf + * @classdesc Represents a ListValue. + * @implements IListValue + * @constructor + * @param {google.protobuf.IListValue=} [properties] Properties to set + */ + function ListValue(properties) { + this.values = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListValue values. + * @member {Array.} values + * @memberof google.protobuf.ListValue + * @instance + */ + ListValue.prototype.values = $util.emptyArray; + + /** + * Creates a new ListValue instance using the specified properties. + * @function create + * @memberof google.protobuf.ListValue + * @static + * @param {google.protobuf.IListValue=} [properties] Properties to set + * @returns {google.protobuf.ListValue} ListValue instance + */ + ListValue.create = function create(properties) { + return new ListValue(properties); + }; + + /** + * Encodes the specified ListValue message. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ListValue + * @static + * @param {google.protobuf.IListValue} message ListValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.values != null && message.values.length) + for (var i = 0; i < message.values.length; ++i) + $root.google.protobuf.Value.encode(message.values[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ListValue message, length delimited. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ListValue + * @static + * @param {google.protobuf.IListValue} message ListValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ListValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ListValue} ListValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListValue.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ListValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.values && message.values.length)) + message.values = []; + message.values.push($root.google.protobuf.Value.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ListValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ListValue} ListValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListValue message. + * @function verify + * @memberof google.protobuf.ListValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.values != null && message.hasOwnProperty("values")) { + if (!Array.isArray(message.values)) + return "values: array expected"; + for (var i = 0; i < message.values.length; ++i) { + var error = $root.google.protobuf.Value.verify(message.values[i]); + if (error) + return "values." + error; + } + } + return null; + }; + + /** + * Creates a ListValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ListValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ListValue} ListValue + */ + ListValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ListValue) + return object; + var message = new $root.google.protobuf.ListValue(); + if (object.values) { + if (!Array.isArray(object.values)) + throw TypeError(".google.protobuf.ListValue.values: array expected"); + message.values = []; + for (var i = 0; i < object.values.length; ++i) { + if (typeof object.values[i] !== "object") + throw TypeError(".google.protobuf.ListValue.values: object expected"); + message.values[i] = $root.google.protobuf.Value.fromObject(object.values[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ListValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ListValue + * @static + * @param {google.protobuf.ListValue} message ListValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.values = []; + if (message.values && message.values.length) { + object.values = []; + for (var j = 0; j < message.values.length; ++j) + object.values[j] = $root.google.protobuf.Value.toObject(message.values[j], options); + } + return object; + }; + + /** + * Converts this ListValue to JSON. + * @function toJSON + * @memberof google.protobuf.ListValue + * @instance + * @returns {Object.} JSON object + */ + ListValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListValue + * @function getTypeUrl + * @memberof google.protobuf.ListValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ListValue"; + }; + + return ListValue; + })(); + + protobuf.Duration = (function() { + + /** + * Properties of a Duration. + * @memberof google.protobuf + * @interface IDuration + * @property {number|Long|null} [seconds] Duration seconds + * @property {number|null} [nanos] Duration nanos + */ + + /** + * Constructs a new Duration. + * @memberof google.protobuf + * @classdesc Represents a Duration. + * @implements IDuration + * @constructor + * @param {google.protobuf.IDuration=} [properties] Properties to set + */ + function Duration(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Duration seconds. + * @member {number|Long} seconds + * @memberof google.protobuf.Duration + * @instance + */ + Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Duration nanos. + * @member {number} nanos + * @memberof google.protobuf.Duration + * @instance + */ + Duration.prototype.nanos = 0; + + /** + * Creates a new Duration instance using the specified properties. + * @function create + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration=} [properties] Properties to set + * @returns {google.protobuf.Duration} Duration instance + */ + Duration.create = function create(properties) { + return new Duration(properties); + }; + + /** + * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration} message Duration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); + return writer; + }; + + /** + * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration} message Duration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Duration(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.seconds = reader.int64(); + break; + } + case 2: { + message.nanos = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Duration message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Duration message. + * @function verify + * @memberof google.protobuf.Duration + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Duration.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) + return "seconds: integer|Long expected"; + if (message.nanos != null && message.hasOwnProperty("nanos")) + if (!$util.isInteger(message.nanos)) + return "nanos: integer expected"; + return null; + }; + + /** + * Creates a Duration message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Duration + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Duration} Duration + */ + Duration.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Duration) + return object; + var message = new $root.google.protobuf.Duration(); + if (object.seconds != null) + if ($util.Long) + (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; + else if (typeof object.seconds === "string") + message.seconds = parseInt(object.seconds, 10); + else if (typeof object.seconds === "number") + message.seconds = object.seconds; + else if (typeof object.seconds === "object") + message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); + if (object.nanos != null) + message.nanos = object.nanos | 0; + return message; + }; + + /** + * Creates a plain object from a Duration message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.Duration} message Duration + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Duration.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.seconds = options.longs === String ? "0" : 0; + object.nanos = 0; + } + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (typeof message.seconds === "number") + object.seconds = options.longs === String ? String(message.seconds) : message.seconds; + else + object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; + if (message.nanos != null && message.hasOwnProperty("nanos")) + object.nanos = message.nanos; + return object; + }; + + /** + * Converts this Duration to JSON. + * @function toJSON + * @memberof google.protobuf.Duration + * @instance + * @returns {Object.} JSON object + */ + Duration.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Duration + * @function getTypeUrl + * @memberof google.protobuf.Duration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Duration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Duration"; + }; + + return Duration; + })(); + + protobuf.Timestamp = (function() { + + /** + * Properties of a Timestamp. + * @memberof google.protobuf + * @interface ITimestamp + * @property {number|Long|null} [seconds] Timestamp seconds + * @property {number|null} [nanos] Timestamp nanos + */ + + /** + * Constructs a new Timestamp. + * @memberof google.protobuf + * @classdesc Represents a Timestamp. + * @implements ITimestamp + * @constructor + * @param {google.protobuf.ITimestamp=} [properties] Properties to set + */ + function Timestamp(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Timestamp seconds. + * @member {number|Long} seconds + * @memberof google.protobuf.Timestamp + * @instance + */ + Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Timestamp nanos. + * @member {number} nanos + * @memberof google.protobuf.Timestamp + * @instance + */ + Timestamp.prototype.nanos = 0; + + /** + * Creates a new Timestamp instance using the specified properties. + * @function create + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp=} [properties] Properties to set + * @returns {google.protobuf.Timestamp} Timestamp instance + */ + Timestamp.create = function create(properties) { + return new Timestamp(properties); + }; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); + return writer; + }; + + /** + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Timestamp(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.seconds = reader.int64(); + break; + } + case 2: { + message.nanos = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Timestamp message. + * @function verify + * @memberof google.protobuf.Timestamp + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Timestamp.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) + return "seconds: integer|Long expected"; + if (message.nanos != null && message.hasOwnProperty("nanos")) + if (!$util.isInteger(message.nanos)) + return "nanos: integer expected"; + return null; + }; + + /** + * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Timestamp + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Timestamp} Timestamp + */ + Timestamp.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Timestamp) + return object; + var message = new $root.google.protobuf.Timestamp(); + if (object.seconds != null) + if ($util.Long) + (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; + else if (typeof object.seconds === "string") + message.seconds = parseInt(object.seconds, 10); + else if (typeof object.seconds === "number") + message.seconds = object.seconds; + else if (typeof object.seconds === "object") + message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); + if (object.nanos != null) + message.nanos = object.nanos | 0; + return message; + }; + + /** + * Creates a plain object from a Timestamp message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.Timestamp} message Timestamp + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Timestamp.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.seconds = options.longs === String ? "0" : 0; + object.nanos = 0; + } + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (typeof message.seconds === "number") + object.seconds = options.longs === String ? String(message.seconds) : message.seconds; + else + object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; + if (message.nanos != null && message.hasOwnProperty("nanos")) + object.nanos = message.nanos; + return object; + }; + + /** + * Converts this Timestamp to JSON. + * @function toJSON + * @memberof google.protobuf.Timestamp + * @instance + * @returns {Object.} JSON object + */ + Timestamp.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Timestamp + * @function getTypeUrl + * @memberof google.protobuf.Timestamp + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Timestamp.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Timestamp"; + }; + + return Timestamp; + })(); + + return protobuf; + })(); + + google.rpc = (function() { + + /** + * Namespace rpc. + * @memberof google + * @namespace + */ + var rpc = {}; + + rpc.Status = (function() { + + /** + * Properties of a Status. + * @memberof google.rpc + * @interface IStatus + * @property {number|null} [code] Status code + * @property {string|null} [message] Status message + * @property {Array.|null} [details] Status details + */ + + /** + * Constructs a new Status. + * @memberof google.rpc + * @classdesc Represents a Status. + * @implements IStatus + * @constructor + * @param {google.rpc.IStatus=} [properties] Properties to set + */ + function Status(properties) { + this.details = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Status code. + * @member {number} code + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.code = 0; + + /** + * Status message. + * @member {string} message + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.message = ""; + + /** + * Status details. + * @member {Array.} details + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.details = $util.emptyArray; + + /** + * Creates a new Status instance using the specified properties. + * @function create + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus=} [properties] Properties to set + * @returns {google.rpc.Status} Status instance + */ + Status.create = function create(properties) { + return new Status(properties); + }; + + /** + * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @function encode + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus} message Status message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Status.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.code != null && Object.hasOwnProperty.call(message, "code")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.code); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.message); + if (message.details != null && message.details.length) + for (var i = 0; i < message.details.length; ++i) + $root.google.protobuf.Any.encode(message.details[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @function encodeDelimited + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus} message Status message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Status.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Status message from the specified reader or buffer. + * @function decode + * @memberof google.rpc.Status + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.rpc.Status} Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Status.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.rpc.Status(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.code = reader.int32(); + break; + } + case 2: { + message.message = reader.string(); + break; + } + case 3: { + if (!(message.details && message.details.length)) + message.details = []; + message.details.push($root.google.protobuf.Any.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Status message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.rpc.Status + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.rpc.Status} Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Status.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Status message. + * @function verify + * @memberof google.rpc.Status + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Status.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.code != null && message.hasOwnProperty("code")) + if (!$util.isInteger(message.code)) + return "code: integer expected"; + if (message.message != null && message.hasOwnProperty("message")) + if (!$util.isString(message.message)) + return "message: string expected"; + if (message.details != null && message.hasOwnProperty("details")) { + if (!Array.isArray(message.details)) + return "details: array expected"; + for (var i = 0; i < message.details.length; ++i) { + var error = $root.google.protobuf.Any.verify(message.details[i]); + if (error) + return "details." + error; + } + } + return null; + }; + + /** + * Creates a Status message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.rpc.Status + * @static + * @param {Object.} object Plain object + * @returns {google.rpc.Status} Status + */ + Status.fromObject = function fromObject(object) { + if (object instanceof $root.google.rpc.Status) + return object; + var message = new $root.google.rpc.Status(); + if (object.code != null) + message.code = object.code | 0; + if (object.message != null) + message.message = String(object.message); + if (object.details) { + if (!Array.isArray(object.details)) + throw TypeError(".google.rpc.Status.details: array expected"); + message.details = []; + for (var i = 0; i < object.details.length; ++i) { + if (typeof object.details[i] !== "object") + throw TypeError(".google.rpc.Status.details: object expected"); + message.details[i] = $root.google.protobuf.Any.fromObject(object.details[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Status message. Also converts values to other types if specified. + * @function toObject + * @memberof google.rpc.Status + * @static + * @param {google.rpc.Status} message Status + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Status.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.details = []; + if (options.defaults) { + object.code = 0; + object.message = ""; + } + if (message.code != null && message.hasOwnProperty("code")) + object.code = message.code; + if (message.message != null && message.hasOwnProperty("message")) + object.message = message.message; + if (message.details && message.details.length) { + object.details = []; + for (var j = 0; j < message.details.length; ++j) + object.details[j] = $root.google.protobuf.Any.toObject(message.details[j], options); + } + return object; + }; + + /** + * Converts this Status to JSON. + * @function toJSON + * @memberof google.rpc.Status + * @instance + * @returns {Object.} JSON object + */ + Status.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Status + * @function getTypeUrl + * @memberof google.rpc.Status + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Status.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.rpc.Status"; + }; + + return Status; + })(); + + return rpc; + })(); + + return google; + })(); + + return $root; +}); diff --git a/packages/google-dataflow/protos/protos.json b/packages/google-dataflow/protos/protos.json new file mode 100644 index 00000000000..36fe6f07db0 --- /dev/null +++ b/packages/google-dataflow/protos/protos.json @@ -0,0 +1,4119 @@ +{ + "nested": { + "google": { + "nested": { + "dataflow": { + "nested": { + "v1beta3": { + "options": { + "csharp_namespace": "Google.Cloud.Dataflow.V1Beta3", + "go_package": "google.golang.org/genproto/googleapis/dataflow/v1beta3;dataflow", + "java_multiple_files": true, + "java_outer_classname": "TemplatesProto", + "java_package": "com.google.dataflow.v1beta3", + "php_namespace": "Google\\Cloud\\Dataflow\\V1beta3", + "ruby_package": "Google::Cloud::Dataflow::V1beta3" + }, + "nested": { + "Environment": { + "fields": { + "tempStoragePrefix": { + "type": "string", + "id": 1 + }, + "clusterManagerApiService": { + "type": "string", + "id": 2 + }, + "experiments": { + "rule": "repeated", + "type": "string", + "id": 3 + }, + "serviceOptions": { + "rule": "repeated", + "type": "string", + "id": 16 + }, + "serviceKmsKeyName": { + "type": "string", + "id": 12 + }, + "workerPools": { + "rule": "repeated", + "type": "WorkerPool", + "id": 4 + }, + "userAgent": { + "type": "google.protobuf.Struct", + "id": 5 + }, + "version": { + "type": "google.protobuf.Struct", + "id": 6 + }, + "dataset": { + "type": "string", + "id": 7 + }, + "sdkPipelineOptions": { + "type": "google.protobuf.Struct", + "id": 8 + }, + "internalExperiments": { + "type": "google.protobuf.Any", + "id": 9 + }, + "serviceAccountEmail": { + "type": "string", + "id": 10 + }, + "flexResourceSchedulingGoal": { + "type": "FlexResourceSchedulingGoal", + "id": 11 + }, + "workerRegion": { + "type": "string", + "id": 13 + }, + "workerZone": { + "type": "string", + "id": 14 + }, + "shuffleMode": { + "type": "ShuffleMode", + "id": 15, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "debugOptions": { + "type": "DebugOptions", + "id": 17 + } + } + }, + "Package": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "location": { + "type": "string", + "id": 2 + } + } + }, + "JobType": { + "values": { + "JOB_TYPE_UNKNOWN": 0, + "JOB_TYPE_BATCH": 1, + "JOB_TYPE_STREAMING": 2 + } + }, + "FlexResourceSchedulingGoal": { + "values": { + "FLEXRS_UNSPECIFIED": 0, + "FLEXRS_SPEED_OPTIMIZED": 1, + "FLEXRS_COST_OPTIMIZED": 2 + } + }, + "Disk": { + "fields": { + "sizeGb": { + "type": "int32", + "id": 1 + }, + "diskType": { + "type": "string", + "id": 2 + }, + "mountPoint": { + "type": "string", + "id": 3 + } + } + }, + "WorkerSettings": { + "fields": { + "baseUrl": { + "type": "string", + "id": 1 + }, + "reportingEnabled": { + "type": "bool", + "id": 2 + }, + "servicePath": { + "type": "string", + "id": 3 + }, + "shuffleServicePath": { + "type": "string", + "id": 4 + }, + "workerId": { + "type": "string", + "id": 5 + }, + "tempStoragePrefix": { + "type": "string", + "id": 6 + } + } + }, + "TaskRunnerSettings": { + "fields": { + "taskUser": { + "type": "string", + "id": 1 + }, + "taskGroup": { + "type": "string", + "id": 2 + }, + "oauthScopes": { + "rule": "repeated", + "type": "string", + "id": 3 + }, + "baseUrl": { + "type": "string", + "id": 4 + }, + "dataflowApiVersion": { + "type": "string", + "id": 5 + }, + "parallelWorkerSettings": { + "type": "WorkerSettings", + "id": 6 + }, + "baseTaskDir": { + "type": "string", + "id": 7 + }, + "continueOnException": { + "type": "bool", + "id": 8 + }, + "logToSerialconsole": { + "type": "bool", + "id": 9 + }, + "alsologtostderr": { + "type": "bool", + "id": 10 + }, + "logUploadLocation": { + "type": "string", + "id": 11 + }, + "logDir": { + "type": "string", + "id": 12 + }, + "tempStoragePrefix": { + "type": "string", + "id": 13 + }, + "harnessCommand": { + "type": "string", + "id": 14 + }, + "workflowFileName": { + "type": "string", + "id": 15 + }, + "commandlinesFileName": { + "type": "string", + "id": 16 + }, + "vmId": { + "type": "string", + "id": 17 + }, + "languageHint": { + "type": "string", + "id": 18 + }, + "streamingWorkerMainClass": { + "type": "string", + "id": 19 + } + } + }, + "TeardownPolicy": { + "values": { + "TEARDOWN_POLICY_UNKNOWN": 0, + "TEARDOWN_ALWAYS": 1, + "TEARDOWN_ON_SUCCESS": 2, + "TEARDOWN_NEVER": 3 + } + }, + "DefaultPackageSet": { + "values": { + "DEFAULT_PACKAGE_SET_UNKNOWN": 0, + "DEFAULT_PACKAGE_SET_NONE": 1, + "DEFAULT_PACKAGE_SET_JAVA": 2, + "DEFAULT_PACKAGE_SET_PYTHON": 3 + } + }, + "AutoscalingAlgorithm": { + "values": { + "AUTOSCALING_ALGORITHM_UNKNOWN": 0, + "AUTOSCALING_ALGORITHM_NONE": 1, + "AUTOSCALING_ALGORITHM_BASIC": 2 + } + }, + "AutoscalingSettings": { + "fields": { + "algorithm": { + "type": "AutoscalingAlgorithm", + "id": 1 + }, + "maxNumWorkers": { + "type": "int32", + "id": 2 + } + } + }, + "WorkerIPAddressConfiguration": { + "values": { + "WORKER_IP_UNSPECIFIED": 0, + "WORKER_IP_PUBLIC": 1, + "WORKER_IP_PRIVATE": 2 + } + }, + "SdkHarnessContainerImage": { + "fields": { + "containerImage": { + "type": "string", + "id": 1 + }, + "useSingleCorePerContainer": { + "type": "bool", + "id": 2 + }, + "environmentId": { + "type": "string", + "id": 3 + }, + "capabilities": { + "rule": "repeated", + "type": "string", + "id": 4 + } + } + }, + "WorkerPool": { + "fields": { + "kind": { + "type": "string", + "id": 1 + }, + "numWorkers": { + "type": "int32", + "id": 2 + }, + "packages": { + "rule": "repeated", + "type": "Package", + "id": 3 + }, + "defaultPackageSet": { + "type": "DefaultPackageSet", + "id": 4 + }, + "machineType": { + "type": "string", + "id": 5 + }, + "teardownPolicy": { + "type": "TeardownPolicy", + "id": 6 + }, + "diskSizeGb": { + "type": "int32", + "id": 7 + }, + "diskType": { + "type": "string", + "id": 16 + }, + "diskSourceImage": { + "type": "string", + "id": 8 + }, + "zone": { + "type": "string", + "id": 9 + }, + "taskrunnerSettings": { + "type": "TaskRunnerSettings", + "id": 10 + }, + "onHostMaintenance": { + "type": "string", + "id": 11 + }, + "dataDisks": { + "rule": "repeated", + "type": "Disk", + "id": 12 + }, + "metadata": { + "keyType": "string", + "type": "string", + "id": 13 + }, + "autoscalingSettings": { + "type": "AutoscalingSettings", + "id": 14 + }, + "poolArgs": { + "type": "google.protobuf.Any", + "id": 15 + }, + "network": { + "type": "string", + "id": 17 + }, + "subnetwork": { + "type": "string", + "id": 19 + }, + "workerHarnessContainerImage": { + "type": "string", + "id": 18 + }, + "numThreadsPerWorker": { + "type": "int32", + "id": 20 + }, + "ipConfiguration": { + "type": "WorkerIPAddressConfiguration", + "id": 21 + }, + "sdkHarnessContainerImages": { + "rule": "repeated", + "type": "SdkHarnessContainerImage", + "id": 22 + } + } + }, + "ShuffleMode": { + "values": { + "SHUFFLE_MODE_UNSPECIFIED": 0, + "VM_BASED": 1, + "SERVICE_BASED": 2 + } + }, + "DebugOptions": { + "fields": { + "enableHotKeyLogging": { + "type": "bool", + "id": 1 + } + } + }, + "JobsV1Beta3": { + "options": { + "(google.api.default_host)": "dataflow.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/compute,https://www.googleapis.com/auth/compute.readonly,https://www.googleapis.com/auth/userinfo.email" + }, + "methods": { + "CreateJob": { + "requestType": "CreateJobRequest", + "responseType": "Job", + "options": { + "(google.api.http).post": "/v1b3/projects/{project_id}/locations/{location}/jobs", + "(google.api.http).body": "job", + "(google.api.http).additional_bindings.post": "/v1b3/projects/{project_id}/jobs", + "(google.api.http).additional_bindings.body": "job" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1b3/projects/{project_id}/locations/{location}/jobs", + "body": "job", + "additional_bindings": { + "post": "/v1b3/projects/{project_id}/jobs", + "body": "job" + } + } + } + ] + }, + "GetJob": { + "requestType": "GetJobRequest", + "responseType": "Job", + "options": { + "(google.api.http).get": "/v1b3/projects/{project_id}/locations/{location}/jobs/{job_id}", + "(google.api.http).additional_bindings.get": "/v1b3/projects/{project_id}/jobs/{job_id}" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1b3/projects/{project_id}/locations/{location}/jobs/{job_id}", + "additional_bindings": { + "get": "/v1b3/projects/{project_id}/jobs/{job_id}" + } + } + } + ] + }, + "UpdateJob": { + "requestType": "UpdateJobRequest", + "responseType": "Job", + "options": { + "(google.api.http).put": "/v1b3/projects/{project_id}/locations/{location}/jobs/{job_id}", + "(google.api.http).body": "job", + "(google.api.http).additional_bindings.put": "/v1b3/projects/{project_id}/jobs/{job_id}", + "(google.api.http).additional_bindings.body": "job" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "put": "/v1b3/projects/{project_id}/locations/{location}/jobs/{job_id}", + "body": "job", + "additional_bindings": { + "put": "/v1b3/projects/{project_id}/jobs/{job_id}", + "body": "job" + } + } + } + ] + }, + "ListJobs": { + "requestType": "ListJobsRequest", + "responseType": "ListJobsResponse", + "options": { + "(google.api.http).get": "/v1b3/projects/{project_id}/locations/{location}/jobs", + "(google.api.http).additional_bindings.get": "/v1b3/projects/{project_id}/jobs" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1b3/projects/{project_id}/locations/{location}/jobs", + "additional_bindings": { + "get": "/v1b3/projects/{project_id}/jobs" + } + } + } + ] + }, + "AggregatedListJobs": { + "requestType": "ListJobsRequest", + "responseType": "ListJobsResponse", + "options": { + "(google.api.http).get": "/v1b3/projects/{project_id}/jobs:aggregated" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1b3/projects/{project_id}/jobs:aggregated" + } + } + ] + }, + "CheckActiveJobs": { + "requestType": "CheckActiveJobsRequest", + "responseType": "CheckActiveJobsResponse" + }, + "SnapshotJob": { + "requestType": "SnapshotJobRequest", + "responseType": "Snapshot", + "options": { + "(google.api.http).post": "/v1b3/projects/{project_id}/locations/{location}/jobs/{job_id}:snapshot", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v1b3/projects/{project_id}/jobs/{job_id}:snapshot", + "(google.api.http).additional_bindings.body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1b3/projects/{project_id}/locations/{location}/jobs/{job_id}:snapshot", + "body": "*", + "additional_bindings": { + "post": "/v1b3/projects/{project_id}/jobs/{job_id}:snapshot", + "body": "*" + } + } + } + ] + } + } + }, + "Job": { + "fields": { + "id": { + "type": "string", + "id": 1 + }, + "projectId": { + "type": "string", + "id": 2 + }, + "name": { + "type": "string", + "id": 3 + }, + "type": { + "type": "JobType", + "id": 4 + }, + "environment": { + "type": "Environment", + "id": 5 + }, + "steps": { + "rule": "repeated", + "type": "Step", + "id": 6 + }, + "stepsLocation": { + "type": "string", + "id": 24 + }, + "currentState": { + "type": "JobState", + "id": 7 + }, + "currentStateTime": { + "type": "google.protobuf.Timestamp", + "id": 8 + }, + "requestedState": { + "type": "JobState", + "id": 9 + }, + "executionInfo": { + "type": "JobExecutionInfo", + "id": 10 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 11 + }, + "replaceJobId": { + "type": "string", + "id": 12 + }, + "transformNameMapping": { + "keyType": "string", + "type": "string", + "id": 13 + }, + "clientRequestId": { + "type": "string", + "id": 14 + }, + "replacedByJobId": { + "type": "string", + "id": 15 + }, + "tempFiles": { + "rule": "repeated", + "type": "string", + "id": 16 + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 17 + }, + "location": { + "type": "string", + "id": 18 + }, + "pipelineDescription": { + "type": "PipelineDescription", + "id": 19 + }, + "stageStates": { + "rule": "repeated", + "type": "ExecutionStageState", + "id": 20 + }, + "jobMetadata": { + "type": "JobMetadata", + "id": 21 + }, + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 22 + }, + "createdFromSnapshotId": { + "type": "string", + "id": 23 + }, + "satisfiesPzs": { + "type": "bool", + "id": 25 + } + } + }, + "DatastoreIODetails": { + "fields": { + "namespace": { + "type": "string", + "id": 1 + }, + "projectId": { + "type": "string", + "id": 2 + } + } + }, + "PubSubIODetails": { + "fields": { + "topic": { + "type": "string", + "id": 1 + }, + "subscription": { + "type": "string", + "id": 2 + } + } + }, + "FileIODetails": { + "fields": { + "filePattern": { + "type": "string", + "id": 1 + } + } + }, + "BigTableIODetails": { + "fields": { + "projectId": { + "type": "string", + "id": 1 + }, + "instanceId": { + "type": "string", + "id": 2 + }, + "tableId": { + "type": "string", + "id": 3 + } + } + }, + "BigQueryIODetails": { + "fields": { + "table": { + "type": "string", + "id": 1 + }, + "dataset": { + "type": "string", + "id": 2 + }, + "projectId": { + "type": "string", + "id": 3 + }, + "query": { + "type": "string", + "id": 4 + } + } + }, + "SpannerIODetails": { + "fields": { + "projectId": { + "type": "string", + "id": 1 + }, + "instanceId": { + "type": "string", + "id": 2 + }, + "databaseId": { + "type": "string", + "id": 3 + } + } + }, + "SdkVersion": { + "fields": { + "version": { + "type": "string", + "id": 1 + }, + "versionDisplayName": { + "type": "string", + "id": 2 + }, + "sdkSupportStatus": { + "type": "SdkSupportStatus", + "id": 3 + } + }, + "nested": { + "SdkSupportStatus": { + "values": { + "UNKNOWN": 0, + "SUPPORTED": 1, + "STALE": 2, + "DEPRECATED": 3, + "UNSUPPORTED": 4 + } + } + } + }, + "JobMetadata": { + "fields": { + "sdkVersion": { + "type": "SdkVersion", + "id": 1 + }, + "spannerDetails": { + "rule": "repeated", + "type": "SpannerIODetails", + "id": 2 + }, + "bigqueryDetails": { + "rule": "repeated", + "type": "BigQueryIODetails", + "id": 3 + }, + "bigTableDetails": { + "rule": "repeated", + "type": "BigTableIODetails", + "id": 4 + }, + "pubsubDetails": { + "rule": "repeated", + "type": "PubSubIODetails", + "id": 5 + }, + "fileDetails": { + "rule": "repeated", + "type": "FileIODetails", + "id": 6 + }, + "datastoreDetails": { + "rule": "repeated", + "type": "DatastoreIODetails", + "id": 7 + } + } + }, + "ExecutionStageState": { + "fields": { + "executionStageName": { + "type": "string", + "id": 1 + }, + "executionStageState": { + "type": "JobState", + "id": 2 + }, + "currentStateTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + } + } + }, + "PipelineDescription": { + "fields": { + "originalPipelineTransform": { + "rule": "repeated", + "type": "TransformSummary", + "id": 1 + }, + "executionPipelineStage": { + "rule": "repeated", + "type": "ExecutionStageSummary", + "id": 2 + }, + "displayData": { + "rule": "repeated", + "type": "DisplayData", + "id": 3 + } + } + }, + "KindType": { + "values": { + "UNKNOWN_KIND": 0, + "PAR_DO_KIND": 1, + "GROUP_BY_KEY_KIND": 2, + "FLATTEN_KIND": 3, + "READ_KIND": 4, + "WRITE_KIND": 5, + "CONSTANT_KIND": 6, + "SINGLETON_KIND": 7, + "SHUFFLE_KIND": 8 + } + }, + "TransformSummary": { + "fields": { + "kind": { + "type": "KindType", + "id": 1 + }, + "id": { + "type": "string", + "id": 2 + }, + "name": { + "type": "string", + "id": 3 + }, + "displayData": { + "rule": "repeated", + "type": "DisplayData", + "id": 4 + }, + "outputCollectionName": { + "rule": "repeated", + "type": "string", + "id": 5 + }, + "inputCollectionName": { + "rule": "repeated", + "type": "string", + "id": 6 + } + } + }, + "ExecutionStageSummary": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "id": { + "type": "string", + "id": 2 + }, + "kind": { + "type": "KindType", + "id": 3 + }, + "inputSource": { + "rule": "repeated", + "type": "StageSource", + "id": 4 + }, + "outputSource": { + "rule": "repeated", + "type": "StageSource", + "id": 5 + }, + "prerequisiteStage": { + "rule": "repeated", + "type": "string", + "id": 8 + }, + "componentTransform": { + "rule": "repeated", + "type": "ComponentTransform", + "id": 6 + }, + "componentSource": { + "rule": "repeated", + "type": "ComponentSource", + "id": 7 + } + }, + "nested": { + "StageSource": { + "fields": { + "userName": { + "type": "string", + "id": 1 + }, + "name": { + "type": "string", + "id": 2 + }, + "originalTransformOrCollection": { + "type": "string", + "id": 3 + }, + "sizeBytes": { + "type": "int64", + "id": 4 + } + } + }, + "ComponentTransform": { + "fields": { + "userName": { + "type": "string", + "id": 1 + }, + "name": { + "type": "string", + "id": 2 + }, + "originalTransform": { + "type": "string", + "id": 3 + } + } + }, + "ComponentSource": { + "fields": { + "userName": { + "type": "string", + "id": 1 + }, + "name": { + "type": "string", + "id": 2 + }, + "originalTransformOrCollection": { + "type": "string", + "id": 3 + } + } + } + } + }, + "DisplayData": { + "oneofs": { + "Value": { + "oneof": [ + "strValue", + "int64Value", + "floatValue", + "javaClassValue", + "timestampValue", + "durationValue", + "boolValue" + ] + } + }, + "fields": { + "key": { + "type": "string", + "id": 1 + }, + "namespace": { + "type": "string", + "id": 2 + }, + "strValue": { + "type": "string", + "id": 4 + }, + "int64Value": { + "type": "int64", + "id": 5 + }, + "floatValue": { + "type": "float", + "id": 6 + }, + "javaClassValue": { + "type": "string", + "id": 7 + }, + "timestampValue": { + "type": "google.protobuf.Timestamp", + "id": 8 + }, + "durationValue": { + "type": "google.protobuf.Duration", + "id": 9 + }, + "boolValue": { + "type": "bool", + "id": 10 + }, + "shortStrValue": { + "type": "string", + "id": 11 + }, + "url": { + "type": "string", + "id": 12 + }, + "label": { + "type": "string", + "id": 13 + } + } + }, + "Step": { + "fields": { + "kind": { + "type": "string", + "id": 1 + }, + "name": { + "type": "string", + "id": 2 + }, + "properties": { + "type": "google.protobuf.Struct", + "id": 3 + } + } + }, + "JobState": { + "values": { + "JOB_STATE_UNKNOWN": 0, + "JOB_STATE_STOPPED": 1, + "JOB_STATE_RUNNING": 2, + "JOB_STATE_DONE": 3, + "JOB_STATE_FAILED": 4, + "JOB_STATE_CANCELLED": 5, + "JOB_STATE_UPDATED": 6, + "JOB_STATE_DRAINING": 7, + "JOB_STATE_DRAINED": 8, + "JOB_STATE_PENDING": 9, + "JOB_STATE_CANCELLING": 10, + "JOB_STATE_QUEUED": 11, + "JOB_STATE_RESOURCE_CLEANING_UP": 12 + } + }, + "JobExecutionInfo": { + "fields": { + "stages": { + "keyType": "string", + "type": "JobExecutionStageInfo", + "id": 1 + } + } + }, + "JobExecutionStageInfo": { + "fields": { + "stepName": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + }, + "JobView": { + "values": { + "JOB_VIEW_UNKNOWN": 0, + "JOB_VIEW_SUMMARY": 1, + "JOB_VIEW_ALL": 2, + "JOB_VIEW_DESCRIPTION": 3 + } + }, + "CreateJobRequest": { + "fields": { + "projectId": { + "type": "string", + "id": 1 + }, + "job": { + "type": "Job", + "id": 2 + }, + "view": { + "type": "JobView", + "id": 3 + }, + "replaceJobId": { + "type": "string", + "id": 4 + }, + "location": { + "type": "string", + "id": 5 + } + } + }, + "GetJobRequest": { + "fields": { + "projectId": { + "type": "string", + "id": 1 + }, + "jobId": { + "type": "string", + "id": 2 + }, + "view": { + "type": "JobView", + "id": 3 + }, + "location": { + "type": "string", + "id": 4 + } + } + }, + "UpdateJobRequest": { + "fields": { + "projectId": { + "type": "string", + "id": 1 + }, + "jobId": { + "type": "string", + "id": 2 + }, + "job": { + "type": "Job", + "id": 3 + }, + "location": { + "type": "string", + "id": 4 + } + } + }, + "ListJobsRequest": { + "fields": { + "filter": { + "type": "Filter", + "id": 5 + }, + "projectId": { + "type": "string", + "id": 1 + }, + "view": { + "type": "JobView", + "id": 2, + "options": { + "deprecated": true + } + }, + "pageSize": { + "type": "int32", + "id": 3 + }, + "pageToken": { + "type": "string", + "id": 4 + }, + "location": { + "type": "string", + "id": 17 + } + }, + "nested": { + "Filter": { + "values": { + "UNKNOWN": 0, + "ALL": 1, + "TERMINATED": 2, + "ACTIVE": 3 + } + } + } + }, + "FailedLocation": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "ListJobsResponse": { + "fields": { + "jobs": { + "rule": "repeated", + "type": "Job", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "failedLocation": { + "rule": "repeated", + "type": "FailedLocation", + "id": 3 + } + } + }, + "SnapshotJobRequest": { + "fields": { + "projectId": { + "type": "string", + "id": 1 + }, + "jobId": { + "type": "string", + "id": 2 + }, + "ttl": { + "type": "google.protobuf.Duration", + "id": 3 + }, + "location": { + "type": "string", + "id": 4 + }, + "snapshotSources": { + "type": "bool", + "id": 5 + }, + "description": { + "type": "string", + "id": 6 + } + } + }, + "CheckActiveJobsRequest": { + "fields": { + "projectId": { + "type": "string", + "id": 1 + } + } + }, + "CheckActiveJobsResponse": { + "fields": { + "activeJobsExist": { + "type": "bool", + "id": 1 + } + } + }, + "SnapshotsV1Beta3": { + "options": { + "(google.api.default_host)": "dataflow.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/compute,https://www.googleapis.com/auth/compute.readonly,https://www.googleapis.com/auth/userinfo.email" + }, + "methods": { + "GetSnapshot": { + "requestType": "GetSnapshotRequest", + "responseType": "Snapshot", + "options": { + "(google.api.http).get": "/v1b3/projects/{project_id}/locations/{location}/snapshots/{snapshot_id}", + "(google.api.http).additional_bindings.get": "/v1b3/projects/{project_id}/snapshots/{snapshot_id}" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1b3/projects/{project_id}/locations/{location}/snapshots/{snapshot_id}", + "additional_bindings": { + "get": "/v1b3/projects/{project_id}/snapshots/{snapshot_id}" + } + } + } + ] + }, + "DeleteSnapshot": { + "requestType": "DeleteSnapshotRequest", + "responseType": "DeleteSnapshotResponse", + "options": { + "(google.api.http).delete": "/v1b3/projects/{project_id}/locations/{location}/snapshots/{snapshot_id}", + "(google.api.http).additional_bindings.delete": "/v1b3/projects/{project_id}/snapshots" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1b3/projects/{project_id}/locations/{location}/snapshots/{snapshot_id}", + "additional_bindings": { + "delete": "/v1b3/projects/{project_id}/snapshots" + } + } + } + ] + }, + "ListSnapshots": { + "requestType": "ListSnapshotsRequest", + "responseType": "ListSnapshotsResponse", + "options": { + "(google.api.http).get": "/v1b3/projects/{project_id}/locations/{location}/jobs/{job_id}/snapshots", + "(google.api.http).additional_bindings.get": "/v1b3/projects/{project_id}/snapshots" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1b3/projects/{project_id}/locations/{location}/jobs/{job_id}/snapshots", + "additional_bindings": [ + { + "get": "/v1b3/projects/{project_id}/locations/{location}/snapshots" + }, + { + "get": "/v1b3/projects/{project_id}/snapshots" + } + ] + } + } + ] + } + } + }, + "SnapshotState": { + "values": { + "UNKNOWN_SNAPSHOT_STATE": 0, + "PENDING": 1, + "RUNNING": 2, + "READY": 3, + "FAILED": 4, + "DELETED": 5 + } + }, + "PubsubSnapshotMetadata": { + "fields": { + "topicName": { + "type": "string", + "id": 1 + }, + "snapshotName": { + "type": "string", + "id": 2 + }, + "expireTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + } + } + }, + "Snapshot": { + "fields": { + "id": { + "type": "string", + "id": 1 + }, + "projectId": { + "type": "string", + "id": 2 + }, + "sourceJobId": { + "type": "string", + "id": 3 + }, + "creationTime": { + "type": "google.protobuf.Timestamp", + "id": 4 + }, + "ttl": { + "type": "google.protobuf.Duration", + "id": 5 + }, + "state": { + "type": "SnapshotState", + "id": 6 + }, + "pubsubMetadata": { + "rule": "repeated", + "type": "PubsubSnapshotMetadata", + "id": 7 + }, + "description": { + "type": "string", + "id": 8 + }, + "diskSizeBytes": { + "type": "int64", + "id": 9 + }, + "region": { + "type": "string", + "id": 10 + } + } + }, + "GetSnapshotRequest": { + "fields": { + "projectId": { + "type": "string", + "id": 1 + }, + "snapshotId": { + "type": "string", + "id": 2 + }, + "location": { + "type": "string", + "id": 3 + } + } + }, + "DeleteSnapshotRequest": { + "fields": { + "projectId": { + "type": "string", + "id": 1 + }, + "snapshotId": { + "type": "string", + "id": 2 + }, + "location": { + "type": "string", + "id": 3 + } + } + }, + "DeleteSnapshotResponse": { + "fields": {} + }, + "ListSnapshotsRequest": { + "fields": { + "projectId": { + "type": "string", + "id": 1 + }, + "jobId": { + "type": "string", + "id": 3 + }, + "location": { + "type": "string", + "id": 2 + } + } + }, + "ListSnapshotsResponse": { + "fields": { + "snapshots": { + "rule": "repeated", + "type": "Snapshot", + "id": 1 + } + } + }, + "MessagesV1Beta3": { + "options": { + "(google.api.default_host)": "dataflow.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/compute,https://www.googleapis.com/auth/compute.readonly,https://www.googleapis.com/auth/userinfo.email" + }, + "methods": { + "ListJobMessages": { + "requestType": "ListJobMessagesRequest", + "responseType": "ListJobMessagesResponse", + "options": { + "(google.api.http).get": "/v1b3/projects/{project_id}/locations/{location}/jobs/{job_id}/messages", + "(google.api.http).additional_bindings.get": "/v1b3/projects/{project_id}/jobs/{job_id}/messages" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1b3/projects/{project_id}/locations/{location}/jobs/{job_id}/messages", + "additional_bindings": { + "get": "/v1b3/projects/{project_id}/jobs/{job_id}/messages" + } + } + } + ] + } + } + }, + "JobMessage": { + "fields": { + "id": { + "type": "string", + "id": 1 + }, + "time": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "messageText": { + "type": "string", + "id": 3 + }, + "messageImportance": { + "type": "JobMessageImportance", + "id": 4 + } + } + }, + "JobMessageImportance": { + "values": { + "JOB_MESSAGE_IMPORTANCE_UNKNOWN": 0, + "JOB_MESSAGE_DEBUG": 1, + "JOB_MESSAGE_DETAILED": 2, + "JOB_MESSAGE_BASIC": 5, + "JOB_MESSAGE_WARNING": 3, + "JOB_MESSAGE_ERROR": 4 + } + }, + "StructuredMessage": { + "fields": { + "messageText": { + "type": "string", + "id": 1 + }, + "messageKey": { + "type": "string", + "id": 2 + }, + "parameters": { + "rule": "repeated", + "type": "Parameter", + "id": 3 + } + }, + "nested": { + "Parameter": { + "fields": { + "key": { + "type": "string", + "id": 1 + }, + "value": { + "type": "google.protobuf.Value", + "id": 2 + } + } + } + } + }, + "AutoscalingEvent": { + "fields": { + "currentNumWorkers": { + "type": "int64", + "id": 1 + }, + "targetNumWorkers": { + "type": "int64", + "id": 2 + }, + "eventType": { + "type": "AutoscalingEventType", + "id": 3 + }, + "description": { + "type": "StructuredMessage", + "id": 4 + }, + "time": { + "type": "google.protobuf.Timestamp", + "id": 5 + }, + "workerPool": { + "type": "string", + "id": 7 + } + }, + "nested": { + "AutoscalingEventType": { + "values": { + "TYPE_UNKNOWN": 0, + "TARGET_NUM_WORKERS_CHANGED": 1, + "CURRENT_NUM_WORKERS_CHANGED": 2, + "ACTUATION_FAILURE": 3, + "NO_CHANGE": 4 + } + } + } + }, + "ListJobMessagesRequest": { + "fields": { + "projectId": { + "type": "string", + "id": 1 + }, + "jobId": { + "type": "string", + "id": 2 + }, + "minimumImportance": { + "type": "JobMessageImportance", + "id": 3 + }, + "pageSize": { + "type": "int32", + "id": 4 + }, + "pageToken": { + "type": "string", + "id": 5 + }, + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 6 + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 7 + }, + "location": { + "type": "string", + "id": 8 + } + } + }, + "ListJobMessagesResponse": { + "fields": { + "jobMessages": { + "rule": "repeated", + "type": "JobMessage", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "autoscalingEvents": { + "rule": "repeated", + "type": "AutoscalingEvent", + "id": 3 + } + } + }, + "MetricsV1Beta3": { + "options": { + "(google.api.default_host)": "dataflow.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/compute,https://www.googleapis.com/auth/compute.readonly,https://www.googleapis.com/auth/userinfo.email" + }, + "methods": { + "GetJobMetrics": { + "requestType": "GetJobMetricsRequest", + "responseType": "JobMetrics", + "options": { + "(google.api.http).get": "/v1b3/projects/{project_id}/locations/{location}/jobs/{job_id}/metrics", + "(google.api.http).additional_bindings.get": "/v1b3/projects/{project_id}/jobs/{job_id}/metrics" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1b3/projects/{project_id}/locations/{location}/jobs/{job_id}/metrics", + "additional_bindings": { + "get": "/v1b3/projects/{project_id}/jobs/{job_id}/metrics" + } + } + } + ] + }, + "GetJobExecutionDetails": { + "requestType": "GetJobExecutionDetailsRequest", + "responseType": "JobExecutionDetails", + "options": { + "(google.api.http).get": "/v1b3/projects/{project_id}/locations/{location}/jobs/{job_id}/executionDetails" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1b3/projects/{project_id}/locations/{location}/jobs/{job_id}/executionDetails" + } + } + ] + }, + "GetStageExecutionDetails": { + "requestType": "GetStageExecutionDetailsRequest", + "responseType": "StageExecutionDetails", + "options": { + "(google.api.http).get": "/v1b3/projects/{project_id}/locations/{location}/jobs/{job_id}/stages/{stage_id}/executionDetails" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1b3/projects/{project_id}/locations/{location}/jobs/{job_id}/stages/{stage_id}/executionDetails" + } + } + ] + } + } + }, + "MetricStructuredName": { + "fields": { + "origin": { + "type": "string", + "id": 1 + }, + "name": { + "type": "string", + "id": 2 + }, + "context": { + "keyType": "string", + "type": "string", + "id": 3 + } + } + }, + "MetricUpdate": { + "fields": { + "name": { + "type": "MetricStructuredName", + "id": 1 + }, + "kind": { + "type": "string", + "id": 2 + }, + "cumulative": { + "type": "bool", + "id": 3 + }, + "scalar": { + "type": "google.protobuf.Value", + "id": 4 + }, + "meanSum": { + "type": "google.protobuf.Value", + "id": 5 + }, + "meanCount": { + "type": "google.protobuf.Value", + "id": 6 + }, + "set": { + "type": "google.protobuf.Value", + "id": 7 + }, + "distribution": { + "type": "google.protobuf.Value", + "id": 11 + }, + "gauge": { + "type": "google.protobuf.Value", + "id": 12 + }, + "internal": { + "type": "google.protobuf.Value", + "id": 8 + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 9 + } + } + }, + "GetJobMetricsRequest": { + "fields": { + "projectId": { + "type": "string", + "id": 1 + }, + "jobId": { + "type": "string", + "id": 2 + }, + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + }, + "location": { + "type": "string", + "id": 4 + } + } + }, + "JobMetrics": { + "fields": { + "metricTime": { + "type": "google.protobuf.Timestamp", + "id": 1 + }, + "metrics": { + "rule": "repeated", + "type": "MetricUpdate", + "id": 2 + } + } + }, + "GetJobExecutionDetailsRequest": { + "fields": { + "projectId": { + "type": "string", + "id": 1 + }, + "jobId": { + "type": "string", + "id": 2 + }, + "location": { + "type": "string", + "id": 3 + }, + "pageSize": { + "type": "int32", + "id": 4 + }, + "pageToken": { + "type": "string", + "id": 5 + } + } + }, + "ProgressTimeseries": { + "fields": { + "currentProgress": { + "type": "double", + "id": 1 + }, + "dataPoints": { + "rule": "repeated", + "type": "Point", + "id": 2 + } + }, + "nested": { + "Point": { + "fields": { + "time": { + "type": "google.protobuf.Timestamp", + "id": 1 + }, + "value": { + "type": "double", + "id": 2 + } + } + } + } + }, + "ExecutionState": { + "values": { + "EXECUTION_STATE_UNKNOWN": 0, + "EXECUTION_STATE_NOT_STARTED": 1, + "EXECUTION_STATE_RUNNING": 2, + "EXECUTION_STATE_SUCCEEDED": 3, + "EXECUTION_STATE_FAILED": 4, + "EXECUTION_STATE_CANCELLED": 5 + } + }, + "StageSummary": { + "fields": { + "stageId": { + "type": "string", + "id": 1 + }, + "state": { + "type": "ExecutionState", + "id": 2 + }, + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 4 + }, + "progress": { + "type": "ProgressTimeseries", + "id": 5 + }, + "metrics": { + "rule": "repeated", + "type": "MetricUpdate", + "id": 6 + } + } + }, + "JobExecutionDetails": { + "fields": { + "stages": { + "rule": "repeated", + "type": "StageSummary", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetStageExecutionDetailsRequest": { + "fields": { + "projectId": { + "type": "string", + "id": 1 + }, + "jobId": { + "type": "string", + "id": 2 + }, + "location": { + "type": "string", + "id": 3 + }, + "stageId": { + "type": "string", + "id": 4 + }, + "pageSize": { + "type": "int32", + "id": 5 + }, + "pageToken": { + "type": "string", + "id": 6 + }, + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 7 + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 8 + } + } + }, + "WorkItemDetails": { + "fields": { + "taskId": { + "type": "string", + "id": 1 + }, + "attemptId": { + "type": "string", + "id": 2 + }, + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 4 + }, + "state": { + "type": "ExecutionState", + "id": 5 + }, + "progress": { + "type": "ProgressTimeseries", + "id": 6 + }, + "metrics": { + "rule": "repeated", + "type": "MetricUpdate", + "id": 7 + } + } + }, + "WorkerDetails": { + "fields": { + "workerName": { + "type": "string", + "id": 1 + }, + "workItems": { + "rule": "repeated", + "type": "WorkItemDetails", + "id": 2 + } + } + }, + "StageExecutionDetails": { + "fields": { + "workers": { + "rule": "repeated", + "type": "WorkerDetails", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "TopologyConfig": { + "fields": { + "computations": { + "rule": "repeated", + "type": "ComputationTopology", + "id": 1 + }, + "dataDiskAssignments": { + "rule": "repeated", + "type": "DataDiskAssignment", + "id": 2 + }, + "userStageToComputationNameMap": { + "keyType": "string", + "type": "string", + "id": 3 + }, + "forwardingKeyBits": { + "type": "int32", + "id": 4 + }, + "persistentStateVersion": { + "type": "int32", + "id": 5 + } + } + }, + "PubsubLocation": { + "fields": { + "topic": { + "type": "string", + "id": 1 + }, + "subscription": { + "type": "string", + "id": 2 + }, + "timestampLabel": { + "type": "string", + "id": 3 + }, + "idLabel": { + "type": "string", + "id": 4 + }, + "dropLateData": { + "type": "bool", + "id": 5 + }, + "trackingSubscription": { + "type": "string", + "id": 6 + }, + "withAttributes": { + "type": "bool", + "id": 7 + } + } + }, + "StreamingStageLocation": { + "fields": { + "streamId": { + "type": "string", + "id": 1 + } + } + }, + "StreamingSideInputLocation": { + "fields": { + "tag": { + "type": "string", + "id": 1 + }, + "stateFamily": { + "type": "string", + "id": 2 + } + } + }, + "CustomSourceLocation": { + "fields": { + "stateful": { + "type": "bool", + "id": 1 + } + } + }, + "StreamLocation": { + "oneofs": { + "location": { + "oneof": [ + "streamingStageLocation", + "pubsubLocation", + "sideInputLocation", + "customSourceLocation" + ] + } + }, + "fields": { + "streamingStageLocation": { + "type": "StreamingStageLocation", + "id": 1 + }, + "pubsubLocation": { + "type": "PubsubLocation", + "id": 2 + }, + "sideInputLocation": { + "type": "StreamingSideInputLocation", + "id": 3 + }, + "customSourceLocation": { + "type": "CustomSourceLocation", + "id": 4 + } + } + }, + "StateFamilyConfig": { + "fields": { + "stateFamily": { + "type": "string", + "id": 1 + }, + "isRead": { + "type": "bool", + "id": 2 + } + } + }, + "ComputationTopology": { + "fields": { + "systemStageName": { + "type": "string", + "id": 1 + }, + "computationId": { + "type": "string", + "id": 5 + }, + "keyRanges": { + "rule": "repeated", + "type": "KeyRangeLocation", + "id": 2 + }, + "inputs": { + "rule": "repeated", + "type": "StreamLocation", + "id": 3 + }, + "outputs": { + "rule": "repeated", + "type": "StreamLocation", + "id": 4 + }, + "stateFamilies": { + "rule": "repeated", + "type": "StateFamilyConfig", + "id": 7 + } + } + }, + "KeyRangeLocation": { + "fields": { + "start": { + "type": "string", + "id": 1 + }, + "end": { + "type": "string", + "id": 2 + }, + "deliveryEndpoint": { + "type": "string", + "id": 3 + }, + "dataDisk": { + "type": "string", + "id": 5 + }, + "deprecatedPersistentDirectory": { + "type": "string", + "id": 4, + "options": { + "deprecated": true + } + } + } + }, + "MountedDataDisk": { + "fields": { + "dataDisk": { + "type": "string", + "id": 1 + } + } + }, + "DataDiskAssignment": { + "fields": { + "vmInstance": { + "type": "string", + "id": 1 + }, + "dataDisks": { + "rule": "repeated", + "type": "string", + "id": 2 + } + } + }, + "KeyRangeDataDiskAssignment": { + "fields": { + "start": { + "type": "string", + "id": 1 + }, + "end": { + "type": "string", + "id": 2 + }, + "dataDisk": { + "type": "string", + "id": 3 + } + } + }, + "StreamingComputationRanges": { + "fields": { + "computationId": { + "type": "string", + "id": 1 + }, + "rangeAssignments": { + "rule": "repeated", + "type": "KeyRangeDataDiskAssignment", + "id": 2 + } + } + }, + "StreamingApplianceSnapshotConfig": { + "fields": { + "snapshotId": { + "type": "string", + "id": 1 + }, + "importStateEndpoint": { + "type": "string", + "id": 2 + } + } + }, + "TemplatesService": { + "options": { + "(google.api.default_host)": "dataflow.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/compute,https://www.googleapis.com/auth/compute.readonly,https://www.googleapis.com/auth/userinfo.email" + }, + "methods": { + "CreateJobFromTemplate": { + "requestType": "CreateJobFromTemplateRequest", + "responseType": "Job", + "options": { + "(google.api.http).post": "/v1b3/projects/{project_id}/locations/{location}/templates", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v1b3/projects/{project_id}/templates", + "(google.api.http).additional_bindings.body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1b3/projects/{project_id}/locations/{location}/templates", + "body": "*", + "additional_bindings": { + "post": "/v1b3/projects/{project_id}/templates", + "body": "*" + } + } + } + ] + }, + "LaunchTemplate": { + "requestType": "LaunchTemplateRequest", + "responseType": "LaunchTemplateResponse", + "options": { + "(google.api.http).post": "/v1b3/projects/{project_id}/locations/{location}/templates:launch", + "(google.api.http).body": "launch_parameters", + "(google.api.http).additional_bindings.post": "/v1b3/projects/{project_id}/templates:launch", + "(google.api.http).additional_bindings.body": "launch_parameters" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1b3/projects/{project_id}/locations/{location}/templates:launch", + "body": "launch_parameters", + "additional_bindings": { + "post": "/v1b3/projects/{project_id}/templates:launch", + "body": "launch_parameters" + } + } + } + ] + }, + "GetTemplate": { + "requestType": "GetTemplateRequest", + "responseType": "GetTemplateResponse", + "options": { + "(google.api.http).get": "/v1b3/projects/{project_id}/locations/{location}/templates:get", + "(google.api.http).additional_bindings.get": "/v1b3/projects/{project_id}/templates:get" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1b3/projects/{project_id}/locations/{location}/templates:get", + "additional_bindings": { + "get": "/v1b3/projects/{project_id}/templates:get" + } + } + } + ] + } + } + }, + "FlexTemplatesService": { + "options": { + "(google.api.default_host)": "dataflow.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/compute,https://www.googleapis.com/auth/compute.readonly,https://www.googleapis.com/auth/userinfo.email" + }, + "methods": { + "LaunchFlexTemplate": { + "requestType": "LaunchFlexTemplateRequest", + "responseType": "LaunchFlexTemplateResponse", + "options": { + "(google.api.http).post": "/v1b3/projects/{project_id}/locations/{location}/flexTemplates:launch", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1b3/projects/{project_id}/locations/{location}/flexTemplates:launch", + "body": "*" + } + } + ] + } + } + }, + "LaunchFlexTemplateResponse": { + "fields": { + "job": { + "type": "Job", + "id": 1 + } + } + }, + "ContainerSpec": { + "fields": { + "image": { + "type": "string", + "id": 1 + }, + "metadata": { + "type": "TemplateMetadata", + "id": 2 + }, + "sdkInfo": { + "type": "SDKInfo", + "id": 3 + }, + "defaultEnvironment": { + "type": "FlexTemplateRuntimeEnvironment", + "id": 4 + } + } + }, + "LaunchFlexTemplateParameter": { + "oneofs": { + "template": { + "oneof": [ + "containerSpec", + "containerSpecGcsPath" + ] + } + }, + "fields": { + "jobName": { + "type": "string", + "id": 1 + }, + "containerSpec": { + "type": "ContainerSpec", + "id": 4 + }, + "containerSpecGcsPath": { + "type": "string", + "id": 5 + }, + "parameters": { + "keyType": "string", + "type": "string", + "id": 2 + }, + "launchOptions": { + "keyType": "string", + "type": "string", + "id": 6 + }, + "environment": { + "type": "FlexTemplateRuntimeEnvironment", + "id": 7 + }, + "update": { + "type": "bool", + "id": 8 + }, + "transformNameMappings": { + "keyType": "string", + "type": "string", + "id": 9 + } + } + }, + "FlexTemplateRuntimeEnvironment": { + "fields": { + "numWorkers": { + "type": "int32", + "id": 1 + }, + "maxWorkers": { + "type": "int32", + "id": 2 + }, + "zone": { + "type": "string", + "id": 3 + }, + "serviceAccountEmail": { + "type": "string", + "id": 4 + }, + "tempLocation": { + "type": "string", + "id": 5 + }, + "machineType": { + "type": "string", + "id": 6 + }, + "additionalExperiments": { + "rule": "repeated", + "type": "string", + "id": 7 + }, + "network": { + "type": "string", + "id": 8 + }, + "subnetwork": { + "type": "string", + "id": 9 + }, + "additionalUserLabels": { + "keyType": "string", + "type": "string", + "id": 10 + }, + "kmsKeyName": { + "type": "string", + "id": 11 + }, + "ipConfiguration": { + "type": "WorkerIPAddressConfiguration", + "id": 12 + }, + "workerRegion": { + "type": "string", + "id": 13 + }, + "workerZone": { + "type": "string", + "id": 14 + }, + "enableStreamingEngine": { + "type": "bool", + "id": 15 + }, + "flexrsGoal": { + "type": "FlexResourceSchedulingGoal", + "id": 16 + }, + "stagingLocation": { + "type": "string", + "id": 17 + }, + "sdkContainerImage": { + "type": "string", + "id": 18 + }, + "diskSizeGb": { + "type": "int32", + "id": 20 + }, + "autoscalingAlgorithm": { + "type": "AutoscalingAlgorithm", + "id": 21 + }, + "dumpHeapOnOom": { + "type": "bool", + "id": 22 + }, + "saveHeapDumpsToGcsPath": { + "type": "string", + "id": 23 + }, + "launcherMachineType": { + "type": "string", + "id": 24 + } + } + }, + "LaunchFlexTemplateRequest": { + "fields": { + "projectId": { + "type": "string", + "id": 1 + }, + "launchParameter": { + "type": "LaunchFlexTemplateParameter", + "id": 2 + }, + "location": { + "type": "string", + "id": 3 + }, + "validateOnly": { + "type": "bool", + "id": 4 + } + } + }, + "RuntimeEnvironment": { + "fields": { + "numWorkers": { + "type": "int32", + "id": 11 + }, + "maxWorkers": { + "type": "int32", + "id": 1 + }, + "zone": { + "type": "string", + "id": 2 + }, + "serviceAccountEmail": { + "type": "string", + "id": 3 + }, + "tempLocation": { + "type": "string", + "id": 4 + }, + "bypassTempDirValidation": { + "type": "bool", + "id": 5 + }, + "machineType": { + "type": "string", + "id": 6 + }, + "additionalExperiments": { + "rule": "repeated", + "type": "string", + "id": 7 + }, + "network": { + "type": "string", + "id": 8 + }, + "subnetwork": { + "type": "string", + "id": 9 + }, + "additionalUserLabels": { + "keyType": "string", + "type": "string", + "id": 10 + }, + "kmsKeyName": { + "type": "string", + "id": 12 + }, + "ipConfiguration": { + "type": "WorkerIPAddressConfiguration", + "id": 14 + }, + "workerRegion": { + "type": "string", + "id": 15 + }, + "workerZone": { + "type": "string", + "id": 16 + }, + "enableStreamingEngine": { + "type": "bool", + "id": 17 + } + } + }, + "ParameterMetadata": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "label": { + "type": "string", + "id": 2 + }, + "helpText": { + "type": "string", + "id": 3 + }, + "isOptional": { + "type": "bool", + "id": 4 + }, + "regexes": { + "rule": "repeated", + "type": "string", + "id": 5 + }, + "paramType": { + "type": "ParameterType", + "id": 6 + }, + "customMetadata": { + "keyType": "string", + "type": "string", + "id": 7 + } + } + }, + "ParameterType": { + "values": { + "DEFAULT": 0, + "TEXT": 1, + "GCS_READ_BUCKET": 2, + "GCS_WRITE_BUCKET": 3, + "GCS_READ_FILE": 4, + "GCS_WRITE_FILE": 5, + "GCS_READ_FOLDER": 6, + "GCS_WRITE_FOLDER": 7, + "PUBSUB_TOPIC": 8, + "PUBSUB_SUBSCRIPTION": 9 + } + }, + "TemplateMetadata": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "description": { + "type": "string", + "id": 2 + }, + "parameters": { + "rule": "repeated", + "type": "ParameterMetadata", + "id": 3 + } + } + }, + "SDKInfo": { + "fields": { + "language": { + "type": "Language", + "id": 1 + }, + "version": { + "type": "string", + "id": 2 + } + }, + "nested": { + "Language": { + "values": { + "UNKNOWN": 0, + "JAVA": 1, + "PYTHON": 2 + } + } + } + }, + "RuntimeMetadata": { + "fields": { + "sdkInfo": { + "type": "SDKInfo", + "id": 1 + }, + "parameters": { + "rule": "repeated", + "type": "ParameterMetadata", + "id": 2 + } + } + }, + "CreateJobFromTemplateRequest": { + "oneofs": { + "template": { + "oneof": [ + "gcsPath" + ] + } + }, + "fields": { + "projectId": { + "type": "string", + "id": 1 + }, + "jobName": { + "type": "string", + "id": 4 + }, + "gcsPath": { + "type": "string", + "id": 2 + }, + "parameters": { + "keyType": "string", + "type": "string", + "id": 3 + }, + "environment": { + "type": "RuntimeEnvironment", + "id": 5 + }, + "location": { + "type": "string", + "id": 6 + } + } + }, + "GetTemplateRequest": { + "oneofs": { + "template": { + "oneof": [ + "gcsPath" + ] + } + }, + "fields": { + "projectId": { + "type": "string", + "id": 1 + }, + "gcsPath": { + "type": "string", + "id": 2 + }, + "view": { + "type": "TemplateView", + "id": 3 + }, + "location": { + "type": "string", + "id": 4 + } + }, + "nested": { + "TemplateView": { + "values": { + "METADATA_ONLY": 0 + } + } + } + }, + "GetTemplateResponse": { + "fields": { + "status": { + "type": "google.rpc.Status", + "id": 1 + }, + "metadata": { + "type": "TemplateMetadata", + "id": 2 + }, + "templateType": { + "type": "TemplateType", + "id": 3 + }, + "runtimeMetadata": { + "type": "RuntimeMetadata", + "id": 4 + } + }, + "nested": { + "TemplateType": { + "values": { + "UNKNOWN": 0, + "LEGACY": 1, + "FLEX": 2 + } + } + } + }, + "LaunchTemplateParameters": { + "fields": { + "jobName": { + "type": "string", + "id": 1 + }, + "parameters": { + "keyType": "string", + "type": "string", + "id": 2 + }, + "environment": { + "type": "RuntimeEnvironment", + "id": 3 + }, + "update": { + "type": "bool", + "id": 4 + }, + "transformNameMapping": { + "keyType": "string", + "type": "string", + "id": 5 + } + } + }, + "LaunchTemplateRequest": { + "oneofs": { + "template": { + "oneof": [ + "gcsPath", + "dynamicTemplate" + ] + } + }, + "fields": { + "projectId": { + "type": "string", + "id": 1 + }, + "validateOnly": { + "type": "bool", + "id": 2 + }, + "gcsPath": { + "type": "string", + "id": 3 + }, + "dynamicTemplate": { + "type": "DynamicTemplateLaunchParams", + "id": 6 + }, + "launchParameters": { + "type": "LaunchTemplateParameters", + "id": 4 + }, + "location": { + "type": "string", + "id": 5 + } + } + }, + "LaunchTemplateResponse": { + "fields": { + "job": { + "type": "Job", + "id": 1 + } + } + }, + "InvalidTemplateParameters": { + "fields": { + "parameterViolations": { + "rule": "repeated", + "type": "ParameterViolation", + "id": 1 + } + }, + "nested": { + "ParameterViolation": { + "fields": { + "parameter": { + "type": "string", + "id": 1 + }, + "description": { + "type": "string", + "id": 2 + } + } + } + } + }, + "DynamicTemplateLaunchParams": { + "fields": { + "gcsPath": { + "type": "string", + "id": 1 + }, + "stagingLocation": { + "type": "string", + "id": 2 + } + } + } + } + } + } + }, + "api": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/api/annotations;annotations", + "java_multiple_files": true, + "java_outer_classname": "ClientProto", + "java_package": "com.google.api", + "objc_class_prefix": "GAPI", + "cc_enable_arenas": true + }, + "nested": { + "fieldBehavior": { + "rule": "repeated", + "type": "google.api.FieldBehavior", + "id": 1052, + "extend": "google.protobuf.FieldOptions" + }, + "FieldBehavior": { + "values": { + "FIELD_BEHAVIOR_UNSPECIFIED": 0, + "OPTIONAL": 1, + "REQUIRED": 2, + "OUTPUT_ONLY": 3, + "INPUT_ONLY": 4, + "IMMUTABLE": 5, + "UNORDERED_LIST": 6, + "NON_EMPTY_DEFAULT": 7 + } + }, + "http": { + "type": "HttpRule", + "id": 72295728, + "extend": "google.protobuf.MethodOptions" + }, + "Http": { + "fields": { + "rules": { + "rule": "repeated", + "type": "HttpRule", + "id": 1 + }, + "fullyDecodeReservedExpansion": { + "type": "bool", + "id": 2 + } + } + }, + "HttpRule": { + "oneofs": { + "pattern": { + "oneof": [ + "get", + "put", + "post", + "delete", + "patch", + "custom" + ] + } + }, + "fields": { + "selector": { + "type": "string", + "id": 1 + }, + "get": { + "type": "string", + "id": 2 + }, + "put": { + "type": "string", + "id": 3 + }, + "post": { + "type": "string", + "id": 4 + }, + "delete": { + "type": "string", + "id": 5 + }, + "patch": { + "type": "string", + "id": 6 + }, + "custom": { + "type": "CustomHttpPattern", + "id": 8 + }, + "body": { + "type": "string", + "id": 7 + }, + "responseBody": { + "type": "string", + "id": 12 + }, + "additionalBindings": { + "rule": "repeated", + "type": "HttpRule", + "id": 11 + } + } + }, + "CustomHttpPattern": { + "fields": { + "kind": { + "type": "string", + "id": 1 + }, + "path": { + "type": "string", + "id": 2 + } + } + }, + "methodSignature": { + "rule": "repeated", + "type": "string", + "id": 1051, + "extend": "google.protobuf.MethodOptions" + }, + "defaultHost": { + "type": "string", + "id": 1049, + "extend": "google.protobuf.ServiceOptions" + }, + "oauthScopes": { + "type": "string", + "id": 1050, + "extend": "google.protobuf.ServiceOptions" + } + } + }, + "protobuf": { + "options": { + "go_package": "google.golang.org/protobuf/types/descriptorpb", + "java_package": "com.google.protobuf", + "java_outer_classname": "DescriptorProtos", + "csharp_namespace": "Google.Protobuf.Reflection", + "objc_class_prefix": "GPB", + "cc_enable_arenas": true, + "optimize_for": "SPEED" + }, + "nested": { + "FileDescriptorSet": { + "fields": { + "file": { + "rule": "repeated", + "type": "FileDescriptorProto", + "id": 1 + } + } + }, + "FileDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "package": { + "type": "string", + "id": 2 + }, + "dependency": { + "rule": "repeated", + "type": "string", + "id": 3 + }, + "publicDependency": { + "rule": "repeated", + "type": "int32", + "id": 10, + "options": { + "packed": false + } + }, + "weakDependency": { + "rule": "repeated", + "type": "int32", + "id": 11, + "options": { + "packed": false + } + }, + "messageType": { + "rule": "repeated", + "type": "DescriptorProto", + "id": 4 + }, + "enumType": { + "rule": "repeated", + "type": "EnumDescriptorProto", + "id": 5 + }, + "service": { + "rule": "repeated", + "type": "ServiceDescriptorProto", + "id": 6 + }, + "extension": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 7 + }, + "options": { + "type": "FileOptions", + "id": 8 + }, + "sourceCodeInfo": { + "type": "SourceCodeInfo", + "id": 9 + }, + "syntax": { + "type": "string", + "id": 12 + }, + "edition": { + "type": "string", + "id": 13 + } + } + }, + "DescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "field": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 2 + }, + "extension": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 6 + }, + "nestedType": { + "rule": "repeated", + "type": "DescriptorProto", + "id": 3 + }, + "enumType": { + "rule": "repeated", + "type": "EnumDescriptorProto", + "id": 4 + }, + "extensionRange": { + "rule": "repeated", + "type": "ExtensionRange", + "id": 5 + }, + "oneofDecl": { + "rule": "repeated", + "type": "OneofDescriptorProto", + "id": 8 + }, + "options": { + "type": "MessageOptions", + "id": 7 + }, + "reservedRange": { + "rule": "repeated", + "type": "ReservedRange", + "id": 9 + }, + "reservedName": { + "rule": "repeated", + "type": "string", + "id": 10 + } + }, + "nested": { + "ExtensionRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + }, + "options": { + "type": "ExtensionRangeOptions", + "id": 3 + } + } + }, + "ReservedRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + } + } + } + } + }, + "ExtensionRangeOptions": { + "fields": { + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "FieldDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "number": { + "type": "int32", + "id": 3 + }, + "label": { + "type": "Label", + "id": 4 + }, + "type": { + "type": "Type", + "id": 5 + }, + "typeName": { + "type": "string", + "id": 6 + }, + "extendee": { + "type": "string", + "id": 2 + }, + "defaultValue": { + "type": "string", + "id": 7 + }, + "oneofIndex": { + "type": "int32", + "id": 9 + }, + "jsonName": { + "type": "string", + "id": 10 + }, + "options": { + "type": "FieldOptions", + "id": 8 + }, + "proto3Optional": { + "type": "bool", + "id": 17 + } + }, + "nested": { + "Type": { + "values": { + "TYPE_DOUBLE": 1, + "TYPE_FLOAT": 2, + "TYPE_INT64": 3, + "TYPE_UINT64": 4, + "TYPE_INT32": 5, + "TYPE_FIXED64": 6, + "TYPE_FIXED32": 7, + "TYPE_BOOL": 8, + "TYPE_STRING": 9, + "TYPE_GROUP": 10, + "TYPE_MESSAGE": 11, + "TYPE_BYTES": 12, + "TYPE_UINT32": 13, + "TYPE_ENUM": 14, + "TYPE_SFIXED32": 15, + "TYPE_SFIXED64": 16, + "TYPE_SINT32": 17, + "TYPE_SINT64": 18 + } + }, + "Label": { + "values": { + "LABEL_OPTIONAL": 1, + "LABEL_REQUIRED": 2, + "LABEL_REPEATED": 3 + } + } + } + }, + "OneofDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "options": { + "type": "OneofOptions", + "id": 2 + } + } + }, + "EnumDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "value": { + "rule": "repeated", + "type": "EnumValueDescriptorProto", + "id": 2 + }, + "options": { + "type": "EnumOptions", + "id": 3 + }, + "reservedRange": { + "rule": "repeated", + "type": "EnumReservedRange", + "id": 4 + }, + "reservedName": { + "rule": "repeated", + "type": "string", + "id": 5 + } + }, + "nested": { + "EnumReservedRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + } + } + } + } + }, + "EnumValueDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "number": { + "type": "int32", + "id": 2 + }, + "options": { + "type": "EnumValueOptions", + "id": 3 + } + } + }, + "ServiceDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "method": { + "rule": "repeated", + "type": "MethodDescriptorProto", + "id": 2 + }, + "options": { + "type": "ServiceOptions", + "id": 3 + } + } + }, + "MethodDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "inputType": { + "type": "string", + "id": 2 + }, + "outputType": { + "type": "string", + "id": 3 + }, + "options": { + "type": "MethodOptions", + "id": 4 + }, + "clientStreaming": { + "type": "bool", + "id": 5, + "options": { + "default": false + } + }, + "serverStreaming": { + "type": "bool", + "id": 6, + "options": { + "default": false + } + } + } + }, + "FileOptions": { + "fields": { + "javaPackage": { + "type": "string", + "id": 1 + }, + "javaOuterClassname": { + "type": "string", + "id": 8 + }, + "javaMultipleFiles": { + "type": "bool", + "id": 10, + "options": { + "default": false + } + }, + "javaGenerateEqualsAndHash": { + "type": "bool", + "id": 20, + "options": { + "deprecated": true + } + }, + "javaStringCheckUtf8": { + "type": "bool", + "id": 27, + "options": { + "default": false + } + }, + "optimizeFor": { + "type": "OptimizeMode", + "id": 9, + "options": { + "default": "SPEED" + } + }, + "goPackage": { + "type": "string", + "id": 11 + }, + "ccGenericServices": { + "type": "bool", + "id": 16, + "options": { + "default": false + } + }, + "javaGenericServices": { + "type": "bool", + "id": 17, + "options": { + "default": false + } + }, + "pyGenericServices": { + "type": "bool", + "id": 18, + "options": { + "default": false + } + }, + "phpGenericServices": { + "type": "bool", + "id": 42, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 23, + "options": { + "default": false + } + }, + "ccEnableArenas": { + "type": "bool", + "id": 31, + "options": { + "default": true + } + }, + "objcClassPrefix": { + "type": "string", + "id": 36 + }, + "csharpNamespace": { + "type": "string", + "id": 37 + }, + "swiftPrefix": { + "type": "string", + "id": 39 + }, + "phpClassPrefix": { + "type": "string", + "id": 40 + }, + "phpNamespace": { + "type": "string", + "id": 41 + }, + "phpMetadataNamespace": { + "type": "string", + "id": 44 + }, + "rubyPackage": { + "type": "string", + "id": 45 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 38, + 38 + ] + ], + "nested": { + "OptimizeMode": { + "values": { + "SPEED": 1, + "CODE_SIZE": 2, + "LITE_RUNTIME": 3 + } + } + } + }, + "MessageOptions": { + "fields": { + "messageSetWireFormat": { + "type": "bool", + "id": 1, + "options": { + "default": false + } + }, + "noStandardDescriptorAccessor": { + "type": "bool", + "id": 2, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "mapEntry": { + "type": "bool", + "id": 7 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 4, + 4 + ], + [ + 5, + 5 + ], + [ + 6, + 6 + ], + [ + 8, + 8 + ], + [ + 9, + 9 + ] + ] + }, + "FieldOptions": { + "fields": { + "ctype": { + "type": "CType", + "id": 1, + "options": { + "default": "STRING" + } + }, + "packed": { + "type": "bool", + "id": 2 + }, + "jstype": { + "type": "JSType", + "id": 6, + "options": { + "default": "JS_NORMAL" + } + }, + "lazy": { + "type": "bool", + "id": 5, + "options": { + "default": false + } + }, + "unverifiedLazy": { + "type": "bool", + "id": 15, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "weak": { + "type": "bool", + "id": 10, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 4, + 4 + ] + ], + "nested": { + "CType": { + "values": { + "STRING": 0, + "CORD": 1, + "STRING_PIECE": 2 + } + }, + "JSType": { + "values": { + "JS_NORMAL": 0, + "JS_STRING": 1, + "JS_NUMBER": 2 + } + } + } + }, + "OneofOptions": { + "fields": { + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "EnumOptions": { + "fields": { + "allowAlias": { + "type": "bool", + "id": 2 + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 5, + 5 + ] + ] + }, + "EnumValueOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 1, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "ServiceOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 33, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "MethodOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 33, + "options": { + "default": false + } + }, + "idempotencyLevel": { + "type": "IdempotencyLevel", + "id": 34, + "options": { + "default": "IDEMPOTENCY_UNKNOWN" + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "nested": { + "IdempotencyLevel": { + "values": { + "IDEMPOTENCY_UNKNOWN": 0, + "NO_SIDE_EFFECTS": 1, + "IDEMPOTENT": 2 + } + } + } + }, + "UninterpretedOption": { + "fields": { + "name": { + "rule": "repeated", + "type": "NamePart", + "id": 2 + }, + "identifierValue": { + "type": "string", + "id": 3 + }, + "positiveIntValue": { + "type": "uint64", + "id": 4 + }, + "negativeIntValue": { + "type": "int64", + "id": 5 + }, + "doubleValue": { + "type": "double", + "id": 6 + }, + "stringValue": { + "type": "bytes", + "id": 7 + }, + "aggregateValue": { + "type": "string", + "id": 8 + } + }, + "nested": { + "NamePart": { + "fields": { + "namePart": { + "rule": "required", + "type": "string", + "id": 1 + }, + "isExtension": { + "rule": "required", + "type": "bool", + "id": 2 + } + } + } + } + }, + "SourceCodeInfo": { + "fields": { + "location": { + "rule": "repeated", + "type": "Location", + "id": 1 + } + }, + "nested": { + "Location": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1 + }, + "span": { + "rule": "repeated", + "type": "int32", + "id": 2 + }, + "leadingComments": { + "type": "string", + "id": 3 + }, + "trailingComments": { + "type": "string", + "id": 4 + }, + "leadingDetachedComments": { + "rule": "repeated", + "type": "string", + "id": 6 + } + } + } + } + }, + "GeneratedCodeInfo": { + "fields": { + "annotation": { + "rule": "repeated", + "type": "Annotation", + "id": 1 + } + }, + "nested": { + "Annotation": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1 + }, + "sourceFile": { + "type": "string", + "id": 2 + }, + "begin": { + "type": "int32", + "id": 3 + }, + "end": { + "type": "int32", + "id": 4 + }, + "semantic": { + "type": "Semantic", + "id": 5 + } + }, + "nested": { + "Semantic": { + "values": { + "NONE": 0, + "SET": 1, + "ALIAS": 2 + } + } + } + } + } + }, + "Any": { + "fields": { + "type_url": { + "type": "string", + "id": 1 + }, + "value": { + "type": "bytes", + "id": 2 + } + } + }, + "Struct": { + "fields": { + "fields": { + "keyType": "string", + "type": "Value", + "id": 1 + } + } + }, + "Value": { + "oneofs": { + "kind": { + "oneof": [ + "nullValue", + "numberValue", + "stringValue", + "boolValue", + "structValue", + "listValue" + ] + } + }, + "fields": { + "nullValue": { + "type": "NullValue", + "id": 1 + }, + "numberValue": { + "type": "double", + "id": 2 + }, + "stringValue": { + "type": "string", + "id": 3 + }, + "boolValue": { + "type": "bool", + "id": 4 + }, + "structValue": { + "type": "Struct", + "id": 5 + }, + "listValue": { + "type": "ListValue", + "id": 6 + } + } + }, + "NullValue": { + "values": { + "NULL_VALUE": 0 + } + }, + "ListValue": { + "fields": { + "values": { + "rule": "repeated", + "type": "Value", + "id": 1 + } + } + }, + "Duration": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + }, + "Timestamp": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + } + } + }, + "rpc": { + "options": { + "cc_enable_arenas": true, + "go_package": "google.golang.org/genproto/googleapis/rpc/status;status", + "java_multiple_files": true, + "java_outer_classname": "StatusProto", + "java_package": "com.google.rpc", + "objc_class_prefix": "RPC" + }, + "nested": { + "Status": { + "fields": { + "code": { + "type": "int32", + "id": 1 + }, + "message": { + "type": "string", + "id": 2 + }, + "details": { + "rule": "repeated", + "type": "google.protobuf.Any", + "id": 3 + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/packages/google-dataflow/samples/README.md b/packages/google-dataflow/samples/README.md new file mode 100644 index 00000000000..180a9acf6b1 --- /dev/null +++ b/packages/google-dataflow/samples/README.md @@ -0,0 +1,50 @@ +[//]: # "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 + +# [Dataflow: Node.js Samples](https://github.com/googleapis/nodejs-dataflow) + +[![Open in Cloud Shell][shell_img]][shell_link] + + + +## Table of Contents + +* [Before you begin](#before-you-begin) +* [Samples](#samples) + * [Quickstart](#quickstart) + +## Before you begin + +Before running the samples, make sure you've followed the steps outlined in +[Using the client library](https://github.com/googleapis/nodejs-dataflow#using-the-client-library). + +`cd samples` + +`npm install` + +`cd ..` + +## Samples + + + +### Quickstart + +View the [source code](https://github.com/googleapis/nodejs-dataflow/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-dataflow&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) + +__Usage:__ + + +`node samples/quickstart.js` + + + + + + +[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png +[shell_link]: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-dataflow&page=editor&open_in_editor=samples/README.md +[product-docs]: https://cloud.google.com/dataflow/ diff --git a/packages/google-dataflow/samples/generated/v1beta3/flex_templates_service.launch_flex_template.js b/packages/google-dataflow/samples/generated/v1beta3/flex_templates_service.launch_flex_template.js new file mode 100644 index 00000000000..82957e0a111 --- /dev/null +++ b/packages/google-dataflow/samples/generated/v1beta3/flex_templates_service.launch_flex_template.js @@ -0,0 +1,75 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main() { + // [START dataflow_v1beta3_generated_FlexTemplatesService_LaunchFlexTemplate_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 Cloud Platform project that the job belongs to. + */ + // const projectId = 'abc123' + /** + * Required. Parameter to launch a job form Flex Template. + */ + // const launchParameter = {} + /** + * Required. The regional endpoint + * (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) to + * which to direct the request. E.g., us-central1, us-west1. + */ + // const location = 'abc123' + /** + * If true, the request is validated but not actually executed. + * Defaults to false. + */ + // const validateOnly = true + + // Imports the Dataflow library + const {FlexTemplatesServiceClient} = require('@google-cloud/dataflow').v1beta3; + + // Instantiates a client + const dataflowClient = new FlexTemplatesServiceClient(); + + async function callLaunchFlexTemplate() { + // Construct request + const request = { + }; + + // Run request + const response = await dataflowClient.launchFlexTemplate(request); + console.log(response); + } + + callLaunchFlexTemplate(); + // [END dataflow_v1beta3_generated_FlexTemplatesService_LaunchFlexTemplate_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-dataflow/samples/generated/v1beta3/jobs_v1_beta3.aggregated_list_jobs.js b/packages/google-dataflow/samples/generated/v1beta3/jobs_v1_beta3.aggregated_list_jobs.js new file mode 100644 index 00000000000..492a6b03966 --- /dev/null +++ b/packages/google-dataflow/samples/generated/v1beta3/jobs_v1_beta3.aggregated_list_jobs.js @@ -0,0 +1,83 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main() { + // [START dataflow_v1beta3_generated_JobsV1Beta3_AggregatedListJobs_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * The kind of filter to use. + */ + // const filter = {} + /** + * The project which owns the jobs. + */ + // const projectId = 'abc123' + /** + * If there are many jobs, limit response to at most this many. + * The actual number of jobs returned will be the lesser of max_responses + * and an unspecified server-defined limit. + */ + // const pageSize = 1234 + /** + * Set this to the 'next_page_token' field of a previous response + * to request additional results in a long list. + */ + // const pageToken = 'abc123' + /** + * The regional endpoint + * (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) that + * contains this job. + */ + // const location = 'abc123' + + // Imports the Dataflow library + const {JobsV1Beta3Client} = require('@google-cloud/dataflow').v1beta3; + + // Instantiates a client + const dataflowClient = new JobsV1Beta3Client(); + + async function callAggregatedListJobs() { + // Construct request + const request = { + }; + + // Run request + const iterable = await dataflowClient.aggregatedListJobsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callAggregatedListJobs(); + // [END dataflow_v1beta3_generated_JobsV1Beta3_AggregatedListJobs_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-dataflow/samples/generated/v1beta3/jobs_v1_beta3.check_active_jobs.js b/packages/google-dataflow/samples/generated/v1beta3/jobs_v1_beta3.check_active_jobs.js new file mode 100644 index 00000000000..8e1f708db2d --- /dev/null +++ b/packages/google-dataflow/samples/generated/v1beta3/jobs_v1_beta3.check_active_jobs.js @@ -0,0 +1,60 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main() { + // [START dataflow_v1beta3_generated_JobsV1Beta3_CheckActiveJobs_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * The project which owns the jobs. + */ + // const projectId = 'abc123' + + // Imports the Dataflow library + const {JobsV1Beta3Client} = require('@google-cloud/dataflow').v1beta3; + + // Instantiates a client + const dataflowClient = new JobsV1Beta3Client(); + + async function callCheckActiveJobs() { + // Construct request + const request = { + }; + + // Run request + const response = await dataflowClient.checkActiveJobs(request); + console.log(response); + } + + callCheckActiveJobs(); + // [END dataflow_v1beta3_generated_JobsV1Beta3_CheckActiveJobs_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-dataflow/samples/generated/v1beta3/jobs_v1_beta3.create_job.js b/packages/google-dataflow/samples/generated/v1beta3/jobs_v1_beta3.create_job.js new file mode 100644 index 00000000000..e55050a98a6 --- /dev/null +++ b/packages/google-dataflow/samples/generated/v1beta3/jobs_v1_beta3.create_job.js @@ -0,0 +1,74 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main() { + // [START dataflow_v1beta3_generated_JobsV1Beta3_CreateJob_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * The ID of the Cloud Platform project that the job belongs to. + */ + // const projectId = 'abc123' + /** + * The job to create. + */ + // const job = {} + /** + * The level of information requested in response. + */ + // const view = {} + /** + * The regional endpoint + * (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) that + * contains this job. + */ + // const location = 'abc123' + + // Imports the Dataflow library + const {JobsV1Beta3Client} = require('@google-cloud/dataflow').v1beta3; + + // Instantiates a client + const dataflowClient = new JobsV1Beta3Client(); + + async function callCreateJob() { + // Construct request + const request = { + }; + + // Run request + const response = await dataflowClient.createJob(request); + console.log(response); + } + + callCreateJob(); + // [END dataflow_v1beta3_generated_JobsV1Beta3_CreateJob_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-dataflow/samples/generated/v1beta3/jobs_v1_beta3.get_job.js b/packages/google-dataflow/samples/generated/v1beta3/jobs_v1_beta3.get_job.js new file mode 100644 index 00000000000..112361dbf05 --- /dev/null +++ b/packages/google-dataflow/samples/generated/v1beta3/jobs_v1_beta3.get_job.js @@ -0,0 +1,74 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main() { + // [START dataflow_v1beta3_generated_JobsV1Beta3_GetJob_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * The ID of the Cloud Platform project that the job belongs to. + */ + // const projectId = 'abc123' + /** + * The job ID. + */ + // const jobId = 'abc123' + /** + * The level of information requested in response. + */ + // const view = {} + /** + * The regional endpoint + * (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) that + * contains this job. + */ + // const location = 'abc123' + + // Imports the Dataflow library + const {JobsV1Beta3Client} = require('@google-cloud/dataflow').v1beta3; + + // Instantiates a client + const dataflowClient = new JobsV1Beta3Client(); + + async function callGetJob() { + // Construct request + const request = { + }; + + // Run request + const response = await dataflowClient.getJob(request); + console.log(response); + } + + callGetJob(); + // [END dataflow_v1beta3_generated_JobsV1Beta3_GetJob_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-dataflow/samples/generated/v1beta3/jobs_v1_beta3.list_jobs.js b/packages/google-dataflow/samples/generated/v1beta3/jobs_v1_beta3.list_jobs.js new file mode 100644 index 00000000000..09a7c8db50f --- /dev/null +++ b/packages/google-dataflow/samples/generated/v1beta3/jobs_v1_beta3.list_jobs.js @@ -0,0 +1,83 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main() { + // [START dataflow_v1beta3_generated_JobsV1Beta3_ListJobs_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * The kind of filter to use. + */ + // const filter = {} + /** + * The project which owns the jobs. + */ + // const projectId = 'abc123' + /** + * If there are many jobs, limit response to at most this many. + * The actual number of jobs returned will be the lesser of max_responses + * and an unspecified server-defined limit. + */ + // const pageSize = 1234 + /** + * Set this to the 'next_page_token' field of a previous response + * to request additional results in a long list. + */ + // const pageToken = 'abc123' + /** + * The regional endpoint + * (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) that + * contains this job. + */ + // const location = 'abc123' + + // Imports the Dataflow library + const {JobsV1Beta3Client} = require('@google-cloud/dataflow').v1beta3; + + // Instantiates a client + const dataflowClient = new JobsV1Beta3Client(); + + async function callListJobs() { + // Construct request + const request = { + }; + + // Run request + const iterable = await dataflowClient.listJobsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListJobs(); + // [END dataflow_v1beta3_generated_JobsV1Beta3_ListJobs_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-dataflow/samples/generated/v1beta3/jobs_v1_beta3.snapshot_job.js b/packages/google-dataflow/samples/generated/v1beta3/jobs_v1_beta3.snapshot_job.js new file mode 100644 index 00000000000..74383b2aa51 --- /dev/null +++ b/packages/google-dataflow/samples/generated/v1beta3/jobs_v1_beta3.snapshot_job.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() { + // [START dataflow_v1beta3_generated_JobsV1Beta3_SnapshotJob_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * The project which owns the job to be snapshotted. + */ + // const projectId = 'abc123' + /** + * The job to be snapshotted. + */ + // const jobId = 'abc123' + /** + * TTL for the snapshot. + */ + // const ttl = {} + /** + * The location that contains this job. + */ + // const location = 'abc123' + /** + * If true, perform snapshots for sources which support this. + */ + // const snapshotSources = true + /** + * User specified description of the snapshot. Maybe empty. + */ + // const description = 'abc123' + + // Imports the Dataflow library + const {JobsV1Beta3Client} = require('@google-cloud/dataflow').v1beta3; + + // Instantiates a client + const dataflowClient = new JobsV1Beta3Client(); + + async function callSnapshotJob() { + // Construct request + const request = { + }; + + // Run request + const response = await dataflowClient.snapshotJob(request); + console.log(response); + } + + callSnapshotJob(); + // [END dataflow_v1beta3_generated_JobsV1Beta3_SnapshotJob_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-dataflow/samples/generated/v1beta3/jobs_v1_beta3.update_job.js b/packages/google-dataflow/samples/generated/v1beta3/jobs_v1_beta3.update_job.js new file mode 100644 index 00000000000..e16ea96c260 --- /dev/null +++ b/packages/google-dataflow/samples/generated/v1beta3/jobs_v1_beta3.update_job.js @@ -0,0 +1,75 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main() { + // [START dataflow_v1beta3_generated_JobsV1Beta3_UpdateJob_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * The ID of the Cloud Platform project that the job belongs to. + */ + // const projectId = 'abc123' + /** + * The job ID. + */ + // const jobId = 'abc123' + /** + * The updated job. + * Only the job state is updatable; other fields will be ignored. + */ + // const job = {} + /** + * The regional endpoint + * (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) that + * contains this job. + */ + // const location = 'abc123' + + // Imports the Dataflow library + const {JobsV1Beta3Client} = require('@google-cloud/dataflow').v1beta3; + + // Instantiates a client + const dataflowClient = new JobsV1Beta3Client(); + + async function callUpdateJob() { + // Construct request + const request = { + }; + + // Run request + const response = await dataflowClient.updateJob(request); + console.log(response); + } + + callUpdateJob(); + // [END dataflow_v1beta3_generated_JobsV1Beta3_UpdateJob_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-dataflow/samples/generated/v1beta3/messages_v1_beta3.list_job_messages.js b/packages/google-dataflow/samples/generated/v1beta3/messages_v1_beta3.list_job_messages.js new file mode 100644 index 00000000000..cbd24369ccc --- /dev/null +++ b/packages/google-dataflow/samples/generated/v1beta3/messages_v1_beta3.list_job_messages.js @@ -0,0 +1,98 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main() { + // [START dataflow_v1beta3_generated_MessagesV1Beta3_ListJobMessages_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. + */ + /** + * A project id. + */ + // const projectId = 'abc123' + /** + * The job to get messages about. + */ + // const jobId = 'abc123' + /** + * Filter to only get messages with importance >= level + */ + // const minimumImportance = {} + /** + * If specified, determines the maximum number of messages to + * return. If unspecified, the service may choose an appropriate + * default, or may return an arbitrarily large number of results. + */ + // const pageSize = 1234 + /** + * If supplied, this should be the value of next_page_token returned + * by an earlier call. This will cause the next page of results to + * be returned. + */ + // const pageToken = 'abc123' + /** + * If specified, return only messages with timestamps >= start_time. + * The default is the job creation time (i.e. beginning of messages). + */ + // const startTime = {} + /** + * Return only messages with timestamps < end_time. The default is now + * (i.e. return up to the latest messages available). + */ + // const endTime = {} + /** + * The regional endpoint + * (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) that + * contains the job specified by job_id. + */ + // const location = 'abc123' + + // Imports the Dataflow library + const {MessagesV1Beta3Client} = require('@google-cloud/dataflow').v1beta3; + + // Instantiates a client + const dataflowClient = new MessagesV1Beta3Client(); + + async function callListJobMessages() { + // Construct request + const request = { + }; + + // Run request + const iterable = await dataflowClient.listJobMessagesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListJobMessages(); + // [END dataflow_v1beta3_generated_MessagesV1Beta3_ListJobMessages_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-dataflow/samples/generated/v1beta3/metrics_v1_beta3.get_job_execution_details.js b/packages/google-dataflow/samples/generated/v1beta3/metrics_v1_beta3.get_job_execution_details.js new file mode 100644 index 00000000000..b1ba0163be4 --- /dev/null +++ b/packages/google-dataflow/samples/generated/v1beta3/metrics_v1_beta3.get_job_execution_details.js @@ -0,0 +1,84 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main() { + // [START dataflow_v1beta3_generated_MetricsV1Beta3_GetJobExecutionDetails_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. + */ + /** + * A project id. + */ + // const projectId = 'abc123' + /** + * The job to get execution details for. + */ + // const jobId = 'abc123' + /** + * The regional endpoint + * (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) that + * contains the job specified by job_id. + */ + // const location = 'abc123' + /** + * If specified, determines the maximum number of stages to + * return. If unspecified, the service may choose an appropriate + * default, or may return an arbitrarily large number of results. + */ + // const pageSize = 1234 + /** + * If supplied, this should be the value of next_page_token returned + * by an earlier call. This will cause the next page of results to + * be returned. + */ + // const pageToken = 'abc123' + + // Imports the Dataflow library + const {MetricsV1Beta3Client} = require('@google-cloud/dataflow').v1beta3; + + // Instantiates a client + const dataflowClient = new MetricsV1Beta3Client(); + + async function callGetJobExecutionDetails() { + // Construct request + const request = { + }; + + // Run request + const iterable = await dataflowClient.getJobExecutionDetailsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callGetJobExecutionDetails(); + // [END dataflow_v1beta3_generated_MetricsV1Beta3_GetJobExecutionDetails_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-dataflow/samples/generated/v1beta3/metrics_v1_beta3.get_job_metrics.js b/packages/google-dataflow/samples/generated/v1beta3/metrics_v1_beta3.get_job_metrics.js new file mode 100644 index 00000000000..901b840ad8a --- /dev/null +++ b/packages/google-dataflow/samples/generated/v1beta3/metrics_v1_beta3.get_job_metrics.js @@ -0,0 +1,75 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main() { + // [START dataflow_v1beta3_generated_MetricsV1Beta3_GetJobMetrics_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. + */ + /** + * A project id. + */ + // const projectId = 'abc123' + /** + * The job to get metrics for. + */ + // const jobId = 'abc123' + /** + * Return only metric data that has changed since this time. + * Default is to return all information about all metrics for the job. + */ + // const startTime = {} + /** + * The regional endpoint + * (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) that + * contains the job specified by job_id. + */ + // const location = 'abc123' + + // Imports the Dataflow library + const {MetricsV1Beta3Client} = require('@google-cloud/dataflow').v1beta3; + + // Instantiates a client + const dataflowClient = new MetricsV1Beta3Client(); + + async function callGetJobMetrics() { + // Construct request + const request = { + }; + + // Run request + const response = await dataflowClient.getJobMetrics(request); + console.log(response); + } + + callGetJobMetrics(); + // [END dataflow_v1beta3_generated_MetricsV1Beta3_GetJobMetrics_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-dataflow/samples/generated/v1beta3/metrics_v1_beta3.get_stage_execution_details.js b/packages/google-dataflow/samples/generated/v1beta3/metrics_v1_beta3.get_stage_execution_details.js new file mode 100644 index 00000000000..cd96ac1c799 --- /dev/null +++ b/packages/google-dataflow/samples/generated/v1beta3/metrics_v1_beta3.get_stage_execution_details.js @@ -0,0 +1,96 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main() { + // [START dataflow_v1beta3_generated_MetricsV1Beta3_GetStageExecutionDetails_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. + */ + /** + * A project id. + */ + // const projectId = 'abc123' + /** + * The job to get execution details for. + */ + // const jobId = 'abc123' + /** + * The regional endpoint + * (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) that + * contains the job specified by job_id. + */ + // const location = 'abc123' + /** + * The stage for which to fetch information. + */ + // const stageId = 'abc123' + /** + * If specified, determines the maximum number of work items to + * return. If unspecified, the service may choose an appropriate + * default, or may return an arbitrarily large number of results. + */ + // const pageSize = 1234 + /** + * If supplied, this should be the value of next_page_token returned + * by an earlier call. This will cause the next page of results to + * be returned. + */ + // const pageToken = 'abc123' + /** + * Lower time bound of work items to include, by start time. + */ + // const startTime = {} + /** + * Upper time bound of work items to include, by start time. + */ + // const endTime = {} + + // Imports the Dataflow library + const {MetricsV1Beta3Client} = require('@google-cloud/dataflow').v1beta3; + + // Instantiates a client + const dataflowClient = new MetricsV1Beta3Client(); + + async function callGetStageExecutionDetails() { + // Construct request + const request = { + }; + + // Run request + const iterable = await dataflowClient.getStageExecutionDetailsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callGetStageExecutionDetails(); + // [END dataflow_v1beta3_generated_MetricsV1Beta3_GetStageExecutionDetails_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-dataflow/samples/generated/v1beta3/snapshots_v1_beta3.delete_snapshot.js b/packages/google-dataflow/samples/generated/v1beta3/snapshots_v1_beta3.delete_snapshot.js new file mode 100644 index 00000000000..ea4e33ef215 --- /dev/null +++ b/packages/google-dataflow/samples/generated/v1beta3/snapshots_v1_beta3.delete_snapshot.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() { + // [START dataflow_v1beta3_generated_SnapshotsV1Beta3_DeleteSnapshot_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * The ID of the Cloud Platform project that the snapshot belongs to. + */ + // const projectId = 'abc123' + /** + * The ID of the snapshot. + */ + // const snapshotId = 'abc123' + /** + * The location that contains this snapshot. + */ + // const location = 'abc123' + + // Imports the Dataflow library + const {SnapshotsV1Beta3Client} = require('@google-cloud/dataflow').v1beta3; + + // Instantiates a client + const dataflowClient = new SnapshotsV1Beta3Client(); + + async function callDeleteSnapshot() { + // Construct request + const request = { + }; + + // Run request + const response = await dataflowClient.deleteSnapshot(request); + console.log(response); + } + + callDeleteSnapshot(); + // [END dataflow_v1beta3_generated_SnapshotsV1Beta3_DeleteSnapshot_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-dataflow/samples/generated/v1beta3/snapshots_v1_beta3.get_snapshot.js b/packages/google-dataflow/samples/generated/v1beta3/snapshots_v1_beta3.get_snapshot.js new file mode 100644 index 00000000000..5ca049ceb52 --- /dev/null +++ b/packages/google-dataflow/samples/generated/v1beta3/snapshots_v1_beta3.get_snapshot.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() { + // [START dataflow_v1beta3_generated_SnapshotsV1Beta3_GetSnapshot_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * The ID of the Cloud Platform project that the snapshot belongs to. + */ + // const projectId = 'abc123' + /** + * The ID of the snapshot. + */ + // const snapshotId = 'abc123' + /** + * The location that contains this snapshot. + */ + // const location = 'abc123' + + // Imports the Dataflow library + const {SnapshotsV1Beta3Client} = require('@google-cloud/dataflow').v1beta3; + + // Instantiates a client + const dataflowClient = new SnapshotsV1Beta3Client(); + + async function callGetSnapshot() { + // Construct request + const request = { + }; + + // Run request + const response = await dataflowClient.getSnapshot(request); + console.log(response); + } + + callGetSnapshot(); + // [END dataflow_v1beta3_generated_SnapshotsV1Beta3_GetSnapshot_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-dataflow/samples/generated/v1beta3/snapshots_v1_beta3.list_snapshots.js b/packages/google-dataflow/samples/generated/v1beta3/snapshots_v1_beta3.list_snapshots.js new file mode 100644 index 00000000000..09de355fb9e --- /dev/null +++ b/packages/google-dataflow/samples/generated/v1beta3/snapshots_v1_beta3.list_snapshots.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() { + // [START dataflow_v1beta3_generated_SnapshotsV1Beta3_ListSnapshots_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * The project ID to list snapshots for. + */ + // const projectId = 'abc123' + /** + * If specified, list snapshots created from this job. + */ + // const jobId = 'abc123' + /** + * The location to list snapshots in. + */ + // const location = 'abc123' + + // Imports the Dataflow library + const {SnapshotsV1Beta3Client} = require('@google-cloud/dataflow').v1beta3; + + // Instantiates a client + const dataflowClient = new SnapshotsV1Beta3Client(); + + async function callListSnapshots() { + // Construct request + const request = { + }; + + // Run request + const response = await dataflowClient.listSnapshots(request); + console.log(response); + } + + callListSnapshots(); + // [END dataflow_v1beta3_generated_SnapshotsV1Beta3_ListSnapshots_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-dataflow/samples/generated/v1beta3/snippet_metadata.google.dataflow.v1beta3.json b/packages/google-dataflow/samples/generated/v1beta3/snippet_metadata.google.dataflow.v1beta3.json new file mode 100644 index 00000000000..0662c854497 --- /dev/null +++ b/packages/google-dataflow/samples/generated/v1beta3/snippet_metadata.google.dataflow.v1beta3.json @@ -0,0 +1,1007 @@ +{ + "clientLibrary": { + "name": "nodejs-dataflow", + "version": "2.0.1", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.dataflow.v1beta3", + "version": "v1beta3" + } + ] + }, + "snippets": [ + { + "regionTag": "dataflow_v1beta3_generated_FlexTemplatesService_LaunchFlexTemplate_async", + "title": "FlexTemplatesService launchFlexTemplate Sample", + "origin": "API_DEFINITION", + "description": " Launch a job with a FlexTemplate.", + "canonical": true, + "file": "flex_templates_service.launch_flex_template.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 67, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "LaunchFlexTemplate", + "fullName": "google.dataflow.v1beta3.FlexTemplatesService.LaunchFlexTemplate", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "launch_parameter", + "type": ".google.dataflow.v1beta3.LaunchFlexTemplateParameter" + }, + { + "name": "location", + "type": "TYPE_STRING" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.dataflow.v1beta3.LaunchFlexTemplateResponse", + "client": { + "shortName": "FlexTemplatesServiceClient", + "fullName": "google.dataflow.v1beta3.FlexTemplatesServiceClient" + }, + "method": { + "shortName": "LaunchFlexTemplate", + "fullName": "google.dataflow.v1beta3.FlexTemplatesService.LaunchFlexTemplate", + "service": { + "shortName": "FlexTemplatesService", + "fullName": "google.dataflow.v1beta3.FlexTemplatesService" + } + } + } + }, + { + "regionTag": "dataflow_v1beta3_generated_JobsV1Beta3_CreateJob_async", + "title": "FlexTemplatesService createJob Sample", + "origin": "API_DEFINITION", + "description": " Creates a Cloud Dataflow job. To create a job, we recommend using `projects.locations.jobs.create` with a [regional endpoint] (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints). Using `projects.jobs.create` is not recommended, as your job will always start in `us-central1`.", + "canonical": true, + "file": "jobs_v1_beta3.create_job.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 66, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateJob", + "fullName": "google.dataflow.v1beta3.JobsV1Beta3.CreateJob", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "job", + "type": ".google.dataflow.v1beta3.Job" + }, + { + "name": "view", + "type": ".google.dataflow.v1beta3.JobView" + }, + { + "name": "replace_job_id", + "type": "TYPE_STRING" + }, + { + "name": "location", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.dataflow.v1beta3.Job", + "client": { + "shortName": "JobsV1Beta3Client", + "fullName": "google.dataflow.v1beta3.JobsV1Beta3Client" + }, + "method": { + "shortName": "CreateJob", + "fullName": "google.dataflow.v1beta3.JobsV1Beta3.CreateJob", + "service": { + "shortName": "JobsV1Beta3", + "fullName": "google.dataflow.v1beta3.JobsV1Beta3" + } + } + } + }, + { + "regionTag": "dataflow_v1beta3_generated_JobsV1Beta3_GetJob_async", + "title": "FlexTemplatesService getJob Sample", + "origin": "API_DEFINITION", + "description": " Gets the state of the specified Cloud Dataflow job. To get the state of a job, we recommend using `projects.locations.jobs.get` with a [regional endpoint] (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints). Using `projects.jobs.get` is not recommended, as you can only get the state of jobs that are running in `us-central1`.", + "canonical": true, + "file": "jobs_v1_beta3.get_job.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 66, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetJob", + "fullName": "google.dataflow.v1beta3.JobsV1Beta3.GetJob", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "job_id", + "type": "TYPE_STRING" + }, + { + "name": "view", + "type": ".google.dataflow.v1beta3.JobView" + }, + { + "name": "location", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.dataflow.v1beta3.Job", + "client": { + "shortName": "JobsV1Beta3Client", + "fullName": "google.dataflow.v1beta3.JobsV1Beta3Client" + }, + "method": { + "shortName": "GetJob", + "fullName": "google.dataflow.v1beta3.JobsV1Beta3.GetJob", + "service": { + "shortName": "JobsV1Beta3", + "fullName": "google.dataflow.v1beta3.JobsV1Beta3" + } + } + } + }, + { + "regionTag": "dataflow_v1beta3_generated_JobsV1Beta3_UpdateJob_async", + "title": "FlexTemplatesService updateJob Sample", + "origin": "API_DEFINITION", + "description": " Updates the state of an existing Cloud Dataflow job. To update the state of an existing job, we recommend using `projects.locations.jobs.update` with a [regional endpoint] (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints). Using `projects.jobs.update` is not recommended, as you can only update the state of jobs that are running in `us-central1`.", + "canonical": true, + "file": "jobs_v1_beta3.update_job.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 67, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateJob", + "fullName": "google.dataflow.v1beta3.JobsV1Beta3.UpdateJob", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "job_id", + "type": "TYPE_STRING" + }, + { + "name": "job", + "type": ".google.dataflow.v1beta3.Job" + }, + { + "name": "location", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.dataflow.v1beta3.Job", + "client": { + "shortName": "JobsV1Beta3Client", + "fullName": "google.dataflow.v1beta3.JobsV1Beta3Client" + }, + "method": { + "shortName": "UpdateJob", + "fullName": "google.dataflow.v1beta3.JobsV1Beta3.UpdateJob", + "service": { + "shortName": "JobsV1Beta3", + "fullName": "google.dataflow.v1beta3.JobsV1Beta3" + } + } + } + }, + { + "regionTag": "dataflow_v1beta3_generated_JobsV1Beta3_ListJobs_async", + "title": "FlexTemplatesService listJobs Sample", + "origin": "API_DEFINITION", + "description": " List the jobs of a project. To list the jobs of a project in a region, we recommend using `projects.locations.jobs.list` with a [regional endpoint] (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints). To list the all jobs across all regions, use `projects.jobs.aggregated`. Using `projects.jobs.list` is not recommended, as you can only get the list of jobs that are running in `us-central1`.", + "canonical": true, + "file": "jobs_v1_beta3.list_jobs.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 75, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListJobs", + "fullName": "google.dataflow.v1beta3.JobsV1Beta3.ListJobs", + "async": true, + "parameters": [ + { + "name": "filter", + "type": ".google.dataflow.v1beta3.ListJobsRequest.Filter" + }, + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "view", + "type": ".google.dataflow.v1beta3.JobView" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "location", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.dataflow.v1beta3.ListJobsResponse", + "client": { + "shortName": "JobsV1Beta3Client", + "fullName": "google.dataflow.v1beta3.JobsV1Beta3Client" + }, + "method": { + "shortName": "ListJobs", + "fullName": "google.dataflow.v1beta3.JobsV1Beta3.ListJobs", + "service": { + "shortName": "JobsV1Beta3", + "fullName": "google.dataflow.v1beta3.JobsV1Beta3" + } + } + } + }, + { + "regionTag": "dataflow_v1beta3_generated_JobsV1Beta3_AggregatedListJobs_async", + "title": "FlexTemplatesService aggregatedListJobs Sample", + "origin": "API_DEFINITION", + "description": " List the jobs of a project across all regions.", + "canonical": true, + "file": "jobs_v1_beta3.aggregated_list_jobs.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 75, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "AggregatedListJobs", + "fullName": "google.dataflow.v1beta3.JobsV1Beta3.AggregatedListJobs", + "async": true, + "parameters": [ + { + "name": "filter", + "type": ".google.dataflow.v1beta3.ListJobsRequest.Filter" + }, + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "view", + "type": ".google.dataflow.v1beta3.JobView" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "location", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.dataflow.v1beta3.ListJobsResponse", + "client": { + "shortName": "JobsV1Beta3Client", + "fullName": "google.dataflow.v1beta3.JobsV1Beta3Client" + }, + "method": { + "shortName": "AggregatedListJobs", + "fullName": "google.dataflow.v1beta3.JobsV1Beta3.AggregatedListJobs", + "service": { + "shortName": "JobsV1Beta3", + "fullName": "google.dataflow.v1beta3.JobsV1Beta3" + } + } + } + }, + { + "regionTag": "dataflow_v1beta3_generated_JobsV1Beta3_CheckActiveJobs_async", + "title": "FlexTemplatesService checkActiveJobs Sample", + "origin": "API_DEFINITION", + "description": " Check for existence of active jobs in the given project across all regions.", + "canonical": true, + "file": "jobs_v1_beta3.check_active_jobs.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 52, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CheckActiveJobs", + "fullName": "google.dataflow.v1beta3.JobsV1Beta3.CheckActiveJobs", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.dataflow.v1beta3.CheckActiveJobsResponse", + "client": { + "shortName": "JobsV1Beta3Client", + "fullName": "google.dataflow.v1beta3.JobsV1Beta3Client" + }, + "method": { + "shortName": "CheckActiveJobs", + "fullName": "google.dataflow.v1beta3.JobsV1Beta3.CheckActiveJobs", + "service": { + "shortName": "JobsV1Beta3", + "fullName": "google.dataflow.v1beta3.JobsV1Beta3" + } + } + } + }, + { + "regionTag": "dataflow_v1beta3_generated_JobsV1Beta3_SnapshotJob_async", + "title": "FlexTemplatesService snapshotJob Sample", + "origin": "API_DEFINITION", + "description": " Snapshot the state of a streaming job.", + "canonical": true, + "file": "jobs_v1_beta3.snapshot_job.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 72, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SnapshotJob", + "fullName": "google.dataflow.v1beta3.JobsV1Beta3.SnapshotJob", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "job_id", + "type": "TYPE_STRING" + }, + { + "name": "ttl", + "type": ".google.protobuf.Duration" + }, + { + "name": "location", + "type": "TYPE_STRING" + }, + { + "name": "snapshot_sources", + "type": "TYPE_BOOL" + }, + { + "name": "description", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.dataflow.v1beta3.Snapshot", + "client": { + "shortName": "JobsV1Beta3Client", + "fullName": "google.dataflow.v1beta3.JobsV1Beta3Client" + }, + "method": { + "shortName": "SnapshotJob", + "fullName": "google.dataflow.v1beta3.JobsV1Beta3.SnapshotJob", + "service": { + "shortName": "JobsV1Beta3", + "fullName": "google.dataflow.v1beta3.JobsV1Beta3" + } + } + } + }, + { + "regionTag": "dataflow_v1beta3_generated_MessagesV1Beta3_ListJobMessages_async", + "title": "FlexTemplatesService listJobMessages Sample", + "origin": "API_DEFINITION", + "description": " Request the job status. To request the status of a job, we recommend using `projects.locations.jobs.messages.list` with a [regional endpoint] (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints). Using `projects.jobs.messages.list` is not recommended, as you can only request the status of jobs that are running in `us-central1`.", + "canonical": true, + "file": "messages_v1_beta3.list_job_messages.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 90, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListJobMessages", + "fullName": "google.dataflow.v1beta3.MessagesV1Beta3.ListJobMessages", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "job_id", + "type": "TYPE_STRING" + }, + { + "name": "minimum_importance", + "type": ".google.dataflow.v1beta3.JobMessageImportance" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "start_time", + "type": ".google.protobuf.Timestamp" + }, + { + "name": "end_time", + "type": ".google.protobuf.Timestamp" + }, + { + "name": "location", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.dataflow.v1beta3.ListJobMessagesResponse", + "client": { + "shortName": "MessagesV1Beta3Client", + "fullName": "google.dataflow.v1beta3.MessagesV1Beta3Client" + }, + "method": { + "shortName": "ListJobMessages", + "fullName": "google.dataflow.v1beta3.MessagesV1Beta3.ListJobMessages", + "service": { + "shortName": "MessagesV1Beta3", + "fullName": "google.dataflow.v1beta3.MessagesV1Beta3" + } + } + } + }, + { + "regionTag": "dataflow_v1beta3_generated_MetricsV1Beta3_GetJobMetrics_async", + "title": "FlexTemplatesService getJobMetrics Sample", + "origin": "API_DEFINITION", + "description": " Request the job status. To request the status of a job, we recommend using `projects.locations.jobs.getMetrics` with a [regional endpoint] (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints). Using `projects.jobs.getMetrics` is not recommended, as you can only request the status of jobs that are running in `us-central1`.", + "canonical": true, + "file": "metrics_v1_beta3.get_job_metrics.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 67, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetJobMetrics", + "fullName": "google.dataflow.v1beta3.MetricsV1Beta3.GetJobMetrics", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "job_id", + "type": "TYPE_STRING" + }, + { + "name": "start_time", + "type": ".google.protobuf.Timestamp" + }, + { + "name": "location", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.dataflow.v1beta3.JobMetrics", + "client": { + "shortName": "MetricsV1Beta3Client", + "fullName": "google.dataflow.v1beta3.MetricsV1Beta3Client" + }, + "method": { + "shortName": "GetJobMetrics", + "fullName": "google.dataflow.v1beta3.MetricsV1Beta3.GetJobMetrics", + "service": { + "shortName": "MetricsV1Beta3", + "fullName": "google.dataflow.v1beta3.MetricsV1Beta3" + } + } + } + }, + { + "regionTag": "dataflow_v1beta3_generated_MetricsV1Beta3_GetJobExecutionDetails_async", + "title": "FlexTemplatesService getJobExecutionDetails Sample", + "origin": "API_DEFINITION", + "description": " Request detailed information about the execution status of the job. EXPERIMENTAL. This API is subject to change or removal without notice.", + "canonical": true, + "file": "metrics_v1_beta3.get_job_execution_details.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 76, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetJobExecutionDetails", + "fullName": "google.dataflow.v1beta3.MetricsV1Beta3.GetJobExecutionDetails", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "job_id", + "type": "TYPE_STRING" + }, + { + "name": "location", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.dataflow.v1beta3.JobExecutionDetails", + "client": { + "shortName": "MetricsV1Beta3Client", + "fullName": "google.dataflow.v1beta3.MetricsV1Beta3Client" + }, + "method": { + "shortName": "GetJobExecutionDetails", + "fullName": "google.dataflow.v1beta3.MetricsV1Beta3.GetJobExecutionDetails", + "service": { + "shortName": "MetricsV1Beta3", + "fullName": "google.dataflow.v1beta3.MetricsV1Beta3" + } + } + } + }, + { + "regionTag": "dataflow_v1beta3_generated_MetricsV1Beta3_GetStageExecutionDetails_async", + "title": "FlexTemplatesService getStageExecutionDetails Sample", + "origin": "API_DEFINITION", + "description": " Request detailed information about the execution status of a stage of the job. EXPERIMENTAL. This API is subject to change or removal without notice.", + "canonical": true, + "file": "metrics_v1_beta3.get_stage_execution_details.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 88, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetStageExecutionDetails", + "fullName": "google.dataflow.v1beta3.MetricsV1Beta3.GetStageExecutionDetails", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "job_id", + "type": "TYPE_STRING" + }, + { + "name": "location", + "type": "TYPE_STRING" + }, + { + "name": "stage_id", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "start_time", + "type": ".google.protobuf.Timestamp" + }, + { + "name": "end_time", + "type": ".google.protobuf.Timestamp" + } + ], + "resultType": ".google.dataflow.v1beta3.StageExecutionDetails", + "client": { + "shortName": "MetricsV1Beta3Client", + "fullName": "google.dataflow.v1beta3.MetricsV1Beta3Client" + }, + "method": { + "shortName": "GetStageExecutionDetails", + "fullName": "google.dataflow.v1beta3.MetricsV1Beta3.GetStageExecutionDetails", + "service": { + "shortName": "MetricsV1Beta3", + "fullName": "google.dataflow.v1beta3.MetricsV1Beta3" + } + } + } + }, + { + "regionTag": "dataflow_v1beta3_generated_SnapshotsV1Beta3_GetSnapshot_async", + "title": "FlexTemplatesService getSnapshot Sample", + "origin": "API_DEFINITION", + "description": " Gets information about a snapshot.", + "canonical": true, + "file": "snapshots_v1_beta3.get_snapshot.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 60, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetSnapshot", + "fullName": "google.dataflow.v1beta3.SnapshotsV1Beta3.GetSnapshot", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "snapshot_id", + "type": "TYPE_STRING" + }, + { + "name": "location", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.dataflow.v1beta3.Snapshot", + "client": { + "shortName": "SnapshotsV1Beta3Client", + "fullName": "google.dataflow.v1beta3.SnapshotsV1Beta3Client" + }, + "method": { + "shortName": "GetSnapshot", + "fullName": "google.dataflow.v1beta3.SnapshotsV1Beta3.GetSnapshot", + "service": { + "shortName": "SnapshotsV1Beta3", + "fullName": "google.dataflow.v1beta3.SnapshotsV1Beta3" + } + } + } + }, + { + "regionTag": "dataflow_v1beta3_generated_SnapshotsV1Beta3_DeleteSnapshot_async", + "title": "FlexTemplatesService deleteSnapshot Sample", + "origin": "API_DEFINITION", + "description": " Deletes a snapshot.", + "canonical": true, + "file": "snapshots_v1_beta3.delete_snapshot.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 60, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteSnapshot", + "fullName": "google.dataflow.v1beta3.SnapshotsV1Beta3.DeleteSnapshot", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "snapshot_id", + "type": "TYPE_STRING" + }, + { + "name": "location", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.dataflow.v1beta3.DeleteSnapshotResponse", + "client": { + "shortName": "SnapshotsV1Beta3Client", + "fullName": "google.dataflow.v1beta3.SnapshotsV1Beta3Client" + }, + "method": { + "shortName": "DeleteSnapshot", + "fullName": "google.dataflow.v1beta3.SnapshotsV1Beta3.DeleteSnapshot", + "service": { + "shortName": "SnapshotsV1Beta3", + "fullName": "google.dataflow.v1beta3.SnapshotsV1Beta3" + } + } + } + }, + { + "regionTag": "dataflow_v1beta3_generated_SnapshotsV1Beta3_ListSnapshots_async", + "title": "FlexTemplatesService listSnapshots Sample", + "origin": "API_DEFINITION", + "description": " Lists snapshots.", + "canonical": true, + "file": "snapshots_v1_beta3.list_snapshots.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 60, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListSnapshots", + "fullName": "google.dataflow.v1beta3.SnapshotsV1Beta3.ListSnapshots", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "job_id", + "type": "TYPE_STRING" + }, + { + "name": "location", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.dataflow.v1beta3.ListSnapshotsResponse", + "client": { + "shortName": "SnapshotsV1Beta3Client", + "fullName": "google.dataflow.v1beta3.SnapshotsV1Beta3Client" + }, + "method": { + "shortName": "ListSnapshots", + "fullName": "google.dataflow.v1beta3.SnapshotsV1Beta3.ListSnapshots", + "service": { + "shortName": "SnapshotsV1Beta3", + "fullName": "google.dataflow.v1beta3.SnapshotsV1Beta3" + } + } + } + }, + { + "regionTag": "dataflow_v1beta3_generated_TemplatesService_CreateJobFromTemplate_async", + "title": "FlexTemplatesService createJobFromTemplate Sample", + "origin": "API_DEFINITION", + "description": " Creates a Cloud Dataflow job from a template.", + "canonical": true, + "file": "templates_service.create_job_from_template.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 76, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateJobFromTemplate", + "fullName": "google.dataflow.v1beta3.TemplatesService.CreateJobFromTemplate", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "job_name", + "type": "TYPE_STRING" + }, + { + "name": "gcs_path", + "type": "TYPE_STRING" + }, + { + "name": "parameters", + "type": "TYPE_MESSAGE[]" + }, + { + "name": "environment", + "type": ".google.dataflow.v1beta3.RuntimeEnvironment" + }, + { + "name": "location", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.dataflow.v1beta3.Job", + "client": { + "shortName": "TemplatesServiceClient", + "fullName": "google.dataflow.v1beta3.TemplatesServiceClient" + }, + "method": { + "shortName": "CreateJobFromTemplate", + "fullName": "google.dataflow.v1beta3.TemplatesService.CreateJobFromTemplate", + "service": { + "shortName": "TemplatesService", + "fullName": "google.dataflow.v1beta3.TemplatesService" + } + } + } + }, + { + "regionTag": "dataflow_v1beta3_generated_TemplatesService_LaunchTemplate_async", + "title": "FlexTemplatesService launchTemplate Sample", + "origin": "API_DEFINITION", + "description": " Launch a template.", + "canonical": true, + "file": "templates_service.launch_template.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 78, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "LaunchTemplate", + "fullName": "google.dataflow.v1beta3.TemplatesService.LaunchTemplate", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + }, + { + "name": "gcs_path", + "type": "TYPE_STRING" + }, + { + "name": "dynamic_template", + "type": ".google.dataflow.v1beta3.DynamicTemplateLaunchParams" + }, + { + "name": "launch_parameters", + "type": ".google.dataflow.v1beta3.LaunchTemplateParameters" + }, + { + "name": "location", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.dataflow.v1beta3.LaunchTemplateResponse", + "client": { + "shortName": "TemplatesServiceClient", + "fullName": "google.dataflow.v1beta3.TemplatesServiceClient" + }, + "method": { + "shortName": "LaunchTemplate", + "fullName": "google.dataflow.v1beta3.TemplatesService.LaunchTemplate", + "service": { + "shortName": "TemplatesService", + "fullName": "google.dataflow.v1beta3.TemplatesService" + } + } + } + }, + { + "regionTag": "dataflow_v1beta3_generated_TemplatesService_GetTemplate_async", + "title": "FlexTemplatesService getTemplate Sample", + "origin": "API_DEFINITION", + "description": " Get the template associated with a template.", + "canonical": true, + "file": "templates_service.get_template.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetTemplate", + "fullName": "google.dataflow.v1beta3.TemplatesService.GetTemplate", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "gcs_path", + "type": "TYPE_STRING" + }, + { + "name": "view", + "type": ".google.dataflow.v1beta3.GetTemplateRequest.TemplateView" + }, + { + "name": "location", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.dataflow.v1beta3.GetTemplateResponse", + "client": { + "shortName": "TemplatesServiceClient", + "fullName": "google.dataflow.v1beta3.TemplatesServiceClient" + }, + "method": { + "shortName": "GetTemplate", + "fullName": "google.dataflow.v1beta3.TemplatesService.GetTemplate", + "service": { + "shortName": "TemplatesService", + "fullName": "google.dataflow.v1beta3.TemplatesService" + } + } + } + } + ] +} \ No newline at end of file diff --git a/packages/google-dataflow/samples/generated/v1beta3/templates_service.create_job_from_template.js b/packages/google-dataflow/samples/generated/v1beta3/templates_service.create_job_from_template.js new file mode 100644 index 00000000000..3d2cd086155 --- /dev/null +++ b/packages/google-dataflow/samples/generated/v1beta3/templates_service.create_job_from_template.js @@ -0,0 +1,84 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main() { + // [START dataflow_v1beta3_generated_TemplatesService_CreateJobFromTemplate_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 Cloud Platform project that the job belongs to. + */ + // const projectId = 'abc123' + /** + * Required. The job name to use for the created job. + */ + // const jobName = 'abc123' + /** + * Required. A Cloud Storage path to the template from which to + * create the job. + * Must be a valid Cloud Storage URL, beginning with `gs://`. + */ + // const gcsPath = 'abc123' + /** + * The runtime parameters to pass to the job. + */ + // const parameters = 1234 + /** + * The runtime environment for the job. + */ + // const environment = {} + /** + * The regional endpoint + * (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) to + * which to direct the request. + */ + // const location = 'abc123' + + // Imports the Dataflow library + const {TemplatesServiceClient} = require('@google-cloud/dataflow').v1beta3; + + // Instantiates a client + const dataflowClient = new TemplatesServiceClient(); + + async function callCreateJobFromTemplate() { + // Construct request + const request = { + }; + + // Run request + const response = await dataflowClient.createJobFromTemplate(request); + console.log(response); + } + + callCreateJobFromTemplate(); + // [END dataflow_v1beta3_generated_TemplatesService_CreateJobFromTemplate_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-dataflow/samples/generated/v1beta3/templates_service.get_template.js b/packages/google-dataflow/samples/generated/v1beta3/templates_service.get_template.js new file mode 100644 index 00000000000..7ba027200c1 --- /dev/null +++ b/packages/google-dataflow/samples/generated/v1beta3/templates_service.get_template.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() { + // [START dataflow_v1beta3_generated_TemplatesService_GetTemplate_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 Cloud Platform project that the job belongs to. + */ + // const projectId = 'abc123' + /** + * Required. A Cloud Storage path to the template from which to + * create the job. + * Must be valid Cloud Storage URL, beginning with 'gs://'. + */ + // const gcsPath = 'abc123' + /** + * The view to retrieve. Defaults to METADATA_ONLY. + */ + // const view = {} + /** + * The regional endpoint + * (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) to + * which to direct the request. + */ + // const location = 'abc123' + + // Imports the Dataflow library + const {TemplatesServiceClient} = require('@google-cloud/dataflow').v1beta3; + + // Instantiates a client + const dataflowClient = new TemplatesServiceClient(); + + async function callGetTemplate() { + // Construct request + const request = { + }; + + // Run request + const response = await dataflowClient.getTemplate(request); + console.log(response); + } + + callGetTemplate(); + // [END dataflow_v1beta3_generated_TemplatesService_GetTemplate_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-dataflow/samples/generated/v1beta3/templates_service.launch_template.js b/packages/google-dataflow/samples/generated/v1beta3/templates_service.launch_template.js new file mode 100644 index 00000000000..8c2e8640a7e --- /dev/null +++ b/packages/google-dataflow/samples/generated/v1beta3/templates_service.launch_template.js @@ -0,0 +1,86 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main() { + // [START dataflow_v1beta3_generated_TemplatesService_LaunchTemplate_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 Cloud Platform project that the job belongs to. + */ + // const projectId = 'abc123' + /** + * If true, the request is validated but not actually executed. + * Defaults to false. + */ + // const validateOnly = true + /** + * A Cloud Storage path to the template from which to create + * the job. + * Must be valid Cloud Storage URL, beginning with 'gs://'. + */ + // const gcsPath = 'abc123' + /** + * Params for launching a dynamic template. + */ + // const dynamicTemplate = {} + /** + * The parameters of the template to launch. This should be part of the + * body of the POST request. + */ + // const launchParameters = {} + /** + * The regional endpoint + * (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) to + * which to direct the request. + */ + // const location = 'abc123' + + // Imports the Dataflow library + const {TemplatesServiceClient} = require('@google-cloud/dataflow').v1beta3; + + // Instantiates a client + const dataflowClient = new TemplatesServiceClient(); + + async function callLaunchTemplate() { + // Construct request + const request = { + }; + + // Run request + const response = await dataflowClient.launchTemplate(request); + console.log(response); + } + + callLaunchTemplate(); + // [END dataflow_v1beta3_generated_TemplatesService_LaunchTemplate_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-dataflow/samples/package.json b/packages/google-dataflow/samples/package.json new file mode 100644 index 00000000000..6808f8bff03 --- /dev/null +++ b/packages/google-dataflow/samples/package.json @@ -0,0 +1,23 @@ +{ + "name": "nodejs-dataflow", + "private": true, + "license": "Apache-2.0", + "author": "Google LLC", + "engines": { + "node": ">=12.0.0" + }, + "files": [ + "*.js" + ], + "scripts": { + "test": "c8 mocha --timeout 600000 test/*.js" + }, + "dependencies": { + "@google-cloud/dataflow": "^2.0.1" + }, + "devDependencies": { + "c8": "^7.1.0", + "chai": "^4.2.0", + "mocha": "^8.0.0" + } +} \ No newline at end of file diff --git a/packages/google-dataflow/samples/quickstart.js b/packages/google-dataflow/samples/quickstart.js new file mode 100644 index 00000000000..58a6681c671 --- /dev/null +++ b/packages/google-dataflow/samples/quickstart.js @@ -0,0 +1,52 @@ +// Licensed under the Apache License, Version 2.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, + gcsPath = 'gs://dataflow-templates/latest/PubSub_Subscription_to_BigQuery' +) { + // [START nodejs_dataflow_quickstart] + // Imports the Google Cloud client library + + const {TemplatesServiceClient} = require('@google-cloud/dataflow'); + + // TODO(developer): replace with your prefered project ID. + // const projectId = 'my-project' + // TODO(developer): replace with your bucket path. + // const gcsPath = 'gs:///path' + + // Creates a client + const client = new TemplatesServiceClient(); + + //TODO(library generator): write the actual function you will be testing + async function getTemplate() { + const template = await client.getTemplate({ + projectId, + gcsPath, + }); + console.info(template); + } + getTemplate(); + // [END nodejs_dataflow_quickstart] +} + +main(...process.argv.slice(2)).catch(err => { + console.error(err.message); + process.exitCode = 1; +}); +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); diff --git a/packages/google-dataflow/samples/test/quickstart.js b/packages/google-dataflow/samples/test/quickstart.js new file mode 100644 index 00000000000..9d8816c4244 --- /dev/null +++ b/packages/google-dataflow/samples/test/quickstart.js @@ -0,0 +1,43 @@ +// +// Licensed under the Apache License, Version 2.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 path = require('path'); +const cp = require('child_process'); +const {before, describe, it} = require('mocha'); +const {TemplatesServiceClient} = require('@google-cloud/dataflow'); +const {assert} = require('chai'); + +const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'}); + +const cwd = path.join(__dirname, '..'); + +const client = new TemplatesServiceClient(); + +describe('Quickstart', () => { + let projectId; + + before(async () => { + projectId = await client.getProjectId(); + }); + + it('should run quickstart', async () => { + const stdout = execSync(`node ./quickstart.js ${projectId}`, {cwd}); + assert.match(stdout, /status: null/); + }); +}); diff --git a/packages/google-dataflow/src/index.ts b/packages/google-dataflow/src/index.ts new file mode 100644 index 00000000000..f06f0201f66 --- /dev/null +++ b/packages/google-dataflow/src/index.ts @@ -0,0 +1,53 @@ +// 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 v1beta3 from './v1beta3'; + +const FlexTemplatesServiceClient = v1beta3.FlexTemplatesServiceClient; +type FlexTemplatesServiceClient = v1beta3.FlexTemplatesServiceClient; +const JobsV1Beta3Client = v1beta3.JobsV1Beta3Client; +type JobsV1Beta3Client = v1beta3.JobsV1Beta3Client; +const MessagesV1Beta3Client = v1beta3.MessagesV1Beta3Client; +type MessagesV1Beta3Client = v1beta3.MessagesV1Beta3Client; +const MetricsV1Beta3Client = v1beta3.MetricsV1Beta3Client; +type MetricsV1Beta3Client = v1beta3.MetricsV1Beta3Client; +const SnapshotsV1Beta3Client = v1beta3.SnapshotsV1Beta3Client; +type SnapshotsV1Beta3Client = v1beta3.SnapshotsV1Beta3Client; +const TemplatesServiceClient = v1beta3.TemplatesServiceClient; +type TemplatesServiceClient = v1beta3.TemplatesServiceClient; + +export { + v1beta3, + FlexTemplatesServiceClient, + JobsV1Beta3Client, + MessagesV1Beta3Client, + MetricsV1Beta3Client, + SnapshotsV1Beta3Client, + TemplatesServiceClient, +}; +export default { + v1beta3, + FlexTemplatesServiceClient, + JobsV1Beta3Client, + MessagesV1Beta3Client, + MetricsV1Beta3Client, + SnapshotsV1Beta3Client, + TemplatesServiceClient, +}; +import * as protos from '../protos/protos'; +export {protos}; diff --git a/packages/google-dataflow/src/v1beta3/flex_templates_service_client.ts b/packages/google-dataflow/src/v1beta3/flex_templates_service_client.ts new file mode 100644 index 00000000000..50d7ad75b8e --- /dev/null +++ b/packages/google-dataflow/src/v1beta3/flex_templates_service_client.ts @@ -0,0 +1,425 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import type * as gax from 'google-gax'; +import type { + Callback, + CallOptions, + Descriptors, + ClientOptions, +} from 'google-gax'; + +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1beta3/flex_templates_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './flex_templates_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Provides a service for Flex templates. This feature is not ready yet. + * @class + * @memberof v1beta3 + */ +export class FlexTemplatesServiceClient { + 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}; + flexTemplatesServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of FlexTemplatesServiceClient. + * + * @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 FlexTemplatesServiceClient({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 FlexTemplatesServiceClient; + 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); + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.dataflow.v1beta3.FlexTemplatesService', + 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.flexTemplatesServiceStub) { + return this.flexTemplatesServiceStub; + } + + // Put together the "service stub" for + // google.dataflow.v1beta3.FlexTemplatesService. + this.flexTemplatesServiceStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.dataflow.v1beta3.FlexTemplatesService' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.dataflow.v1beta3.FlexTemplatesService, + 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 flexTemplatesServiceStubMethods = ['launchFlexTemplate']; + for (const methodName of flexTemplatesServiceStubMethods) { + const callPromise = this.flexTemplatesServiceStub.then( + stub => + (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error | null | undefined) => () => { + throw err; + } + ); + + const descriptor = undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.flexTemplatesServiceStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'dataflow.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 'dataflow.googleapis.com'; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return [ + 'https://www.googleapis.com/auth/cloud-platform', + 'https://www.googleapis.com/auth/compute', + 'https://www.googleapis.com/auth/compute.readonly', + 'https://www.googleapis.com/auth/userinfo.email', + ]; + } + + 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 -- + // ------------------- + /** + * Launch a job with a FlexTemplate. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Required. The ID of the Cloud Platform project that the job belongs to. + * @param {google.dataflow.v1beta3.LaunchFlexTemplateParameter} request.launchParameter + * Required. Parameter to launch a job form Flex Template. + * @param {string} request.location + * Required. The [regional endpoint] + * (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) to + * which to direct the request. E.g., us-central1, us-west1. + * @param {boolean} request.validateOnly + * If true, the request is validated but not actually executed. + * Defaults to false. + * @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 [LaunchFlexTemplateResponse]{@link google.dataflow.v1beta3.LaunchFlexTemplateResponse}. + * 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/v1beta3/flex_templates_service.launch_flex_template.js + * region_tag:dataflow_v1beta3_generated_FlexTemplatesService_LaunchFlexTemplate_async + */ + launchFlexTemplate( + request?: protos.google.dataflow.v1beta3.ILaunchFlexTemplateRequest, + options?: CallOptions + ): Promise< + [ + protos.google.dataflow.v1beta3.ILaunchFlexTemplateResponse, + protos.google.dataflow.v1beta3.ILaunchFlexTemplateRequest | undefined, + {} | undefined + ] + >; + launchFlexTemplate( + request: protos.google.dataflow.v1beta3.ILaunchFlexTemplateRequest, + options: CallOptions, + callback: Callback< + protos.google.dataflow.v1beta3.ILaunchFlexTemplateResponse, + | protos.google.dataflow.v1beta3.ILaunchFlexTemplateRequest + | null + | undefined, + {} | null | undefined + > + ): void; + launchFlexTemplate( + request: protos.google.dataflow.v1beta3.ILaunchFlexTemplateRequest, + callback: Callback< + protos.google.dataflow.v1beta3.ILaunchFlexTemplateResponse, + | protos.google.dataflow.v1beta3.ILaunchFlexTemplateRequest + | null + | undefined, + {} | null | undefined + > + ): void; + launchFlexTemplate( + request?: protos.google.dataflow.v1beta3.ILaunchFlexTemplateRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.dataflow.v1beta3.ILaunchFlexTemplateResponse, + | protos.google.dataflow.v1beta3.ILaunchFlexTemplateRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.dataflow.v1beta3.ILaunchFlexTemplateResponse, + | protos.google.dataflow.v1beta3.ILaunchFlexTemplateRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.dataflow.v1beta3.ILaunchFlexTemplateResponse, + protos.google.dataflow.v1beta3.ILaunchFlexTemplateRequest | 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 ?? '', + location: request.location ?? '', + }); + this.initialize(); + return this.innerApiCalls.launchFlexTemplate(request, options, callback); + } + + /** + * 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.flexTemplatesServiceStub && !this._terminated) { + return this.flexTemplatesServiceStub.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-dataflow/src/v1beta3/flex_templates_service_client_config.json b/packages/google-dataflow/src/v1beta3/flex_templates_service_client_config.json new file mode 100644 index 00000000000..030c5540a61 --- /dev/null +++ b/packages/google-dataflow/src/v1beta3/flex_templates_service_client_config.json @@ -0,0 +1,30 @@ +{ + "interfaces": { + "google.dataflow.v1beta3.FlexTemplatesService": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "LaunchFlexTemplate": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-dataflow/src/v1beta3/flex_templates_service_proto_list.json b/packages/google-dataflow/src/v1beta3/flex_templates_service_proto_list.json new file mode 100644 index 00000000000..cd5511e4fd8 --- /dev/null +++ b/packages/google-dataflow/src/v1beta3/flex_templates_service_proto_list.json @@ -0,0 +1,9 @@ +[ + "../../protos/google/dataflow/v1beta3/environment.proto", + "../../protos/google/dataflow/v1beta3/jobs.proto", + "../../protos/google/dataflow/v1beta3/messages.proto", + "../../protos/google/dataflow/v1beta3/metrics.proto", + "../../protos/google/dataflow/v1beta3/snapshots.proto", + "../../protos/google/dataflow/v1beta3/streaming.proto", + "../../protos/google/dataflow/v1beta3/templates.proto" +] diff --git a/packages/google-dataflow/src/v1beta3/gapic_metadata.json b/packages/google-dataflow/src/v1beta3/gapic_metadata.json new file mode 100644 index 00000000000..44fe73585b4 --- /dev/null +++ b/packages/google-dataflow/src/v1beta3/gapic_metadata.json @@ -0,0 +1,293 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.dataflow.v1beta3", + "libraryPackage": "@google-cloud/dataflow", + "services": { + "FlexTemplatesService": { + "clients": { + "grpc": { + "libraryClient": "FlexTemplatesServiceClient", + "rpcs": { + "LaunchFlexTemplate": { + "methods": [ + "launchFlexTemplate" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "FlexTemplatesServiceClient", + "rpcs": { + "LaunchFlexTemplate": { + "methods": [ + "launchFlexTemplate" + ] + } + } + } + } + }, + "JobsV1Beta3": { + "clients": { + "grpc": { + "libraryClient": "JobsV1Beta3Client", + "rpcs": { + "CreateJob": { + "methods": [ + "createJob" + ] + }, + "GetJob": { + "methods": [ + "getJob" + ] + }, + "UpdateJob": { + "methods": [ + "updateJob" + ] + }, + "CheckActiveJobs": { + "methods": [ + "checkActiveJobs" + ] + }, + "SnapshotJob": { + "methods": [ + "snapshotJob" + ] + }, + "ListJobs": { + "methods": [ + "listJobs", + "listJobsStream", + "listJobsAsync" + ] + }, + "AggregatedListJobs": { + "methods": [ + "aggregatedListJobs", + "aggregatedListJobsStream", + "aggregatedListJobsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "JobsV1Beta3Client", + "rpcs": { + "CreateJob": { + "methods": [ + "createJob" + ] + }, + "GetJob": { + "methods": [ + "getJob" + ] + }, + "UpdateJob": { + "methods": [ + "updateJob" + ] + }, + "CheckActiveJobs": { + "methods": [ + "checkActiveJobs" + ] + }, + "SnapshotJob": { + "methods": [ + "snapshotJob" + ] + }, + "ListJobs": { + "methods": [ + "listJobs", + "listJobsStream", + "listJobsAsync" + ] + }, + "AggregatedListJobs": { + "methods": [ + "aggregatedListJobs", + "aggregatedListJobsStream", + "aggregatedListJobsAsync" + ] + } + } + } + } + }, + "MessagesV1Beta3": { + "clients": { + "grpc": { + "libraryClient": "MessagesV1Beta3Client", + "rpcs": { + "ListJobMessages": { + "methods": [ + "listJobMessages", + "listJobMessagesStream", + "listJobMessagesAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "MessagesV1Beta3Client", + "rpcs": { + "ListJobMessages": { + "methods": [ + "listJobMessages", + "listJobMessagesStream", + "listJobMessagesAsync" + ] + } + } + } + } + }, + "MetricsV1Beta3": { + "clients": { + "grpc": { + "libraryClient": "MetricsV1Beta3Client", + "rpcs": { + "GetJobMetrics": { + "methods": [ + "getJobMetrics" + ] + }, + "GetJobExecutionDetails": { + "methods": [ + "getJobExecutionDetails", + "getJobExecutionDetailsStream", + "getJobExecutionDetailsAsync" + ] + }, + "GetStageExecutionDetails": { + "methods": [ + "getStageExecutionDetails", + "getStageExecutionDetailsStream", + "getStageExecutionDetailsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "MetricsV1Beta3Client", + "rpcs": { + "GetJobMetrics": { + "methods": [ + "getJobMetrics" + ] + }, + "GetJobExecutionDetails": { + "methods": [ + "getJobExecutionDetails", + "getJobExecutionDetailsStream", + "getJobExecutionDetailsAsync" + ] + }, + "GetStageExecutionDetails": { + "methods": [ + "getStageExecutionDetails", + "getStageExecutionDetailsStream", + "getStageExecutionDetailsAsync" + ] + } + } + } + } + }, + "SnapshotsV1Beta3": { + "clients": { + "grpc": { + "libraryClient": "SnapshotsV1Beta3Client", + "rpcs": { + "GetSnapshot": { + "methods": [ + "getSnapshot" + ] + }, + "DeleteSnapshot": { + "methods": [ + "deleteSnapshot" + ] + }, + "ListSnapshots": { + "methods": [ + "listSnapshots" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "SnapshotsV1Beta3Client", + "rpcs": { + "GetSnapshot": { + "methods": [ + "getSnapshot" + ] + }, + "DeleteSnapshot": { + "methods": [ + "deleteSnapshot" + ] + }, + "ListSnapshots": { + "methods": [ + "listSnapshots" + ] + } + } + } + } + }, + "TemplatesService": { + "clients": { + "grpc": { + "libraryClient": "TemplatesServiceClient", + "rpcs": { + "CreateJobFromTemplate": { + "methods": [ + "createJobFromTemplate" + ] + }, + "LaunchTemplate": { + "methods": [ + "launchTemplate" + ] + }, + "GetTemplate": { + "methods": [ + "getTemplate" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "TemplatesServiceClient", + "rpcs": { + "CreateJobFromTemplate": { + "methods": [ + "createJobFromTemplate" + ] + }, + "LaunchTemplate": { + "methods": [ + "launchTemplate" + ] + }, + "GetTemplate": { + "methods": [ + "getTemplate" + ] + } + } + } + } + } + } +} diff --git a/packages/google-dataflow/src/v1beta3/index.ts b/packages/google-dataflow/src/v1beta3/index.ts new file mode 100644 index 00000000000..e996da2faed --- /dev/null +++ b/packages/google-dataflow/src/v1beta3/index.ts @@ -0,0 +1,24 @@ +// 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 {FlexTemplatesServiceClient} from './flex_templates_service_client'; +export {JobsV1Beta3Client} from './jobs_v1_beta3_client'; +export {MessagesV1Beta3Client} from './messages_v1_beta3_client'; +export {MetricsV1Beta3Client} from './metrics_v1_beta3_client'; +export {SnapshotsV1Beta3Client} from './snapshots_v1_beta3_client'; +export {TemplatesServiceClient} from './templates_service_client'; diff --git a/packages/google-dataflow/src/v1beta3/jobs_v1_beta3_client.ts b/packages/google-dataflow/src/v1beta3/jobs_v1_beta3_client.ts new file mode 100644 index 00000000000..ddaf19bccf0 --- /dev/null +++ b/packages/google-dataflow/src/v1beta3/jobs_v1_beta3_client.ts @@ -0,0 +1,1271 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import type * as gax from 'google-gax'; +import type { + Callback, + CallOptions, + Descriptors, + ClientOptions, + PaginationCallback, + GaxCall, +} from 'google-gax'; +import {Transform} from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1beta3/jobs_v1_beta3_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './jobs_v1_beta3_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Provides a method to create and modify Google Cloud Dataflow jobs. + * A Job is a multi-stage computation graph run by the Cloud Dataflow service. + * @class + * @memberof v1beta3 + */ +export class JobsV1Beta3Client { + 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}; + jobsV1Beta3Stub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of JobsV1Beta3Client. + * + * @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 JobsV1Beta3Client({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 JobsV1Beta3Client; + 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); + + // Some of the methods on this service return "paged" results, + // (e.g. 50 results at a time, with tokens to get subsequent + // pages). Denote the keys used for pagination and results. + this.descriptors.page = { + listJobs: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'jobs' + ), + aggregatedListJobs: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'jobs' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.dataflow.v1beta3.JobsV1Beta3', + 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.jobsV1Beta3Stub) { + return this.jobsV1Beta3Stub; + } + + // Put together the "service stub" for + // google.dataflow.v1beta3.JobsV1Beta3. + this.jobsV1Beta3Stub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.dataflow.v1beta3.JobsV1Beta3' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.dataflow.v1beta3.JobsV1Beta3, + 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 jobsV1Beta3StubMethods = [ + 'createJob', + 'getJob', + 'updateJob', + 'listJobs', + 'aggregatedListJobs', + 'checkActiveJobs', + 'snapshotJob', + ]; + for (const methodName of jobsV1Beta3StubMethods) { + const callPromise = this.jobsV1Beta3Stub.then( + stub => + (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error | null | undefined) => () => { + throw err; + } + ); + + const descriptor = this.descriptors.page[methodName] || undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.jobsV1Beta3Stub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'dataflow.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 'dataflow.googleapis.com'; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return [ + 'https://www.googleapis.com/auth/cloud-platform', + 'https://www.googleapis.com/auth/compute', + 'https://www.googleapis.com/auth/compute.readonly', + 'https://www.googleapis.com/auth/userinfo.email', + ]; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId( + callback?: Callback + ): Promise | void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- + /** + * Creates a Cloud Dataflow job. + * + * To create a job, we recommend using `projects.locations.jobs.create` with a + * [regional endpoint] + * (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints). Using + * `projects.jobs.create` is not recommended, as your job will always start + * in `us-central1`. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * The ID of the Cloud Platform project that the job belongs to. + * @param {google.dataflow.v1beta3.Job} request.job + * The job to create. + * @param {google.dataflow.v1beta3.JobView} request.view + * The level of information requested in response. + * @param {string} request.replaceJobId + * Deprecated. This field is now in the Job message. + * @param {string} request.location + * The [regional endpoint] + * (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) that + * contains this 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 [Job]{@link google.dataflow.v1beta3.Job}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta3/jobs_v1_beta3.create_job.js + * region_tag:dataflow_v1beta3_generated_JobsV1Beta3_CreateJob_async + */ + createJob( + request?: protos.google.dataflow.v1beta3.ICreateJobRequest, + options?: CallOptions + ): Promise< + [ + protos.google.dataflow.v1beta3.IJob, + protos.google.dataflow.v1beta3.ICreateJobRequest | undefined, + {} | undefined + ] + >; + createJob( + request: protos.google.dataflow.v1beta3.ICreateJobRequest, + options: CallOptions, + callback: Callback< + protos.google.dataflow.v1beta3.IJob, + protos.google.dataflow.v1beta3.ICreateJobRequest | null | undefined, + {} | null | undefined + > + ): void; + createJob( + request: protos.google.dataflow.v1beta3.ICreateJobRequest, + callback: Callback< + protos.google.dataflow.v1beta3.IJob, + protos.google.dataflow.v1beta3.ICreateJobRequest | null | undefined, + {} | null | undefined + > + ): void; + createJob( + request?: protos.google.dataflow.v1beta3.ICreateJobRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.dataflow.v1beta3.IJob, + protos.google.dataflow.v1beta3.ICreateJobRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.dataflow.v1beta3.IJob, + protos.google.dataflow.v1beta3.ICreateJobRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.dataflow.v1beta3.IJob, + protos.google.dataflow.v1beta3.ICreateJobRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + project_id: request.projectId ?? '', + location: request.location ?? '', + }); + this.initialize(); + return this.innerApiCalls.createJob(request, options, callback); + } + /** + * Gets the state of the specified Cloud Dataflow job. + * + * To get the state of a job, we recommend using `projects.locations.jobs.get` + * with a [regional endpoint] + * (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints). Using + * `projects.jobs.get` is not recommended, as you can only get the state of + * jobs that are running in `us-central1`. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * The ID of the Cloud Platform project that the job belongs to. + * @param {string} request.jobId + * The job ID. + * @param {google.dataflow.v1beta3.JobView} request.view + * The level of information requested in response. + * @param {string} request.location + * The [regional endpoint] + * (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) that + * contains this 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 [Job]{@link google.dataflow.v1beta3.Job}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta3/jobs_v1_beta3.get_job.js + * region_tag:dataflow_v1beta3_generated_JobsV1Beta3_GetJob_async + */ + getJob( + request?: protos.google.dataflow.v1beta3.IGetJobRequest, + options?: CallOptions + ): Promise< + [ + protos.google.dataflow.v1beta3.IJob, + protos.google.dataflow.v1beta3.IGetJobRequest | undefined, + {} | undefined + ] + >; + getJob( + request: protos.google.dataflow.v1beta3.IGetJobRequest, + options: CallOptions, + callback: Callback< + protos.google.dataflow.v1beta3.IJob, + protos.google.dataflow.v1beta3.IGetJobRequest | null | undefined, + {} | null | undefined + > + ): void; + getJob( + request: protos.google.dataflow.v1beta3.IGetJobRequest, + callback: Callback< + protos.google.dataflow.v1beta3.IJob, + protos.google.dataflow.v1beta3.IGetJobRequest | null | undefined, + {} | null | undefined + > + ): void; + getJob( + request?: protos.google.dataflow.v1beta3.IGetJobRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.dataflow.v1beta3.IJob, + protos.google.dataflow.v1beta3.IGetJobRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.dataflow.v1beta3.IJob, + protos.google.dataflow.v1beta3.IGetJobRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.dataflow.v1beta3.IJob, + protos.google.dataflow.v1beta3.IGetJobRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + project_id: request.projectId ?? '', + location: request.location ?? '', + job_id: request.jobId ?? '', + }); + this.initialize(); + return this.innerApiCalls.getJob(request, options, callback); + } + /** + * Updates the state of an existing Cloud Dataflow job. + * + * To update the state of an existing job, we recommend using + * `projects.locations.jobs.update` with a [regional endpoint] + * (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints). Using + * `projects.jobs.update` is not recommended, as you can only update the state + * of jobs that are running in `us-central1`. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * The ID of the Cloud Platform project that the job belongs to. + * @param {string} request.jobId + * The job ID. + * @param {google.dataflow.v1beta3.Job} request.job + * The updated job. + * Only the job state is updatable; other fields will be ignored. + * @param {string} request.location + * The [regional endpoint] + * (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) that + * contains this 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 [Job]{@link google.dataflow.v1beta3.Job}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta3/jobs_v1_beta3.update_job.js + * region_tag:dataflow_v1beta3_generated_JobsV1Beta3_UpdateJob_async + */ + updateJob( + request?: protos.google.dataflow.v1beta3.IUpdateJobRequest, + options?: CallOptions + ): Promise< + [ + protos.google.dataflow.v1beta3.IJob, + protos.google.dataflow.v1beta3.IUpdateJobRequest | undefined, + {} | undefined + ] + >; + updateJob( + request: protos.google.dataflow.v1beta3.IUpdateJobRequest, + options: CallOptions, + callback: Callback< + protos.google.dataflow.v1beta3.IJob, + protos.google.dataflow.v1beta3.IUpdateJobRequest | null | undefined, + {} | null | undefined + > + ): void; + updateJob( + request: protos.google.dataflow.v1beta3.IUpdateJobRequest, + callback: Callback< + protos.google.dataflow.v1beta3.IJob, + protos.google.dataflow.v1beta3.IUpdateJobRequest | null | undefined, + {} | null | undefined + > + ): void; + updateJob( + request?: protos.google.dataflow.v1beta3.IUpdateJobRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.dataflow.v1beta3.IJob, + protos.google.dataflow.v1beta3.IUpdateJobRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.dataflow.v1beta3.IJob, + protos.google.dataflow.v1beta3.IUpdateJobRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.dataflow.v1beta3.IJob, + protos.google.dataflow.v1beta3.IUpdateJobRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + project_id: request.projectId ?? '', + location: request.location ?? '', + job_id: request.jobId ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateJob(request, options, callback); + } + /** + * Check for existence of active jobs in the given project across all regions. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * The project which owns the jobs. + * @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 [CheckActiveJobsResponse]{@link google.dataflow.v1beta3.CheckActiveJobsResponse}. + * 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/v1beta3/jobs_v1_beta3.check_active_jobs.js + * region_tag:dataflow_v1beta3_generated_JobsV1Beta3_CheckActiveJobs_async + */ + checkActiveJobs( + request?: protos.google.dataflow.v1beta3.ICheckActiveJobsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.dataflow.v1beta3.ICheckActiveJobsResponse, + protos.google.dataflow.v1beta3.ICheckActiveJobsRequest | undefined, + {} | undefined + ] + >; + checkActiveJobs( + request: protos.google.dataflow.v1beta3.ICheckActiveJobsRequest, + options: CallOptions, + callback: Callback< + protos.google.dataflow.v1beta3.ICheckActiveJobsResponse, + protos.google.dataflow.v1beta3.ICheckActiveJobsRequest | null | undefined, + {} | null | undefined + > + ): void; + checkActiveJobs( + request: protos.google.dataflow.v1beta3.ICheckActiveJobsRequest, + callback: Callback< + protos.google.dataflow.v1beta3.ICheckActiveJobsResponse, + protos.google.dataflow.v1beta3.ICheckActiveJobsRequest | null | undefined, + {} | null | undefined + > + ): void; + checkActiveJobs( + request?: protos.google.dataflow.v1beta3.ICheckActiveJobsRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.dataflow.v1beta3.ICheckActiveJobsResponse, + | protos.google.dataflow.v1beta3.ICheckActiveJobsRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.dataflow.v1beta3.ICheckActiveJobsResponse, + protos.google.dataflow.v1beta3.ICheckActiveJobsRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.dataflow.v1beta3.ICheckActiveJobsResponse, + protos.google.dataflow.v1beta3.ICheckActiveJobsRequest | 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.checkActiveJobs(request, options, callback); + } + /** + * Snapshot the state of a streaming job. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * The project which owns the job to be snapshotted. + * @param {string} request.jobId + * The job to be snapshotted. + * @param {google.protobuf.Duration} request.ttl + * TTL for the snapshot. + * @param {string} request.location + * The location that contains this job. + * @param {boolean} request.snapshotSources + * If true, perform snapshots for sources which support this. + * @param {string} request.description + * User specified description of the snapshot. Maybe empty. + * @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 [Snapshot]{@link google.dataflow.v1beta3.Snapshot}. + * 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/v1beta3/jobs_v1_beta3.snapshot_job.js + * region_tag:dataflow_v1beta3_generated_JobsV1Beta3_SnapshotJob_async + */ + snapshotJob( + request?: protos.google.dataflow.v1beta3.ISnapshotJobRequest, + options?: CallOptions + ): Promise< + [ + protos.google.dataflow.v1beta3.ISnapshot, + protos.google.dataflow.v1beta3.ISnapshotJobRequest | undefined, + {} | undefined + ] + >; + snapshotJob( + request: protos.google.dataflow.v1beta3.ISnapshotJobRequest, + options: CallOptions, + callback: Callback< + protos.google.dataflow.v1beta3.ISnapshot, + protos.google.dataflow.v1beta3.ISnapshotJobRequest | null | undefined, + {} | null | undefined + > + ): void; + snapshotJob( + request: protos.google.dataflow.v1beta3.ISnapshotJobRequest, + callback: Callback< + protos.google.dataflow.v1beta3.ISnapshot, + protos.google.dataflow.v1beta3.ISnapshotJobRequest | null | undefined, + {} | null | undefined + > + ): void; + snapshotJob( + request?: protos.google.dataflow.v1beta3.ISnapshotJobRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.dataflow.v1beta3.ISnapshot, + protos.google.dataflow.v1beta3.ISnapshotJobRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.dataflow.v1beta3.ISnapshot, + protos.google.dataflow.v1beta3.ISnapshotJobRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.dataflow.v1beta3.ISnapshot, + protos.google.dataflow.v1beta3.ISnapshotJobRequest | 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 ?? '', + location: request.location ?? '', + job_id: request.jobId ?? '', + }); + this.initialize(); + return this.innerApiCalls.snapshotJob(request, options, callback); + } + + /** + * List the jobs of a project. + * + * To list the jobs of a project in a region, we recommend using + * `projects.locations.jobs.list` with a [regional endpoint] + * (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints). To + * list the all jobs across all regions, use `projects.jobs.aggregated`. Using + * `projects.jobs.list` is not recommended, as you can only get the list of + * jobs that are running in `us-central1`. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.dataflow.v1beta3.ListJobsRequest.Filter} request.filter + * The kind of filter to use. + * @param {string} request.projectId + * The project which owns the jobs. + * @param {google.dataflow.v1beta3.JobView} request.view + * Deprecated. ListJobs always returns summaries now. + * Use GetJob for other JobViews. + * @param {number} request.pageSize + * If there are many jobs, limit response to at most this many. + * The actual number of jobs returned will be the lesser of max_responses + * and an unspecified server-defined limit. + * @param {string} request.pageToken + * Set this to the 'next_page_token' field of a previous response + * to request additional results in a long list. + * @param {string} request.location + * The [regional endpoint] + * (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) that + * contains this 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 Array of [Job]{@link google.dataflow.v1beta3.Job}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listJobsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listJobs( + request?: protos.google.dataflow.v1beta3.IListJobsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.dataflow.v1beta3.IJob[], + protos.google.dataflow.v1beta3.IListJobsRequest | null, + protos.google.dataflow.v1beta3.IListJobsResponse + ] + >; + listJobs( + request: protos.google.dataflow.v1beta3.IListJobsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.dataflow.v1beta3.IListJobsRequest, + protos.google.dataflow.v1beta3.IListJobsResponse | null | undefined, + protos.google.dataflow.v1beta3.IJob + > + ): void; + listJobs( + request: protos.google.dataflow.v1beta3.IListJobsRequest, + callback: PaginationCallback< + protos.google.dataflow.v1beta3.IListJobsRequest, + protos.google.dataflow.v1beta3.IListJobsResponse | null | undefined, + protos.google.dataflow.v1beta3.IJob + > + ): void; + listJobs( + request?: protos.google.dataflow.v1beta3.IListJobsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.dataflow.v1beta3.IListJobsRequest, + protos.google.dataflow.v1beta3.IListJobsResponse | null | undefined, + protos.google.dataflow.v1beta3.IJob + >, + callback?: PaginationCallback< + protos.google.dataflow.v1beta3.IListJobsRequest, + protos.google.dataflow.v1beta3.IListJobsResponse | null | undefined, + protos.google.dataflow.v1beta3.IJob + > + ): Promise< + [ + protos.google.dataflow.v1beta3.IJob[], + protos.google.dataflow.v1beta3.IListJobsRequest | null, + protos.google.dataflow.v1beta3.IListJobsResponse + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + project_id: request.projectId ?? '', + location: request.location ?? '', + }); + this.initialize(); + return this.innerApiCalls.listJobs(request, options, callback); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {google.dataflow.v1beta3.ListJobsRequest.Filter} request.filter + * The kind of filter to use. + * @param {string} request.projectId + * The project which owns the jobs. + * @param {google.dataflow.v1beta3.JobView} request.view + * Deprecated. ListJobs always returns summaries now. + * Use GetJob for other JobViews. + * @param {number} request.pageSize + * If there are many jobs, limit response to at most this many. + * The actual number of jobs returned will be the lesser of max_responses + * and an unspecified server-defined limit. + * @param {string} request.pageToken + * Set this to the 'next_page_token' field of a previous response + * to request additional results in a long list. + * @param {string} request.location + * The [regional endpoint] + * (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) that + * contains this job. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [Job]{@link google.dataflow.v1beta3.Job} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listJobsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listJobsStream( + request?: protos.google.dataflow.v1beta3.IListJobsRequest, + options?: CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + project_id: request.projectId ?? '', + location: request.location ?? '', + }); + const defaultCallSettings = this._defaults['listJobs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listJobs.createStream( + this.innerApiCalls.listJobs as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listJobs`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {google.dataflow.v1beta3.ListJobsRequest.Filter} request.filter + * The kind of filter to use. + * @param {string} request.projectId + * The project which owns the jobs. + * @param {google.dataflow.v1beta3.JobView} request.view + * Deprecated. ListJobs always returns summaries now. + * Use GetJob for other JobViews. + * @param {number} request.pageSize + * If there are many jobs, limit response to at most this many. + * The actual number of jobs returned will be the lesser of max_responses + * and an unspecified server-defined limit. + * @param {string} request.pageToken + * Set this to the 'next_page_token' field of a previous response + * to request additional results in a long list. + * @param {string} request.location + * The [regional endpoint] + * (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) that + * contains this job. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [Job]{@link google.dataflow.v1beta3.Job}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1beta3/jobs_v1_beta3.list_jobs.js + * region_tag:dataflow_v1beta3_generated_JobsV1Beta3_ListJobs_async + */ + listJobsAsync( + request?: protos.google.dataflow.v1beta3.IListJobsRequest, + options?: CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + project_id: request.projectId ?? '', + location: request.location ?? '', + }); + const defaultCallSettings = this._defaults['listJobs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listJobs.asyncIterate( + this.innerApiCalls['listJobs'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * List the jobs of a project across all regions. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.dataflow.v1beta3.ListJobsRequest.Filter} request.filter + * The kind of filter to use. + * @param {string} request.projectId + * The project which owns the jobs. + * @param {google.dataflow.v1beta3.JobView} request.view + * Deprecated. ListJobs always returns summaries now. + * Use GetJob for other JobViews. + * @param {number} request.pageSize + * If there are many jobs, limit response to at most this many. + * The actual number of jobs returned will be the lesser of max_responses + * and an unspecified server-defined limit. + * @param {string} request.pageToken + * Set this to the 'next_page_token' field of a previous response + * to request additional results in a long list. + * @param {string} request.location + * The [regional endpoint] + * (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) that + * contains this 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 Array of [Job]{@link google.dataflow.v1beta3.Job}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `aggregatedListJobsAsync()` + * 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. + */ + aggregatedListJobs( + request?: protos.google.dataflow.v1beta3.IListJobsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.dataflow.v1beta3.IJob[], + protos.google.dataflow.v1beta3.IListJobsRequest | null, + protos.google.dataflow.v1beta3.IListJobsResponse + ] + >; + aggregatedListJobs( + request: protos.google.dataflow.v1beta3.IListJobsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.dataflow.v1beta3.IListJobsRequest, + protos.google.dataflow.v1beta3.IListJobsResponse | null | undefined, + protos.google.dataflow.v1beta3.IJob + > + ): void; + aggregatedListJobs( + request: protos.google.dataflow.v1beta3.IListJobsRequest, + callback: PaginationCallback< + protos.google.dataflow.v1beta3.IListJobsRequest, + protos.google.dataflow.v1beta3.IListJobsResponse | null | undefined, + protos.google.dataflow.v1beta3.IJob + > + ): void; + aggregatedListJobs( + request?: protos.google.dataflow.v1beta3.IListJobsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.dataflow.v1beta3.IListJobsRequest, + protos.google.dataflow.v1beta3.IListJobsResponse | null | undefined, + protos.google.dataflow.v1beta3.IJob + >, + callback?: PaginationCallback< + protos.google.dataflow.v1beta3.IListJobsRequest, + protos.google.dataflow.v1beta3.IListJobsResponse | null | undefined, + protos.google.dataflow.v1beta3.IJob + > + ): Promise< + [ + protos.google.dataflow.v1beta3.IJob[], + protos.google.dataflow.v1beta3.IListJobsRequest | null, + protos.google.dataflow.v1beta3.IListJobsResponse + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + project_id: request.projectId ?? '', + }); + this.initialize(); + return this.innerApiCalls.aggregatedListJobs(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 {google.dataflow.v1beta3.ListJobsRequest.Filter} request.filter + * The kind of filter to use. + * @param {string} request.projectId + * The project which owns the jobs. + * @param {google.dataflow.v1beta3.JobView} request.view + * Deprecated. ListJobs always returns summaries now. + * Use GetJob for other JobViews. + * @param {number} request.pageSize + * If there are many jobs, limit response to at most this many. + * The actual number of jobs returned will be the lesser of max_responses + * and an unspecified server-defined limit. + * @param {string} request.pageToken + * Set this to the 'next_page_token' field of a previous response + * to request additional results in a long list. + * @param {string} request.location + * The [regional endpoint] + * (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) that + * contains this job. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [Job]{@link google.dataflow.v1beta3.Job} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `aggregatedListJobsAsync()` + * 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. + */ + aggregatedListJobsStream( + request?: protos.google.dataflow.v1beta3.IListJobsRequest, + options?: CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + project_id: request.projectId ?? '', + }); + const defaultCallSettings = this._defaults['aggregatedListJobs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.aggregatedListJobs.createStream( + this.innerApiCalls.aggregatedListJobs as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `aggregatedListJobs`, 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 {google.dataflow.v1beta3.ListJobsRequest.Filter} request.filter + * The kind of filter to use. + * @param {string} request.projectId + * The project which owns the jobs. + * @param {google.dataflow.v1beta3.JobView} request.view + * Deprecated. ListJobs always returns summaries now. + * Use GetJob for other JobViews. + * @param {number} request.pageSize + * If there are many jobs, limit response to at most this many. + * The actual number of jobs returned will be the lesser of max_responses + * and an unspecified server-defined limit. + * @param {string} request.pageToken + * Set this to the 'next_page_token' field of a previous response + * to request additional results in a long list. + * @param {string} request.location + * The [regional endpoint] + * (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) that + * contains this job. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [Job]{@link google.dataflow.v1beta3.Job}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1beta3/jobs_v1_beta3.aggregated_list_jobs.js + * region_tag:dataflow_v1beta3_generated_JobsV1Beta3_AggregatedListJobs_async + */ + aggregatedListJobsAsync( + request?: protos.google.dataflow.v1beta3.IListJobsRequest, + options?: CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + project_id: request.projectId ?? '', + }); + const defaultCallSettings = this._defaults['aggregatedListJobs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.aggregatedListJobs.asyncIterate( + this.innerApiCalls['aggregatedListJobs'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + + /** + * 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.jobsV1Beta3Stub && !this._terminated) { + return this.jobsV1Beta3Stub.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-dataflow/src/v1beta3/jobs_v1_beta3_client_config.json b/packages/google-dataflow/src/v1beta3/jobs_v1_beta3_client_config.json new file mode 100644 index 00000000000..1365d3fd6ed --- /dev/null +++ b/packages/google-dataflow/src/v1beta3/jobs_v1_beta3_client_config.json @@ -0,0 +1,61 @@ +{ + "interfaces": { + "google.dataflow.v1beta3.JobsV1Beta3": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "CreateJob": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetJob": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateJob": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListJobs": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "AggregatedListJobs": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CheckActiveJobs": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SnapshotJob": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-dataflow/src/v1beta3/jobs_v1_beta3_proto_list.json b/packages/google-dataflow/src/v1beta3/jobs_v1_beta3_proto_list.json new file mode 100644 index 00000000000..cd5511e4fd8 --- /dev/null +++ b/packages/google-dataflow/src/v1beta3/jobs_v1_beta3_proto_list.json @@ -0,0 +1,9 @@ +[ + "../../protos/google/dataflow/v1beta3/environment.proto", + "../../protos/google/dataflow/v1beta3/jobs.proto", + "../../protos/google/dataflow/v1beta3/messages.proto", + "../../protos/google/dataflow/v1beta3/metrics.proto", + "../../protos/google/dataflow/v1beta3/snapshots.proto", + "../../protos/google/dataflow/v1beta3/streaming.proto", + "../../protos/google/dataflow/v1beta3/templates.proto" +] diff --git a/packages/google-dataflow/src/v1beta3/messages_v1_beta3_client.ts b/packages/google-dataflow/src/v1beta3/messages_v1_beta3_client.ts new file mode 100644 index 00000000000..30862011e91 --- /dev/null +++ b/packages/google-dataflow/src/v1beta3/messages_v1_beta3_client.ts @@ -0,0 +1,594 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import type * as gax from 'google-gax'; +import type { + Callback, + CallOptions, + Descriptors, + ClientOptions, + PaginationCallback, + GaxCall, +} from 'google-gax'; +import {Transform} from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1beta3/messages_v1_beta3_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './messages_v1_beta3_client_config.json'; +const version = require('../../../package.json').version; + +/** + * The Dataflow Messages API is used for monitoring the progress of + * Dataflow jobs. + * @class + * @memberof v1beta3 + */ +export class MessagesV1Beta3Client { + 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}; + messagesV1Beta3Stub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of MessagesV1Beta3Client. + * + * @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 MessagesV1Beta3Client({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 MessagesV1Beta3Client; + 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); + + // 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 = { + listJobMessages: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'jobMessages' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.dataflow.v1beta3.MessagesV1Beta3', + 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.messagesV1Beta3Stub) { + return this.messagesV1Beta3Stub; + } + + // Put together the "service stub" for + // google.dataflow.v1beta3.MessagesV1Beta3. + this.messagesV1Beta3Stub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.dataflow.v1beta3.MessagesV1Beta3' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.dataflow.v1beta3.MessagesV1Beta3, + 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 messagesV1Beta3StubMethods = ['listJobMessages']; + for (const methodName of messagesV1Beta3StubMethods) { + const callPromise = this.messagesV1Beta3Stub.then( + stub => + (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error | null | undefined) => () => { + throw err; + } + ); + + const descriptor = this.descriptors.page[methodName] || undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.messagesV1Beta3Stub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'dataflow.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 'dataflow.googleapis.com'; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return [ + 'https://www.googleapis.com/auth/cloud-platform', + 'https://www.googleapis.com/auth/compute', + 'https://www.googleapis.com/auth/compute.readonly', + 'https://www.googleapis.com/auth/userinfo.email', + ]; + } + + 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 -- + // ------------------- + + /** + * Request the job status. + * + * To request the status of a job, we recommend using + * `projects.locations.jobs.messages.list` with a [regional endpoint] + * (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints). Using + * `projects.jobs.messages.list` is not recommended, as you can only request + * the status of jobs that are running in `us-central1`. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * A project id. + * @param {string} request.jobId + * The job to get messages about. + * @param {google.dataflow.v1beta3.JobMessageImportance} request.minimumImportance + * Filter to only get messages with importance >= level + * @param {number} request.pageSize + * If specified, determines the maximum number of messages to + * return. If unspecified, the service may choose an appropriate + * default, or may return an arbitrarily large number of results. + * @param {string} request.pageToken + * If supplied, this should be the value of next_page_token returned + * by an earlier call. This will cause the next page of results to + * be returned. + * @param {google.protobuf.Timestamp} request.startTime + * If specified, return only messages with timestamps >= start_time. + * The default is the job creation time (i.e. beginning of messages). + * @param {google.protobuf.Timestamp} request.endTime + * Return only messages with timestamps < end_time. The default is now + * (i.e. return up to the latest messages available). + * @param {string} request.location + * The [regional endpoint] + * (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) that + * contains the job specified by job_id. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [JobMessage]{@link google.dataflow.v1beta3.JobMessage}. + * 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 `listJobMessagesAsync()` + * 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. + */ + listJobMessages( + request?: protos.google.dataflow.v1beta3.IListJobMessagesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.dataflow.v1beta3.IJobMessage[], + protos.google.dataflow.v1beta3.IListJobMessagesRequest | null, + protos.google.dataflow.v1beta3.IListJobMessagesResponse + ] + >; + listJobMessages( + request: protos.google.dataflow.v1beta3.IListJobMessagesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.dataflow.v1beta3.IListJobMessagesRequest, + | protos.google.dataflow.v1beta3.IListJobMessagesResponse + | null + | undefined, + protos.google.dataflow.v1beta3.IJobMessage + > + ): void; + listJobMessages( + request: protos.google.dataflow.v1beta3.IListJobMessagesRequest, + callback: PaginationCallback< + protos.google.dataflow.v1beta3.IListJobMessagesRequest, + | protos.google.dataflow.v1beta3.IListJobMessagesResponse + | null + | undefined, + protos.google.dataflow.v1beta3.IJobMessage + > + ): void; + listJobMessages( + request?: protos.google.dataflow.v1beta3.IListJobMessagesRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.dataflow.v1beta3.IListJobMessagesRequest, + | protos.google.dataflow.v1beta3.IListJobMessagesResponse + | null + | undefined, + protos.google.dataflow.v1beta3.IJobMessage + >, + callback?: PaginationCallback< + protos.google.dataflow.v1beta3.IListJobMessagesRequest, + | protos.google.dataflow.v1beta3.IListJobMessagesResponse + | null + | undefined, + protos.google.dataflow.v1beta3.IJobMessage + > + ): Promise< + [ + protos.google.dataflow.v1beta3.IJobMessage[], + protos.google.dataflow.v1beta3.IListJobMessagesRequest | null, + protos.google.dataflow.v1beta3.IListJobMessagesResponse + ] + > | 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 ?? '', + location: request.location ?? '', + job_id: request.jobId ?? '', + }); + this.initialize(); + return this.innerApiCalls.listJobMessages(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 + * A project id. + * @param {string} request.jobId + * The job to get messages about. + * @param {google.dataflow.v1beta3.JobMessageImportance} request.minimumImportance + * Filter to only get messages with importance >= level + * @param {number} request.pageSize + * If specified, determines the maximum number of messages to + * return. If unspecified, the service may choose an appropriate + * default, or may return an arbitrarily large number of results. + * @param {string} request.pageToken + * If supplied, this should be the value of next_page_token returned + * by an earlier call. This will cause the next page of results to + * be returned. + * @param {google.protobuf.Timestamp} request.startTime + * If specified, return only messages with timestamps >= start_time. + * The default is the job creation time (i.e. beginning of messages). + * @param {google.protobuf.Timestamp} request.endTime + * Return only messages with timestamps < end_time. The default is now + * (i.e. return up to the latest messages available). + * @param {string} request.location + * The [regional endpoint] + * (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) that + * contains the job specified by job_id. + * @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 [JobMessage]{@link google.dataflow.v1beta3.JobMessage} 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 `listJobMessagesAsync()` + * 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. + */ + listJobMessagesStream( + request?: protos.google.dataflow.v1beta3.IListJobMessagesRequest, + 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 ?? '', + location: request.location ?? '', + job_id: request.jobId ?? '', + }); + const defaultCallSettings = this._defaults['listJobMessages']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listJobMessages.createStream( + this.innerApiCalls.listJobMessages as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listJobMessages`, 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 + * A project id. + * @param {string} request.jobId + * The job to get messages about. + * @param {google.dataflow.v1beta3.JobMessageImportance} request.minimumImportance + * Filter to only get messages with importance >= level + * @param {number} request.pageSize + * If specified, determines the maximum number of messages to + * return. If unspecified, the service may choose an appropriate + * default, or may return an arbitrarily large number of results. + * @param {string} request.pageToken + * If supplied, this should be the value of next_page_token returned + * by an earlier call. This will cause the next page of results to + * be returned. + * @param {google.protobuf.Timestamp} request.startTime + * If specified, return only messages with timestamps >= start_time. + * The default is the job creation time (i.e. beginning of messages). + * @param {google.protobuf.Timestamp} request.endTime + * Return only messages with timestamps < end_time. The default is now + * (i.e. return up to the latest messages available). + * @param {string} request.location + * The [regional endpoint] + * (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) that + * contains the job specified by job_id. + * @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 + * [JobMessage]{@link google.dataflow.v1beta3.JobMessage}. 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/v1beta3/messages_v1_beta3.list_job_messages.js + * region_tag:dataflow_v1beta3_generated_MessagesV1Beta3_ListJobMessages_async + */ + listJobMessagesAsync( + request?: protos.google.dataflow.v1beta3.IListJobMessagesRequest, + 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 ?? '', + location: request.location ?? '', + job_id: request.jobId ?? '', + }); + const defaultCallSettings = this._defaults['listJobMessages']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listJobMessages.asyncIterate( + this.innerApiCalls['listJobMessages'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + + /** + * 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.messagesV1Beta3Stub && !this._terminated) { + return this.messagesV1Beta3Stub.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-dataflow/src/v1beta3/messages_v1_beta3_client_config.json b/packages/google-dataflow/src/v1beta3/messages_v1_beta3_client_config.json new file mode 100644 index 00000000000..bed4b6c3449 --- /dev/null +++ b/packages/google-dataflow/src/v1beta3/messages_v1_beta3_client_config.json @@ -0,0 +1,31 @@ +{ + "interfaces": { + "google.dataflow.v1beta3.MessagesV1Beta3": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "ListJobMessages": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-dataflow/src/v1beta3/messages_v1_beta3_proto_list.json b/packages/google-dataflow/src/v1beta3/messages_v1_beta3_proto_list.json new file mode 100644 index 00000000000..cd5511e4fd8 --- /dev/null +++ b/packages/google-dataflow/src/v1beta3/messages_v1_beta3_proto_list.json @@ -0,0 +1,9 @@ +[ + "../../protos/google/dataflow/v1beta3/environment.proto", + "../../protos/google/dataflow/v1beta3/jobs.proto", + "../../protos/google/dataflow/v1beta3/messages.proto", + "../../protos/google/dataflow/v1beta3/metrics.proto", + "../../protos/google/dataflow/v1beta3/snapshots.proto", + "../../protos/google/dataflow/v1beta3/streaming.proto", + "../../protos/google/dataflow/v1beta3/templates.proto" +] diff --git a/packages/google-dataflow/src/v1beta3/metrics_v1_beta3_client.ts b/packages/google-dataflow/src/v1beta3/metrics_v1_beta3_client.ts new file mode 100644 index 00000000000..3e942b6f809 --- /dev/null +++ b/packages/google-dataflow/src/v1beta3/metrics_v1_beta3_client.ts @@ -0,0 +1,922 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import type * as gax from 'google-gax'; +import type { + Callback, + CallOptions, + Descriptors, + ClientOptions, + PaginationCallback, + GaxCall, +} from 'google-gax'; +import {Transform} from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1beta3/metrics_v1_beta3_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './metrics_v1_beta3_client_config.json'; +const version = require('../../../package.json').version; + +/** + * The Dataflow Metrics API lets you monitor the progress of Dataflow + * jobs. + * @class + * @memberof v1beta3 + */ +export class MetricsV1Beta3Client { + 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}; + metricsV1Beta3Stub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of MetricsV1Beta3Client. + * + * @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 MetricsV1Beta3Client({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 MetricsV1Beta3Client; + 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); + + // 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 = { + getJobExecutionDetails: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'stages' + ), + getStageExecutionDetails: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'workers' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.dataflow.v1beta3.MetricsV1Beta3', + 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.metricsV1Beta3Stub) { + return this.metricsV1Beta3Stub; + } + + // Put together the "service stub" for + // google.dataflow.v1beta3.MetricsV1Beta3. + this.metricsV1Beta3Stub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.dataflow.v1beta3.MetricsV1Beta3' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.dataflow.v1beta3.MetricsV1Beta3, + 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 metricsV1Beta3StubMethods = [ + 'getJobMetrics', + 'getJobExecutionDetails', + 'getStageExecutionDetails', + ]; + for (const methodName of metricsV1Beta3StubMethods) { + const callPromise = this.metricsV1Beta3Stub.then( + stub => + (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error | null | undefined) => () => { + throw err; + } + ); + + const descriptor = this.descriptors.page[methodName] || undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.metricsV1Beta3Stub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'dataflow.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 'dataflow.googleapis.com'; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return [ + 'https://www.googleapis.com/auth/cloud-platform', + 'https://www.googleapis.com/auth/compute', + 'https://www.googleapis.com/auth/compute.readonly', + 'https://www.googleapis.com/auth/userinfo.email', + ]; + } + + 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 -- + // ------------------- + /** + * Request the job status. + * + * To request the status of a job, we recommend using + * `projects.locations.jobs.getMetrics` with a [regional endpoint] + * (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints). Using + * `projects.jobs.getMetrics` is not recommended, as you can only request the + * status of jobs that are running in `us-central1`. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * A project id. + * @param {string} request.jobId + * The job to get metrics for. + * @param {google.protobuf.Timestamp} request.startTime + * Return only metric data that has changed since this time. + * Default is to return all information about all metrics for the job. + * @param {string} request.location + * The [regional endpoint] + * (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) that + * contains the job specified by job_id. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [JobMetrics]{@link google.dataflow.v1beta3.JobMetrics}. + * 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/v1beta3/metrics_v1_beta3.get_job_metrics.js + * region_tag:dataflow_v1beta3_generated_MetricsV1Beta3_GetJobMetrics_async + */ + getJobMetrics( + request?: protos.google.dataflow.v1beta3.IGetJobMetricsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.dataflow.v1beta3.IJobMetrics, + protos.google.dataflow.v1beta3.IGetJobMetricsRequest | undefined, + {} | undefined + ] + >; + getJobMetrics( + request: protos.google.dataflow.v1beta3.IGetJobMetricsRequest, + options: CallOptions, + callback: Callback< + protos.google.dataflow.v1beta3.IJobMetrics, + protos.google.dataflow.v1beta3.IGetJobMetricsRequest | null | undefined, + {} | null | undefined + > + ): void; + getJobMetrics( + request: protos.google.dataflow.v1beta3.IGetJobMetricsRequest, + callback: Callback< + protos.google.dataflow.v1beta3.IJobMetrics, + protos.google.dataflow.v1beta3.IGetJobMetricsRequest | null | undefined, + {} | null | undefined + > + ): void; + getJobMetrics( + request?: protos.google.dataflow.v1beta3.IGetJobMetricsRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.dataflow.v1beta3.IJobMetrics, + | protos.google.dataflow.v1beta3.IGetJobMetricsRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.dataflow.v1beta3.IJobMetrics, + protos.google.dataflow.v1beta3.IGetJobMetricsRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.dataflow.v1beta3.IJobMetrics, + protos.google.dataflow.v1beta3.IGetJobMetricsRequest | 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 ?? '', + location: request.location ?? '', + job_id: request.jobId ?? '', + }); + this.initialize(); + return this.innerApiCalls.getJobMetrics(request, options, callback); + } + + /** + * Request detailed information about the execution status of the job. + * + * EXPERIMENTAL. This API is subject to change or removal without notice. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * A project id. + * @param {string} request.jobId + * The job to get execution details for. + * @param {string} request.location + * The [regional endpoint] + * (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) that + * contains the job specified by job_id. + * @param {number} request.pageSize + * If specified, determines the maximum number of stages to + * return. If unspecified, the service may choose an appropriate + * default, or may return an arbitrarily large number of results. + * @param {string} request.pageToken + * If supplied, this should be the value of next_page_token returned + * by an earlier call. This will cause the next page of results to + * be returned. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [StageSummary]{@link google.dataflow.v1beta3.StageSummary}. + * 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 `getJobExecutionDetailsAsync()` + * 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. + */ + getJobExecutionDetails( + request?: protos.google.dataflow.v1beta3.IGetJobExecutionDetailsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.dataflow.v1beta3.IStageSummary[], + protos.google.dataflow.v1beta3.IGetJobExecutionDetailsRequest | null, + protos.google.dataflow.v1beta3.IJobExecutionDetails + ] + >; + getJobExecutionDetails( + request: protos.google.dataflow.v1beta3.IGetJobExecutionDetailsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.dataflow.v1beta3.IGetJobExecutionDetailsRequest, + protos.google.dataflow.v1beta3.IJobExecutionDetails | null | undefined, + protos.google.dataflow.v1beta3.IStageSummary + > + ): void; + getJobExecutionDetails( + request: protos.google.dataflow.v1beta3.IGetJobExecutionDetailsRequest, + callback: PaginationCallback< + protos.google.dataflow.v1beta3.IGetJobExecutionDetailsRequest, + protos.google.dataflow.v1beta3.IJobExecutionDetails | null | undefined, + protos.google.dataflow.v1beta3.IStageSummary + > + ): void; + getJobExecutionDetails( + request?: protos.google.dataflow.v1beta3.IGetJobExecutionDetailsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.dataflow.v1beta3.IGetJobExecutionDetailsRequest, + | protos.google.dataflow.v1beta3.IJobExecutionDetails + | null + | undefined, + protos.google.dataflow.v1beta3.IStageSummary + >, + callback?: PaginationCallback< + protos.google.dataflow.v1beta3.IGetJobExecutionDetailsRequest, + protos.google.dataflow.v1beta3.IJobExecutionDetails | null | undefined, + protos.google.dataflow.v1beta3.IStageSummary + > + ): Promise< + [ + protos.google.dataflow.v1beta3.IStageSummary[], + protos.google.dataflow.v1beta3.IGetJobExecutionDetailsRequest | null, + protos.google.dataflow.v1beta3.IJobExecutionDetails + ] + > | 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 ?? '', + location: request.location ?? '', + job_id: request.jobId ?? '', + }); + this.initialize(); + return this.innerApiCalls.getJobExecutionDetails( + 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 + * A project id. + * @param {string} request.jobId + * The job to get execution details for. + * @param {string} request.location + * The [regional endpoint] + * (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) that + * contains the job specified by job_id. + * @param {number} request.pageSize + * If specified, determines the maximum number of stages to + * return. If unspecified, the service may choose an appropriate + * default, or may return an arbitrarily large number of results. + * @param {string} request.pageToken + * If supplied, this should be the value of next_page_token returned + * by an earlier call. This will cause the next page of results to + * be returned. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [StageSummary]{@link google.dataflow.v1beta3.StageSummary} 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 `getJobExecutionDetailsAsync()` + * 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. + */ + getJobExecutionDetailsStream( + request?: protos.google.dataflow.v1beta3.IGetJobExecutionDetailsRequest, + 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 ?? '', + location: request.location ?? '', + job_id: request.jobId ?? '', + }); + const defaultCallSettings = this._defaults['getJobExecutionDetails']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.getJobExecutionDetails.createStream( + this.innerApiCalls.getJobExecutionDetails as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `getJobExecutionDetails`, 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 + * A project id. + * @param {string} request.jobId + * The job to get execution details for. + * @param {string} request.location + * The [regional endpoint] + * (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) that + * contains the job specified by job_id. + * @param {number} request.pageSize + * If specified, determines the maximum number of stages to + * return. If unspecified, the service may choose an appropriate + * default, or may return an arbitrarily large number of results. + * @param {string} request.pageToken + * If supplied, this should be the value of next_page_token returned + * by an earlier call. This will cause the next page of results to + * be returned. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [StageSummary]{@link google.dataflow.v1beta3.StageSummary}. 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/v1beta3/metrics_v1_beta3.get_job_execution_details.js + * region_tag:dataflow_v1beta3_generated_MetricsV1Beta3_GetJobExecutionDetails_async + */ + getJobExecutionDetailsAsync( + request?: protos.google.dataflow.v1beta3.IGetJobExecutionDetailsRequest, + 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 ?? '', + location: request.location ?? '', + job_id: request.jobId ?? '', + }); + const defaultCallSettings = this._defaults['getJobExecutionDetails']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.getJobExecutionDetails.asyncIterate( + this.innerApiCalls['getJobExecutionDetails'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Request detailed information about the execution status of a stage of the + * job. + * + * EXPERIMENTAL. This API is subject to change or removal without notice. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * A project id. + * @param {string} request.jobId + * The job to get execution details for. + * @param {string} request.location + * The [regional endpoint] + * (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) that + * contains the job specified by job_id. + * @param {string} request.stageId + * The stage for which to fetch information. + * @param {number} request.pageSize + * If specified, determines the maximum number of work items to + * return. If unspecified, the service may choose an appropriate + * default, or may return an arbitrarily large number of results. + * @param {string} request.pageToken + * If supplied, this should be the value of next_page_token returned + * by an earlier call. This will cause the next page of results to + * be returned. + * @param {google.protobuf.Timestamp} request.startTime + * Lower time bound of work items to include, by start time. + * @param {google.protobuf.Timestamp} request.endTime + * Upper time bound of work items to include, by start time. + * @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 [WorkerDetails]{@link google.dataflow.v1beta3.WorkerDetails}. + * 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 `getStageExecutionDetailsAsync()` + * 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. + */ + getStageExecutionDetails( + request?: protos.google.dataflow.v1beta3.IGetStageExecutionDetailsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.dataflow.v1beta3.IWorkerDetails[], + protos.google.dataflow.v1beta3.IGetStageExecutionDetailsRequest | null, + protos.google.dataflow.v1beta3.IStageExecutionDetails + ] + >; + getStageExecutionDetails( + request: protos.google.dataflow.v1beta3.IGetStageExecutionDetailsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.dataflow.v1beta3.IGetStageExecutionDetailsRequest, + protos.google.dataflow.v1beta3.IStageExecutionDetails | null | undefined, + protos.google.dataflow.v1beta3.IWorkerDetails + > + ): void; + getStageExecutionDetails( + request: protos.google.dataflow.v1beta3.IGetStageExecutionDetailsRequest, + callback: PaginationCallback< + protos.google.dataflow.v1beta3.IGetStageExecutionDetailsRequest, + protos.google.dataflow.v1beta3.IStageExecutionDetails | null | undefined, + protos.google.dataflow.v1beta3.IWorkerDetails + > + ): void; + getStageExecutionDetails( + request?: protos.google.dataflow.v1beta3.IGetStageExecutionDetailsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.dataflow.v1beta3.IGetStageExecutionDetailsRequest, + | protos.google.dataflow.v1beta3.IStageExecutionDetails + | null + | undefined, + protos.google.dataflow.v1beta3.IWorkerDetails + >, + callback?: PaginationCallback< + protos.google.dataflow.v1beta3.IGetStageExecutionDetailsRequest, + protos.google.dataflow.v1beta3.IStageExecutionDetails | null | undefined, + protos.google.dataflow.v1beta3.IWorkerDetails + > + ): Promise< + [ + protos.google.dataflow.v1beta3.IWorkerDetails[], + protos.google.dataflow.v1beta3.IGetStageExecutionDetailsRequest | null, + protos.google.dataflow.v1beta3.IStageExecutionDetails + ] + > | 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 ?? '', + location: request.location ?? '', + job_id: request.jobId ?? '', + stage_id: request.stageId ?? '', + }); + this.initialize(); + return this.innerApiCalls.getStageExecutionDetails( + 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 + * A project id. + * @param {string} request.jobId + * The job to get execution details for. + * @param {string} request.location + * The [regional endpoint] + * (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) that + * contains the job specified by job_id. + * @param {string} request.stageId + * The stage for which to fetch information. + * @param {number} request.pageSize + * If specified, determines the maximum number of work items to + * return. If unspecified, the service may choose an appropriate + * default, or may return an arbitrarily large number of results. + * @param {string} request.pageToken + * If supplied, this should be the value of next_page_token returned + * by an earlier call. This will cause the next page of results to + * be returned. + * @param {google.protobuf.Timestamp} request.startTime + * Lower time bound of work items to include, by start time. + * @param {google.protobuf.Timestamp} request.endTime + * Upper time bound of work items to include, by start time. + * @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 [WorkerDetails]{@link google.dataflow.v1beta3.WorkerDetails} 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 `getStageExecutionDetailsAsync()` + * 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. + */ + getStageExecutionDetailsStream( + request?: protos.google.dataflow.v1beta3.IGetStageExecutionDetailsRequest, + 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 ?? '', + location: request.location ?? '', + job_id: request.jobId ?? '', + stage_id: request.stageId ?? '', + }); + const defaultCallSettings = this._defaults['getStageExecutionDetails']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.getStageExecutionDetails.createStream( + this.innerApiCalls.getStageExecutionDetails as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `getStageExecutionDetails`, 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 + * A project id. + * @param {string} request.jobId + * The job to get execution details for. + * @param {string} request.location + * The [regional endpoint] + * (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) that + * contains the job specified by job_id. + * @param {string} request.stageId + * The stage for which to fetch information. + * @param {number} request.pageSize + * If specified, determines the maximum number of work items to + * return. If unspecified, the service may choose an appropriate + * default, or may return an arbitrarily large number of results. + * @param {string} request.pageToken + * If supplied, this should be the value of next_page_token returned + * by an earlier call. This will cause the next page of results to + * be returned. + * @param {google.protobuf.Timestamp} request.startTime + * Lower time bound of work items to include, by start time. + * @param {google.protobuf.Timestamp} request.endTime + * Upper time bound of work items to include, by start time. + * @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 + * [WorkerDetails]{@link google.dataflow.v1beta3.WorkerDetails}. 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/v1beta3/metrics_v1_beta3.get_stage_execution_details.js + * region_tag:dataflow_v1beta3_generated_MetricsV1Beta3_GetStageExecutionDetails_async + */ + getStageExecutionDetailsAsync( + request?: protos.google.dataflow.v1beta3.IGetStageExecutionDetailsRequest, + 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 ?? '', + location: request.location ?? '', + job_id: request.jobId ?? '', + stage_id: request.stageId ?? '', + }); + const defaultCallSettings = this._defaults['getStageExecutionDetails']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.getStageExecutionDetails.asyncIterate( + this.innerApiCalls['getStageExecutionDetails'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + + /** + * 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.metricsV1Beta3Stub && !this._terminated) { + return this.metricsV1Beta3Stub.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-dataflow/src/v1beta3/metrics_v1_beta3_client_config.json b/packages/google-dataflow/src/v1beta3/metrics_v1_beta3_client_config.json new file mode 100644 index 00000000000..3495334a569 --- /dev/null +++ b/packages/google-dataflow/src/v1beta3/metrics_v1_beta3_client_config.json @@ -0,0 +1,41 @@ +{ + "interfaces": { + "google.dataflow.v1beta3.MetricsV1Beta3": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "GetJobMetrics": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetJobExecutionDetails": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetStageExecutionDetails": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-dataflow/src/v1beta3/metrics_v1_beta3_proto_list.json b/packages/google-dataflow/src/v1beta3/metrics_v1_beta3_proto_list.json new file mode 100644 index 00000000000..cd5511e4fd8 --- /dev/null +++ b/packages/google-dataflow/src/v1beta3/metrics_v1_beta3_proto_list.json @@ -0,0 +1,9 @@ +[ + "../../protos/google/dataflow/v1beta3/environment.proto", + "../../protos/google/dataflow/v1beta3/jobs.proto", + "../../protos/google/dataflow/v1beta3/messages.proto", + "../../protos/google/dataflow/v1beta3/metrics.proto", + "../../protos/google/dataflow/v1beta3/snapshots.proto", + "../../protos/google/dataflow/v1beta3/streaming.proto", + "../../protos/google/dataflow/v1beta3/templates.proto" +] diff --git a/packages/google-dataflow/src/v1beta3/snapshots_v1_beta3_client.ts b/packages/google-dataflow/src/v1beta3/snapshots_v1_beta3_client.ts new file mode 100644 index 00000000000..2a7b329c7b0 --- /dev/null +++ b/packages/google-dataflow/src/v1beta3/snapshots_v1_beta3_client.ts @@ -0,0 +1,599 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import type * as gax from 'google-gax'; +import type { + Callback, + CallOptions, + Descriptors, + ClientOptions, +} from 'google-gax'; + +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1beta3/snapshots_v1_beta3_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './snapshots_v1_beta3_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Provides methods to manage snapshots of Google Cloud Dataflow jobs. + * @class + * @memberof v1beta3 + */ +export class SnapshotsV1Beta3Client { + 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}; + snapshotsV1Beta3Stub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of SnapshotsV1Beta3Client. + * + * @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 SnapshotsV1Beta3Client({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 SnapshotsV1Beta3Client; + 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); + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.dataflow.v1beta3.SnapshotsV1Beta3', + 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.snapshotsV1Beta3Stub) { + return this.snapshotsV1Beta3Stub; + } + + // Put together the "service stub" for + // google.dataflow.v1beta3.SnapshotsV1Beta3. + this.snapshotsV1Beta3Stub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.dataflow.v1beta3.SnapshotsV1Beta3' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.dataflow.v1beta3.SnapshotsV1Beta3, + 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 snapshotsV1Beta3StubMethods = [ + 'getSnapshot', + 'deleteSnapshot', + 'listSnapshots', + ]; + for (const methodName of snapshotsV1Beta3StubMethods) { + const callPromise = this.snapshotsV1Beta3Stub.then( + stub => + (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error | null | undefined) => () => { + throw err; + } + ); + + const descriptor = undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.snapshotsV1Beta3Stub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'dataflow.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 'dataflow.googleapis.com'; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return [ + 'https://www.googleapis.com/auth/cloud-platform', + 'https://www.googleapis.com/auth/compute', + 'https://www.googleapis.com/auth/compute.readonly', + 'https://www.googleapis.com/auth/userinfo.email', + ]; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId( + callback?: Callback + ): Promise | void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- + /** + * Gets information about a snapshot. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * The ID of the Cloud Platform project that the snapshot belongs to. + * @param {string} request.snapshotId + * The ID of the snapshot. + * @param {string} request.location + * The location that contains this snapshot. + * @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 [Snapshot]{@link google.dataflow.v1beta3.Snapshot}. + * 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/v1beta3/snapshots_v1_beta3.get_snapshot.js + * region_tag:dataflow_v1beta3_generated_SnapshotsV1Beta3_GetSnapshot_async + */ + getSnapshot( + request?: protos.google.dataflow.v1beta3.IGetSnapshotRequest, + options?: CallOptions + ): Promise< + [ + protos.google.dataflow.v1beta3.ISnapshot, + protos.google.dataflow.v1beta3.IGetSnapshotRequest | undefined, + {} | undefined + ] + >; + getSnapshot( + request: protos.google.dataflow.v1beta3.IGetSnapshotRequest, + options: CallOptions, + callback: Callback< + protos.google.dataflow.v1beta3.ISnapshot, + protos.google.dataflow.v1beta3.IGetSnapshotRequest | null | undefined, + {} | null | undefined + > + ): void; + getSnapshot( + request: protos.google.dataflow.v1beta3.IGetSnapshotRequest, + callback: Callback< + protos.google.dataflow.v1beta3.ISnapshot, + protos.google.dataflow.v1beta3.IGetSnapshotRequest | null | undefined, + {} | null | undefined + > + ): void; + getSnapshot( + request?: protos.google.dataflow.v1beta3.IGetSnapshotRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.dataflow.v1beta3.ISnapshot, + protos.google.dataflow.v1beta3.IGetSnapshotRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.dataflow.v1beta3.ISnapshot, + protos.google.dataflow.v1beta3.IGetSnapshotRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.dataflow.v1beta3.ISnapshot, + protos.google.dataflow.v1beta3.IGetSnapshotRequest | 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 ?? '', + location: request.location ?? '', + snapshot_id: request.snapshotId ?? '', + }); + this.initialize(); + return this.innerApiCalls.getSnapshot(request, options, callback); + } + /** + * Deletes a snapshot. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * The ID of the Cloud Platform project that the snapshot belongs to. + * @param {string} request.snapshotId + * The ID of the snapshot. + * @param {string} request.location + * The location that contains this snapshot. + * @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 [DeleteSnapshotResponse]{@link google.dataflow.v1beta3.DeleteSnapshotResponse}. + * 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/v1beta3/snapshots_v1_beta3.delete_snapshot.js + * region_tag:dataflow_v1beta3_generated_SnapshotsV1Beta3_DeleteSnapshot_async + */ + deleteSnapshot( + request?: protos.google.dataflow.v1beta3.IDeleteSnapshotRequest, + options?: CallOptions + ): Promise< + [ + protos.google.dataflow.v1beta3.IDeleteSnapshotResponse, + protos.google.dataflow.v1beta3.IDeleteSnapshotRequest | undefined, + {} | undefined + ] + >; + deleteSnapshot( + request: protos.google.dataflow.v1beta3.IDeleteSnapshotRequest, + options: CallOptions, + callback: Callback< + protos.google.dataflow.v1beta3.IDeleteSnapshotResponse, + protos.google.dataflow.v1beta3.IDeleteSnapshotRequest | null | undefined, + {} | null | undefined + > + ): void; + deleteSnapshot( + request: protos.google.dataflow.v1beta3.IDeleteSnapshotRequest, + callback: Callback< + protos.google.dataflow.v1beta3.IDeleteSnapshotResponse, + protos.google.dataflow.v1beta3.IDeleteSnapshotRequest | null | undefined, + {} | null | undefined + > + ): void; + deleteSnapshot( + request?: protos.google.dataflow.v1beta3.IDeleteSnapshotRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.dataflow.v1beta3.IDeleteSnapshotResponse, + | protos.google.dataflow.v1beta3.IDeleteSnapshotRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.dataflow.v1beta3.IDeleteSnapshotResponse, + protos.google.dataflow.v1beta3.IDeleteSnapshotRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.dataflow.v1beta3.IDeleteSnapshotResponse, + protos.google.dataflow.v1beta3.IDeleteSnapshotRequest | 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 ?? '', + location: request.location ?? '', + snapshot_id: request.snapshotId ?? '', + }); + this.initialize(); + return this.innerApiCalls.deleteSnapshot(request, options, callback); + } + /** + * Lists snapshots. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * The project ID to list snapshots for. + * @param {string} request.jobId + * If specified, list snapshots created from this job. + * @param {string} request.location + * The location to list snapshots in. + * @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 [ListSnapshotsResponse]{@link google.dataflow.v1beta3.ListSnapshotsResponse}. + * 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/v1beta3/snapshots_v1_beta3.list_snapshots.js + * region_tag:dataflow_v1beta3_generated_SnapshotsV1Beta3_ListSnapshots_async + */ + listSnapshots( + request?: protos.google.dataflow.v1beta3.IListSnapshotsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.dataflow.v1beta3.IListSnapshotsResponse, + protos.google.dataflow.v1beta3.IListSnapshotsRequest | undefined, + {} | undefined + ] + >; + listSnapshots( + request: protos.google.dataflow.v1beta3.IListSnapshotsRequest, + options: CallOptions, + callback: Callback< + protos.google.dataflow.v1beta3.IListSnapshotsResponse, + protos.google.dataflow.v1beta3.IListSnapshotsRequest | null | undefined, + {} | null | undefined + > + ): void; + listSnapshots( + request: protos.google.dataflow.v1beta3.IListSnapshotsRequest, + callback: Callback< + protos.google.dataflow.v1beta3.IListSnapshotsResponse, + protos.google.dataflow.v1beta3.IListSnapshotsRequest | null | undefined, + {} | null | undefined + > + ): void; + listSnapshots( + request?: protos.google.dataflow.v1beta3.IListSnapshotsRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.dataflow.v1beta3.IListSnapshotsResponse, + | protos.google.dataflow.v1beta3.IListSnapshotsRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.dataflow.v1beta3.IListSnapshotsResponse, + protos.google.dataflow.v1beta3.IListSnapshotsRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.dataflow.v1beta3.IListSnapshotsResponse, + protos.google.dataflow.v1beta3.IListSnapshotsRequest | 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 ?? '', + location: request.location ?? '', + job_id: request.jobId ?? '', + }); + this.initialize(); + return this.innerApiCalls.listSnapshots(request, options, callback); + } + + /** + * 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.snapshotsV1Beta3Stub && !this._terminated) { + return this.snapshotsV1Beta3Stub.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-dataflow/src/v1beta3/snapshots_v1_beta3_client_config.json b/packages/google-dataflow/src/v1beta3/snapshots_v1_beta3_client_config.json new file mode 100644 index 00000000000..8ef03a6abc4 --- /dev/null +++ b/packages/google-dataflow/src/v1beta3/snapshots_v1_beta3_client_config.json @@ -0,0 +1,41 @@ +{ + "interfaces": { + "google.dataflow.v1beta3.SnapshotsV1Beta3": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "GetSnapshot": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteSnapshot": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListSnapshots": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-dataflow/src/v1beta3/snapshots_v1_beta3_proto_list.json b/packages/google-dataflow/src/v1beta3/snapshots_v1_beta3_proto_list.json new file mode 100644 index 00000000000..cd5511e4fd8 --- /dev/null +++ b/packages/google-dataflow/src/v1beta3/snapshots_v1_beta3_proto_list.json @@ -0,0 +1,9 @@ +[ + "../../protos/google/dataflow/v1beta3/environment.proto", + "../../protos/google/dataflow/v1beta3/jobs.proto", + "../../protos/google/dataflow/v1beta3/messages.proto", + "../../protos/google/dataflow/v1beta3/metrics.proto", + "../../protos/google/dataflow/v1beta3/snapshots.proto", + "../../protos/google/dataflow/v1beta3/streaming.proto", + "../../protos/google/dataflow/v1beta3/templates.proto" +] diff --git a/packages/google-dataflow/src/v1beta3/templates_service_client.ts b/packages/google-dataflow/src/v1beta3/templates_service_client.ts new file mode 100644 index 00000000000..6a58979bba5 --- /dev/null +++ b/packages/google-dataflow/src/v1beta3/templates_service_client.ts @@ -0,0 +1,630 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import type * as gax from 'google-gax'; +import type { + Callback, + CallOptions, + Descriptors, + ClientOptions, +} from 'google-gax'; + +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1beta3/templates_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './templates_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Provides a method to create Cloud Dataflow jobs from templates. + * @class + * @memberof v1beta3 + */ +export class TemplatesServiceClient { + 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}; + templatesServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of TemplatesServiceClient. + * + * @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 TemplatesServiceClient({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 TemplatesServiceClient; + 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); + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.dataflow.v1beta3.TemplatesService', + 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.templatesServiceStub) { + return this.templatesServiceStub; + } + + // Put together the "service stub" for + // google.dataflow.v1beta3.TemplatesService. + this.templatesServiceStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.dataflow.v1beta3.TemplatesService' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.dataflow.v1beta3.TemplatesService, + 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 templatesServiceStubMethods = [ + 'createJobFromTemplate', + 'launchTemplate', + 'getTemplate', + ]; + for (const methodName of templatesServiceStubMethods) { + const callPromise = this.templatesServiceStub.then( + stub => + (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error | null | undefined) => () => { + throw err; + } + ); + + const descriptor = undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.templatesServiceStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'dataflow.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 'dataflow.googleapis.com'; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return [ + 'https://www.googleapis.com/auth/cloud-platform', + 'https://www.googleapis.com/auth/compute', + 'https://www.googleapis.com/auth/compute.readonly', + 'https://www.googleapis.com/auth/userinfo.email', + ]; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId( + callback?: Callback + ): Promise | void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- + /** + * Creates a Cloud Dataflow job from a template. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Required. The ID of the Cloud Platform project that the job belongs to. + * @param {string} request.jobName + * Required. The job name to use for the created job. + * @param {string} request.gcsPath + * Required. A Cloud Storage path to the template from which to + * create the job. + * Must be a valid Cloud Storage URL, beginning with `gs://`. + * @param {number[]} request.parameters + * The runtime parameters to pass to the job. + * @param {google.dataflow.v1beta3.RuntimeEnvironment} request.environment + * The runtime environment for the job. + * @param {string} request.location + * The [regional endpoint] + * (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) to + * which to direct the request. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Job]{@link google.dataflow.v1beta3.Job}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta3/templates_service.create_job_from_template.js + * region_tag:dataflow_v1beta3_generated_TemplatesService_CreateJobFromTemplate_async + */ + createJobFromTemplate( + request?: protos.google.dataflow.v1beta3.ICreateJobFromTemplateRequest, + options?: CallOptions + ): Promise< + [ + protos.google.dataflow.v1beta3.IJob, + protos.google.dataflow.v1beta3.ICreateJobFromTemplateRequest | undefined, + {} | undefined + ] + >; + createJobFromTemplate( + request: protos.google.dataflow.v1beta3.ICreateJobFromTemplateRequest, + options: CallOptions, + callback: Callback< + protos.google.dataflow.v1beta3.IJob, + | protos.google.dataflow.v1beta3.ICreateJobFromTemplateRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createJobFromTemplate( + request: protos.google.dataflow.v1beta3.ICreateJobFromTemplateRequest, + callback: Callback< + protos.google.dataflow.v1beta3.IJob, + | protos.google.dataflow.v1beta3.ICreateJobFromTemplateRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createJobFromTemplate( + request?: protos.google.dataflow.v1beta3.ICreateJobFromTemplateRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.dataflow.v1beta3.IJob, + | protos.google.dataflow.v1beta3.ICreateJobFromTemplateRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.dataflow.v1beta3.IJob, + | protos.google.dataflow.v1beta3.ICreateJobFromTemplateRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.dataflow.v1beta3.IJob, + protos.google.dataflow.v1beta3.ICreateJobFromTemplateRequest | 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 ?? '', + location: request.location ?? '', + }); + this.initialize(); + return this.innerApiCalls.createJobFromTemplate(request, options, callback); + } + /** + * Launch a template. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Required. The ID of the Cloud Platform project that the job belongs to. + * @param {boolean} request.validateOnly + * If true, the request is validated but not actually executed. + * Defaults to false. + * @param {string} request.gcsPath + * A Cloud Storage path to the template from which to create + * the job. + * Must be valid Cloud Storage URL, beginning with 'gs://'. + * @param {google.dataflow.v1beta3.DynamicTemplateLaunchParams} request.dynamicTemplate + * Params for launching a dynamic template. + * @param {google.dataflow.v1beta3.LaunchTemplateParameters} request.launchParameters + * The parameters of the template to launch. This should be part of the + * body of the POST request. + * @param {string} request.location + * The [regional endpoint] + * (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) to + * which to direct the request. + * @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 [LaunchTemplateResponse]{@link google.dataflow.v1beta3.LaunchTemplateResponse}. + * 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/v1beta3/templates_service.launch_template.js + * region_tag:dataflow_v1beta3_generated_TemplatesService_LaunchTemplate_async + */ + launchTemplate( + request?: protos.google.dataflow.v1beta3.ILaunchTemplateRequest, + options?: CallOptions + ): Promise< + [ + protos.google.dataflow.v1beta3.ILaunchTemplateResponse, + protos.google.dataflow.v1beta3.ILaunchTemplateRequest | undefined, + {} | undefined + ] + >; + launchTemplate( + request: protos.google.dataflow.v1beta3.ILaunchTemplateRequest, + options: CallOptions, + callback: Callback< + protos.google.dataflow.v1beta3.ILaunchTemplateResponse, + protos.google.dataflow.v1beta3.ILaunchTemplateRequest | null | undefined, + {} | null | undefined + > + ): void; + launchTemplate( + request: protos.google.dataflow.v1beta3.ILaunchTemplateRequest, + callback: Callback< + protos.google.dataflow.v1beta3.ILaunchTemplateResponse, + protos.google.dataflow.v1beta3.ILaunchTemplateRequest | null | undefined, + {} | null | undefined + > + ): void; + launchTemplate( + request?: protos.google.dataflow.v1beta3.ILaunchTemplateRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.dataflow.v1beta3.ILaunchTemplateResponse, + | protos.google.dataflow.v1beta3.ILaunchTemplateRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.dataflow.v1beta3.ILaunchTemplateResponse, + protos.google.dataflow.v1beta3.ILaunchTemplateRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.dataflow.v1beta3.ILaunchTemplateResponse, + protos.google.dataflow.v1beta3.ILaunchTemplateRequest | 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 ?? '', + location: request.location ?? '', + }); + this.initialize(); + return this.innerApiCalls.launchTemplate(request, options, callback); + } + /** + * Get the template associated with a template. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Required. The ID of the Cloud Platform project that the job belongs to. + * @param {string} request.gcsPath + * Required. A Cloud Storage path to the template from which to + * create the job. + * Must be valid Cloud Storage URL, beginning with 'gs://'. + * @param {google.dataflow.v1beta3.GetTemplateRequest.TemplateView} request.view + * The view to retrieve. Defaults to METADATA_ONLY. + * @param {string} request.location + * The [regional endpoint] + * (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) to + * which to direct the request. + * @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 [GetTemplateResponse]{@link google.dataflow.v1beta3.GetTemplateResponse}. + * 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/v1beta3/templates_service.get_template.js + * region_tag:dataflow_v1beta3_generated_TemplatesService_GetTemplate_async + */ + getTemplate( + request?: protos.google.dataflow.v1beta3.IGetTemplateRequest, + options?: CallOptions + ): Promise< + [ + protos.google.dataflow.v1beta3.IGetTemplateResponse, + protos.google.dataflow.v1beta3.IGetTemplateRequest | undefined, + {} | undefined + ] + >; + getTemplate( + request: protos.google.dataflow.v1beta3.IGetTemplateRequest, + options: CallOptions, + callback: Callback< + protos.google.dataflow.v1beta3.IGetTemplateResponse, + protos.google.dataflow.v1beta3.IGetTemplateRequest | null | undefined, + {} | null | undefined + > + ): void; + getTemplate( + request: protos.google.dataflow.v1beta3.IGetTemplateRequest, + callback: Callback< + protos.google.dataflow.v1beta3.IGetTemplateResponse, + protos.google.dataflow.v1beta3.IGetTemplateRequest | null | undefined, + {} | null | undefined + > + ): void; + getTemplate( + request?: protos.google.dataflow.v1beta3.IGetTemplateRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.dataflow.v1beta3.IGetTemplateResponse, + protos.google.dataflow.v1beta3.IGetTemplateRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.dataflow.v1beta3.IGetTemplateResponse, + protos.google.dataflow.v1beta3.IGetTemplateRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.dataflow.v1beta3.IGetTemplateResponse, + protos.google.dataflow.v1beta3.IGetTemplateRequest | 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 ?? '', + location: request.location ?? '', + }); + this.initialize(); + return this.innerApiCalls.getTemplate(request, options, callback); + } + + /** + * 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.templatesServiceStub && !this._terminated) { + return this.templatesServiceStub.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-dataflow/src/v1beta3/templates_service_client_config.json b/packages/google-dataflow/src/v1beta3/templates_service_client_config.json new file mode 100644 index 00000000000..eb6364e00fd --- /dev/null +++ b/packages/google-dataflow/src/v1beta3/templates_service_client_config.json @@ -0,0 +1,41 @@ +{ + "interfaces": { + "google.dataflow.v1beta3.TemplatesService": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "CreateJobFromTemplate": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "LaunchTemplate": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetTemplate": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-dataflow/src/v1beta3/templates_service_proto_list.json b/packages/google-dataflow/src/v1beta3/templates_service_proto_list.json new file mode 100644 index 00000000000..cd5511e4fd8 --- /dev/null +++ b/packages/google-dataflow/src/v1beta3/templates_service_proto_list.json @@ -0,0 +1,9 @@ +[ + "../../protos/google/dataflow/v1beta3/environment.proto", + "../../protos/google/dataflow/v1beta3/jobs.proto", + "../../protos/google/dataflow/v1beta3/messages.proto", + "../../protos/google/dataflow/v1beta3/metrics.proto", + "../../protos/google/dataflow/v1beta3/snapshots.proto", + "../../protos/google/dataflow/v1beta3/streaming.proto", + "../../protos/google/dataflow/v1beta3/templates.proto" +] diff --git a/packages/google-dataflow/system-test/fixtures/sample/src/index.js b/packages/google-dataflow/system-test/fixtures/sample/src/index.js new file mode 100644 index 00000000000..fe1e9f6b047 --- /dev/null +++ b/packages/google-dataflow/system-test/fixtures/sample/src/index.js @@ -0,0 +1,31 @@ +// 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 dataflow = require('@google-cloud/dataflow'); + +function main() { + const flexTemplatesServiceClient = new dataflow.FlexTemplatesServiceClient(); + const jobsV1Beta3Client = new dataflow.JobsV1Beta3Client(); + const messagesV1Beta3Client = new dataflow.MessagesV1Beta3Client(); + const metricsV1Beta3Client = new dataflow.MetricsV1Beta3Client(); + const snapshotsV1Beta3Client = new dataflow.SnapshotsV1Beta3Client(); + const templatesServiceClient = new dataflow.TemplatesServiceClient(); +} + +main(); diff --git a/packages/google-dataflow/system-test/fixtures/sample/src/index.ts b/packages/google-dataflow/system-test/fixtures/sample/src/index.ts new file mode 100644 index 00000000000..3bd2feef5d6 --- /dev/null +++ b/packages/google-dataflow/system-test/fixtures/sample/src/index.ts @@ -0,0 +1,71 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import { + FlexTemplatesServiceClient, + JobsV1Beta3Client, + MessagesV1Beta3Client, + MetricsV1Beta3Client, + SnapshotsV1Beta3Client, + TemplatesServiceClient, +} from '@google-cloud/dataflow'; + +// check that the client class type name can be used +function doStuffWithFlexTemplatesServiceClient( + client: FlexTemplatesServiceClient +) { + client.close(); +} +function doStuffWithJobsV1Beta3Client(client: JobsV1Beta3Client) { + client.close(); +} +function doStuffWithMessagesV1Beta3Client(client: MessagesV1Beta3Client) { + client.close(); +} +function doStuffWithMetricsV1Beta3Client(client: MetricsV1Beta3Client) { + client.close(); +} +function doStuffWithSnapshotsV1Beta3Client(client: SnapshotsV1Beta3Client) { + client.close(); +} +function doStuffWithTemplatesServiceClient(client: TemplatesServiceClient) { + client.close(); +} + +function main() { + // check that the client instance can be created + const flexTemplatesServiceClient = new FlexTemplatesServiceClient(); + doStuffWithFlexTemplatesServiceClient(flexTemplatesServiceClient); + // check that the client instance can be created + const jobsV1Beta3Client = new JobsV1Beta3Client(); + doStuffWithJobsV1Beta3Client(jobsV1Beta3Client); + // check that the client instance can be created + const messagesV1Beta3Client = new MessagesV1Beta3Client(); + doStuffWithMessagesV1Beta3Client(messagesV1Beta3Client); + // check that the client instance can be created + const metricsV1Beta3Client = new MetricsV1Beta3Client(); + doStuffWithMetricsV1Beta3Client(metricsV1Beta3Client); + // check that the client instance can be created + const snapshotsV1Beta3Client = new SnapshotsV1Beta3Client(); + doStuffWithSnapshotsV1Beta3Client(snapshotsV1Beta3Client); + // check that the client instance can be created + const templatesServiceClient = new TemplatesServiceClient(); + doStuffWithTemplatesServiceClient(templatesServiceClient); +} + +main(); diff --git a/packages/google-dataflow/system-test/install.ts b/packages/google-dataflow/system-test/install.ts new file mode 100644 index 00000000000..6dd1eaadafa --- /dev/null +++ b/packages/google-dataflow/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-dataflow/test/gapic_flex_templates_service_v1beta3.ts b/packages/google-dataflow/test/gapic_flex_templates_service_v1beta3.ts new file mode 100644 index 00000000000..2902e11b500 --- /dev/null +++ b/packages/google-dataflow/test/gapic_flex_templates_service_v1beta3.ts @@ -0,0 +1,331 @@ +// 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 flextemplatesserviceModule from '../src'; + +import {protobuf} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON( + require('../protos/protos.json') +).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = ( + instance.constructor as typeof protobuf.Message + ).toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject( + filledObject + ) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error + ? sinon.stub().rejects(error) + : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback( + response?: ResponseType, + error?: Error +) { + return error + ? sinon.stub().callsArgWith(2, error) + : sinon.stub().callsArgWith(2, null, response); +} + +describe('v1beta3.FlexTemplatesServiceClient', () => { + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = + flextemplatesserviceModule.v1beta3.FlexTemplatesServiceClient + .servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + flextemplatesserviceModule.v1beta3.FlexTemplatesServiceClient + .apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = + flextemplatesserviceModule.v1beta3.FlexTemplatesServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = + new flextemplatesserviceModule.v1beta3.FlexTemplatesServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = + new flextemplatesserviceModule.v1beta3.FlexTemplatesServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = + new flextemplatesserviceModule.v1beta3.FlexTemplatesServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.flexTemplatesServiceStub, undefined); + await client.initialize(); + assert(client.flexTemplatesServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = + new flextemplatesserviceModule.v1beta3.FlexTemplatesServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.flexTemplatesServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = + new flextemplatesserviceModule.v1beta3.FlexTemplatesServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.flexTemplatesServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = + new flextemplatesserviceModule.v1beta3.FlexTemplatesServiceClient({ + 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 flextemplatesserviceModule.v1beta3.FlexTemplatesServiceClient({ + 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('launchFlexTemplate', () => { + it('invokes launchFlexTemplate without error', async () => { + const client = + new flextemplatesserviceModule.v1beta3.FlexTemplatesServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.dataflow.v1beta3.LaunchFlexTemplateRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.dataflow.v1beta3.LaunchFlexTemplateRequest', + ['projectId'] + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.dataflow.v1beta3.LaunchFlexTemplateRequest', + ['location'] + ); + request.location = defaultValue2; + const expectedHeaderRequestParams = `project_id=${defaultValue1}&location=${defaultValue2}`; + const expectedResponse = generateSampleMessage( + new protos.google.dataflow.v1beta3.LaunchFlexTemplateResponse() + ); + client.innerApiCalls.launchFlexTemplate = + stubSimpleCall(expectedResponse); + const [response] = await client.launchFlexTemplate(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.launchFlexTemplate as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.launchFlexTemplate as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes launchFlexTemplate without error using callback', async () => { + const client = + new flextemplatesserviceModule.v1beta3.FlexTemplatesServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.dataflow.v1beta3.LaunchFlexTemplateRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.dataflow.v1beta3.LaunchFlexTemplateRequest', + ['projectId'] + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.dataflow.v1beta3.LaunchFlexTemplateRequest', + ['location'] + ); + request.location = defaultValue2; + const expectedHeaderRequestParams = `project_id=${defaultValue1}&location=${defaultValue2}`; + const expectedResponse = generateSampleMessage( + new protos.google.dataflow.v1beta3.LaunchFlexTemplateResponse() + ); + client.innerApiCalls.launchFlexTemplate = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.launchFlexTemplate( + request, + ( + err?: Error | null, + result?: protos.google.dataflow.v1beta3.ILaunchFlexTemplateResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.launchFlexTemplate as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.launchFlexTemplate as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes launchFlexTemplate with error', async () => { + const client = + new flextemplatesserviceModule.v1beta3.FlexTemplatesServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.dataflow.v1beta3.LaunchFlexTemplateRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.dataflow.v1beta3.LaunchFlexTemplateRequest', + ['projectId'] + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.dataflow.v1beta3.LaunchFlexTemplateRequest', + ['location'] + ); + request.location = defaultValue2; + const expectedHeaderRequestParams = `project_id=${defaultValue1}&location=${defaultValue2}`; + const expectedError = new Error('expected'); + client.innerApiCalls.launchFlexTemplate = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.launchFlexTemplate(request), expectedError); + const actualRequest = ( + client.innerApiCalls.launchFlexTemplate as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.launchFlexTemplate as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes launchFlexTemplate with closed client', async () => { + const client = + new flextemplatesserviceModule.v1beta3.FlexTemplatesServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.dataflow.v1beta3.LaunchFlexTemplateRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.dataflow.v1beta3.LaunchFlexTemplateRequest', + ['projectId'] + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.dataflow.v1beta3.LaunchFlexTemplateRequest', + ['location'] + ); + request.location = defaultValue2; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.launchFlexTemplate(request), expectedError); + }); + }); +}); diff --git a/packages/google-dataflow/test/gapic_jobs_v1_beta3_v1beta3.ts b/packages/google-dataflow/test/gapic_jobs_v1_beta3_v1beta3.ts new file mode 100644 index 00000000000..72eb5fc4a39 --- /dev/null +++ b/packages/google-dataflow/test/gapic_jobs_v1_beta3_v1beta3.ts @@ -0,0 +1,1588 @@ +// 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 jobsv1beta3Module from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON( + require('../protos/protos.json') +).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = ( + instance.constructor as typeof protobuf.Message + ).toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject( + filledObject + ) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error + ? sinon.stub().rejects(error) + : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback( + response?: ResponseType, + error?: Error +) { + return error + ? sinon.stub().callsArgWith(2, error) + : sinon.stub().callsArgWith(2, null, response); +} + +function stubPageStreamingCall( + responses?: ResponseType[], + error?: Error +) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error + ? sinon.stub().callsArgWith(2, error) + : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { + mockStream.write({}); + }); + } + setImmediate(() => { + mockStream.end(); + }); + } else { + setImmediate(() => { + mockStream.write({}); + }); + setImmediate(() => { + mockStream.end(); + }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall( + responses?: ResponseType[], + error?: Error +) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + }, + }; + }, + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v1beta3.JobsV1Beta3Client', () => { + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = + jobsv1beta3Module.v1beta3.JobsV1Beta3Client.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + jobsv1beta3Module.v1beta3.JobsV1Beta3Client.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = jobsv1beta3Module.v1beta3.JobsV1Beta3Client.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new jobsv1beta3Module.v1beta3.JobsV1Beta3Client(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new jobsv1beta3Module.v1beta3.JobsV1Beta3Client({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new jobsv1beta3Module.v1beta3.JobsV1Beta3Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.jobsV1Beta3Stub, undefined); + await client.initialize(); + assert(client.jobsV1Beta3Stub); + }); + + it('has close method for the initialized client', done => { + const client = new jobsv1beta3Module.v1beta3.JobsV1Beta3Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.jobsV1Beta3Stub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new jobsv1beta3Module.v1beta3.JobsV1Beta3Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.jobsV1Beta3Stub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new jobsv1beta3Module.v1beta3.JobsV1Beta3Client({ + 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 jobsv1beta3Module.v1beta3.JobsV1Beta3Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon + .stub() + .callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error | null, projectId?: string | null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); + }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); + }); + }); + + describe('createJob', () => { + it('invokes createJob without error', async () => { + const client = new jobsv1beta3Module.v1beta3.JobsV1Beta3Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.dataflow.v1beta3.CreateJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.dataflow.v1beta3.CreateJobRequest', + ['projectId'] + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.dataflow.v1beta3.CreateJobRequest', + ['location'] + ); + request.location = defaultValue2; + const expectedHeaderRequestParams = `project_id=${defaultValue1}&location=${defaultValue2}`; + const expectedResponse = generateSampleMessage( + new protos.google.dataflow.v1beta3.Job() + ); + client.innerApiCalls.createJob = stubSimpleCall(expectedResponse); + const [response] = await client.createJob(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createJob without error using callback', async () => { + const client = new jobsv1beta3Module.v1beta3.JobsV1Beta3Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.dataflow.v1beta3.CreateJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.dataflow.v1beta3.CreateJobRequest', + ['projectId'] + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.dataflow.v1beta3.CreateJobRequest', + ['location'] + ); + request.location = defaultValue2; + const expectedHeaderRequestParams = `project_id=${defaultValue1}&location=${defaultValue2}`; + const expectedResponse = generateSampleMessage( + new protos.google.dataflow.v1beta3.Job() + ); + client.innerApiCalls.createJob = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createJob( + request, + ( + err?: Error | null, + result?: protos.google.dataflow.v1beta3.IJob | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createJob with error', async () => { + const client = new jobsv1beta3Module.v1beta3.JobsV1Beta3Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.dataflow.v1beta3.CreateJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.dataflow.v1beta3.CreateJobRequest', + ['projectId'] + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.dataflow.v1beta3.CreateJobRequest', + ['location'] + ); + request.location = defaultValue2; + const expectedHeaderRequestParams = `project_id=${defaultValue1}&location=${defaultValue2}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createJob = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createJob(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createJob with closed client', async () => { + const client = new jobsv1beta3Module.v1beta3.JobsV1Beta3Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.dataflow.v1beta3.CreateJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.dataflow.v1beta3.CreateJobRequest', + ['projectId'] + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.dataflow.v1beta3.CreateJobRequest', + ['location'] + ); + request.location = defaultValue2; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createJob(request), expectedError); + }); + }); + + describe('getJob', () => { + it('invokes getJob without error', async () => { + const client = new jobsv1beta3Module.v1beta3.JobsV1Beta3Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.dataflow.v1beta3.GetJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.dataflow.v1beta3.GetJobRequest', + ['projectId'] + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.dataflow.v1beta3.GetJobRequest', + ['location'] + ); + request.location = defaultValue2; + const defaultValue3 = getTypeDefaultValue( + '.google.dataflow.v1beta3.GetJobRequest', + ['jobId'] + ); + request.jobId = defaultValue3; + const expectedHeaderRequestParams = `project_id=${defaultValue1}&location=${defaultValue2}&job_id=${defaultValue3}`; + const expectedResponse = generateSampleMessage( + new protos.google.dataflow.v1beta3.Job() + ); + client.innerApiCalls.getJob = stubSimpleCall(expectedResponse); + const [response] = await client.getJob(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getJob as SinonStub).getCall( + 0 + ).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getJob without error using callback', async () => { + const client = new jobsv1beta3Module.v1beta3.JobsV1Beta3Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.dataflow.v1beta3.GetJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.dataflow.v1beta3.GetJobRequest', + ['projectId'] + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.dataflow.v1beta3.GetJobRequest', + ['location'] + ); + request.location = defaultValue2; + const defaultValue3 = getTypeDefaultValue( + '.google.dataflow.v1beta3.GetJobRequest', + ['jobId'] + ); + request.jobId = defaultValue3; + const expectedHeaderRequestParams = `project_id=${defaultValue1}&location=${defaultValue2}&job_id=${defaultValue3}`; + const expectedResponse = generateSampleMessage( + new protos.google.dataflow.v1beta3.Job() + ); + client.innerApiCalls.getJob = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getJob( + request, + ( + err?: Error | null, + result?: protos.google.dataflow.v1beta3.IJob | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getJob as SinonStub).getCall( + 0 + ).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getJob with error', async () => { + const client = new jobsv1beta3Module.v1beta3.JobsV1Beta3Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.dataflow.v1beta3.GetJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.dataflow.v1beta3.GetJobRequest', + ['projectId'] + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.dataflow.v1beta3.GetJobRequest', + ['location'] + ); + request.location = defaultValue2; + const defaultValue3 = getTypeDefaultValue( + '.google.dataflow.v1beta3.GetJobRequest', + ['jobId'] + ); + request.jobId = defaultValue3; + const expectedHeaderRequestParams = `project_id=${defaultValue1}&location=${defaultValue2}&job_id=${defaultValue3}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getJob = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getJob(request), expectedError); + const actualRequest = (client.innerApiCalls.getJob as SinonStub).getCall( + 0 + ).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getJob with closed client', async () => { + const client = new jobsv1beta3Module.v1beta3.JobsV1Beta3Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.dataflow.v1beta3.GetJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.dataflow.v1beta3.GetJobRequest', + ['projectId'] + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.dataflow.v1beta3.GetJobRequest', + ['location'] + ); + request.location = defaultValue2; + const defaultValue3 = getTypeDefaultValue( + '.google.dataflow.v1beta3.GetJobRequest', + ['jobId'] + ); + request.jobId = defaultValue3; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getJob(request), expectedError); + }); + }); + + describe('updateJob', () => { + it('invokes updateJob without error', async () => { + const client = new jobsv1beta3Module.v1beta3.JobsV1Beta3Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.dataflow.v1beta3.UpdateJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.dataflow.v1beta3.UpdateJobRequest', + ['projectId'] + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.dataflow.v1beta3.UpdateJobRequest', + ['location'] + ); + request.location = defaultValue2; + const defaultValue3 = getTypeDefaultValue( + '.google.dataflow.v1beta3.UpdateJobRequest', + ['jobId'] + ); + request.jobId = defaultValue3; + const expectedHeaderRequestParams = `project_id=${defaultValue1}&location=${defaultValue2}&job_id=${defaultValue3}`; + const expectedResponse = generateSampleMessage( + new protos.google.dataflow.v1beta3.Job() + ); + client.innerApiCalls.updateJob = stubSimpleCall(expectedResponse); + const [response] = await client.updateJob(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateJob without error using callback', async () => { + const client = new jobsv1beta3Module.v1beta3.JobsV1Beta3Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.dataflow.v1beta3.UpdateJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.dataflow.v1beta3.UpdateJobRequest', + ['projectId'] + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.dataflow.v1beta3.UpdateJobRequest', + ['location'] + ); + request.location = defaultValue2; + const defaultValue3 = getTypeDefaultValue( + '.google.dataflow.v1beta3.UpdateJobRequest', + ['jobId'] + ); + request.jobId = defaultValue3; + const expectedHeaderRequestParams = `project_id=${defaultValue1}&location=${defaultValue2}&job_id=${defaultValue3}`; + const expectedResponse = generateSampleMessage( + new protos.google.dataflow.v1beta3.Job() + ); + client.innerApiCalls.updateJob = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateJob( + request, + ( + err?: Error | null, + result?: protos.google.dataflow.v1beta3.IJob | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateJob with error', async () => { + const client = new jobsv1beta3Module.v1beta3.JobsV1Beta3Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.dataflow.v1beta3.UpdateJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.dataflow.v1beta3.UpdateJobRequest', + ['projectId'] + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.dataflow.v1beta3.UpdateJobRequest', + ['location'] + ); + request.location = defaultValue2; + const defaultValue3 = getTypeDefaultValue( + '.google.dataflow.v1beta3.UpdateJobRequest', + ['jobId'] + ); + request.jobId = defaultValue3; + const expectedHeaderRequestParams = `project_id=${defaultValue1}&location=${defaultValue2}&job_id=${defaultValue3}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateJob = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateJob(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateJob with closed client', async () => { + const client = new jobsv1beta3Module.v1beta3.JobsV1Beta3Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.dataflow.v1beta3.UpdateJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.dataflow.v1beta3.UpdateJobRequest', + ['projectId'] + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.dataflow.v1beta3.UpdateJobRequest', + ['location'] + ); + request.location = defaultValue2; + const defaultValue3 = getTypeDefaultValue( + '.google.dataflow.v1beta3.UpdateJobRequest', + ['jobId'] + ); + request.jobId = defaultValue3; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateJob(request), expectedError); + }); + }); + + describe('checkActiveJobs', () => { + it('invokes checkActiveJobs without error', async () => { + const client = new jobsv1beta3Module.v1beta3.JobsV1Beta3Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.dataflow.v1beta3.CheckActiveJobsRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.dataflow.v1beta3.CheckActiveJobsResponse() + ); + client.innerApiCalls.checkActiveJobs = stubSimpleCall(expectedResponse); + const [response] = await client.checkActiveJobs(request); + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes checkActiveJobs without error using callback', async () => { + const client = new jobsv1beta3Module.v1beta3.JobsV1Beta3Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.dataflow.v1beta3.CheckActiveJobsRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.dataflow.v1beta3.CheckActiveJobsResponse() + ); + client.innerApiCalls.checkActiveJobs = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.checkActiveJobs( + request, + ( + err?: Error | null, + result?: protos.google.dataflow.v1beta3.ICheckActiveJobsResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes checkActiveJobs with error', async () => { + const client = new jobsv1beta3Module.v1beta3.JobsV1Beta3Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.dataflow.v1beta3.CheckActiveJobsRequest() + ); + const expectedError = new Error('expected'); + client.innerApiCalls.checkActiveJobs = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.checkActiveJobs(request), expectedError); + }); + + it('invokes checkActiveJobs with closed client', async () => { + const client = new jobsv1beta3Module.v1beta3.JobsV1Beta3Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.dataflow.v1beta3.CheckActiveJobsRequest() + ); + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.checkActiveJobs(request), expectedError); + }); + }); + + describe('snapshotJob', () => { + it('invokes snapshotJob without error', async () => { + const client = new jobsv1beta3Module.v1beta3.JobsV1Beta3Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.dataflow.v1beta3.SnapshotJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.dataflow.v1beta3.SnapshotJobRequest', + ['projectId'] + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.dataflow.v1beta3.SnapshotJobRequest', + ['location'] + ); + request.location = defaultValue2; + const defaultValue3 = getTypeDefaultValue( + '.google.dataflow.v1beta3.SnapshotJobRequest', + ['jobId'] + ); + request.jobId = defaultValue3; + const expectedHeaderRequestParams = `project_id=${defaultValue1}&location=${defaultValue2}&job_id=${defaultValue3}`; + const expectedResponse = generateSampleMessage( + new protos.google.dataflow.v1beta3.Snapshot() + ); + client.innerApiCalls.snapshotJob = stubSimpleCall(expectedResponse); + const [response] = await client.snapshotJob(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.snapshotJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.snapshotJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes snapshotJob without error using callback', async () => { + const client = new jobsv1beta3Module.v1beta3.JobsV1Beta3Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.dataflow.v1beta3.SnapshotJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.dataflow.v1beta3.SnapshotJobRequest', + ['projectId'] + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.dataflow.v1beta3.SnapshotJobRequest', + ['location'] + ); + request.location = defaultValue2; + const defaultValue3 = getTypeDefaultValue( + '.google.dataflow.v1beta3.SnapshotJobRequest', + ['jobId'] + ); + request.jobId = defaultValue3; + const expectedHeaderRequestParams = `project_id=${defaultValue1}&location=${defaultValue2}&job_id=${defaultValue3}`; + const expectedResponse = generateSampleMessage( + new protos.google.dataflow.v1beta3.Snapshot() + ); + client.innerApiCalls.snapshotJob = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.snapshotJob( + request, + ( + err?: Error | null, + result?: protos.google.dataflow.v1beta3.ISnapshot | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.snapshotJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.snapshotJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes snapshotJob with error', async () => { + const client = new jobsv1beta3Module.v1beta3.JobsV1Beta3Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.dataflow.v1beta3.SnapshotJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.dataflow.v1beta3.SnapshotJobRequest', + ['projectId'] + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.dataflow.v1beta3.SnapshotJobRequest', + ['location'] + ); + request.location = defaultValue2; + const defaultValue3 = getTypeDefaultValue( + '.google.dataflow.v1beta3.SnapshotJobRequest', + ['jobId'] + ); + request.jobId = defaultValue3; + const expectedHeaderRequestParams = `project_id=${defaultValue1}&location=${defaultValue2}&job_id=${defaultValue3}`; + const expectedError = new Error('expected'); + client.innerApiCalls.snapshotJob = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.snapshotJob(request), expectedError); + const actualRequest = ( + client.innerApiCalls.snapshotJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.snapshotJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes snapshotJob with closed client', async () => { + const client = new jobsv1beta3Module.v1beta3.JobsV1Beta3Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.dataflow.v1beta3.SnapshotJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.dataflow.v1beta3.SnapshotJobRequest', + ['projectId'] + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.dataflow.v1beta3.SnapshotJobRequest', + ['location'] + ); + request.location = defaultValue2; + const defaultValue3 = getTypeDefaultValue( + '.google.dataflow.v1beta3.SnapshotJobRequest', + ['jobId'] + ); + request.jobId = defaultValue3; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.snapshotJob(request), expectedError); + }); + }); + + describe('listJobs', () => { + it('invokes listJobs without error', async () => { + const client = new jobsv1beta3Module.v1beta3.JobsV1Beta3Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.dataflow.v1beta3.ListJobsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.dataflow.v1beta3.ListJobsRequest', + ['projectId'] + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.dataflow.v1beta3.ListJobsRequest', + ['location'] + ); + request.location = defaultValue2; + const expectedHeaderRequestParams = `project_id=${defaultValue1}&location=${defaultValue2}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.dataflow.v1beta3.Job()), + generateSampleMessage(new protos.google.dataflow.v1beta3.Job()), + generateSampleMessage(new protos.google.dataflow.v1beta3.Job()), + ]; + client.innerApiCalls.listJobs = stubSimpleCall(expectedResponse); + const [response] = await client.listJobs(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listJobs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listJobs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listJobs without error using callback', async () => { + const client = new jobsv1beta3Module.v1beta3.JobsV1Beta3Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.dataflow.v1beta3.ListJobsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.dataflow.v1beta3.ListJobsRequest', + ['projectId'] + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.dataflow.v1beta3.ListJobsRequest', + ['location'] + ); + request.location = defaultValue2; + const expectedHeaderRequestParams = `project_id=${defaultValue1}&location=${defaultValue2}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.dataflow.v1beta3.Job()), + generateSampleMessage(new protos.google.dataflow.v1beta3.Job()), + generateSampleMessage(new protos.google.dataflow.v1beta3.Job()), + ]; + client.innerApiCalls.listJobs = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listJobs( + request, + ( + err?: Error | null, + result?: protos.google.dataflow.v1beta3.IJob[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listJobs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listJobs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listJobs with error', async () => { + const client = new jobsv1beta3Module.v1beta3.JobsV1Beta3Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.dataflow.v1beta3.ListJobsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.dataflow.v1beta3.ListJobsRequest', + ['projectId'] + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.dataflow.v1beta3.ListJobsRequest', + ['location'] + ); + request.location = defaultValue2; + const expectedHeaderRequestParams = `project_id=${defaultValue1}&location=${defaultValue2}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listJobs = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listJobs(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listJobs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listJobs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listJobsStream without error', async () => { + const client = new jobsv1beta3Module.v1beta3.JobsV1Beta3Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.dataflow.v1beta3.ListJobsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.dataflow.v1beta3.ListJobsRequest', + ['projectId'] + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.dataflow.v1beta3.ListJobsRequest', + ['location'] + ); + request.location = defaultValue2; + const expectedHeaderRequestParams = `project_id=${defaultValue1}&location=${defaultValue2}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.dataflow.v1beta3.Job()), + generateSampleMessage(new protos.google.dataflow.v1beta3.Job()), + generateSampleMessage(new protos.google.dataflow.v1beta3.Job()), + ]; + client.descriptors.page.listJobs.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listJobsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.dataflow.v1beta3.Job[] = []; + stream.on('data', (response: protos.google.dataflow.v1beta3.Job) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert( + (client.descriptors.page.listJobs.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listJobs, request) + ); + assert( + (client.descriptors.page.listJobs.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listJobsStream with error', async () => { + const client = new jobsv1beta3Module.v1beta3.JobsV1Beta3Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.dataflow.v1beta3.ListJobsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.dataflow.v1beta3.ListJobsRequest', + ['projectId'] + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.dataflow.v1beta3.ListJobsRequest', + ['location'] + ); + request.location = defaultValue2; + const expectedHeaderRequestParams = `project_id=${defaultValue1}&location=${defaultValue2}`; + const expectedError = new Error('expected'); + client.descriptors.page.listJobs.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listJobsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.dataflow.v1beta3.Job[] = []; + stream.on('data', (response: protos.google.dataflow.v1beta3.Job) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listJobs.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listJobs, request) + ); + assert( + (client.descriptors.page.listJobs.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listJobs without error', async () => { + const client = new jobsv1beta3Module.v1beta3.JobsV1Beta3Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.dataflow.v1beta3.ListJobsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.dataflow.v1beta3.ListJobsRequest', + ['projectId'] + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.dataflow.v1beta3.ListJobsRequest', + ['location'] + ); + request.location = defaultValue2; + const expectedHeaderRequestParams = `project_id=${defaultValue1}&location=${defaultValue2}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.dataflow.v1beta3.Job()), + generateSampleMessage(new protos.google.dataflow.v1beta3.Job()), + generateSampleMessage(new protos.google.dataflow.v1beta3.Job()), + ]; + client.descriptors.page.listJobs.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.dataflow.v1beta3.IJob[] = []; + const iterable = client.listJobsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listJobs.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert( + (client.descriptors.page.listJobs.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listJobs with error', async () => { + const client = new jobsv1beta3Module.v1beta3.JobsV1Beta3Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.dataflow.v1beta3.ListJobsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.dataflow.v1beta3.ListJobsRequest', + ['projectId'] + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.dataflow.v1beta3.ListJobsRequest', + ['location'] + ); + request.location = defaultValue2; + const expectedHeaderRequestParams = `project_id=${defaultValue1}&location=${defaultValue2}`; + const expectedError = new Error('expected'); + client.descriptors.page.listJobs.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listJobsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.dataflow.v1beta3.IJob[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listJobs.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert( + (client.descriptors.page.listJobs.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('aggregatedListJobs', () => { + it('invokes aggregatedListJobs without error', async () => { + const client = new jobsv1beta3Module.v1beta3.JobsV1Beta3Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.dataflow.v1beta3.ListJobsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.dataflow.v1beta3.ListJobsRequest', + ['projectId'] + ); + request.projectId = defaultValue1; + const expectedHeaderRequestParams = `project_id=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.dataflow.v1beta3.Job()), + generateSampleMessage(new protos.google.dataflow.v1beta3.Job()), + generateSampleMessage(new protos.google.dataflow.v1beta3.Job()), + ]; + client.innerApiCalls.aggregatedListJobs = + stubSimpleCall(expectedResponse); + const [response] = await client.aggregatedListJobs(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.aggregatedListJobs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.aggregatedListJobs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes aggregatedListJobs without error using callback', async () => { + const client = new jobsv1beta3Module.v1beta3.JobsV1Beta3Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.dataflow.v1beta3.ListJobsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.dataflow.v1beta3.ListJobsRequest', + ['projectId'] + ); + request.projectId = defaultValue1; + const expectedHeaderRequestParams = `project_id=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.dataflow.v1beta3.Job()), + generateSampleMessage(new protos.google.dataflow.v1beta3.Job()), + generateSampleMessage(new protos.google.dataflow.v1beta3.Job()), + ]; + client.innerApiCalls.aggregatedListJobs = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.aggregatedListJobs( + request, + ( + err?: Error | null, + result?: protos.google.dataflow.v1beta3.IJob[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.aggregatedListJobs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.aggregatedListJobs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes aggregatedListJobs with error', async () => { + const client = new jobsv1beta3Module.v1beta3.JobsV1Beta3Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.dataflow.v1beta3.ListJobsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.dataflow.v1beta3.ListJobsRequest', + ['projectId'] + ); + request.projectId = defaultValue1; + const expectedHeaderRequestParams = `project_id=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.aggregatedListJobs = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.aggregatedListJobs(request), expectedError); + const actualRequest = ( + client.innerApiCalls.aggregatedListJobs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.aggregatedListJobs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes aggregatedListJobsStream without error', async () => { + const client = new jobsv1beta3Module.v1beta3.JobsV1Beta3Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.dataflow.v1beta3.ListJobsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.dataflow.v1beta3.ListJobsRequest', + ['projectId'] + ); + request.projectId = defaultValue1; + const expectedHeaderRequestParams = `project_id=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.dataflow.v1beta3.Job()), + generateSampleMessage(new protos.google.dataflow.v1beta3.Job()), + generateSampleMessage(new protos.google.dataflow.v1beta3.Job()), + ]; + client.descriptors.page.aggregatedListJobs.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.aggregatedListJobsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.dataflow.v1beta3.Job[] = []; + stream.on('data', (response: protos.google.dataflow.v1beta3.Job) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert( + (client.descriptors.page.aggregatedListJobs.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.aggregatedListJobs, request) + ); + assert( + (client.descriptors.page.aggregatedListJobs.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes aggregatedListJobsStream with error', async () => { + const client = new jobsv1beta3Module.v1beta3.JobsV1Beta3Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.dataflow.v1beta3.ListJobsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.dataflow.v1beta3.ListJobsRequest', + ['projectId'] + ); + request.projectId = defaultValue1; + const expectedHeaderRequestParams = `project_id=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.aggregatedListJobs.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.aggregatedListJobsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.dataflow.v1beta3.Job[] = []; + stream.on('data', (response: protos.google.dataflow.v1beta3.Job) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.aggregatedListJobs.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.aggregatedListJobs, request) + ); + assert( + (client.descriptors.page.aggregatedListJobs.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with aggregatedListJobs without error', async () => { + const client = new jobsv1beta3Module.v1beta3.JobsV1Beta3Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.dataflow.v1beta3.ListJobsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.dataflow.v1beta3.ListJobsRequest', + ['projectId'] + ); + request.projectId = defaultValue1; + const expectedHeaderRequestParams = `project_id=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.dataflow.v1beta3.Job()), + generateSampleMessage(new protos.google.dataflow.v1beta3.Job()), + generateSampleMessage(new protos.google.dataflow.v1beta3.Job()), + ]; + client.descriptors.page.aggregatedListJobs.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.dataflow.v1beta3.IJob[] = []; + const iterable = client.aggregatedListJobsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.aggregatedListJobs.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.aggregatedListJobs.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with aggregatedListJobs with error', async () => { + const client = new jobsv1beta3Module.v1beta3.JobsV1Beta3Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.dataflow.v1beta3.ListJobsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.dataflow.v1beta3.ListJobsRequest', + ['projectId'] + ); + request.projectId = defaultValue1; + const expectedHeaderRequestParams = `project_id=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.aggregatedListJobs.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.aggregatedListJobsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.dataflow.v1beta3.IJob[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.aggregatedListJobs.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.aggregatedListJobs.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); +}); diff --git a/packages/google-dataflow/test/gapic_messages_v1_beta3_v1beta3.ts b/packages/google-dataflow/test/gapic_messages_v1_beta3_v1beta3.ts new file mode 100644 index 00000000000..ace04e0915a --- /dev/null +++ b/packages/google-dataflow/test/gapic_messages_v1_beta3_v1beta3.ts @@ -0,0 +1,600 @@ +// 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 messagesv1beta3Module from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON( + require('../protos/protos.json') +).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = ( + instance.constructor as typeof protobuf.Message + ).toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject( + filledObject + ) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error + ? sinon.stub().rejects(error) + : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback( + response?: ResponseType, + error?: Error +) { + return error + ? sinon.stub().callsArgWith(2, error) + : sinon.stub().callsArgWith(2, null, response); +} + +function stubPageStreamingCall( + responses?: ResponseType[], + error?: Error +) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error + ? sinon.stub().callsArgWith(2, error) + : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { + mockStream.write({}); + }); + } + setImmediate(() => { + mockStream.end(); + }); + } else { + setImmediate(() => { + mockStream.write({}); + }); + setImmediate(() => { + mockStream.end(); + }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall( + responses?: ResponseType[], + error?: Error +) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + }, + }; + }, + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v1beta3.MessagesV1Beta3Client', () => { + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = + messagesv1beta3Module.v1beta3.MessagesV1Beta3Client.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + messagesv1beta3Module.v1beta3.MessagesV1Beta3Client.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = messagesv1beta3Module.v1beta3.MessagesV1Beta3Client.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new messagesv1beta3Module.v1beta3.MessagesV1Beta3Client(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new messagesv1beta3Module.v1beta3.MessagesV1Beta3Client({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new messagesv1beta3Module.v1beta3.MessagesV1Beta3Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.messagesV1Beta3Stub, undefined); + await client.initialize(); + assert(client.messagesV1Beta3Stub); + }); + + it('has close method for the initialized client', done => { + const client = new messagesv1beta3Module.v1beta3.MessagesV1Beta3Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.messagesV1Beta3Stub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new messagesv1beta3Module.v1beta3.MessagesV1Beta3Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.messagesV1Beta3Stub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new messagesv1beta3Module.v1beta3.MessagesV1Beta3Client({ + 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 messagesv1beta3Module.v1beta3.MessagesV1Beta3Client({ + 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('listJobMessages', () => { + it('invokes listJobMessages without error', async () => { + const client = new messagesv1beta3Module.v1beta3.MessagesV1Beta3Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.dataflow.v1beta3.ListJobMessagesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.dataflow.v1beta3.ListJobMessagesRequest', + ['projectId'] + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.dataflow.v1beta3.ListJobMessagesRequest', + ['location'] + ); + request.location = defaultValue2; + const defaultValue3 = getTypeDefaultValue( + '.google.dataflow.v1beta3.ListJobMessagesRequest', + ['jobId'] + ); + request.jobId = defaultValue3; + const expectedHeaderRequestParams = `project_id=${defaultValue1}&location=${defaultValue2}&job_id=${defaultValue3}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.dataflow.v1beta3.JobMessage()), + generateSampleMessage(new protos.google.dataflow.v1beta3.JobMessage()), + generateSampleMessage(new protos.google.dataflow.v1beta3.JobMessage()), + ]; + client.innerApiCalls.listJobMessages = stubSimpleCall(expectedResponse); + const [response] = await client.listJobMessages(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listJobMessages as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listJobMessages as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listJobMessages without error using callback', async () => { + const client = new messagesv1beta3Module.v1beta3.MessagesV1Beta3Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.dataflow.v1beta3.ListJobMessagesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.dataflow.v1beta3.ListJobMessagesRequest', + ['projectId'] + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.dataflow.v1beta3.ListJobMessagesRequest', + ['location'] + ); + request.location = defaultValue2; + const defaultValue3 = getTypeDefaultValue( + '.google.dataflow.v1beta3.ListJobMessagesRequest', + ['jobId'] + ); + request.jobId = defaultValue3; + const expectedHeaderRequestParams = `project_id=${defaultValue1}&location=${defaultValue2}&job_id=${defaultValue3}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.dataflow.v1beta3.JobMessage()), + generateSampleMessage(new protos.google.dataflow.v1beta3.JobMessage()), + generateSampleMessage(new protos.google.dataflow.v1beta3.JobMessage()), + ]; + client.innerApiCalls.listJobMessages = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listJobMessages( + request, + ( + err?: Error | null, + result?: protos.google.dataflow.v1beta3.IJobMessage[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listJobMessages as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listJobMessages as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listJobMessages with error', async () => { + const client = new messagesv1beta3Module.v1beta3.MessagesV1Beta3Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.dataflow.v1beta3.ListJobMessagesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.dataflow.v1beta3.ListJobMessagesRequest', + ['projectId'] + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.dataflow.v1beta3.ListJobMessagesRequest', + ['location'] + ); + request.location = defaultValue2; + const defaultValue3 = getTypeDefaultValue( + '.google.dataflow.v1beta3.ListJobMessagesRequest', + ['jobId'] + ); + request.jobId = defaultValue3; + const expectedHeaderRequestParams = `project_id=${defaultValue1}&location=${defaultValue2}&job_id=${defaultValue3}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listJobMessages = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listJobMessages(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listJobMessages as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listJobMessages as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listJobMessagesStream without error', async () => { + const client = new messagesv1beta3Module.v1beta3.MessagesV1Beta3Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.dataflow.v1beta3.ListJobMessagesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.dataflow.v1beta3.ListJobMessagesRequest', + ['projectId'] + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.dataflow.v1beta3.ListJobMessagesRequest', + ['location'] + ); + request.location = defaultValue2; + const defaultValue3 = getTypeDefaultValue( + '.google.dataflow.v1beta3.ListJobMessagesRequest', + ['jobId'] + ); + request.jobId = defaultValue3; + const expectedHeaderRequestParams = `project_id=${defaultValue1}&location=${defaultValue2}&job_id=${defaultValue3}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.dataflow.v1beta3.JobMessage()), + generateSampleMessage(new protos.google.dataflow.v1beta3.JobMessage()), + generateSampleMessage(new protos.google.dataflow.v1beta3.JobMessage()), + ]; + client.descriptors.page.listJobMessages.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listJobMessagesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.dataflow.v1beta3.JobMessage[] = []; + stream.on( + 'data', + (response: protos.google.dataflow.v1beta3.JobMessage) => { + 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.listJobMessages.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listJobMessages, request) + ); + assert( + (client.descriptors.page.listJobMessages.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listJobMessagesStream with error', async () => { + const client = new messagesv1beta3Module.v1beta3.MessagesV1Beta3Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.dataflow.v1beta3.ListJobMessagesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.dataflow.v1beta3.ListJobMessagesRequest', + ['projectId'] + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.dataflow.v1beta3.ListJobMessagesRequest', + ['location'] + ); + request.location = defaultValue2; + const defaultValue3 = getTypeDefaultValue( + '.google.dataflow.v1beta3.ListJobMessagesRequest', + ['jobId'] + ); + request.jobId = defaultValue3; + const expectedHeaderRequestParams = `project_id=${defaultValue1}&location=${defaultValue2}&job_id=${defaultValue3}`; + const expectedError = new Error('expected'); + client.descriptors.page.listJobMessages.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listJobMessagesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.dataflow.v1beta3.JobMessage[] = []; + stream.on( + 'data', + (response: protos.google.dataflow.v1beta3.JobMessage) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listJobMessages.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listJobMessages, request) + ); + assert( + (client.descriptors.page.listJobMessages.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listJobMessages without error', async () => { + const client = new messagesv1beta3Module.v1beta3.MessagesV1Beta3Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.dataflow.v1beta3.ListJobMessagesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.dataflow.v1beta3.ListJobMessagesRequest', + ['projectId'] + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.dataflow.v1beta3.ListJobMessagesRequest', + ['location'] + ); + request.location = defaultValue2; + const defaultValue3 = getTypeDefaultValue( + '.google.dataflow.v1beta3.ListJobMessagesRequest', + ['jobId'] + ); + request.jobId = defaultValue3; + const expectedHeaderRequestParams = `project_id=${defaultValue1}&location=${defaultValue2}&job_id=${defaultValue3}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.dataflow.v1beta3.JobMessage()), + generateSampleMessage(new protos.google.dataflow.v1beta3.JobMessage()), + generateSampleMessage(new protos.google.dataflow.v1beta3.JobMessage()), + ]; + client.descriptors.page.listJobMessages.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.dataflow.v1beta3.IJobMessage[] = []; + const iterable = client.listJobMessagesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listJobMessages.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listJobMessages.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listJobMessages with error', async () => { + const client = new messagesv1beta3Module.v1beta3.MessagesV1Beta3Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.dataflow.v1beta3.ListJobMessagesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.dataflow.v1beta3.ListJobMessagesRequest', + ['projectId'] + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.dataflow.v1beta3.ListJobMessagesRequest', + ['location'] + ); + request.location = defaultValue2; + const defaultValue3 = getTypeDefaultValue( + '.google.dataflow.v1beta3.ListJobMessagesRequest', + ['jobId'] + ); + request.jobId = defaultValue3; + const expectedHeaderRequestParams = `project_id=${defaultValue1}&location=${defaultValue2}&job_id=${defaultValue3}`; + const expectedError = new Error('expected'); + client.descriptors.page.listJobMessages.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listJobMessagesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.dataflow.v1beta3.IJobMessage[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listJobMessages.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listJobMessages.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); +}); diff --git a/packages/google-dataflow/test/gapic_metrics_v1_beta3_v1beta3.ts b/packages/google-dataflow/test/gapic_metrics_v1_beta3_v1beta3.ts new file mode 100644 index 00000000000..2a7036c71c1 --- /dev/null +++ b/packages/google-dataflow/test/gapic_metrics_v1_beta3_v1beta3.ts @@ -0,0 +1,1272 @@ +// 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 metricsv1beta3Module from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON( + require('../protos/protos.json') +).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = ( + instance.constructor as typeof protobuf.Message + ).toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject( + filledObject + ) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error + ? sinon.stub().rejects(error) + : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback( + response?: ResponseType, + error?: Error +) { + return error + ? sinon.stub().callsArgWith(2, error) + : sinon.stub().callsArgWith(2, null, response); +} + +function stubPageStreamingCall( + responses?: ResponseType[], + error?: Error +) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error + ? sinon.stub().callsArgWith(2, error) + : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { + mockStream.write({}); + }); + } + setImmediate(() => { + mockStream.end(); + }); + } else { + setImmediate(() => { + mockStream.write({}); + }); + setImmediate(() => { + mockStream.end(); + }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall( + responses?: ResponseType[], + error?: Error +) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + }, + }; + }, + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v1beta3.MetricsV1Beta3Client', () => { + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = + metricsv1beta3Module.v1beta3.MetricsV1Beta3Client.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + metricsv1beta3Module.v1beta3.MetricsV1Beta3Client.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = metricsv1beta3Module.v1beta3.MetricsV1Beta3Client.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new metricsv1beta3Module.v1beta3.MetricsV1Beta3Client(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new metricsv1beta3Module.v1beta3.MetricsV1Beta3Client({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new metricsv1beta3Module.v1beta3.MetricsV1Beta3Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.metricsV1Beta3Stub, undefined); + await client.initialize(); + assert(client.metricsV1Beta3Stub); + }); + + it('has close method for the initialized client', done => { + const client = new metricsv1beta3Module.v1beta3.MetricsV1Beta3Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.metricsV1Beta3Stub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new metricsv1beta3Module.v1beta3.MetricsV1Beta3Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.metricsV1Beta3Stub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new metricsv1beta3Module.v1beta3.MetricsV1Beta3Client({ + 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 metricsv1beta3Module.v1beta3.MetricsV1Beta3Client({ + 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('getJobMetrics', () => { + it('invokes getJobMetrics without error', async () => { + const client = new metricsv1beta3Module.v1beta3.MetricsV1Beta3Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.dataflow.v1beta3.GetJobMetricsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.dataflow.v1beta3.GetJobMetricsRequest', + ['projectId'] + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.dataflow.v1beta3.GetJobMetricsRequest', + ['location'] + ); + request.location = defaultValue2; + const defaultValue3 = getTypeDefaultValue( + '.google.dataflow.v1beta3.GetJobMetricsRequest', + ['jobId'] + ); + request.jobId = defaultValue3; + const expectedHeaderRequestParams = `project_id=${defaultValue1}&location=${defaultValue2}&job_id=${defaultValue3}`; + const expectedResponse = generateSampleMessage( + new protos.google.dataflow.v1beta3.JobMetrics() + ); + client.innerApiCalls.getJobMetrics = stubSimpleCall(expectedResponse); + const [response] = await client.getJobMetrics(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getJobMetrics as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getJobMetrics as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getJobMetrics without error using callback', async () => { + const client = new metricsv1beta3Module.v1beta3.MetricsV1Beta3Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.dataflow.v1beta3.GetJobMetricsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.dataflow.v1beta3.GetJobMetricsRequest', + ['projectId'] + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.dataflow.v1beta3.GetJobMetricsRequest', + ['location'] + ); + request.location = defaultValue2; + const defaultValue3 = getTypeDefaultValue( + '.google.dataflow.v1beta3.GetJobMetricsRequest', + ['jobId'] + ); + request.jobId = defaultValue3; + const expectedHeaderRequestParams = `project_id=${defaultValue1}&location=${defaultValue2}&job_id=${defaultValue3}`; + const expectedResponse = generateSampleMessage( + new protos.google.dataflow.v1beta3.JobMetrics() + ); + client.innerApiCalls.getJobMetrics = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getJobMetrics( + request, + ( + err?: Error | null, + result?: protos.google.dataflow.v1beta3.IJobMetrics | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getJobMetrics as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getJobMetrics as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getJobMetrics with error', async () => { + const client = new metricsv1beta3Module.v1beta3.MetricsV1Beta3Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.dataflow.v1beta3.GetJobMetricsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.dataflow.v1beta3.GetJobMetricsRequest', + ['projectId'] + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.dataflow.v1beta3.GetJobMetricsRequest', + ['location'] + ); + request.location = defaultValue2; + const defaultValue3 = getTypeDefaultValue( + '.google.dataflow.v1beta3.GetJobMetricsRequest', + ['jobId'] + ); + request.jobId = defaultValue3; + const expectedHeaderRequestParams = `project_id=${defaultValue1}&location=${defaultValue2}&job_id=${defaultValue3}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getJobMetrics = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getJobMetrics(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getJobMetrics as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getJobMetrics as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getJobMetrics with closed client', async () => { + const client = new metricsv1beta3Module.v1beta3.MetricsV1Beta3Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.dataflow.v1beta3.GetJobMetricsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.dataflow.v1beta3.GetJobMetricsRequest', + ['projectId'] + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.dataflow.v1beta3.GetJobMetricsRequest', + ['location'] + ); + request.location = defaultValue2; + const defaultValue3 = getTypeDefaultValue( + '.google.dataflow.v1beta3.GetJobMetricsRequest', + ['jobId'] + ); + request.jobId = defaultValue3; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getJobMetrics(request), expectedError); + }); + }); + + describe('getJobExecutionDetails', () => { + it('invokes getJobExecutionDetails without error', async () => { + const client = new metricsv1beta3Module.v1beta3.MetricsV1Beta3Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.dataflow.v1beta3.GetJobExecutionDetailsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.dataflow.v1beta3.GetJobExecutionDetailsRequest', + ['projectId'] + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.dataflow.v1beta3.GetJobExecutionDetailsRequest', + ['location'] + ); + request.location = defaultValue2; + const defaultValue3 = getTypeDefaultValue( + '.google.dataflow.v1beta3.GetJobExecutionDetailsRequest', + ['jobId'] + ); + request.jobId = defaultValue3; + const expectedHeaderRequestParams = `project_id=${defaultValue1}&location=${defaultValue2}&job_id=${defaultValue3}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.dataflow.v1beta3.StageSummary() + ), + generateSampleMessage( + new protos.google.dataflow.v1beta3.StageSummary() + ), + generateSampleMessage( + new protos.google.dataflow.v1beta3.StageSummary() + ), + ]; + client.innerApiCalls.getJobExecutionDetails = + stubSimpleCall(expectedResponse); + const [response] = await client.getJobExecutionDetails(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getJobExecutionDetails as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getJobExecutionDetails as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getJobExecutionDetails without error using callback', async () => { + const client = new metricsv1beta3Module.v1beta3.MetricsV1Beta3Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.dataflow.v1beta3.GetJobExecutionDetailsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.dataflow.v1beta3.GetJobExecutionDetailsRequest', + ['projectId'] + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.dataflow.v1beta3.GetJobExecutionDetailsRequest', + ['location'] + ); + request.location = defaultValue2; + const defaultValue3 = getTypeDefaultValue( + '.google.dataflow.v1beta3.GetJobExecutionDetailsRequest', + ['jobId'] + ); + request.jobId = defaultValue3; + const expectedHeaderRequestParams = `project_id=${defaultValue1}&location=${defaultValue2}&job_id=${defaultValue3}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.dataflow.v1beta3.StageSummary() + ), + generateSampleMessage( + new protos.google.dataflow.v1beta3.StageSummary() + ), + generateSampleMessage( + new protos.google.dataflow.v1beta3.StageSummary() + ), + ]; + client.innerApiCalls.getJobExecutionDetails = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getJobExecutionDetails( + request, + ( + err?: Error | null, + result?: protos.google.dataflow.v1beta3.IStageSummary[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getJobExecutionDetails as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getJobExecutionDetails as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getJobExecutionDetails with error', async () => { + const client = new metricsv1beta3Module.v1beta3.MetricsV1Beta3Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.dataflow.v1beta3.GetJobExecutionDetailsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.dataflow.v1beta3.GetJobExecutionDetailsRequest', + ['projectId'] + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.dataflow.v1beta3.GetJobExecutionDetailsRequest', + ['location'] + ); + request.location = defaultValue2; + const defaultValue3 = getTypeDefaultValue( + '.google.dataflow.v1beta3.GetJobExecutionDetailsRequest', + ['jobId'] + ); + request.jobId = defaultValue3; + const expectedHeaderRequestParams = `project_id=${defaultValue1}&location=${defaultValue2}&job_id=${defaultValue3}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getJobExecutionDetails = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.getJobExecutionDetails(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.getJobExecutionDetails as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getJobExecutionDetails as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getJobExecutionDetailsStream without error', async () => { + const client = new metricsv1beta3Module.v1beta3.MetricsV1Beta3Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.dataflow.v1beta3.GetJobExecutionDetailsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.dataflow.v1beta3.GetJobExecutionDetailsRequest', + ['projectId'] + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.dataflow.v1beta3.GetJobExecutionDetailsRequest', + ['location'] + ); + request.location = defaultValue2; + const defaultValue3 = getTypeDefaultValue( + '.google.dataflow.v1beta3.GetJobExecutionDetailsRequest', + ['jobId'] + ); + request.jobId = defaultValue3; + const expectedHeaderRequestParams = `project_id=${defaultValue1}&location=${defaultValue2}&job_id=${defaultValue3}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.dataflow.v1beta3.StageSummary() + ), + generateSampleMessage( + new protos.google.dataflow.v1beta3.StageSummary() + ), + generateSampleMessage( + new protos.google.dataflow.v1beta3.StageSummary() + ), + ]; + client.descriptors.page.getJobExecutionDetails.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.getJobExecutionDetailsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.dataflow.v1beta3.StageSummary[] = []; + stream.on( + 'data', + (response: protos.google.dataflow.v1beta3.StageSummary) => { + 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.getJobExecutionDetails + .createStream as SinonStub + ) + .getCall(0) + .calledWith(client.innerApiCalls.getJobExecutionDetails, request) + ); + assert( + ( + client.descriptors.page.getJobExecutionDetails + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes getJobExecutionDetailsStream with error', async () => { + const client = new metricsv1beta3Module.v1beta3.MetricsV1Beta3Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.dataflow.v1beta3.GetJobExecutionDetailsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.dataflow.v1beta3.GetJobExecutionDetailsRequest', + ['projectId'] + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.dataflow.v1beta3.GetJobExecutionDetailsRequest', + ['location'] + ); + request.location = defaultValue2; + const defaultValue3 = getTypeDefaultValue( + '.google.dataflow.v1beta3.GetJobExecutionDetailsRequest', + ['jobId'] + ); + request.jobId = defaultValue3; + const expectedHeaderRequestParams = `project_id=${defaultValue1}&location=${defaultValue2}&job_id=${defaultValue3}`; + const expectedError = new Error('expected'); + client.descriptors.page.getJobExecutionDetails.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.getJobExecutionDetailsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.dataflow.v1beta3.StageSummary[] = []; + stream.on( + 'data', + (response: protos.google.dataflow.v1beta3.StageSummary) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + ( + client.descriptors.page.getJobExecutionDetails + .createStream as SinonStub + ) + .getCall(0) + .calledWith(client.innerApiCalls.getJobExecutionDetails, request) + ); + assert( + ( + client.descriptors.page.getJobExecutionDetails + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with getJobExecutionDetails without error', async () => { + const client = new metricsv1beta3Module.v1beta3.MetricsV1Beta3Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.dataflow.v1beta3.GetJobExecutionDetailsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.dataflow.v1beta3.GetJobExecutionDetailsRequest', + ['projectId'] + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.dataflow.v1beta3.GetJobExecutionDetailsRequest', + ['location'] + ); + request.location = defaultValue2; + const defaultValue3 = getTypeDefaultValue( + '.google.dataflow.v1beta3.GetJobExecutionDetailsRequest', + ['jobId'] + ); + request.jobId = defaultValue3; + const expectedHeaderRequestParams = `project_id=${defaultValue1}&location=${defaultValue2}&job_id=${defaultValue3}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.dataflow.v1beta3.StageSummary() + ), + generateSampleMessage( + new protos.google.dataflow.v1beta3.StageSummary() + ), + generateSampleMessage( + new protos.google.dataflow.v1beta3.StageSummary() + ), + ]; + client.descriptors.page.getJobExecutionDetails.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.dataflow.v1beta3.IStageSummary[] = []; + const iterable = client.getJobExecutionDetailsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.getJobExecutionDetails + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.descriptors.page.getJobExecutionDetails + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with getJobExecutionDetails with error', async () => { + const client = new metricsv1beta3Module.v1beta3.MetricsV1Beta3Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.dataflow.v1beta3.GetJobExecutionDetailsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.dataflow.v1beta3.GetJobExecutionDetailsRequest', + ['projectId'] + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.dataflow.v1beta3.GetJobExecutionDetailsRequest', + ['location'] + ); + request.location = defaultValue2; + const defaultValue3 = getTypeDefaultValue( + '.google.dataflow.v1beta3.GetJobExecutionDetailsRequest', + ['jobId'] + ); + request.jobId = defaultValue3; + const expectedHeaderRequestParams = `project_id=${defaultValue1}&location=${defaultValue2}&job_id=${defaultValue3}`; + const expectedError = new Error('expected'); + client.descriptors.page.getJobExecutionDetails.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.getJobExecutionDetailsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.dataflow.v1beta3.IStageSummary[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.getJobExecutionDetails + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.descriptors.page.getJobExecutionDetails + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('getStageExecutionDetails', () => { + it('invokes getStageExecutionDetails without error', async () => { + const client = new metricsv1beta3Module.v1beta3.MetricsV1Beta3Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.dataflow.v1beta3.GetStageExecutionDetailsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.dataflow.v1beta3.GetStageExecutionDetailsRequest', + ['projectId'] + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.dataflow.v1beta3.GetStageExecutionDetailsRequest', + ['location'] + ); + request.location = defaultValue2; + const defaultValue3 = getTypeDefaultValue( + '.google.dataflow.v1beta3.GetStageExecutionDetailsRequest', + ['jobId'] + ); + request.jobId = defaultValue3; + const defaultValue4 = getTypeDefaultValue( + '.google.dataflow.v1beta3.GetStageExecutionDetailsRequest', + ['stageId'] + ); + request.stageId = defaultValue4; + const expectedHeaderRequestParams = `project_id=${defaultValue1}&location=${defaultValue2}&job_id=${defaultValue3}&stage_id=${defaultValue4}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.dataflow.v1beta3.WorkerDetails() + ), + generateSampleMessage( + new protos.google.dataflow.v1beta3.WorkerDetails() + ), + generateSampleMessage( + new protos.google.dataflow.v1beta3.WorkerDetails() + ), + ]; + client.innerApiCalls.getStageExecutionDetails = + stubSimpleCall(expectedResponse); + const [response] = await client.getStageExecutionDetails(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getStageExecutionDetails as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getStageExecutionDetails as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getStageExecutionDetails without error using callback', async () => { + const client = new metricsv1beta3Module.v1beta3.MetricsV1Beta3Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.dataflow.v1beta3.GetStageExecutionDetailsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.dataflow.v1beta3.GetStageExecutionDetailsRequest', + ['projectId'] + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.dataflow.v1beta3.GetStageExecutionDetailsRequest', + ['location'] + ); + request.location = defaultValue2; + const defaultValue3 = getTypeDefaultValue( + '.google.dataflow.v1beta3.GetStageExecutionDetailsRequest', + ['jobId'] + ); + request.jobId = defaultValue3; + const defaultValue4 = getTypeDefaultValue( + '.google.dataflow.v1beta3.GetStageExecutionDetailsRequest', + ['stageId'] + ); + request.stageId = defaultValue4; + const expectedHeaderRequestParams = `project_id=${defaultValue1}&location=${defaultValue2}&job_id=${defaultValue3}&stage_id=${defaultValue4}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.dataflow.v1beta3.WorkerDetails() + ), + generateSampleMessage( + new protos.google.dataflow.v1beta3.WorkerDetails() + ), + generateSampleMessage( + new protos.google.dataflow.v1beta3.WorkerDetails() + ), + ]; + client.innerApiCalls.getStageExecutionDetails = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getStageExecutionDetails( + request, + ( + err?: Error | null, + result?: protos.google.dataflow.v1beta3.IWorkerDetails[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getStageExecutionDetails as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getStageExecutionDetails as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getStageExecutionDetails with error', async () => { + const client = new metricsv1beta3Module.v1beta3.MetricsV1Beta3Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.dataflow.v1beta3.GetStageExecutionDetailsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.dataflow.v1beta3.GetStageExecutionDetailsRequest', + ['projectId'] + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.dataflow.v1beta3.GetStageExecutionDetailsRequest', + ['location'] + ); + request.location = defaultValue2; + const defaultValue3 = getTypeDefaultValue( + '.google.dataflow.v1beta3.GetStageExecutionDetailsRequest', + ['jobId'] + ); + request.jobId = defaultValue3; + const defaultValue4 = getTypeDefaultValue( + '.google.dataflow.v1beta3.GetStageExecutionDetailsRequest', + ['stageId'] + ); + request.stageId = defaultValue4; + const expectedHeaderRequestParams = `project_id=${defaultValue1}&location=${defaultValue2}&job_id=${defaultValue3}&stage_id=${defaultValue4}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getStageExecutionDetails = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.getStageExecutionDetails(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.getStageExecutionDetails as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getStageExecutionDetails as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getStageExecutionDetailsStream without error', async () => { + const client = new metricsv1beta3Module.v1beta3.MetricsV1Beta3Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.dataflow.v1beta3.GetStageExecutionDetailsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.dataflow.v1beta3.GetStageExecutionDetailsRequest', + ['projectId'] + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.dataflow.v1beta3.GetStageExecutionDetailsRequest', + ['location'] + ); + request.location = defaultValue2; + const defaultValue3 = getTypeDefaultValue( + '.google.dataflow.v1beta3.GetStageExecutionDetailsRequest', + ['jobId'] + ); + request.jobId = defaultValue3; + const defaultValue4 = getTypeDefaultValue( + '.google.dataflow.v1beta3.GetStageExecutionDetailsRequest', + ['stageId'] + ); + request.stageId = defaultValue4; + const expectedHeaderRequestParams = `project_id=${defaultValue1}&location=${defaultValue2}&job_id=${defaultValue3}&stage_id=${defaultValue4}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.dataflow.v1beta3.WorkerDetails() + ), + generateSampleMessage( + new protos.google.dataflow.v1beta3.WorkerDetails() + ), + generateSampleMessage( + new protos.google.dataflow.v1beta3.WorkerDetails() + ), + ]; + client.descriptors.page.getStageExecutionDetails.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.getStageExecutionDetailsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.dataflow.v1beta3.WorkerDetails[] = []; + stream.on( + 'data', + (response: protos.google.dataflow.v1beta3.WorkerDetails) => { + 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.getStageExecutionDetails + .createStream as SinonStub + ) + .getCall(0) + .calledWith(client.innerApiCalls.getStageExecutionDetails, request) + ); + assert( + ( + client.descriptors.page.getStageExecutionDetails + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes getStageExecutionDetailsStream with error', async () => { + const client = new metricsv1beta3Module.v1beta3.MetricsV1Beta3Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.dataflow.v1beta3.GetStageExecutionDetailsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.dataflow.v1beta3.GetStageExecutionDetailsRequest', + ['projectId'] + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.dataflow.v1beta3.GetStageExecutionDetailsRequest', + ['location'] + ); + request.location = defaultValue2; + const defaultValue3 = getTypeDefaultValue( + '.google.dataflow.v1beta3.GetStageExecutionDetailsRequest', + ['jobId'] + ); + request.jobId = defaultValue3; + const defaultValue4 = getTypeDefaultValue( + '.google.dataflow.v1beta3.GetStageExecutionDetailsRequest', + ['stageId'] + ); + request.stageId = defaultValue4; + const expectedHeaderRequestParams = `project_id=${defaultValue1}&location=${defaultValue2}&job_id=${defaultValue3}&stage_id=${defaultValue4}`; + const expectedError = new Error('expected'); + client.descriptors.page.getStageExecutionDetails.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.getStageExecutionDetailsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.dataflow.v1beta3.WorkerDetails[] = []; + stream.on( + 'data', + (response: protos.google.dataflow.v1beta3.WorkerDetails) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + ( + client.descriptors.page.getStageExecutionDetails + .createStream as SinonStub + ) + .getCall(0) + .calledWith(client.innerApiCalls.getStageExecutionDetails, request) + ); + assert( + ( + client.descriptors.page.getStageExecutionDetails + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with getStageExecutionDetails without error', async () => { + const client = new metricsv1beta3Module.v1beta3.MetricsV1Beta3Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.dataflow.v1beta3.GetStageExecutionDetailsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.dataflow.v1beta3.GetStageExecutionDetailsRequest', + ['projectId'] + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.dataflow.v1beta3.GetStageExecutionDetailsRequest', + ['location'] + ); + request.location = defaultValue2; + const defaultValue3 = getTypeDefaultValue( + '.google.dataflow.v1beta3.GetStageExecutionDetailsRequest', + ['jobId'] + ); + request.jobId = defaultValue3; + const defaultValue4 = getTypeDefaultValue( + '.google.dataflow.v1beta3.GetStageExecutionDetailsRequest', + ['stageId'] + ); + request.stageId = defaultValue4; + const expectedHeaderRequestParams = `project_id=${defaultValue1}&location=${defaultValue2}&job_id=${defaultValue3}&stage_id=${defaultValue4}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.dataflow.v1beta3.WorkerDetails() + ), + generateSampleMessage( + new protos.google.dataflow.v1beta3.WorkerDetails() + ), + generateSampleMessage( + new protos.google.dataflow.v1beta3.WorkerDetails() + ), + ]; + client.descriptors.page.getStageExecutionDetails.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.dataflow.v1beta3.IWorkerDetails[] = []; + const iterable = client.getStageExecutionDetailsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.getStageExecutionDetails + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.descriptors.page.getStageExecutionDetails + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with getStageExecutionDetails with error', async () => { + const client = new metricsv1beta3Module.v1beta3.MetricsV1Beta3Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.dataflow.v1beta3.GetStageExecutionDetailsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.dataflow.v1beta3.GetStageExecutionDetailsRequest', + ['projectId'] + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.dataflow.v1beta3.GetStageExecutionDetailsRequest', + ['location'] + ); + request.location = defaultValue2; + const defaultValue3 = getTypeDefaultValue( + '.google.dataflow.v1beta3.GetStageExecutionDetailsRequest', + ['jobId'] + ); + request.jobId = defaultValue3; + const defaultValue4 = getTypeDefaultValue( + '.google.dataflow.v1beta3.GetStageExecutionDetailsRequest', + ['stageId'] + ); + request.stageId = defaultValue4; + const expectedHeaderRequestParams = `project_id=${defaultValue1}&location=${defaultValue2}&job_id=${defaultValue3}&stage_id=${defaultValue4}`; + const expectedError = new Error('expected'); + client.descriptors.page.getStageExecutionDetails.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.getStageExecutionDetailsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.dataflow.v1beta3.IWorkerDetails[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.getStageExecutionDetails + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.descriptors.page.getStageExecutionDetails + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); +}); diff --git a/packages/google-dataflow/test/gapic_snapshots_v1_beta3_v1beta3.ts b/packages/google-dataflow/test/gapic_snapshots_v1_beta3_v1beta3.ts new file mode 100644 index 00000000000..7665e416c13 --- /dev/null +++ b/packages/google-dataflow/test/gapic_snapshots_v1_beta3_v1beta3.ts @@ -0,0 +1,677 @@ +// 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 snapshotsv1beta3Module from '../src'; + +import {protobuf} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON( + require('../protos/protos.json') +).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = ( + instance.constructor as typeof protobuf.Message + ).toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject( + filledObject + ) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error + ? sinon.stub().rejects(error) + : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback( + response?: ResponseType, + error?: Error +) { + return error + ? sinon.stub().callsArgWith(2, error) + : sinon.stub().callsArgWith(2, null, response); +} + +describe('v1beta3.SnapshotsV1Beta3Client', () => { + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = + snapshotsv1beta3Module.v1beta3.SnapshotsV1Beta3Client.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + snapshotsv1beta3Module.v1beta3.SnapshotsV1Beta3Client.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = snapshotsv1beta3Module.v1beta3.SnapshotsV1Beta3Client.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = + new snapshotsv1beta3Module.v1beta3.SnapshotsV1Beta3Client(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new snapshotsv1beta3Module.v1beta3.SnapshotsV1Beta3Client({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new snapshotsv1beta3Module.v1beta3.SnapshotsV1Beta3Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.snapshotsV1Beta3Stub, undefined); + await client.initialize(); + assert(client.snapshotsV1Beta3Stub); + }); + + it('has close method for the initialized client', done => { + const client = new snapshotsv1beta3Module.v1beta3.SnapshotsV1Beta3Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.snapshotsV1Beta3Stub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new snapshotsv1beta3Module.v1beta3.SnapshotsV1Beta3Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.snapshotsV1Beta3Stub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new snapshotsv1beta3Module.v1beta3.SnapshotsV1Beta3Client({ + 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 snapshotsv1beta3Module.v1beta3.SnapshotsV1Beta3Client({ + 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('getSnapshot', () => { + it('invokes getSnapshot without error', async () => { + const client = new snapshotsv1beta3Module.v1beta3.SnapshotsV1Beta3Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.dataflow.v1beta3.GetSnapshotRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.dataflow.v1beta3.GetSnapshotRequest', + ['projectId'] + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.dataflow.v1beta3.GetSnapshotRequest', + ['location'] + ); + request.location = defaultValue2; + const defaultValue3 = getTypeDefaultValue( + '.google.dataflow.v1beta3.GetSnapshotRequest', + ['snapshotId'] + ); + request.snapshotId = defaultValue3; + const expectedHeaderRequestParams = `project_id=${defaultValue1}&location=${defaultValue2}&snapshot_id=${defaultValue3}`; + const expectedResponse = generateSampleMessage( + new protos.google.dataflow.v1beta3.Snapshot() + ); + client.innerApiCalls.getSnapshot = stubSimpleCall(expectedResponse); + const [response] = await client.getSnapshot(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getSnapshot as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getSnapshot as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getSnapshot without error using callback', async () => { + const client = new snapshotsv1beta3Module.v1beta3.SnapshotsV1Beta3Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.dataflow.v1beta3.GetSnapshotRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.dataflow.v1beta3.GetSnapshotRequest', + ['projectId'] + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.dataflow.v1beta3.GetSnapshotRequest', + ['location'] + ); + request.location = defaultValue2; + const defaultValue3 = getTypeDefaultValue( + '.google.dataflow.v1beta3.GetSnapshotRequest', + ['snapshotId'] + ); + request.snapshotId = defaultValue3; + const expectedHeaderRequestParams = `project_id=${defaultValue1}&location=${defaultValue2}&snapshot_id=${defaultValue3}`; + const expectedResponse = generateSampleMessage( + new protos.google.dataflow.v1beta3.Snapshot() + ); + client.innerApiCalls.getSnapshot = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getSnapshot( + request, + ( + err?: Error | null, + result?: protos.google.dataflow.v1beta3.ISnapshot | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getSnapshot as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getSnapshot as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getSnapshot with error', async () => { + const client = new snapshotsv1beta3Module.v1beta3.SnapshotsV1Beta3Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.dataflow.v1beta3.GetSnapshotRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.dataflow.v1beta3.GetSnapshotRequest', + ['projectId'] + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.dataflow.v1beta3.GetSnapshotRequest', + ['location'] + ); + request.location = defaultValue2; + const defaultValue3 = getTypeDefaultValue( + '.google.dataflow.v1beta3.GetSnapshotRequest', + ['snapshotId'] + ); + request.snapshotId = defaultValue3; + const expectedHeaderRequestParams = `project_id=${defaultValue1}&location=${defaultValue2}&snapshot_id=${defaultValue3}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getSnapshot = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getSnapshot(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getSnapshot as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getSnapshot as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getSnapshot with closed client', async () => { + const client = new snapshotsv1beta3Module.v1beta3.SnapshotsV1Beta3Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.dataflow.v1beta3.GetSnapshotRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.dataflow.v1beta3.GetSnapshotRequest', + ['projectId'] + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.dataflow.v1beta3.GetSnapshotRequest', + ['location'] + ); + request.location = defaultValue2; + const defaultValue3 = getTypeDefaultValue( + '.google.dataflow.v1beta3.GetSnapshotRequest', + ['snapshotId'] + ); + request.snapshotId = defaultValue3; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getSnapshot(request), expectedError); + }); + }); + + describe('deleteSnapshot', () => { + it('invokes deleteSnapshot without error', async () => { + const client = new snapshotsv1beta3Module.v1beta3.SnapshotsV1Beta3Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.dataflow.v1beta3.DeleteSnapshotRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.dataflow.v1beta3.DeleteSnapshotRequest', + ['projectId'] + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.dataflow.v1beta3.DeleteSnapshotRequest', + ['location'] + ); + request.location = defaultValue2; + const defaultValue3 = getTypeDefaultValue( + '.google.dataflow.v1beta3.DeleteSnapshotRequest', + ['snapshotId'] + ); + request.snapshotId = defaultValue3; + const expectedHeaderRequestParams = `project_id=${defaultValue1}&location=${defaultValue2}&snapshot_id=${defaultValue3}`; + const expectedResponse = generateSampleMessage( + new protos.google.dataflow.v1beta3.DeleteSnapshotResponse() + ); + client.innerApiCalls.deleteSnapshot = stubSimpleCall(expectedResponse); + const [response] = await client.deleteSnapshot(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteSnapshot as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteSnapshot as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteSnapshot without error using callback', async () => { + const client = new snapshotsv1beta3Module.v1beta3.SnapshotsV1Beta3Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.dataflow.v1beta3.DeleteSnapshotRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.dataflow.v1beta3.DeleteSnapshotRequest', + ['projectId'] + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.dataflow.v1beta3.DeleteSnapshotRequest', + ['location'] + ); + request.location = defaultValue2; + const defaultValue3 = getTypeDefaultValue( + '.google.dataflow.v1beta3.DeleteSnapshotRequest', + ['snapshotId'] + ); + request.snapshotId = defaultValue3; + const expectedHeaderRequestParams = `project_id=${defaultValue1}&location=${defaultValue2}&snapshot_id=${defaultValue3}`; + const expectedResponse = generateSampleMessage( + new protos.google.dataflow.v1beta3.DeleteSnapshotResponse() + ); + client.innerApiCalls.deleteSnapshot = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteSnapshot( + request, + ( + err?: Error | null, + result?: protos.google.dataflow.v1beta3.IDeleteSnapshotResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteSnapshot as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteSnapshot as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteSnapshot with error', async () => { + const client = new snapshotsv1beta3Module.v1beta3.SnapshotsV1Beta3Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.dataflow.v1beta3.DeleteSnapshotRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.dataflow.v1beta3.DeleteSnapshotRequest', + ['projectId'] + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.dataflow.v1beta3.DeleteSnapshotRequest', + ['location'] + ); + request.location = defaultValue2; + const defaultValue3 = getTypeDefaultValue( + '.google.dataflow.v1beta3.DeleteSnapshotRequest', + ['snapshotId'] + ); + request.snapshotId = defaultValue3; + const expectedHeaderRequestParams = `project_id=${defaultValue1}&location=${defaultValue2}&snapshot_id=${defaultValue3}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteSnapshot = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteSnapshot(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteSnapshot as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteSnapshot as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteSnapshot with closed client', async () => { + const client = new snapshotsv1beta3Module.v1beta3.SnapshotsV1Beta3Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.dataflow.v1beta3.DeleteSnapshotRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.dataflow.v1beta3.DeleteSnapshotRequest', + ['projectId'] + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.dataflow.v1beta3.DeleteSnapshotRequest', + ['location'] + ); + request.location = defaultValue2; + const defaultValue3 = getTypeDefaultValue( + '.google.dataflow.v1beta3.DeleteSnapshotRequest', + ['snapshotId'] + ); + request.snapshotId = defaultValue3; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteSnapshot(request), expectedError); + }); + }); + + describe('listSnapshots', () => { + it('invokes listSnapshots without error', async () => { + const client = new snapshotsv1beta3Module.v1beta3.SnapshotsV1Beta3Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.dataflow.v1beta3.ListSnapshotsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.dataflow.v1beta3.ListSnapshotsRequest', + ['projectId'] + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.dataflow.v1beta3.ListSnapshotsRequest', + ['location'] + ); + request.location = defaultValue2; + const defaultValue3 = getTypeDefaultValue( + '.google.dataflow.v1beta3.ListSnapshotsRequest', + ['jobId'] + ); + request.jobId = defaultValue3; + const expectedHeaderRequestParams = `project_id=${defaultValue1}&location=${defaultValue2}&job_id=${defaultValue3}`; + const expectedResponse = generateSampleMessage( + new protos.google.dataflow.v1beta3.ListSnapshotsResponse() + ); + client.innerApiCalls.listSnapshots = stubSimpleCall(expectedResponse); + const [response] = await client.listSnapshots(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listSnapshots as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listSnapshots as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSnapshots without error using callback', async () => { + const client = new snapshotsv1beta3Module.v1beta3.SnapshotsV1Beta3Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.dataflow.v1beta3.ListSnapshotsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.dataflow.v1beta3.ListSnapshotsRequest', + ['projectId'] + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.dataflow.v1beta3.ListSnapshotsRequest', + ['location'] + ); + request.location = defaultValue2; + const defaultValue3 = getTypeDefaultValue( + '.google.dataflow.v1beta3.ListSnapshotsRequest', + ['jobId'] + ); + request.jobId = defaultValue3; + const expectedHeaderRequestParams = `project_id=${defaultValue1}&location=${defaultValue2}&job_id=${defaultValue3}`; + const expectedResponse = generateSampleMessage( + new protos.google.dataflow.v1beta3.ListSnapshotsResponse() + ); + client.innerApiCalls.listSnapshots = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listSnapshots( + request, + ( + err?: Error | null, + result?: protos.google.dataflow.v1beta3.IListSnapshotsResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listSnapshots as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listSnapshots as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSnapshots with error', async () => { + const client = new snapshotsv1beta3Module.v1beta3.SnapshotsV1Beta3Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.dataflow.v1beta3.ListSnapshotsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.dataflow.v1beta3.ListSnapshotsRequest', + ['projectId'] + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.dataflow.v1beta3.ListSnapshotsRequest', + ['location'] + ); + request.location = defaultValue2; + const defaultValue3 = getTypeDefaultValue( + '.google.dataflow.v1beta3.ListSnapshotsRequest', + ['jobId'] + ); + request.jobId = defaultValue3; + const expectedHeaderRequestParams = `project_id=${defaultValue1}&location=${defaultValue2}&job_id=${defaultValue3}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listSnapshots = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listSnapshots(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listSnapshots as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listSnapshots as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSnapshots with closed client', async () => { + const client = new snapshotsv1beta3Module.v1beta3.SnapshotsV1Beta3Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.dataflow.v1beta3.ListSnapshotsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.dataflow.v1beta3.ListSnapshotsRequest', + ['projectId'] + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.dataflow.v1beta3.ListSnapshotsRequest', + ['location'] + ); + request.location = defaultValue2; + const defaultValue3 = getTypeDefaultValue( + '.google.dataflow.v1beta3.ListSnapshotsRequest', + ['jobId'] + ); + request.jobId = defaultValue3; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.listSnapshots(request), expectedError); + }); + }); +}); diff --git a/packages/google-dataflow/test/gapic_templates_service_v1beta3.ts b/packages/google-dataflow/test/gapic_templates_service_v1beta3.ts new file mode 100644 index 00000000000..4299eef0a0a --- /dev/null +++ b/packages/google-dataflow/test/gapic_templates_service_v1beta3.ts @@ -0,0 +1,624 @@ +// 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 templatesserviceModule from '../src'; + +import {protobuf} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON( + require('../protos/protos.json') +).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = ( + instance.constructor as typeof protobuf.Message + ).toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject( + filledObject + ) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error + ? sinon.stub().rejects(error) + : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback( + response?: ResponseType, + error?: Error +) { + return error + ? sinon.stub().callsArgWith(2, error) + : sinon.stub().callsArgWith(2, null, response); +} + +describe('v1beta3.TemplatesServiceClient', () => { + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = + templatesserviceModule.v1beta3.TemplatesServiceClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + templatesserviceModule.v1beta3.TemplatesServiceClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = templatesserviceModule.v1beta3.TemplatesServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = + new templatesserviceModule.v1beta3.TemplatesServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new templatesserviceModule.v1beta3.TemplatesServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new templatesserviceModule.v1beta3.TemplatesServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.templatesServiceStub, undefined); + await client.initialize(); + assert(client.templatesServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = new templatesserviceModule.v1beta3.TemplatesServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.templatesServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new templatesserviceModule.v1beta3.TemplatesServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.templatesServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new templatesserviceModule.v1beta3.TemplatesServiceClient({ + 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 templatesserviceModule.v1beta3.TemplatesServiceClient({ + 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('createJobFromTemplate', () => { + it('invokes createJobFromTemplate without error', async () => { + const client = new templatesserviceModule.v1beta3.TemplatesServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.dataflow.v1beta3.CreateJobFromTemplateRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.dataflow.v1beta3.CreateJobFromTemplateRequest', + ['projectId'] + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.dataflow.v1beta3.CreateJobFromTemplateRequest', + ['location'] + ); + request.location = defaultValue2; + const expectedHeaderRequestParams = `project_id=${defaultValue1}&location=${defaultValue2}`; + const expectedResponse = generateSampleMessage( + new protos.google.dataflow.v1beta3.Job() + ); + client.innerApiCalls.createJobFromTemplate = + stubSimpleCall(expectedResponse); + const [response] = await client.createJobFromTemplate(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createJobFromTemplate as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createJobFromTemplate as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createJobFromTemplate without error using callback', async () => { + const client = new templatesserviceModule.v1beta3.TemplatesServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.dataflow.v1beta3.CreateJobFromTemplateRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.dataflow.v1beta3.CreateJobFromTemplateRequest', + ['projectId'] + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.dataflow.v1beta3.CreateJobFromTemplateRequest', + ['location'] + ); + request.location = defaultValue2; + const expectedHeaderRequestParams = `project_id=${defaultValue1}&location=${defaultValue2}`; + const expectedResponse = generateSampleMessage( + new protos.google.dataflow.v1beta3.Job() + ); + client.innerApiCalls.createJobFromTemplate = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createJobFromTemplate( + request, + ( + err?: Error | null, + result?: protos.google.dataflow.v1beta3.IJob | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createJobFromTemplate as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createJobFromTemplate as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createJobFromTemplate with error', async () => { + const client = new templatesserviceModule.v1beta3.TemplatesServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.dataflow.v1beta3.CreateJobFromTemplateRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.dataflow.v1beta3.CreateJobFromTemplateRequest', + ['projectId'] + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.dataflow.v1beta3.CreateJobFromTemplateRequest', + ['location'] + ); + request.location = defaultValue2; + const expectedHeaderRequestParams = `project_id=${defaultValue1}&location=${defaultValue2}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createJobFromTemplate = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.createJobFromTemplate(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.createJobFromTemplate as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createJobFromTemplate as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createJobFromTemplate with closed client', async () => { + const client = new templatesserviceModule.v1beta3.TemplatesServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.dataflow.v1beta3.CreateJobFromTemplateRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.dataflow.v1beta3.CreateJobFromTemplateRequest', + ['projectId'] + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.dataflow.v1beta3.CreateJobFromTemplateRequest', + ['location'] + ); + request.location = defaultValue2; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.createJobFromTemplate(request), + expectedError + ); + }); + }); + + describe('launchTemplate', () => { + it('invokes launchTemplate without error', async () => { + const client = new templatesserviceModule.v1beta3.TemplatesServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.dataflow.v1beta3.LaunchTemplateRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.dataflow.v1beta3.LaunchTemplateRequest', + ['projectId'] + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.dataflow.v1beta3.LaunchTemplateRequest', + ['location'] + ); + request.location = defaultValue2; + const expectedHeaderRequestParams = `project_id=${defaultValue1}&location=${defaultValue2}`; + const expectedResponse = generateSampleMessage( + new protos.google.dataflow.v1beta3.LaunchTemplateResponse() + ); + client.innerApiCalls.launchTemplate = stubSimpleCall(expectedResponse); + const [response] = await client.launchTemplate(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.launchTemplate as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.launchTemplate as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes launchTemplate without error using callback', async () => { + const client = new templatesserviceModule.v1beta3.TemplatesServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.dataflow.v1beta3.LaunchTemplateRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.dataflow.v1beta3.LaunchTemplateRequest', + ['projectId'] + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.dataflow.v1beta3.LaunchTemplateRequest', + ['location'] + ); + request.location = defaultValue2; + const expectedHeaderRequestParams = `project_id=${defaultValue1}&location=${defaultValue2}`; + const expectedResponse = generateSampleMessage( + new protos.google.dataflow.v1beta3.LaunchTemplateResponse() + ); + client.innerApiCalls.launchTemplate = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.launchTemplate( + request, + ( + err?: Error | null, + result?: protos.google.dataflow.v1beta3.ILaunchTemplateResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.launchTemplate as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.launchTemplate as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes launchTemplate with error', async () => { + const client = new templatesserviceModule.v1beta3.TemplatesServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.dataflow.v1beta3.LaunchTemplateRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.dataflow.v1beta3.LaunchTemplateRequest', + ['projectId'] + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.dataflow.v1beta3.LaunchTemplateRequest', + ['location'] + ); + request.location = defaultValue2; + const expectedHeaderRequestParams = `project_id=${defaultValue1}&location=${defaultValue2}`; + const expectedError = new Error('expected'); + client.innerApiCalls.launchTemplate = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.launchTemplate(request), expectedError); + const actualRequest = ( + client.innerApiCalls.launchTemplate as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.launchTemplate as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes launchTemplate with closed client', async () => { + const client = new templatesserviceModule.v1beta3.TemplatesServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.dataflow.v1beta3.LaunchTemplateRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.dataflow.v1beta3.LaunchTemplateRequest', + ['projectId'] + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.dataflow.v1beta3.LaunchTemplateRequest', + ['location'] + ); + request.location = defaultValue2; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.launchTemplate(request), expectedError); + }); + }); + + describe('getTemplate', () => { + it('invokes getTemplate without error', async () => { + const client = new templatesserviceModule.v1beta3.TemplatesServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.dataflow.v1beta3.GetTemplateRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.dataflow.v1beta3.GetTemplateRequest', + ['projectId'] + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.dataflow.v1beta3.GetTemplateRequest', + ['location'] + ); + request.location = defaultValue2; + const expectedHeaderRequestParams = `project_id=${defaultValue1}&location=${defaultValue2}`; + const expectedResponse = generateSampleMessage( + new protos.google.dataflow.v1beta3.GetTemplateResponse() + ); + client.innerApiCalls.getTemplate = stubSimpleCall(expectedResponse); + const [response] = await client.getTemplate(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getTemplate as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getTemplate as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getTemplate without error using callback', async () => { + const client = new templatesserviceModule.v1beta3.TemplatesServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.dataflow.v1beta3.GetTemplateRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.dataflow.v1beta3.GetTemplateRequest', + ['projectId'] + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.dataflow.v1beta3.GetTemplateRequest', + ['location'] + ); + request.location = defaultValue2; + const expectedHeaderRequestParams = `project_id=${defaultValue1}&location=${defaultValue2}`; + const expectedResponse = generateSampleMessage( + new protos.google.dataflow.v1beta3.GetTemplateResponse() + ); + client.innerApiCalls.getTemplate = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getTemplate( + request, + ( + err?: Error | null, + result?: protos.google.dataflow.v1beta3.IGetTemplateResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getTemplate as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getTemplate as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getTemplate with error', async () => { + const client = new templatesserviceModule.v1beta3.TemplatesServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.dataflow.v1beta3.GetTemplateRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.dataflow.v1beta3.GetTemplateRequest', + ['projectId'] + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.dataflow.v1beta3.GetTemplateRequest', + ['location'] + ); + request.location = defaultValue2; + const expectedHeaderRequestParams = `project_id=${defaultValue1}&location=${defaultValue2}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getTemplate = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getTemplate(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getTemplate as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getTemplate as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getTemplate with closed client', async () => { + const client = new templatesserviceModule.v1beta3.TemplatesServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.dataflow.v1beta3.GetTemplateRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.dataflow.v1beta3.GetTemplateRequest', + ['projectId'] + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.dataflow.v1beta3.GetTemplateRequest', + ['location'] + ); + request.location = defaultValue2; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getTemplate(request), expectedError); + }); + }); +}); diff --git a/packages/google-dataflow/tsconfig.json b/packages/google-dataflow/tsconfig.json new file mode 100644 index 00000000000..c78f1c884ef --- /dev/null +++ b/packages/google-dataflow/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-dataflow/webpack.config.js b/packages/google-dataflow/webpack.config.js new file mode 100644 index 00000000000..6445311cf58 --- /dev/null +++ b/packages/google-dataflow/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: 'FlexTemplatesService', + filename: './flex-templates-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', +};