diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 802614331d8..0e55ffd9a69 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -23,6 +23,7 @@ "packages/google-cloud-billing": "3.1.3", "packages/google-cloud-billing-budgets": "4.1.2", "packages/google-cloud-certificatemanager": "0.6.2", + "packages/google-cloud-clouddms": "2.1.2", "packages/google-cloud-contactcenterinsights": "2.1.2", "packages/google-cloud-channel": "2.2.0", "packages/google-cloud-contentwarehouse": "0.1.2", diff --git a/packages/google-cloud-clouddms/.OwlBot.yaml b/packages/google-cloud-clouddms/.OwlBot.yaml new file mode 100644 index 00000000000..5289f18d4c6 --- /dev/null +++ b/packages/google-cloud-clouddms/.OwlBot.yaml @@ -0,0 +1,20 @@ +# Copyright 2021 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +deep-remove-regex: + - /owl-bot-staging + +deep-copy-regex: + - source: /google/cloud/clouddms/(.*)/.*-nodejs + dest: /owl-bot-staging/google-cloud-clouddms/$1 diff --git a/packages/google-cloud-clouddms/.eslintignore b/packages/google-cloud-clouddms/.eslintignore new file mode 100644 index 00000000000..ea5b04aebe6 --- /dev/null +++ b/packages/google-cloud-clouddms/.eslintignore @@ -0,0 +1,7 @@ +**/node_modules +**/coverage +test/fixtures +build/ +docs/ +protos/ +samples/generated/ diff --git a/packages/google-cloud-clouddms/.eslintrc.json b/packages/google-cloud-clouddms/.eslintrc.json new file mode 100644 index 00000000000..78215349546 --- /dev/null +++ b/packages/google-cloud-clouddms/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "./node_modules/gts" +} diff --git a/packages/google-cloud-clouddms/.gitattributes b/packages/google-cloud-clouddms/.gitattributes new file mode 100644 index 00000000000..33739cb74e4 --- /dev/null +++ b/packages/google-cloud-clouddms/.gitattributes @@ -0,0 +1,4 @@ +*.ts text eol=lf +*.js text eol=lf +protos/* linguist-generated +**/api-extractor.json linguist-language=JSON-with-Comments diff --git a/packages/google-cloud-clouddms/.gitignore b/packages/google-cloud-clouddms/.gitignore new file mode 100644 index 00000000000..5d32b23782f --- /dev/null +++ b/packages/google-cloud-clouddms/.gitignore @@ -0,0 +1,14 @@ +**/*.log +**/node_modules +.coverage +coverage +.nyc_output +docs/ +out/ +build/ +system-test/secrets.js +system-test/*key.json +*.lock +.DS_Store +package-lock.json +__pycache__ diff --git a/packages/google-cloud-clouddms/.jsdoc.js b/packages/google-cloud-clouddms/.jsdoc.js new file mode 100644 index 00000000000..0c06b9149ea --- /dev/null +++ b/packages/google-cloud-clouddms/.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/dms', + theme: 'lumen', + default: { + outputSourceFiles: false + } + }, + markdown: { + idInHeadings: true + } +}; diff --git a/packages/google-cloud-clouddms/.mocharc.js b/packages/google-cloud-clouddms/.mocharc.js new file mode 100644 index 00000000000..cdb7b752160 --- /dev/null +++ b/packages/google-cloud-clouddms/.mocharc.js @@ -0,0 +1,29 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +const config = { + "enable-source-maps": true, + "throw-deprecation": true, + "timeout": 10000, + "recursive": true +} +if (process.env.MOCHA_THROW_DEPRECATION === 'false') { + delete config['throw-deprecation']; +} +if (process.env.MOCHA_REPORTER) { + config.reporter = process.env.MOCHA_REPORTER; +} +if (process.env.MOCHA_REPORTER_OUTPUT) { + config['reporter-option'] = `output=${process.env.MOCHA_REPORTER_OUTPUT}`; +} +module.exports = config diff --git a/packages/google-cloud-clouddms/.nycrc b/packages/google-cloud-clouddms/.nycrc new file mode 100644 index 00000000000..b18d5472b62 --- /dev/null +++ b/packages/google-cloud-clouddms/.nycrc @@ -0,0 +1,24 @@ +{ + "report-dir": "./.coverage", + "reporter": ["text", "lcov"], + "exclude": [ + "**/*-test", + "**/.coverage", + "**/apis", + "**/benchmark", + "**/conformance", + "**/docs", + "**/samples", + "**/scripts", + "**/protos", + "**/test", + "**/*.d.ts", + ".jsdoc.js", + "**/.jsdoc.js", + "karma.conf.js", + "webpack-tests.config.js", + "webpack.config.js" + ], + "exclude-after-remap": false, + "all": true +} diff --git a/packages/google-cloud-clouddms/.prettierignore b/packages/google-cloud-clouddms/.prettierignore new file mode 100644 index 00000000000..9340ad9b86d --- /dev/null +++ b/packages/google-cloud-clouddms/.prettierignore @@ -0,0 +1,6 @@ +**/node_modules +**/coverage +test/fixtures +build/ +docs/ +protos/ diff --git a/packages/google-cloud-clouddms/.prettierrc.js b/packages/google-cloud-clouddms/.prettierrc.js new file mode 100644 index 00000000000..d546a4ad546 --- /dev/null +++ b/packages/google-cloud-clouddms/.prettierrc.js @@ -0,0 +1,17 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +module.exports = { + ...require('gts/.prettierrc.json') +} diff --git a/packages/google-cloud-clouddms/.repo-metadata.json b/packages/google-cloud-clouddms/.repo-metadata.json new file mode 100644 index 00000000000..1576d826c1c --- /dev/null +++ b/packages/google-cloud-clouddms/.repo-metadata.json @@ -0,0 +1,17 @@ +{ + "name": "clouddms", + "aoi_shortname": "datamigration", + "name_pretty": "Cloud Database Migration Service", + "product_documentation": "https://cloud.google.com/database-migration/", + "client_documentation": "https://cloud.google.com/nodejs/docs/reference/dms/latest", + "issue_tracker": "https://github.com/googleapis/google-cloud-node/issues", + "release_level": "stable", + "language": "nodejs", + "repo": "googleapis/google-cloud-node", + "distribution_name": "@google-cloud/dms", + "api_id": "datamigration.googleapis.com", + "requires_billing": true, + "default_version": "v1", + "api_shortname": "dms", + "library_type": "GAPIC_AUTO" +} diff --git a/packages/google-cloud-clouddms/CHANGELOG.md b/packages/google-cloud-clouddms/CHANGELOG.md new file mode 100644 index 00000000000..fcc27cbfcbc --- /dev/null +++ b/packages/google-cloud-clouddms/CHANGELOG.md @@ -0,0 +1,94 @@ +# Changelog + +## [2.1.2](https://github.com/googleapis/nodejs-dms/compare/v2.1.1...v2.1.2) (2022-11-11) + + +### Bug Fixes + +* **deps:** Use google-gax v3.5.2 ([#115](https://github.com/googleapis/nodejs-dms/issues/115)) ([d260ba2](https://github.com/googleapis/nodejs-dms/commit/d260ba2ae215ed5f8fefc67c2208e3597aa3c90c)) +* Preserve default values in x-goog-request-params header ([#108](https://github.com/googleapis/nodejs-dms/issues/108)) ([78512f5](https://github.com/googleapis/nodejs-dms/commit/78512f56e32dd9758653220c5751dda5f03f9dab)) +* Regenerated protos JS and TS definitions ([#118](https://github.com/googleapis/nodejs-dms/issues/118)) ([64fdb51](https://github.com/googleapis/nodejs-dms/commit/64fdb51490a9b16182b20509710b637848a00409)) + +## [2.1.1](https://github.com/googleapis/nodejs-dms/compare/v2.1.0...v2.1.1) (2022-09-01) + + +### Bug Fixes + +* Allow passing gax instance to client constructor ([#107](https://github.com/googleapis/nodejs-dms/issues/107)) ([b90e1bf](https://github.com/googleapis/nodejs-dms/commit/b90e1bf394cfd86007241c8d786ddeca2bbd7178)) +* Better support for fallback mode ([#102](https://github.com/googleapis/nodejs-dms/issues/102)) ([8ac6651](https://github.com/googleapis/nodejs-dms/commit/8ac6651be4422f4cfa4d43aa0fa050e5c186627a)) +* Change import long to require ([#103](https://github.com/googleapis/nodejs-dms/issues/103)) ([0d7d555](https://github.com/googleapis/nodejs-dms/commit/0d7d55597c70bb6edc5f2dcaf7840fae4e8644a3)) +* Do not import the whole google-gax from proto JS ([#1553](https://github.com/googleapis/nodejs-dms/issues/1553)) ([#106](https://github.com/googleapis/nodejs-dms/issues/106)) ([9e7d8e4](https://github.com/googleapis/nodejs-dms/commit/9e7d8e46f989591ade8b06559516bd2c56f83658)) +* Remove pip install statements ([#1546](https://github.com/googleapis/nodejs-dms/issues/1546)) ([#105](https://github.com/googleapis/nodejs-dms/issues/105)) ([85ff0f7](https://github.com/googleapis/nodejs-dms/commit/85ff0f7da4a925d96b477faa6161bcf2b8244b51)) + +## [2.1.0](https://github.com/googleapis/nodejs-dms/compare/v2.0.0...v2.1.0) (2022-07-12) + + +### Features + +* support regapic LRO ([#97](https://github.com/googleapis/nodejs-dms/issues/97)) ([733c394](https://github.com/googleapis/nodejs-dms/commit/733c3940e86ca015fc61223a2ec0de41a25e4e89)) + +## [2.0.0](https://github.com/googleapis/nodejs-dms/compare/v1.1.0...v2.0.0) (2022-05-20) + + +### ⚠ BREAKING CHANGES + +* update library to use Node 12 (#90) + +### Build System + +* update library to use Node 12 ([#90](https://github.com/googleapis/nodejs-dms/issues/90)) ([168f46f](https://github.com/googleapis/nodejs-dms/commit/168f46f8314ff0b6ce59ca8e8236b26a98e923ab)) + +## [1.1.0](https://www.github.com/googleapis/nodejs-dms/compare/v1.0.5...v1.1.0) (2021-08-23) + + +### Features + +* turns on self-signed JWT feature flag ([#39](https://www.github.com/googleapis/nodejs-dms/issues/39)) ([ab31ef7](https://www.github.com/googleapis/nodejs-dms/commit/ab31ef7135716e3e304cf4988900ec59b0a77bef)) + +### [1.0.5](https://www.github.com/googleapis/nodejs-dms/compare/v1.0.4...v1.0.5) (2021-08-17) + + +### Bug Fixes + +* **deps:** google-gax v2.24.1 ([#37](https://www.github.com/googleapis/nodejs-dms/issues/37)) ([ee8483a](https://www.github.com/googleapis/nodejs-dms/commit/ee8483a069e32a189579d44423fd726e9731b2e9)) + +### [1.0.4](https://www.github.com/googleapis/nodejs-dms/compare/v1.0.3...v1.0.4) (2021-08-13) + + +### Bug Fixes + +* **build:** migrate to using main branch ([#35](https://www.github.com/googleapis/nodejs-dms/issues/35)) ([7a25f92](https://www.github.com/googleapis/nodejs-dms/commit/7a25f9251f1877877e79f4477c073952de29348e)) + +### [1.0.3](https://www.github.com/googleapis/nodejs-dms/compare/v1.0.2...v1.0.3) (2021-07-16) + + +### Bug Fixes + +* Updating WORKSPACE files to use the newest version of the Typescript generator. ([#27](https://www.github.com/googleapis/nodejs-dms/issues/27)) ([c3858dc](https://www.github.com/googleapis/nodejs-dms/commit/c3858dcfbf41d4a4eaf3eecd9056a72b6623a14b)) + +### [1.0.2](https://www.github.com/googleapis/nodejs-dms/compare/v1.0.1...v1.0.2) (2021-07-12) + + +### Bug Fixes + +* **deps:** google-gax v2.17.1 ([#25](https://www.github.com/googleapis/nodejs-dms/issues/25)) ([1ea55d9](https://www.github.com/googleapis/nodejs-dms/commit/1ea55d95e5648be81a6a85d9260ba0bf27f82571)) + +### [1.0.1](https://www.github.com/googleapis/nodejs-dms/compare/v1.0.0...v1.0.1) (2021-06-30) + + +### Bug Fixes + +* **deps:** google-gax v2.17.0 with mTLS ([#22](https://www.github.com/googleapis/nodejs-dms/issues/22)) ([cbee80d](https://www.github.com/googleapis/nodejs-dms/commit/cbee80d1db4e8a3982630a9a863f82e98ffeddf2)) + +## 1.0.0 (2021-05-25) + + +### Features + +* add samples ([#2](https://www.github.com/googleapis/nodejs-dms/issues/2)) ([18b317a](https://www.github.com/googleapis/nodejs-dms/commit/18b317a010278321a39a0f9052c74f128806ea92)) +* initial release ([1746468](https://www.github.com/googleapis/nodejs-dms/commit/17464680ee5773136f9a1136d2599307072735b8)) + + +### Bug Fixes + +* GoogleAdsError missing using generator version after 1.3.0 ([#3](https://www.github.com/googleapis/nodejs-dms/issues/3)) ([dbc9a20](https://www.github.com/googleapis/nodejs-dms/commit/dbc9a204e0925d6c6494a3d9e378d1e9670e6ef9)) diff --git a/packages/google-cloud-clouddms/CODE_OF_CONDUCT.md b/packages/google-cloud-clouddms/CODE_OF_CONDUCT.md new file mode 100644 index 00000000000..2add2547a81 --- /dev/null +++ b/packages/google-cloud-clouddms/CODE_OF_CONDUCT.md @@ -0,0 +1,94 @@ + +# Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, gender identity and expression, level of +experience, education, socio-economic status, nationality, personal appearance, +race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or + advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or reject +comments, commits, code, wiki edits, issues, and other contributions that are +not aligned to this Code of Conduct, or to ban temporarily or permanently any +contributor for other behaviors that they deem inappropriate, threatening, +offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +This Code of Conduct also applies outside the project spaces when the Project +Steward has a reasonable belief that an individual's behavior may have a +negative impact on the project or its community. + +## Conflict Resolution + +We do not believe that all conflict is bad; healthy debate and disagreement +often yield positive results. However, it is never okay to be disrespectful or +to engage in behavior that violates the project’s code of conduct. + +If you see someone violating the code of conduct, you are encouraged to address +the behavior directly with those involved. Many issues can be resolved quickly +and easily, and this gives people more control over the outcome of their +dispute. If you are unable to resolve the matter for any reason, or if the +behavior is threatening or harassing, report it. We are dedicated to providing +an environment where participants feel welcome and safe. + +Reports should be directed to *googleapis-stewards@google.com*, the +Project Steward(s) for *Google Cloud Client Libraries*. It is the Project Steward’s duty to +receive and address reported violations of the code of conduct. They will then +work with a committee consisting of representatives from the Open Source +Programs Office and the Google Open Source Strategy team. If for any reason you +are uncomfortable reaching out to the Project Steward, please email +opensource@google.com. + +We will investigate every complaint, but you may not receive a direct response. +We will use our discretion in determining when and how to follow up on reported +incidents, which may range from not taking action to permanent expulsion from +the project and project-sponsored spaces. We will notify the accused of the +report and provide them an opportunity to discuss it before any action is taken. +The identity of the reporter will be omitted from the details of the report +supplied to the accused. In potentially harmful situations, such as ongoing +harassment or threats to anyone's safety, we may take action without notice. + +## Attribution + +This Code of Conduct is adapted from the Contributor Covenant, version 1.4, +available at +https://www.contributor-covenant.org/version/1/4/code-of-conduct.html \ No newline at end of file diff --git a/packages/google-cloud-clouddms/CONTRIBUTING.md b/packages/google-cloud-clouddms/CONTRIBUTING.md new file mode 100644 index 00000000000..cc98cf4ccef --- /dev/null +++ b/packages/google-cloud-clouddms/CONTRIBUTING.md @@ -0,0 +1,76 @@ +# How to become a contributor and submit your own code + +**Table of contents** + +* [Contributor License Agreements](#contributor-license-agreements) +* [Contributing a patch](#contributing-a-patch) +* [Running the tests](#running-the-tests) +* [Releasing the library](#releasing-the-library) + +## Contributor License Agreements + +We'd love to accept your sample apps and patches! Before we can take them, we +have to jump a couple of legal hurdles. + +Please fill out either the individual or corporate Contributor License Agreement +(CLA). + + * If you are an individual writing original source code and you're sure you + own the intellectual property, then you'll need to sign an [individual CLA](https://developers.google.com/open-source/cla/individual). + * If you work for a company that wants to allow you to contribute your work, + then you'll need to sign a [corporate CLA](https://developers.google.com/open-source/cla/corporate). + +Follow either of the two links above to access the appropriate CLA and +instructions for how to sign and return it. Once we receive it, we'll be able to +accept your pull requests. + +## Contributing A Patch + +1. Submit an issue describing your proposed change to the repo in question. +1. The repo owner will respond to your issue promptly. +1. If your proposed change is accepted, and you haven't already done so, sign a + Contributor License Agreement (see details above). +1. Fork the desired repo, develop and test your code changes. +1. Ensure that your code adheres to the existing style in the code to which + you are contributing. +1. Ensure that your code has an appropriate set of tests which all pass. +1. Title your pull request following [Conventional Commits](https://www.conventionalcommits.org/) styling. +1. Submit a pull request. + +### Before you begin + +1. [Select or create a Cloud Platform project][projects]. +1. [Enable billing for your project][billing]. +1. [Enable the Cloud Database Migration Service API][enable_api]. +1. [Set up authentication with a service account][auth] so you can access the + API from your local workstation. + + +## Running the tests + +1. [Prepare your environment for Node.js setup][setup]. + +1. Install dependencies: + + npm install + +1. Run the tests: + + # Run unit tests. + npm test + + # Run sample integration tests. + npm run samples-test + + # Run all system tests. + npm run system-test + +1. Lint (and maybe fix) any changes: + + npm run fix + +[setup]: https://cloud.google.com/nodejs/docs/setup +[projects]: https://console.cloud.google.com/project +[billing]: https://support.google.com/cloud/answer/6293499#enable-billing +[enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=datamigration.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/getting-started \ No newline at end of file diff --git a/packages/google-cloud-clouddms/LICENSE b/packages/google-cloud-clouddms/LICENSE new file mode 100644 index 00000000000..d6456956733 --- /dev/null +++ b/packages/google-cloud-clouddms/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/packages/google-cloud-clouddms/README.md b/packages/google-cloud-clouddms/README.md new file mode 100644 index 00000000000..5fbdf8d3661 --- /dev/null +++ b/packages/google-cloud-clouddms/README.md @@ -0,0 +1,174 @@ +[//]: # "This README.md file is auto-generated, all changes to this file will be lost." +[//]: # "To regenerate it, use `python -m synthtool`." +Google Cloud Platform logo + +# [Cloud Database Migration Service: Node.js Client](https://github.com/googleapis/google-cloud-node) + +[![release level](https://img.shields.io/badge/release%20level-stable-brightgreen.svg?style=flat)](https://cloud.google.com/terms/launch-stages) +[![npm version](https://img.shields.io/npm/v/@google-cloud/dms.svg)](https://www.npmjs.org/package/@google-cloud/dms) + + + + +Cloud Database Migration API client for Node.js + + +A comprehensive list of changes in each version may be found in +[the CHANGELOG](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-clouddms/CHANGELOG.md). + +* [Cloud Database Migration Service Node.js Client API Reference][client-docs] +* [Cloud Database Migration Service Documentation][product-docs] +* [github.com/googleapis/google-cloud-node/packages/google-cloud-clouddms](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-clouddms) + +Read more about the client libraries for Cloud APIs, including the older +Google APIs Client Libraries, in [Client Libraries Explained][explained]. + +[explained]: https://cloud.google.com/apis/docs/client-libraries-explained + +**Table of contents:** + + +* [Quickstart](#quickstart) + * [Before you begin](#before-you-begin) + * [Installing the client library](#installing-the-client-library) + * [Using the client library](#using-the-client-library) +* [Samples](#samples) +* [Versioning](#versioning) +* [Contributing](#contributing) +* [License](#license) + +## Quickstart + +### Before you begin + +1. [Select or create a Cloud Platform project][projects]. +1. [Enable billing for your project][billing]. +1. [Enable the Cloud Database Migration Service API][enable_api]. +1. [Set up authentication with a service account][auth] so you can access the + API from your local workstation. + +### Installing the client library + +```bash +npm install @google-cloud/dms +``` + + +### Using the client library + +```javascript +// Imports the Google Cloud client library +const {DataMigrationServiceClient} = require('@google-cloud/dms'); + +// const parent = 'projects/my-project', // Project to list service usage for. + +// Creates a client +const client = new DataMigrationServiceClient(); +async function listMigrationJobs() { + for await (const migration of client.listMigrationJobsAsync({ + parent: `projects/${projectId}/locations/${location}`, + })) { + console.info(`${migration.name} ${migration.state}`); + } +} +listMigrationJobs(); + +``` + + + +## Samples + +Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/tree/main/samples) directory. Each sample's `README.md` has instructions for running its sample. + +| Sample | Source Code | Try it | +| --------------------------- | --------------------------------- | ------ | +| Data_migration_service.create_connection_profile | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.create_connection_profile.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.create_connection_profile.js,samples/README.md) | +| Data_migration_service.create_migration_job | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.create_migration_job.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.create_migration_job.js,samples/README.md) | +| Data_migration_service.delete_connection_profile | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.delete_connection_profile.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.delete_connection_profile.js,samples/README.md) | +| Data_migration_service.delete_migration_job | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.delete_migration_job.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.delete_migration_job.js,samples/README.md) | +| Data_migration_service.generate_ssh_script | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.generate_ssh_script.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.generate_ssh_script.js,samples/README.md) | +| Data_migration_service.get_connection_profile | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.get_connection_profile.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.get_connection_profile.js,samples/README.md) | +| Data_migration_service.get_migration_job | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.get_migration_job.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.get_migration_job.js,samples/README.md) | +| Data_migration_service.list_connection_profiles | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.list_connection_profiles.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.list_connection_profiles.js,samples/README.md) | +| Data_migration_service.list_migration_jobs | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.list_migration_jobs.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.list_migration_jobs.js,samples/README.md) | +| Data_migration_service.promote_migration_job | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.promote_migration_job.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.promote_migration_job.js,samples/README.md) | +| Data_migration_service.restart_migration_job | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.restart_migration_job.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.restart_migration_job.js,samples/README.md) | +| Data_migration_service.resume_migration_job | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.resume_migration_job.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.resume_migration_job.js,samples/README.md) | +| Data_migration_service.start_migration_job | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.start_migration_job.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.start_migration_job.js,samples/README.md) | +| Data_migration_service.stop_migration_job | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.stop_migration_job.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.stop_migration_job.js,samples/README.md) | +| Data_migration_service.update_connection_profile | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.update_connection_profile.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.update_connection_profile.js,samples/README.md) | +| Data_migration_service.update_migration_job | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.update_migration_job.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.update_migration_job.js,samples/README.md) | +| Data_migration_service.verify_migration_job | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.verify_migration_job.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.verify_migration_job.js,samples/README.md) | +| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-clouddms/samples/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-clouddms/samples/quickstart.js,samples/README.md) | +| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-clouddms/samples/test/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-clouddms/samples/test/quickstart.js,samples/README.md) | + + + +The [Cloud Database Migration Service Node.js Client API Reference][client-docs] documentation +also contains samples. + +## Supported Node.js Versions + +Our client libraries follow the [Node.js release schedule](https://nodejs.org/en/about/releases/). +Libraries are compatible with all current _active_ and _maintenance_ versions of +Node.js. +If you are using an end-of-life version of Node.js, we recommend that you update +as soon as possible to an actively supported LTS version. + +Google's client libraries support legacy versions of Node.js runtimes on a +best-efforts basis with the following warnings: + +* Legacy versions are not tested in continuous integration. +* Some security patches and features cannot be backported. +* Dependencies cannot be kept up-to-date. + +Client libraries targeting some end-of-life versions of Node.js are available, and +can be installed through npm [dist-tags](https://docs.npmjs.com/cli/dist-tag). +The dist-tags follow the naming convention `legacy-(version)`. +For example, `npm install @google-cloud/dms@legacy-8` installs client libraries +for versions compatible with Node.js 8. + +## Versioning + +This library follows [Semantic Versioning](http://semver.org/). + + + +This library is considered to be **stable**. The code surface will not change in backwards-incompatible ways +unless absolutely necessary (e.g. because of critical security issues) or with +an extensive deprecation period. Issues and requests against **stable** libraries +are addressed with the highest priority. + + + + + + +More Information: [Google Cloud Platform Launch Stages][launch_stages] + +[launch_stages]: https://cloud.google.com/terms/launch-stages + +## Contributing + +Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/google-cloud-node/blob/main/CONTRIBUTING.md). + +Please note that this `README.md`, the `samples/README.md`, +and a variety of configuration files in this repository (including `.nycrc` and `tsconfig.json`) +are generated from a central template. To edit one of these files, make an edit +to its templates in +[directory](https://github.com/googleapis/synthtool). + +## License + +Apache Version 2.0 + +See [LICENSE](https://github.com/googleapis/google-cloud-node/blob/main/LICENSE) + +[client-docs]: https://cloud.google.com/nodejs/docs/reference/dms/latest +[product-docs]: https://cloud.google.com/database-migration/ +[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=datamigration.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/getting-started diff --git a/packages/google-cloud-clouddms/linkinator.config.json b/packages/google-cloud-clouddms/linkinator.config.json new file mode 100644 index 00000000000..befd23c8633 --- /dev/null +++ b/packages/google-cloud-clouddms/linkinator.config.json @@ -0,0 +1,16 @@ +{ + "recurse": true, + "skip": [ + "https://codecov.io/gh/googleapis/", + "www.googleapis.com", + "img.shields.io", + "https://console.cloud.google.com/cloudshell", + "https://support.google.com" + ], + "silent": true, + "concurrency": 5, + "retry": true, + "retryErrors": true, + "retryErrorsCount": 5, + "retryErrorsJitter": 3000 +} diff --git a/packages/google-cloud-clouddms/package.json b/packages/google-cloud-clouddms/package.json new file mode 100644 index 00000000000..cf3e5cb246e --- /dev/null +++ b/packages/google-cloud-clouddms/package.json @@ -0,0 +1,72 @@ +{ + "name": "@google-cloud/dms", + "description": "Cloud Database Migration API client for Node.js", + "version": "2.1.2", + "license": "Apache-2.0", + "author": "Google LLC", + "engines": { + "node": ">=12.0.0" + }, + "repository": { + "type": "git", + "directory": "packages/google-cloud-clouddms", + "url": "https://github.com/googleapis/google-cloud-node.git" + }, + "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", + "Cloud Database Migration API" + ], + "scripts": { + "samples-test": "npm run compile && cd samples/ && npm link ../ && npm i && npm test", + "samples-test-suite": "cd samples/ && npm link ../ && npm test && cd ../", + "clean": "gts clean", + "compile": "tsc -p . && cp -r protos build/", + "compile-protos": "compileProtos src", + "docs": "jsdoc -c .jsdoc.js", + "docs-test": "linkinator docs", + "fix": "gts fix", + "lint": "gts check", + "predocs-test": "npm run docs", + "prepare": "npm run compile-protos && npm run compile", + "system-test": "npm run compile && c8 mocha build/system-test", + "test": "c8 mocha build/test", + "prelint": "cd samples; npm link ../; npm install", + "precompile": "gts clean" + }, + "dependencies": { + "google-gax": "^3.5.2" + }, + "devDependencies": { + "@types/mocha": "^9.0.0", + "@types/node": "^18.0.0", + "@types/sinon": "^10.0.0", + "c8": "^7.1.0", + "codecov": "^3.6.5", + "gts": "^3.1.0", + "jsdoc": "^4.0.0", + "jsdoc-fresh": "^2.0.0", + "jsdoc-region-tag": "^2.0.0", + "linkinator": "^4.0.0", + "mocha": "^9.2.2", + "null-loader": "^4.0.0", + "pack-n-play": "^1.0.0-2", + "sinon": "^14.0.0", + "ts-loader": "^9.0.0", + "typescript": "^4.6.4", + "webpack": "^5.0.0", + "webpack-cli": "^4.0.0" + }, + "homepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-clouddms" +} diff --git a/packages/google-cloud-clouddms/protos/google/cloud/clouddms/v1/clouddms.proto b/packages/google-cloud-clouddms/protos/google/cloud/clouddms/v1/clouddms.proto new file mode 100644 index 00000000000..a8e3e74c6e4 --- /dev/null +++ b/packages/google-cloud-clouddms/protos/google/cloud/clouddms/v1/clouddms.proto @@ -0,0 +1,625 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.clouddms.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/clouddms/v1/clouddms_resources.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.CloudDms.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/clouddms/v1;clouddms"; +option java_multiple_files = true; +option java_outer_classname = "ClouddmsProto"; +option java_package = "com.google.cloud.clouddms.v1"; +option php_namespace = "Google\\Cloud\\CloudDms\\V1"; +option ruby_package = "Google::Cloud::CloudDMS::V1"; + +// Database Migration service +service DataMigrationService { + option (google.api.default_host) = "datamigration.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Lists migration jobs in a given project and location. + rpc ListMigrationJobs(ListMigrationJobsRequest) returns (ListMigrationJobsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/migrationJobs" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of a single migration job. + rpc GetMigrationJob(GetMigrationJobRequest) returns (MigrationJob) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/migrationJobs/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a new migration job in a given project and location. + rpc CreateMigrationJob(CreateMigrationJobRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/migrationJobs" + body: "migration_job" + }; + option (google.api.method_signature) = "parent,migration_job,migration_job_id"; + option (google.longrunning.operation_info) = { + response_type: "MigrationJob" + metadata_type: "OperationMetadata" + }; + } + + // Updates the parameters of a single migration job. + rpc UpdateMigrationJob(UpdateMigrationJobRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{migration_job.name=projects/*/locations/*/migrationJobs/*}" + body: "migration_job" + }; + option (google.api.method_signature) = "migration_job,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "MigrationJob" + metadata_type: "OperationMetadata" + }; + } + + // Deletes a single migration job. + rpc DeleteMigrationJob(DeleteMigrationJobRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/migrationJobs/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OperationMetadata" + }; + } + + // Start an already created migration job. + rpc StartMigrationJob(StartMigrationJobRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/migrationJobs/*}:start" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "MigrationJob" + metadata_type: "OperationMetadata" + }; + } + + // Stops a running migration job. + rpc StopMigrationJob(StopMigrationJobRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/migrationJobs/*}:stop" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "MigrationJob" + metadata_type: "OperationMetadata" + }; + } + + // Resume a migration job that is currently stopped and is resumable (was + // stopped during CDC phase). + rpc ResumeMigrationJob(ResumeMigrationJobRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/migrationJobs/*}:resume" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "MigrationJob" + metadata_type: "OperationMetadata" + }; + } + + // Promote a migration job, stopping replication to the destination and + // promoting the destination to be a standalone database. + rpc PromoteMigrationJob(PromoteMigrationJobRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/migrationJobs/*}:promote" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "MigrationJob" + metadata_type: "OperationMetadata" + }; + } + + // Verify a migration job, making sure the destination can reach the source + // and that all configuration and prerequisites are met. + rpc VerifyMigrationJob(VerifyMigrationJobRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/migrationJobs/*}:verify" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "MigrationJob" + metadata_type: "OperationMetadata" + }; + } + + // Restart a stopped or failed migration job, resetting the destination + // instance to its original state and starting the migration process from + // scratch. + rpc RestartMigrationJob(RestartMigrationJobRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/migrationJobs/*}:restart" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "MigrationJob" + metadata_type: "OperationMetadata" + }; + } + + // Generate a SSH configuration script to configure the reverse SSH + // connectivity. + rpc GenerateSshScript(GenerateSshScriptRequest) returns (SshScript) { + option (google.api.http) = { + post: "/v1/{migration_job=projects/*/locations/*/migrationJobs/*}:generateSshScript" + body: "*" + }; + } + + // Retrieve a list of all connection profiles in a given project and location. + rpc ListConnectionProfiles(ListConnectionProfilesRequest) returns (ListConnectionProfilesResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/connectionProfiles" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of a single connection profile. + rpc GetConnectionProfile(GetConnectionProfileRequest) returns (ConnectionProfile) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/connectionProfiles/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a new connection profile in a given project and location. + rpc CreateConnectionProfile(CreateConnectionProfileRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/connectionProfiles" + body: "connection_profile" + }; + option (google.api.method_signature) = "parent,connection_profile,connection_profile_id"; + option (google.longrunning.operation_info) = { + response_type: "ConnectionProfile" + metadata_type: "OperationMetadata" + }; + } + + // Update the configuration of a single connection profile. + rpc UpdateConnectionProfile(UpdateConnectionProfileRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{connection_profile.name=projects/*/locations/*/connectionProfiles/*}" + body: "connection_profile" + }; + option (google.api.method_signature) = "connection_profile,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "ConnectionProfile" + metadata_type: "OperationMetadata" + }; + } + + // Deletes a single Database Migration Service connection profile. + // A connection profile can only be deleted if it is not in use by any + // active migration jobs. + rpc DeleteConnectionProfile(DeleteConnectionProfileRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/connectionProfiles/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OperationMetadata" + }; + } +} + +// Retrieve a list of all migration jobs in a given project and location. +message ListMigrationJobsRequest { + // Required. The parent, which owns this collection of migrationJobs. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "datamigration.googleapis.com/MigrationJob" + } + ]; + + // The maximum number of migration jobs to return. The service may return + // fewer than this value. If unspecified, at most 50 migration jobs will be + // returned. The maximum value is 1000; values above 1000 will be coerced to + // 1000. + int32 page_size = 2; + + // The nextPageToken value received in the previous call to + // migrationJobs.list, used in the subsequent request to retrieve the next + // page of results. On first call this should be left blank. When paginating, + // all other parameters provided to migrationJobs.list must match the call + // that provided the page token. + string page_token = 3; + + // A filter expression that filters migration jobs listed in the response. + // The expression must specify the field name, a comparison operator, and the + // value that you want to use for filtering. The value must be a string, + // a number, or a boolean. The comparison operator must be + // either =, !=, >, or <. For example, list migration jobs created this year + // by specifying **createTime %gt; 2020-01-01T00:00:00.000000000Z.** + // You can also filter nested fields. For example, you could specify + // **reverseSshConnectivity.vmIp = "1.2.3.4"** to select all migration + // jobs connecting through the specific SSH tunnel bastion. + string filter = 4; + + // Sort the results based on the migration job name. + // Valid values are: "name", "name asc", and "name desc". + string order_by = 5; +} + +// Response message for 'ListMigrationJobs' request. +message ListMigrationJobsResponse { + // The list of migration jobs objects. + repeated MigrationJob migration_jobs = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable = 3; +} + +// Request message for 'GetMigrationJob' request. +message GetMigrationJobRequest { + // Required. Name of the migration job resource to get. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "datamigration.googleapis.com/MigrationJob" + } + ]; +} + +// Request message to create a new Database Migration Service migration job +// in the specified project and region. +message CreateMigrationJobRequest { + // Required. The parent, which owns this collection of migration jobs. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "datamigration.googleapis.com/MigrationJob" + } + ]; + + // Required. The ID of the instance to create. + string migration_job_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. Represents a [migration + // job](https://cloud.google.com/database-migration/docs/reference/rest/v1/projects.locations.migrationJobs) + // object. + MigrationJob migration_job = 3 [(google.api.field_behavior) = REQUIRED]; + + // A unique id used to identify the request. If the server receives two + // requests with the same id, then the second request will be ignored. + // + // It is recommended to always set this value to a UUID. + // + // The id must contain only letters (a-z, A-Z), numbers (0-9), underscores + // (_), and hyphens (-). The maximum length is 40 characters. + string request_id = 4; +} + +// Request message for 'UpdateMigrationJob' request. +message UpdateMigrationJobRequest { + // Required. Field mask is used to specify the fields to be overwritten in the + // migration job resource by the update. + google.protobuf.FieldMask update_mask = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The migration job parameters to update. + MigrationJob migration_job = 2 [(google.api.field_behavior) = REQUIRED]; + + // A unique id used to identify the request. If the server receives two + // requests with the same id, then the second request will be ignored. + // + // It is recommended to always set this value to a UUID. + // + // The id must contain only letters (a-z, A-Z), numbers (0-9), underscores + // (_), and hyphens (-). The maximum length is 40 characters. + string request_id = 3; +} + +// Request message for 'DeleteMigrationJob' request. +message DeleteMigrationJobRequest { + // Required. Name of the migration job resource to delete. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "datamigration.googleapis.com/MigrationJob" + } + ]; + + // A unique id used to identify the request. If the server receives two + // requests with the same id, then the second request will be ignored. + // + // It is recommended to always set this value to a UUID. + // + // The id must contain only letters (a-z, A-Z), numbers (0-9), underscores + // (_), and hyphens (-). The maximum length is 40 characters. + string request_id = 2; + + // The destination CloudSQL connection profile is always deleted with the + // migration job. In case of force delete, the destination CloudSQL replica + // database is also deleted. + bool force = 3; +} + +// Request message for 'StartMigrationJob' request. +message StartMigrationJobRequest { + // Name of the migration job resource to start. + string name = 1 [(google.api.resource_reference) = { + type: "datamigration.googleapis.com/MigrationJob" + }]; +} + +// Request message for 'StopMigrationJob' request. +message StopMigrationJobRequest { + // Name of the migration job resource to stop. + string name = 1 [(google.api.resource_reference) = { + type: "datamigration.googleapis.com/MigrationJob" + }]; +} + +// Request message for 'ResumeMigrationJob' request. +message ResumeMigrationJobRequest { + // Name of the migration job resource to resume. + string name = 1 [(google.api.resource_reference) = { + type: "datamigration.googleapis.com/MigrationJob" + }]; +} + +// Request message for 'PromoteMigrationJob' request. +message PromoteMigrationJobRequest { + // Name of the migration job resource to promote. + string name = 1 [(google.api.resource_reference) = { + type: "datamigration.googleapis.com/MigrationJob" + }]; +} + +// Request message for 'VerifyMigrationJob' request. +message VerifyMigrationJobRequest { + // Name of the migration job resource to verify. + string name = 1 [(google.api.resource_reference) = { + type: "datamigration.googleapis.com/MigrationJob" + }]; +} + +// Request message for 'RestartMigrationJob' request. +message RestartMigrationJobRequest { + // Name of the migration job resource to restart. + string name = 1 [(google.api.resource_reference) = { + type: "datamigration.googleapis.com/MigrationJob" + }]; +} + +// Request message for 'GenerateSshScript' request. +message GenerateSshScriptRequest { + // Name of the migration job resource to generate the SSH script. + string migration_job = 1 [(google.api.resource_reference) = { + type: "datamigration.googleapis.com/MigrationJob" + }]; + + // Required. Bastion VM Instance name to use or to create. + string vm = 2 [(google.api.field_behavior) = REQUIRED]; + + // The VM configuration + oneof vm_config { + // The VM creation configuration + VmCreationConfig vm_creation_config = 100; + + // The VM selection configuration + VmSelectionConfig vm_selection_config = 101; + } + + // The port that will be open on the bastion host + int32 vm_port = 3; +} + +// VM creation configuration message +message VmCreationConfig { + // Required. VM instance machine type to create. + string vm_machine_type = 1 [(google.api.field_behavior) = REQUIRED]; + + // The Google Cloud Platform zone to create the VM in. + string vm_zone = 2; + + // The subnet name the vm needs to be created in. + string subnet = 3; +} + +// VM selection configuration message +message VmSelectionConfig { + // Required. The Google Cloud Platform zone the VM is located. + string vm_zone = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// Response message for 'GenerateSshScript' request. +message SshScript { + // The ssh configuration script. + string script = 1; +} + +// Request message for 'ListConnectionProfiles' request. +message ListConnectionProfilesRequest { + // Required. The parent, which owns this collection of connection profiles. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "datamigration.googleapis.com/ConnectionProfile" + } + ]; + + // The maximum number of connection profiles to return. The service may return + // fewer than this value. If unspecified, at most 50 connection profiles will + // be returned. The maximum value is 1000; values above 1000 will be coerced + // to 1000. + int32 page_size = 2; + + // A page token, received from a previous `ListConnectionProfiles` call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to `ListConnectionProfiles` + // must match the call that provided the page token. + string page_token = 3; + + // A filter expression that filters connection profiles listed in the + // response. The expression must specify the field name, a comparison + // operator, and the value that you want to use for filtering. The value must + // be a string, a number, or a boolean. The comparison operator must be either + // =, !=, >, or <. For example, list connection profiles created this year by + // specifying **createTime %gt; 2020-01-01T00:00:00.000000000Z**. You can + // also filter nested fields. For example, you could specify **mySql.username + // = %lt;my_username%gt;** to list all connection profiles configured to + // connect with a specific username. + string filter = 4; + + // the order by fields for the result. + string order_by = 5; +} + +// Response message for 'ListConnectionProfiles' request. +message ListConnectionProfilesResponse { + // The response list of connection profiles. + repeated ConnectionProfile connection_profiles = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable = 3; +} + +// Request message for 'GetConnectionProfile' request. +message GetConnectionProfileRequest { + // Required. Name of the connection profile resource to get. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "datamigration.googleapis.com/ConnectionProfile" + } + ]; +} + +// Request message for 'CreateConnectionProfile' request. +message CreateConnectionProfileRequest { + // Required. The parent, which owns this collection of connection profiles. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "datamigration.googleapis.com/ConnectionProfile" + } + ]; + + // Required. The connection profile identifier. + string connection_profile_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The create request body including the connection profile data + ConnectionProfile connection_profile = 3 [(google.api.field_behavior) = REQUIRED]; + + // A unique id used to identify the request. If the server receives two + // requests with the same id, then the second request will be ignored. + // + // It is recommended to always set this value to a UUID. + // + // The id must contain only letters (a-z, A-Z), numbers (0-9), underscores + // (_), and hyphens (-). The maximum length is 40 characters. + string request_id = 4; +} + +// Request message for 'UpdateConnectionProfile' request. +message UpdateConnectionProfileRequest { + // Required. Field mask is used to specify the fields to be overwritten in the + // connection profile resource by the update. + google.protobuf.FieldMask update_mask = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The connection profile parameters to update. + ConnectionProfile connection_profile = 2 [(google.api.field_behavior) = REQUIRED]; + + // A unique id used to identify the request. If the server receives two + // requests with the same id, then the second request will be ignored. + // + // It is recommended to always set this value to a UUID. + // + // The id must contain only letters (a-z, A-Z), numbers (0-9), underscores + // (_), and hyphens (-). The maximum length is 40 characters. + string request_id = 3; +} + +// Request message for 'DeleteConnectionProfile' request. +message DeleteConnectionProfileRequest { + // Required. Name of the connection profile resource to delete. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "datamigration.googleapis.com/ConnectionProfile" + } + ]; + + // A unique id used to identify the request. If the server receives two + // requests with the same id, then the second request will be ignored. + // + // It is recommended to always set this value to a UUID. + // + // The id must contain only letters (a-z, A-Z), numbers (0-9), underscores + // (_), and hyphens (-). The maximum length is 40 characters. + string request_id = 2; + + // In case of force delete, the CloudSQL replica database is also deleted + // (only for CloudSQL connection profile). + bool force = 3; +} + +// Represents the metadata of the long-running operation. +message OperationMetadata { + // Output only. The time the operation was created. + google.protobuf.Timestamp create_time = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time the operation finished running. + google.protobuf.Timestamp end_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Server-defined resource path for the target of the operation. + string target = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Name of the verb executed by the operation. + string verb = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Human-readable status of the operation, if any. + string status_message = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Identifies whether the user has requested cancellation + // of the operation. Operations that have successfully been cancelled + // have [Operation.error][] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, + // corresponding to `Code.CANCELLED`. + bool requested_cancellation = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. API version used to start the operation. + string api_version = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/packages/google-cloud-clouddms/protos/google/cloud/clouddms/v1/clouddms_resources.proto b/packages/google-cloud-clouddms/protos/google/cloud/clouddms/v1/clouddms_resources.proto new file mode 100644 index 00000000000..dd7731a6e84 --- /dev/null +++ b/packages/google-cloud-clouddms/protos/google/cloud/clouddms/v1/clouddms_resources.proto @@ -0,0 +1,715 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.clouddms.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; +import "google/protobuf/wrappers.proto"; +import "google/rpc/status.proto"; + +option csharp_namespace = "Google.Cloud.CloudDms.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/clouddms/v1;clouddms"; +option java_multiple_files = true; +option java_outer_classname = "ClouddmsResourcesProto"; +option java_package = "com.google.cloud.clouddms.v1"; +option php_namespace = "Google\\Cloud\\CloudDms\\V1"; +option ruby_package = "Google::Cloud::CloudDMS::V1"; + +// SSL configuration information. +message SslConfig { + // Specifies The kind of ssl configuration used. + enum SslType { + // Unspecified. + SSL_TYPE_UNSPECIFIED = 0; + + // Only 'ca_certificate' specified. + SERVER_ONLY = 1; + + // Both server ('ca_certificate'), and client ('client_key', + // 'client_certificate') specified. + SERVER_CLIENT = 2; + } + + // Output only. The ssl config type according to 'client_key', 'client_certificate' and + // 'ca_certificate'. + SslType type = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Input only. The unencrypted PKCS#1 or PKCS#8 PEM-encoded private key associated with + // the Client Certificate. If this field is used then the 'client_certificate' + // field is mandatory. + string client_key = 2 [(google.api.field_behavior) = INPUT_ONLY]; + + // Input only. The x509 PEM-encoded certificate that will be used by the replica to + // authenticate against the source database server.If this field is used then + // the 'client_key' field is mandatory. + string client_certificate = 3 [(google.api.field_behavior) = INPUT_ONLY]; + + // Required. Input only. The x509 PEM-encoded certificate of the CA that signed the source database + // server's certificate. The replica will use this certificate to verify + // it's connecting to the right host. + string ca_certificate = 4 [ + (google.api.field_behavior) = INPUT_ONLY, + (google.api.field_behavior) = REQUIRED + ]; +} + +// Specifies connection parameters required specifically for MySQL databases. +message MySqlConnectionProfile { + // Required. The IP or hostname of the source MySQL database. + string host = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The network port of the source MySQL database. + int32 port = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The username that Database Migration Service will use to connect to the + // database. The value is encrypted when stored in Database Migration Service. + string username = 3 [(google.api.field_behavior) = REQUIRED]; + + // Required. Input only. The password for the user that Database Migration Service will be using to + // connect to the database. This field is not returned on request, and the + // value is encrypted when stored in Database Migration Service. + string password = 4 [ + (google.api.field_behavior) = INPUT_ONLY, + (google.api.field_behavior) = REQUIRED + ]; + + // Output only. Indicates If this connection profile password is stored. + bool password_set = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // SSL configuration for the destination to connect to the source database. + SslConfig ssl = 6; + + // If the source is a Cloud SQL database, use this field to + // provide the Cloud SQL instance ID of the source. + string cloud_sql_id = 7; +} + +// Specifies connection parameters required specifically for PostgreSQL +// databases. +message PostgreSqlConnectionProfile { + // Required. The IP or hostname of the source PostgreSQL database. + string host = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The network port of the source PostgreSQL database. + int32 port = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The username that Database Migration Service will use to connect to the + // database. The value is encrypted when stored in Database Migration Service. + string username = 3 [(google.api.field_behavior) = REQUIRED]; + + // Required. Input only. The password for the user that Database Migration Service will be using to + // connect to the database. This field is not returned on request, and the + // value is encrypted when stored in Database Migration Service. + string password = 4 [ + (google.api.field_behavior) = INPUT_ONLY, + (google.api.field_behavior) = REQUIRED + ]; + + // Output only. Indicates If this connection profile password is stored. + bool password_set = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // SSL configuration for the destination to connect to the source database. + SslConfig ssl = 6; + + // If the source is a Cloud SQL database, use this field to + // provide the Cloud SQL instance ID of the source. + string cloud_sql_id = 7; +} + +// Specifies required connection parameters, and, optionally, the parameters +// required to create a Cloud SQL destination database instance. +message CloudSqlConnectionProfile { + // Output only. The Cloud SQL instance ID that this connection profile is associated with. + string cloud_sql_id = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Immutable. Metadata used to create the destination Cloud SQL database. + CloudSqlSettings settings = 2 [(google.api.field_behavior) = IMMUTABLE]; + + // Output only. The Cloud SQL database instance's private IP. + string private_ip = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The Cloud SQL database instance's public IP. + string public_ip = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// An entry for an Access Control list. +message SqlAclEntry { + // The allowlisted value for the access control list. + string value = 1; + + // The access control entry entry expiration. + oneof expiration { + // The time when this access control entry expires in + // [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example: + // `2012-11-15T16:19:00.094Z`. + google.protobuf.Timestamp expire_time = 10; + + // Input only. The time-to-leave of this access control entry. + google.protobuf.Duration ttl = 11 [(google.api.field_behavior) = INPUT_ONLY]; + } + + // A label to identify this entry. + string label = 3; +} + +// IP Management configuration. +message SqlIpConfig { + // Whether the instance should be assigned an IPv4 address or not. + google.protobuf.BoolValue enable_ipv4 = 1; + + // The resource link for the VPC network from which the Cloud SQL instance is + // accessible for private IP. For example, + // `projects/myProject/global/networks/default`. This setting can + // be updated, but it cannot be removed after it is set. + string private_network = 2; + + // Whether SSL connections over IP should be enforced or not. + google.protobuf.BoolValue require_ssl = 3; + + // The list of external networks that are allowed to connect to the instance + // using the IP. See + // https://en.wikipedia.org/wiki/CIDR_notation#CIDR_notation, also known as + // 'slash' notation (e.g. `192.168.100.0/24`). + repeated SqlAclEntry authorized_networks = 4; +} + +// Settings for creating a Cloud SQL database instance. +message CloudSqlSettings { + // Specifies when the instance should be activated. + enum SqlActivationPolicy { + // unspecified policy. + SQL_ACTIVATION_POLICY_UNSPECIFIED = 0; + + // The instance is always up and running. + ALWAYS = 1; + + // The instance should never spin up. + NEVER = 2; + } + + // The storage options for Cloud SQL databases. + enum SqlDataDiskType { + // Unspecified. + SQL_DATA_DISK_TYPE_UNSPECIFIED = 0; + + // SSD disk. + PD_SSD = 1; + + // HDD disk. + PD_HDD = 2; + } + + // The database engine type and version. + enum SqlDatabaseVersion { + // Unspecified version. + SQL_DATABASE_VERSION_UNSPECIFIED = 0; + + // MySQL 5.6. + MYSQL_5_6 = 1; + + // MySQL 5.7. + MYSQL_5_7 = 2; + + // PostgreSQL 9.6. + POSTGRES_9_6 = 3; + + // PostgreSQL 11. + POSTGRES_11 = 4; + + // PostgreSQL 10. + POSTGRES_10 = 5; + + // MySQL 8.0. + MYSQL_8_0 = 6; + + // PostgreSQL 12. + POSTGRES_12 = 7; + + // PostgreSQL 13. + POSTGRES_13 = 8; + } + + // The database engine type and version. + SqlDatabaseVersion database_version = 1; + + // The resource labels for a Cloud SQL instance to use to annotate any related + // underlying resources such as Compute Engine VMs. + // An object containing a list of "key": "value" pairs. + // + // Example: `{ "name": "wrench", "mass": "18kg", "count": "3" }`. + map user_labels = 2; + + // The tier (or machine type) for this instance, for example: + // `db-n1-standard-1` (MySQL instances) or + // `db-custom-1-3840` (PostgreSQL instances). + // For more information, see + // [Cloud SQL Instance + // Settings](https://cloud.google.com/sql/docs/mysql/instance-settings). + string tier = 3; + + // The maximum size to which storage capacity can be automatically increased. + // The default value is 0, which specifies that there is no limit. + google.protobuf.Int64Value storage_auto_resize_limit = 4; + + // The activation policy specifies when the instance is activated; it is + // applicable only when the instance state is 'RUNNABLE'. Valid values: + // + // 'ALWAYS': The instance is on, and remains so even in + // the absence of connection requests. + // + // `NEVER`: The instance is off; it is not activated, even if a + // connection request arrives. + SqlActivationPolicy activation_policy = 5; + + // The settings for IP Management. This allows to enable or disable the + // instance IP and manage which external networks can connect to the instance. + // The IPv4 address cannot be disabled. + SqlIpConfig ip_config = 6; + + // [default: ON] If you enable this setting, Cloud SQL checks your available + // storage every 30 seconds. If the available storage falls below a threshold + // size, Cloud SQL automatically adds additional storage capacity. If the + // available storage repeatedly falls below the threshold size, Cloud SQL + // continues to add storage until it reaches the maximum of 30 TB. + google.protobuf.BoolValue auto_storage_increase = 7; + + // The database flags passed to the Cloud SQL instance at startup. + // An object containing a list of "key": value pairs. + // Example: { "name": "wrench", "mass": "1.3kg", "count": "3" }. + map database_flags = 8; + + // The type of storage: `PD_SSD` (default) or `PD_HDD`. + SqlDataDiskType data_disk_type = 9; + + // The storage capacity available to the database, in GB. + // The minimum (and default) size is 10GB. + google.protobuf.Int64Value data_disk_size_gb = 10; + + // The Google Cloud Platform zone where your Cloud SQL datdabse instance is + // located. + string zone = 11; + + // The Database Migration Service source connection profile ID, + // in the format: + // `projects/my_project_name/locations/us-central1/connectionProfiles/connection_profile_ID` + string source_id = 12; + + // Input only. Initial root password. + string root_password = 13 [(google.api.field_behavior) = INPUT_ONLY]; + + // Output only. Indicates If this connection profile root password is stored. + bool root_password_set = 14 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The Cloud SQL default instance level collation. + string collation = 15; +} + +// The source database will allow incoming connections from the destination +// database's public IP. You can retrieve the Cloud SQL instance's public IP +// from the Cloud SQL console or using Cloud SQL APIs. No additional +// configuration is required. +message StaticIpConnectivity { + +} + +// The details needed to configure a reverse SSH tunnel between the source and +// destination databases. These details will be used when calling the +// generateSshScript method (see +// https://cloud.google.com/database-migration/docs/reference/rest/v1/projects.locations.migrationJobs/generateSshScript) +// to produce the script that will help set up the reverse SSH tunnel, and to +// set up the VPC peering between the Cloud SQL private network and the VPC. +message ReverseSshConnectivity { + // Required. The IP of the virtual machine (Compute Engine) used as the bastion server + // for the SSH tunnel. + string vm_ip = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The forwarding port of the virtual machine (Compute Engine) used as the + // bastion server for the SSH tunnel. + int32 vm_port = 2 [(google.api.field_behavior) = REQUIRED]; + + // The name of the virtual machine (Compute Engine) used as the bastion server + // for the SSH tunnel. + string vm = 3; + + // The name of the VPC to peer with the Cloud SQL private network. + string vpc = 4; +} + +// The details of the VPC where the source database is located in Google Cloud. +// We will use this information to set up the VPC peering connection between +// Cloud SQL and this VPC. +message VpcPeeringConnectivity { + // The name of the VPC network to peer with the Cloud SQL private network. + string vpc = 1; +} + +// A message defining the database engine and provider. +message DatabaseType { + // The database provider. + DatabaseProvider provider = 1; + + // The database engine. + DatabaseEngine engine = 2; +} + +// Represents a Database Migration Service migration job object. +message MigrationJob { + option (google.api.resource) = { + type: "datamigration.googleapis.com/MigrationJob" + pattern: "projects/{project}/locations/{location}/migrationJobs/{migration_job}" + }; + + // The current migration job states. + enum State { + // The state of the migration job is unknown. + STATE_UNSPECIFIED = 0; + + // The migration job is down for maintenance. + MAINTENANCE = 1; + + // The migration job is in draft mode and no resources are created. + DRAFT = 2; + + // The migration job is being created. + CREATING = 3; + + // The migration job is created and not started. + NOT_STARTED = 4; + + // The migration job is running. + RUNNING = 5; + + // The migration job failed. + FAILED = 6; + + // The migration job has been completed. + COMPLETED = 7; + + // The migration job is being deleted. + DELETING = 8; + + // The migration job is being stopped. + STOPPING = 9; + + // The migration job is currently stopped. + STOPPED = 10; + + // The migration job has been deleted. + DELETED = 11; + + // The migration job is being updated. + UPDATING = 12; + + // The migration job is starting. + STARTING = 13; + + // The migration job is restarting. + RESTARTING = 14; + + // The migration job is resuming. + RESUMING = 15; + } + + // The current migration job phase. + enum Phase { + // The phase of the migration job is unknown. + PHASE_UNSPECIFIED = 0; + + // The migration job is in the full dump phase. + FULL_DUMP = 1; + + // The migration job is CDC phase. + CDC = 2; + + // The migration job is running the promote phase. + PROMOTE_IN_PROGRESS = 3; + + // Only RDS flow - waiting for source writes to stop + WAITING_FOR_SOURCE_WRITES_TO_STOP = 4; + + // Only RDS flow - the sources writes stopped, waiting for dump to begin + PREPARING_THE_DUMP = 5; + } + + // The type of migration job (one-time or continuous). + enum Type { + // The type of the migration job is unknown. + TYPE_UNSPECIFIED = 0; + + // The migration job is a one time migration. + ONE_TIME = 1; + + // The migration job is a continuous migration. + CONTINUOUS = 2; + } + + // The name (URI) of this migration job resource, in the form of: + // projects/{project}/locations/{location}/instances/{instance}. + string name = 1; + + // Output only. The timestamp when the migration job resource was created. + // A timestamp in RFC3339 UTC "Zulu" format, accurate to nanoseconds. + // Example: "2014-10-02T15:01:23.045123456Z". + google.protobuf.Timestamp create_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The timestamp when the migration job resource was last updated. + // A timestamp in RFC3339 UTC "Zulu" format, accurate to nanoseconds. + // Example: "2014-10-02T15:01:23.045123456Z". + google.protobuf.Timestamp update_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The resource labels for migration job to use to annotate any related + // underlying resources such as Compute Engine VMs. An object containing a + // list of "key": "value" pairs. + // + // Example: `{ "name": "wrench", "mass": "1.3kg", "count": "3" }`. + map labels = 4; + + // The migration job display name. + string display_name = 5; + + // The current migration job state. + State state = 6; + + // Output only. The current migration job phase. + Phase phase = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. The migration job type. + Type type = 8 [(google.api.field_behavior) = REQUIRED]; + + // The path to the dump file in Google Cloud Storage, + // in the format: (gs://[BUCKET_NAME]/[OBJECT_NAME]). + string dump_path = 9; + + // Required. The resource name (URI) of the source connection profile. + string source = 10 [(google.api.field_behavior) = REQUIRED]; + + // Required. The resource name (URI) of the destination connection profile. + string destination = 11 [(google.api.field_behavior) = REQUIRED]; + + // The connectivity method. + oneof connectivity { + // The details needed to communicate to the source over Reverse SSH + // tunnel connectivity. + ReverseSshConnectivity reverse_ssh_connectivity = 101; + + // The details of the VPC network that the source database is located in. + VpcPeeringConnectivity vpc_peering_connectivity = 102; + + // static ip connectivity data (default, no additional details needed). + StaticIpConnectivity static_ip_connectivity = 103; + } + + // Output only. The duration of the migration job (in seconds). A duration in seconds + // with up to nine fractional digits, terminated by 's'. Example: "3.5s". + google.protobuf.Duration duration = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The error details in case of state FAILED. + google.rpc.Status error = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The database engine type and provider of the source. + DatabaseType source_database = 14; + + // The database engine type and provider of the destination. + DatabaseType destination_database = 15; + + // Output only. If the migration job is completed, the time when it was completed. + google.protobuf.Timestamp end_time = 16 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// A connection profile definition. +message ConnectionProfile { + option (google.api.resource) = { + type: "datamigration.googleapis.com/ConnectionProfile" + pattern: "projects/{project}/locations/{location}/connectionProfiles/{connection_profile}" + }; + + // The current connection profile state (e.g. DRAFT, READY, or FAILED). + enum State { + // The state of the connection profile is unknown. + STATE_UNSPECIFIED = 0; + + // The connection profile is in draft mode and fully editable. + DRAFT = 1; + + // The connection profile is being created. + CREATING = 2; + + // The connection profile is ready. + READY = 3; + + // The connection profile is being updated. + UPDATING = 4; + + // The connection profile is being deleted. + DELETING = 5; + + // The connection profile has been deleted. + DELETED = 6; + + // The last action on the connection profile failed. + FAILED = 7; + } + + // The name of this connection profile resource in the form of + // projects/{project}/locations/{location}/instances/{instance}. + string name = 1; + + // Output only. The timestamp when the resource was created. + // A timestamp in RFC3339 UTC "Zulu" format, accurate to nanoseconds. + // Example: "2014-10-02T15:01:23.045123456Z". + google.protobuf.Timestamp create_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The timestamp when the resource was last updated. + // A timestamp in RFC3339 UTC "Zulu" format, accurate to nanoseconds. + // Example: "2014-10-02T15:01:23.045123456Z". + google.protobuf.Timestamp update_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The resource labels for connection profile to use to annotate any related + // underlying resources such as Compute Engine VMs. An object containing a + // list of "key": "value" pairs. + // + // Example: `{ "name": "wrench", "mass": "1.3kg", "count": "3" }`. + map labels = 4; + + // The current connection profile state (e.g. DRAFT, READY, or FAILED). + State state = 5; + + // The connection profile display name. + string display_name = 6; + + // The connection profile definition. + oneof connection_profile { + // A MySQL database connection profile. + MySqlConnectionProfile mysql = 100; + + // A PostgreSQL database connection profile. + PostgreSqlConnectionProfile postgresql = 101; + + // A CloudSQL database connection profile. + CloudSqlConnectionProfile cloudsql = 102; + } + + // Output only. The error details in case of state FAILED. + google.rpc.Status error = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The database provider. + DatabaseProvider provider = 8; +} + +// Error message of a verification Migration job. +message MigrationJobVerificationError { + // A general error code describing the type of error that occurred. + enum ErrorCode { + // An unknown error occurred + ERROR_CODE_UNSPECIFIED = 0; + + // We failed to connect to one of the connection profile. + CONNECTION_FAILURE = 1; + + // We failed to authenticate to one of the connection profile. + AUTHENTICATION_FAILURE = 2; + + // One of the involved connection profiles has an invalid configuration. + INVALID_CONNECTION_PROFILE_CONFIG = 3; + + // The versions of the source and the destination are incompatible. + VERSION_INCOMPATIBILITY = 4; + + // The types of the source and the destination are incompatible. + CONNECTION_PROFILE_TYPES_INCOMPATIBILITY = 5; + + // No pglogical extension installed on databases, applicable for postgres. + NO_PGLOGICAL_INSTALLED = 7; + + // pglogical node already exists on databases, applicable for postgres. + PGLOGICAL_NODE_ALREADY_EXISTS = 8; + + // The value of parameter wal_level is not set to logical. + INVALID_WAL_LEVEL = 9; + + // The value of parameter shared_preload_libraries does not include + // pglogical. + INVALID_SHARED_PRELOAD_LIBRARY = 10; + + // The value of parameter max_replication_slots is not sufficient. + INSUFFICIENT_MAX_REPLICATION_SLOTS = 11; + + // The value of parameter max_wal_senders is not sufficient. + INSUFFICIENT_MAX_WAL_SENDERS = 12; + + // The value of parameter max_worker_processes is not sufficient. + INSUFFICIENT_MAX_WORKER_PROCESSES = 13; + + // Extensions installed are either not supported or having unsupported + // versions. + UNSUPPORTED_EXTENSIONS = 14; + + // Unsupported migration type. + UNSUPPORTED_MIGRATION_TYPE = 15; + + // Invalid RDS logical replication. + INVALID_RDS_LOGICAL_REPLICATION = 16; + + // The gtid_mode is not supported, applicable for MySQL. + UNSUPPORTED_GTID_MODE = 17; + + // The table definition is not support due to missing primary key or replica + // identity. + UNSUPPORTED_TABLE_DEFINITION = 18; + + // The definer is not supported. + UNSUPPORTED_DEFINER = 19; + + // Migration is already running at the time of restart request. + CANT_RESTART_RUNNING_MIGRATION = 21; + } + + // Output only. An instance of ErrorCode specifying the error that occurred. + ErrorCode error_code = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. A formatted message with further details about the error and a CTA. + string error_message = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. A specific detailed error message, if supplied by the engine. + string error_detail_message = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// The database engine types. +enum DatabaseEngine { + // The source database engine of the migration job is unknown. + DATABASE_ENGINE_UNSPECIFIED = 0; + + // The source engine is MySQL. + MYSQL = 1; + + // The source engine is PostgreSQL. + POSTGRESQL = 2; +} + +// The database providers. +enum DatabaseProvider { + // The database provider is unknown. + DATABASE_PROVIDER_UNSPECIFIED = 0; + + // CloudSQL runs the database. + CLOUDSQL = 1; + + // RDS runs the database. + RDS = 2; +} diff --git a/packages/google-cloud-clouddms/protos/protos.d.ts b/packages/google-cloud-clouddms/protos/protos.d.ts new file mode 100644 index 00000000000..283936fe680 --- /dev/null +++ b/packages/google-cloud-clouddms/protos/protos.d.ts @@ -0,0 +1,11236 @@ +// 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 cloud. */ + namespace cloud { + + /** Namespace clouddms. */ + namespace clouddms { + + /** Namespace v1. */ + namespace v1 { + + /** Represents a DataMigrationService */ + class DataMigrationService extends $protobuf.rpc.Service { + + /** + * Constructs a new DataMigrationService 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 DataMigrationService 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): DataMigrationService; + + /** + * Calls ListMigrationJobs. + * @param request ListMigrationJobsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListMigrationJobsResponse + */ + public listMigrationJobs(request: google.cloud.clouddms.v1.IListMigrationJobsRequest, callback: google.cloud.clouddms.v1.DataMigrationService.ListMigrationJobsCallback): void; + + /** + * Calls ListMigrationJobs. + * @param request ListMigrationJobsRequest message or plain object + * @returns Promise + */ + public listMigrationJobs(request: google.cloud.clouddms.v1.IListMigrationJobsRequest): Promise; + + /** + * Calls GetMigrationJob. + * @param request GetMigrationJobRequest message or plain object + * @param callback Node-style callback called with the error, if any, and MigrationJob + */ + public getMigrationJob(request: google.cloud.clouddms.v1.IGetMigrationJobRequest, callback: google.cloud.clouddms.v1.DataMigrationService.GetMigrationJobCallback): void; + + /** + * Calls GetMigrationJob. + * @param request GetMigrationJobRequest message or plain object + * @returns Promise + */ + public getMigrationJob(request: google.cloud.clouddms.v1.IGetMigrationJobRequest): Promise; + + /** + * Calls CreateMigrationJob. + * @param request CreateMigrationJobRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createMigrationJob(request: google.cloud.clouddms.v1.ICreateMigrationJobRequest, callback: google.cloud.clouddms.v1.DataMigrationService.CreateMigrationJobCallback): void; + + /** + * Calls CreateMigrationJob. + * @param request CreateMigrationJobRequest message or plain object + * @returns Promise + */ + public createMigrationJob(request: google.cloud.clouddms.v1.ICreateMigrationJobRequest): Promise; + + /** + * Calls UpdateMigrationJob. + * @param request UpdateMigrationJobRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateMigrationJob(request: google.cloud.clouddms.v1.IUpdateMigrationJobRequest, callback: google.cloud.clouddms.v1.DataMigrationService.UpdateMigrationJobCallback): void; + + /** + * Calls UpdateMigrationJob. + * @param request UpdateMigrationJobRequest message or plain object + * @returns Promise + */ + public updateMigrationJob(request: google.cloud.clouddms.v1.IUpdateMigrationJobRequest): Promise; + + /** + * Calls DeleteMigrationJob. + * @param request DeleteMigrationJobRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteMigrationJob(request: google.cloud.clouddms.v1.IDeleteMigrationJobRequest, callback: google.cloud.clouddms.v1.DataMigrationService.DeleteMigrationJobCallback): void; + + /** + * Calls DeleteMigrationJob. + * @param request DeleteMigrationJobRequest message or plain object + * @returns Promise + */ + public deleteMigrationJob(request: google.cloud.clouddms.v1.IDeleteMigrationJobRequest): Promise; + + /** + * Calls StartMigrationJob. + * @param request StartMigrationJobRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public startMigrationJob(request: google.cloud.clouddms.v1.IStartMigrationJobRequest, callback: google.cloud.clouddms.v1.DataMigrationService.StartMigrationJobCallback): void; + + /** + * Calls StartMigrationJob. + * @param request StartMigrationJobRequest message or plain object + * @returns Promise + */ + public startMigrationJob(request: google.cloud.clouddms.v1.IStartMigrationJobRequest): Promise; + + /** + * Calls StopMigrationJob. + * @param request StopMigrationJobRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public stopMigrationJob(request: google.cloud.clouddms.v1.IStopMigrationJobRequest, callback: google.cloud.clouddms.v1.DataMigrationService.StopMigrationJobCallback): void; + + /** + * Calls StopMigrationJob. + * @param request StopMigrationJobRequest message or plain object + * @returns Promise + */ + public stopMigrationJob(request: google.cloud.clouddms.v1.IStopMigrationJobRequest): Promise; + + /** + * Calls ResumeMigrationJob. + * @param request ResumeMigrationJobRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public resumeMigrationJob(request: google.cloud.clouddms.v1.IResumeMigrationJobRequest, callback: google.cloud.clouddms.v1.DataMigrationService.ResumeMigrationJobCallback): void; + + /** + * Calls ResumeMigrationJob. + * @param request ResumeMigrationJobRequest message or plain object + * @returns Promise + */ + public resumeMigrationJob(request: google.cloud.clouddms.v1.IResumeMigrationJobRequest): Promise; + + /** + * Calls PromoteMigrationJob. + * @param request PromoteMigrationJobRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public promoteMigrationJob(request: google.cloud.clouddms.v1.IPromoteMigrationJobRequest, callback: google.cloud.clouddms.v1.DataMigrationService.PromoteMigrationJobCallback): void; + + /** + * Calls PromoteMigrationJob. + * @param request PromoteMigrationJobRequest message or plain object + * @returns Promise + */ + public promoteMigrationJob(request: google.cloud.clouddms.v1.IPromoteMigrationJobRequest): Promise; + + /** + * Calls VerifyMigrationJob. + * @param request VerifyMigrationJobRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public verifyMigrationJob(request: google.cloud.clouddms.v1.IVerifyMigrationJobRequest, callback: google.cloud.clouddms.v1.DataMigrationService.VerifyMigrationJobCallback): void; + + /** + * Calls VerifyMigrationJob. + * @param request VerifyMigrationJobRequest message or plain object + * @returns Promise + */ + public verifyMigrationJob(request: google.cloud.clouddms.v1.IVerifyMigrationJobRequest): Promise; + + /** + * Calls RestartMigrationJob. + * @param request RestartMigrationJobRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public restartMigrationJob(request: google.cloud.clouddms.v1.IRestartMigrationJobRequest, callback: google.cloud.clouddms.v1.DataMigrationService.RestartMigrationJobCallback): void; + + /** + * Calls RestartMigrationJob. + * @param request RestartMigrationJobRequest message or plain object + * @returns Promise + */ + public restartMigrationJob(request: google.cloud.clouddms.v1.IRestartMigrationJobRequest): Promise; + + /** + * Calls GenerateSshScript. + * @param request GenerateSshScriptRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SshScript + */ + public generateSshScript(request: google.cloud.clouddms.v1.IGenerateSshScriptRequest, callback: google.cloud.clouddms.v1.DataMigrationService.GenerateSshScriptCallback): void; + + /** + * Calls GenerateSshScript. + * @param request GenerateSshScriptRequest message or plain object + * @returns Promise + */ + public generateSshScript(request: google.cloud.clouddms.v1.IGenerateSshScriptRequest): Promise; + + /** + * Calls ListConnectionProfiles. + * @param request ListConnectionProfilesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListConnectionProfilesResponse + */ + public listConnectionProfiles(request: google.cloud.clouddms.v1.IListConnectionProfilesRequest, callback: google.cloud.clouddms.v1.DataMigrationService.ListConnectionProfilesCallback): void; + + /** + * Calls ListConnectionProfiles. + * @param request ListConnectionProfilesRequest message or plain object + * @returns Promise + */ + public listConnectionProfiles(request: google.cloud.clouddms.v1.IListConnectionProfilesRequest): Promise; + + /** + * Calls GetConnectionProfile. + * @param request GetConnectionProfileRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ConnectionProfile + */ + public getConnectionProfile(request: google.cloud.clouddms.v1.IGetConnectionProfileRequest, callback: google.cloud.clouddms.v1.DataMigrationService.GetConnectionProfileCallback): void; + + /** + * Calls GetConnectionProfile. + * @param request GetConnectionProfileRequest message or plain object + * @returns Promise + */ + public getConnectionProfile(request: google.cloud.clouddms.v1.IGetConnectionProfileRequest): Promise; + + /** + * Calls CreateConnectionProfile. + * @param request CreateConnectionProfileRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createConnectionProfile(request: google.cloud.clouddms.v1.ICreateConnectionProfileRequest, callback: google.cloud.clouddms.v1.DataMigrationService.CreateConnectionProfileCallback): void; + + /** + * Calls CreateConnectionProfile. + * @param request CreateConnectionProfileRequest message or plain object + * @returns Promise + */ + public createConnectionProfile(request: google.cloud.clouddms.v1.ICreateConnectionProfileRequest): Promise; + + /** + * Calls UpdateConnectionProfile. + * @param request UpdateConnectionProfileRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateConnectionProfile(request: google.cloud.clouddms.v1.IUpdateConnectionProfileRequest, callback: google.cloud.clouddms.v1.DataMigrationService.UpdateConnectionProfileCallback): void; + + /** + * Calls UpdateConnectionProfile. + * @param request UpdateConnectionProfileRequest message or plain object + * @returns Promise + */ + public updateConnectionProfile(request: google.cloud.clouddms.v1.IUpdateConnectionProfileRequest): Promise; + + /** + * Calls DeleteConnectionProfile. + * @param request DeleteConnectionProfileRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteConnectionProfile(request: google.cloud.clouddms.v1.IDeleteConnectionProfileRequest, callback: google.cloud.clouddms.v1.DataMigrationService.DeleteConnectionProfileCallback): void; + + /** + * Calls DeleteConnectionProfile. + * @param request DeleteConnectionProfileRequest message or plain object + * @returns Promise + */ + public deleteConnectionProfile(request: google.cloud.clouddms.v1.IDeleteConnectionProfileRequest): Promise; + } + + namespace DataMigrationService { + + /** + * Callback as used by {@link google.cloud.clouddms.v1.DataMigrationService|listMigrationJobs}. + * @param error Error, if any + * @param [response] ListMigrationJobsResponse + */ + type ListMigrationJobsCallback = (error: (Error|null), response?: google.cloud.clouddms.v1.ListMigrationJobsResponse) => void; + + /** + * Callback as used by {@link google.cloud.clouddms.v1.DataMigrationService|getMigrationJob}. + * @param error Error, if any + * @param [response] MigrationJob + */ + type GetMigrationJobCallback = (error: (Error|null), response?: google.cloud.clouddms.v1.MigrationJob) => void; + + /** + * Callback as used by {@link google.cloud.clouddms.v1.DataMigrationService|createMigrationJob}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateMigrationJobCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.clouddms.v1.DataMigrationService|updateMigrationJob}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateMigrationJobCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.clouddms.v1.DataMigrationService|deleteMigrationJob}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteMigrationJobCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.clouddms.v1.DataMigrationService|startMigrationJob}. + * @param error Error, if any + * @param [response] Operation + */ + type StartMigrationJobCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.clouddms.v1.DataMigrationService|stopMigrationJob}. + * @param error Error, if any + * @param [response] Operation + */ + type StopMigrationJobCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.clouddms.v1.DataMigrationService|resumeMigrationJob}. + * @param error Error, if any + * @param [response] Operation + */ + type ResumeMigrationJobCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.clouddms.v1.DataMigrationService|promoteMigrationJob}. + * @param error Error, if any + * @param [response] Operation + */ + type PromoteMigrationJobCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.clouddms.v1.DataMigrationService|verifyMigrationJob}. + * @param error Error, if any + * @param [response] Operation + */ + type VerifyMigrationJobCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.clouddms.v1.DataMigrationService|restartMigrationJob}. + * @param error Error, if any + * @param [response] Operation + */ + type RestartMigrationJobCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.clouddms.v1.DataMigrationService|generateSshScript}. + * @param error Error, if any + * @param [response] SshScript + */ + type GenerateSshScriptCallback = (error: (Error|null), response?: google.cloud.clouddms.v1.SshScript) => void; + + /** + * Callback as used by {@link google.cloud.clouddms.v1.DataMigrationService|listConnectionProfiles}. + * @param error Error, if any + * @param [response] ListConnectionProfilesResponse + */ + type ListConnectionProfilesCallback = (error: (Error|null), response?: google.cloud.clouddms.v1.ListConnectionProfilesResponse) => void; + + /** + * Callback as used by {@link google.cloud.clouddms.v1.DataMigrationService|getConnectionProfile}. + * @param error Error, if any + * @param [response] ConnectionProfile + */ + type GetConnectionProfileCallback = (error: (Error|null), response?: google.cloud.clouddms.v1.ConnectionProfile) => void; + + /** + * Callback as used by {@link google.cloud.clouddms.v1.DataMigrationService|createConnectionProfile}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateConnectionProfileCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.clouddms.v1.DataMigrationService|updateConnectionProfile}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateConnectionProfileCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.clouddms.v1.DataMigrationService|deleteConnectionProfile}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteConnectionProfileCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + } + + /** Properties of a ListMigrationJobsRequest. */ + interface IListMigrationJobsRequest { + + /** ListMigrationJobsRequest parent */ + parent?: (string|null); + + /** ListMigrationJobsRequest pageSize */ + pageSize?: (number|null); + + /** ListMigrationJobsRequest pageToken */ + pageToken?: (string|null); + + /** ListMigrationJobsRequest filter */ + filter?: (string|null); + + /** ListMigrationJobsRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListMigrationJobsRequest. */ + class ListMigrationJobsRequest implements IListMigrationJobsRequest { + + /** + * Constructs a new ListMigrationJobsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.clouddms.v1.IListMigrationJobsRequest); + + /** ListMigrationJobsRequest parent. */ + public parent: string; + + /** ListMigrationJobsRequest pageSize. */ + public pageSize: number; + + /** ListMigrationJobsRequest pageToken. */ + public pageToken: string; + + /** ListMigrationJobsRequest filter. */ + public filter: string; + + /** ListMigrationJobsRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListMigrationJobsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListMigrationJobsRequest instance + */ + public static create(properties?: google.cloud.clouddms.v1.IListMigrationJobsRequest): google.cloud.clouddms.v1.ListMigrationJobsRequest; + + /** + * Encodes the specified ListMigrationJobsRequest message. Does not implicitly {@link google.cloud.clouddms.v1.ListMigrationJobsRequest.verify|verify} messages. + * @param message ListMigrationJobsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.clouddms.v1.IListMigrationJobsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListMigrationJobsRequest message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.ListMigrationJobsRequest.verify|verify} messages. + * @param message ListMigrationJobsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.clouddms.v1.IListMigrationJobsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListMigrationJobsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListMigrationJobsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.clouddms.v1.ListMigrationJobsRequest; + + /** + * Decodes a ListMigrationJobsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListMigrationJobsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.clouddms.v1.ListMigrationJobsRequest; + + /** + * Verifies a ListMigrationJobsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListMigrationJobsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListMigrationJobsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.clouddms.v1.ListMigrationJobsRequest; + + /** + * Creates a plain object from a ListMigrationJobsRequest message. Also converts values to other types if specified. + * @param message ListMigrationJobsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.clouddms.v1.ListMigrationJobsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListMigrationJobsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListMigrationJobsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListMigrationJobsResponse. */ + interface IListMigrationJobsResponse { + + /** ListMigrationJobsResponse migrationJobs */ + migrationJobs?: (google.cloud.clouddms.v1.IMigrationJob[]|null); + + /** ListMigrationJobsResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListMigrationJobsResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListMigrationJobsResponse. */ + class ListMigrationJobsResponse implements IListMigrationJobsResponse { + + /** + * Constructs a new ListMigrationJobsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.clouddms.v1.IListMigrationJobsResponse); + + /** ListMigrationJobsResponse migrationJobs. */ + public migrationJobs: google.cloud.clouddms.v1.IMigrationJob[]; + + /** ListMigrationJobsResponse nextPageToken. */ + public nextPageToken: string; + + /** ListMigrationJobsResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListMigrationJobsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListMigrationJobsResponse instance + */ + public static create(properties?: google.cloud.clouddms.v1.IListMigrationJobsResponse): google.cloud.clouddms.v1.ListMigrationJobsResponse; + + /** + * Encodes the specified ListMigrationJobsResponse message. Does not implicitly {@link google.cloud.clouddms.v1.ListMigrationJobsResponse.verify|verify} messages. + * @param message ListMigrationJobsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.clouddms.v1.IListMigrationJobsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListMigrationJobsResponse message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.ListMigrationJobsResponse.verify|verify} messages. + * @param message ListMigrationJobsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.clouddms.v1.IListMigrationJobsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListMigrationJobsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListMigrationJobsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.clouddms.v1.ListMigrationJobsResponse; + + /** + * Decodes a ListMigrationJobsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListMigrationJobsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.clouddms.v1.ListMigrationJobsResponse; + + /** + * Verifies a ListMigrationJobsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListMigrationJobsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListMigrationJobsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.clouddms.v1.ListMigrationJobsResponse; + + /** + * Creates a plain object from a ListMigrationJobsResponse message. Also converts values to other types if specified. + * @param message ListMigrationJobsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.clouddms.v1.ListMigrationJobsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListMigrationJobsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListMigrationJobsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetMigrationJobRequest. */ + interface IGetMigrationJobRequest { + + /** GetMigrationJobRequest name */ + name?: (string|null); + } + + /** Represents a GetMigrationJobRequest. */ + class GetMigrationJobRequest implements IGetMigrationJobRequest { + + /** + * Constructs a new GetMigrationJobRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.clouddms.v1.IGetMigrationJobRequest); + + /** GetMigrationJobRequest name. */ + public name: string; + + /** + * Creates a new GetMigrationJobRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetMigrationJobRequest instance + */ + public static create(properties?: google.cloud.clouddms.v1.IGetMigrationJobRequest): google.cloud.clouddms.v1.GetMigrationJobRequest; + + /** + * Encodes the specified GetMigrationJobRequest message. Does not implicitly {@link google.cloud.clouddms.v1.GetMigrationJobRequest.verify|verify} messages. + * @param message GetMigrationJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.clouddms.v1.IGetMigrationJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetMigrationJobRequest message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.GetMigrationJobRequest.verify|verify} messages. + * @param message GetMigrationJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.clouddms.v1.IGetMigrationJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetMigrationJobRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetMigrationJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.clouddms.v1.GetMigrationJobRequest; + + /** + * Decodes a GetMigrationJobRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetMigrationJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.clouddms.v1.GetMigrationJobRequest; + + /** + * Verifies a GetMigrationJobRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetMigrationJobRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetMigrationJobRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.clouddms.v1.GetMigrationJobRequest; + + /** + * Creates a plain object from a GetMigrationJobRequest message. Also converts values to other types if specified. + * @param message GetMigrationJobRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.clouddms.v1.GetMigrationJobRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetMigrationJobRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetMigrationJobRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateMigrationJobRequest. */ + interface ICreateMigrationJobRequest { + + /** CreateMigrationJobRequest parent */ + parent?: (string|null); + + /** CreateMigrationJobRequest migrationJobId */ + migrationJobId?: (string|null); + + /** CreateMigrationJobRequest migrationJob */ + migrationJob?: (google.cloud.clouddms.v1.IMigrationJob|null); + + /** CreateMigrationJobRequest requestId */ + requestId?: (string|null); + } + + /** Represents a CreateMigrationJobRequest. */ + class CreateMigrationJobRequest implements ICreateMigrationJobRequest { + + /** + * Constructs a new CreateMigrationJobRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.clouddms.v1.ICreateMigrationJobRequest); + + /** CreateMigrationJobRequest parent. */ + public parent: string; + + /** CreateMigrationJobRequest migrationJobId. */ + public migrationJobId: string; + + /** CreateMigrationJobRequest migrationJob. */ + public migrationJob?: (google.cloud.clouddms.v1.IMigrationJob|null); + + /** CreateMigrationJobRequest requestId. */ + public requestId: string; + + /** + * Creates a new CreateMigrationJobRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateMigrationJobRequest instance + */ + public static create(properties?: google.cloud.clouddms.v1.ICreateMigrationJobRequest): google.cloud.clouddms.v1.CreateMigrationJobRequest; + + /** + * Encodes the specified CreateMigrationJobRequest message. Does not implicitly {@link google.cloud.clouddms.v1.CreateMigrationJobRequest.verify|verify} messages. + * @param message CreateMigrationJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.clouddms.v1.ICreateMigrationJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateMigrationJobRequest message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.CreateMigrationJobRequest.verify|verify} messages. + * @param message CreateMigrationJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.clouddms.v1.ICreateMigrationJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateMigrationJobRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateMigrationJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.clouddms.v1.CreateMigrationJobRequest; + + /** + * Decodes a CreateMigrationJobRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateMigrationJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.clouddms.v1.CreateMigrationJobRequest; + + /** + * Verifies a CreateMigrationJobRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateMigrationJobRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateMigrationJobRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.clouddms.v1.CreateMigrationJobRequest; + + /** + * Creates a plain object from a CreateMigrationJobRequest message. Also converts values to other types if specified. + * @param message CreateMigrationJobRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.clouddms.v1.CreateMigrationJobRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateMigrationJobRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateMigrationJobRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateMigrationJobRequest. */ + interface IUpdateMigrationJobRequest { + + /** UpdateMigrationJobRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateMigrationJobRequest migrationJob */ + migrationJob?: (google.cloud.clouddms.v1.IMigrationJob|null); + + /** UpdateMigrationJobRequest requestId */ + requestId?: (string|null); + } + + /** Represents an UpdateMigrationJobRequest. */ + class UpdateMigrationJobRequest implements IUpdateMigrationJobRequest { + + /** + * Constructs a new UpdateMigrationJobRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.clouddms.v1.IUpdateMigrationJobRequest); + + /** UpdateMigrationJobRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateMigrationJobRequest migrationJob. */ + public migrationJob?: (google.cloud.clouddms.v1.IMigrationJob|null); + + /** UpdateMigrationJobRequest requestId. */ + public requestId: string; + + /** + * Creates a new UpdateMigrationJobRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateMigrationJobRequest instance + */ + public static create(properties?: google.cloud.clouddms.v1.IUpdateMigrationJobRequest): google.cloud.clouddms.v1.UpdateMigrationJobRequest; + + /** + * Encodes the specified UpdateMigrationJobRequest message. Does not implicitly {@link google.cloud.clouddms.v1.UpdateMigrationJobRequest.verify|verify} messages. + * @param message UpdateMigrationJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.clouddms.v1.IUpdateMigrationJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateMigrationJobRequest message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.UpdateMigrationJobRequest.verify|verify} messages. + * @param message UpdateMigrationJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.clouddms.v1.IUpdateMigrationJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateMigrationJobRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateMigrationJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.clouddms.v1.UpdateMigrationJobRequest; + + /** + * Decodes an UpdateMigrationJobRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateMigrationJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.clouddms.v1.UpdateMigrationJobRequest; + + /** + * Verifies an UpdateMigrationJobRequest message. + * @param message Plain 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 UpdateMigrationJobRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateMigrationJobRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.clouddms.v1.UpdateMigrationJobRequest; + + /** + * Creates a plain object from an UpdateMigrationJobRequest message. Also converts values to other types if specified. + * @param message UpdateMigrationJobRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.clouddms.v1.UpdateMigrationJobRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateMigrationJobRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateMigrationJobRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteMigrationJobRequest. */ + interface IDeleteMigrationJobRequest { + + /** DeleteMigrationJobRequest name */ + name?: (string|null); + + /** DeleteMigrationJobRequest requestId */ + requestId?: (string|null); + + /** DeleteMigrationJobRequest force */ + force?: (boolean|null); + } + + /** Represents a DeleteMigrationJobRequest. */ + class DeleteMigrationJobRequest implements IDeleteMigrationJobRequest { + + /** + * Constructs a new DeleteMigrationJobRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.clouddms.v1.IDeleteMigrationJobRequest); + + /** DeleteMigrationJobRequest name. */ + public name: string; + + /** DeleteMigrationJobRequest requestId. */ + public requestId: string; + + /** DeleteMigrationJobRequest force. */ + public force: boolean; + + /** + * Creates a new DeleteMigrationJobRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteMigrationJobRequest instance + */ + public static create(properties?: google.cloud.clouddms.v1.IDeleteMigrationJobRequest): google.cloud.clouddms.v1.DeleteMigrationJobRequest; + + /** + * Encodes the specified DeleteMigrationJobRequest message. Does not implicitly {@link google.cloud.clouddms.v1.DeleteMigrationJobRequest.verify|verify} messages. + * @param message DeleteMigrationJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.clouddms.v1.IDeleteMigrationJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteMigrationJobRequest message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.DeleteMigrationJobRequest.verify|verify} messages. + * @param message DeleteMigrationJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.clouddms.v1.IDeleteMigrationJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteMigrationJobRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteMigrationJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.clouddms.v1.DeleteMigrationJobRequest; + + /** + * Decodes a DeleteMigrationJobRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteMigrationJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.clouddms.v1.DeleteMigrationJobRequest; + + /** + * Verifies a DeleteMigrationJobRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteMigrationJobRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteMigrationJobRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.clouddms.v1.DeleteMigrationJobRequest; + + /** + * Creates a plain object from a DeleteMigrationJobRequest message. Also converts values to other types if specified. + * @param message DeleteMigrationJobRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.clouddms.v1.DeleteMigrationJobRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteMigrationJobRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteMigrationJobRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StartMigrationJobRequest. */ + interface IStartMigrationJobRequest { + + /** StartMigrationJobRequest name */ + name?: (string|null); + } + + /** Represents a StartMigrationJobRequest. */ + class StartMigrationJobRequest implements IStartMigrationJobRequest { + + /** + * Constructs a new StartMigrationJobRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.clouddms.v1.IStartMigrationJobRequest); + + /** StartMigrationJobRequest name. */ + public name: string; + + /** + * Creates a new StartMigrationJobRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns StartMigrationJobRequest instance + */ + public static create(properties?: google.cloud.clouddms.v1.IStartMigrationJobRequest): google.cloud.clouddms.v1.StartMigrationJobRequest; + + /** + * Encodes the specified StartMigrationJobRequest message. Does not implicitly {@link google.cloud.clouddms.v1.StartMigrationJobRequest.verify|verify} messages. + * @param message StartMigrationJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.clouddms.v1.IStartMigrationJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StartMigrationJobRequest message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.StartMigrationJobRequest.verify|verify} messages. + * @param message StartMigrationJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.clouddms.v1.IStartMigrationJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StartMigrationJobRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StartMigrationJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.clouddms.v1.StartMigrationJobRequest; + + /** + * Decodes a StartMigrationJobRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StartMigrationJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.clouddms.v1.StartMigrationJobRequest; + + /** + * Verifies a StartMigrationJobRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StartMigrationJobRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StartMigrationJobRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.clouddms.v1.StartMigrationJobRequest; + + /** + * Creates a plain object from a StartMigrationJobRequest message. Also converts values to other types if specified. + * @param message StartMigrationJobRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.clouddms.v1.StartMigrationJobRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StartMigrationJobRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StartMigrationJobRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StopMigrationJobRequest. */ + interface IStopMigrationJobRequest { + + /** StopMigrationJobRequest name */ + name?: (string|null); + } + + /** Represents a StopMigrationJobRequest. */ + class StopMigrationJobRequest implements IStopMigrationJobRequest { + + /** + * Constructs a new StopMigrationJobRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.clouddms.v1.IStopMigrationJobRequest); + + /** StopMigrationJobRequest name. */ + public name: string; + + /** + * Creates a new StopMigrationJobRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns StopMigrationJobRequest instance + */ + public static create(properties?: google.cloud.clouddms.v1.IStopMigrationJobRequest): google.cloud.clouddms.v1.StopMigrationJobRequest; + + /** + * Encodes the specified StopMigrationJobRequest message. Does not implicitly {@link google.cloud.clouddms.v1.StopMigrationJobRequest.verify|verify} messages. + * @param message StopMigrationJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.clouddms.v1.IStopMigrationJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StopMigrationJobRequest message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.StopMigrationJobRequest.verify|verify} messages. + * @param message StopMigrationJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.clouddms.v1.IStopMigrationJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StopMigrationJobRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StopMigrationJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.clouddms.v1.StopMigrationJobRequest; + + /** + * Decodes a StopMigrationJobRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StopMigrationJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.clouddms.v1.StopMigrationJobRequest; + + /** + * Verifies a StopMigrationJobRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StopMigrationJobRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StopMigrationJobRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.clouddms.v1.StopMigrationJobRequest; + + /** + * Creates a plain object from a StopMigrationJobRequest message. Also converts values to other types if specified. + * @param message StopMigrationJobRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.clouddms.v1.StopMigrationJobRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StopMigrationJobRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StopMigrationJobRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ResumeMigrationJobRequest. */ + interface IResumeMigrationJobRequest { + + /** ResumeMigrationJobRequest name */ + name?: (string|null); + } + + /** Represents a ResumeMigrationJobRequest. */ + class ResumeMigrationJobRequest implements IResumeMigrationJobRequest { + + /** + * Constructs a new ResumeMigrationJobRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.clouddms.v1.IResumeMigrationJobRequest); + + /** ResumeMigrationJobRequest name. */ + public name: string; + + /** + * Creates a new ResumeMigrationJobRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ResumeMigrationJobRequest instance + */ + public static create(properties?: google.cloud.clouddms.v1.IResumeMigrationJobRequest): google.cloud.clouddms.v1.ResumeMigrationJobRequest; + + /** + * Encodes the specified ResumeMigrationJobRequest message. Does not implicitly {@link google.cloud.clouddms.v1.ResumeMigrationJobRequest.verify|verify} messages. + * @param message ResumeMigrationJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.clouddms.v1.IResumeMigrationJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResumeMigrationJobRequest message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.ResumeMigrationJobRequest.verify|verify} messages. + * @param message ResumeMigrationJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.clouddms.v1.IResumeMigrationJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResumeMigrationJobRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResumeMigrationJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.clouddms.v1.ResumeMigrationJobRequest; + + /** + * Decodes a ResumeMigrationJobRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResumeMigrationJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.clouddms.v1.ResumeMigrationJobRequest; + + /** + * Verifies a ResumeMigrationJobRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResumeMigrationJobRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResumeMigrationJobRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.clouddms.v1.ResumeMigrationJobRequest; + + /** + * Creates a plain object from a ResumeMigrationJobRequest message. Also converts values to other types if specified. + * @param message ResumeMigrationJobRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.clouddms.v1.ResumeMigrationJobRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResumeMigrationJobRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResumeMigrationJobRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PromoteMigrationJobRequest. */ + interface IPromoteMigrationJobRequest { + + /** PromoteMigrationJobRequest name */ + name?: (string|null); + } + + /** Represents a PromoteMigrationJobRequest. */ + class PromoteMigrationJobRequest implements IPromoteMigrationJobRequest { + + /** + * Constructs a new PromoteMigrationJobRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.clouddms.v1.IPromoteMigrationJobRequest); + + /** PromoteMigrationJobRequest name. */ + public name: string; + + /** + * Creates a new PromoteMigrationJobRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns PromoteMigrationJobRequest instance + */ + public static create(properties?: google.cloud.clouddms.v1.IPromoteMigrationJobRequest): google.cloud.clouddms.v1.PromoteMigrationJobRequest; + + /** + * Encodes the specified PromoteMigrationJobRequest message. Does not implicitly {@link google.cloud.clouddms.v1.PromoteMigrationJobRequest.verify|verify} messages. + * @param message PromoteMigrationJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.clouddms.v1.IPromoteMigrationJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PromoteMigrationJobRequest message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.PromoteMigrationJobRequest.verify|verify} messages. + * @param message PromoteMigrationJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.clouddms.v1.IPromoteMigrationJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PromoteMigrationJobRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PromoteMigrationJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.clouddms.v1.PromoteMigrationJobRequest; + + /** + * Decodes a PromoteMigrationJobRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PromoteMigrationJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.clouddms.v1.PromoteMigrationJobRequest; + + /** + * Verifies a PromoteMigrationJobRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PromoteMigrationJobRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PromoteMigrationJobRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.clouddms.v1.PromoteMigrationJobRequest; + + /** + * Creates a plain object from a PromoteMigrationJobRequest message. Also converts values to other types if specified. + * @param message PromoteMigrationJobRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.clouddms.v1.PromoteMigrationJobRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PromoteMigrationJobRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PromoteMigrationJobRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a VerifyMigrationJobRequest. */ + interface IVerifyMigrationJobRequest { + + /** VerifyMigrationJobRequest name */ + name?: (string|null); + } + + /** Represents a VerifyMigrationJobRequest. */ + class VerifyMigrationJobRequest implements IVerifyMigrationJobRequest { + + /** + * Constructs a new VerifyMigrationJobRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.clouddms.v1.IVerifyMigrationJobRequest); + + /** VerifyMigrationJobRequest name. */ + public name: string; + + /** + * Creates a new VerifyMigrationJobRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns VerifyMigrationJobRequest instance + */ + public static create(properties?: google.cloud.clouddms.v1.IVerifyMigrationJobRequest): google.cloud.clouddms.v1.VerifyMigrationJobRequest; + + /** + * Encodes the specified VerifyMigrationJobRequest message. Does not implicitly {@link google.cloud.clouddms.v1.VerifyMigrationJobRequest.verify|verify} messages. + * @param message VerifyMigrationJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.clouddms.v1.IVerifyMigrationJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VerifyMigrationJobRequest message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.VerifyMigrationJobRequest.verify|verify} messages. + * @param message VerifyMigrationJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.clouddms.v1.IVerifyMigrationJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VerifyMigrationJobRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VerifyMigrationJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.clouddms.v1.VerifyMigrationJobRequest; + + /** + * Decodes a VerifyMigrationJobRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VerifyMigrationJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.clouddms.v1.VerifyMigrationJobRequest; + + /** + * Verifies a VerifyMigrationJobRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a VerifyMigrationJobRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VerifyMigrationJobRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.clouddms.v1.VerifyMigrationJobRequest; + + /** + * Creates a plain object from a VerifyMigrationJobRequest message. Also converts values to other types if specified. + * @param message VerifyMigrationJobRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.clouddms.v1.VerifyMigrationJobRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VerifyMigrationJobRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VerifyMigrationJobRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RestartMigrationJobRequest. */ + interface IRestartMigrationJobRequest { + + /** RestartMigrationJobRequest name */ + name?: (string|null); + } + + /** Represents a RestartMigrationJobRequest. */ + class RestartMigrationJobRequest implements IRestartMigrationJobRequest { + + /** + * Constructs a new RestartMigrationJobRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.clouddms.v1.IRestartMigrationJobRequest); + + /** RestartMigrationJobRequest name. */ + public name: string; + + /** + * Creates a new RestartMigrationJobRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RestartMigrationJobRequest instance + */ + public static create(properties?: google.cloud.clouddms.v1.IRestartMigrationJobRequest): google.cloud.clouddms.v1.RestartMigrationJobRequest; + + /** + * Encodes the specified RestartMigrationJobRequest message. Does not implicitly {@link google.cloud.clouddms.v1.RestartMigrationJobRequest.verify|verify} messages. + * @param message RestartMigrationJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.clouddms.v1.IRestartMigrationJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RestartMigrationJobRequest message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.RestartMigrationJobRequest.verify|verify} messages. + * @param message RestartMigrationJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.clouddms.v1.IRestartMigrationJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RestartMigrationJobRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RestartMigrationJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.clouddms.v1.RestartMigrationJobRequest; + + /** + * Decodes a RestartMigrationJobRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RestartMigrationJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.clouddms.v1.RestartMigrationJobRequest; + + /** + * Verifies a RestartMigrationJobRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RestartMigrationJobRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RestartMigrationJobRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.clouddms.v1.RestartMigrationJobRequest; + + /** + * Creates a plain object from a RestartMigrationJobRequest message. Also converts values to other types if specified. + * @param message RestartMigrationJobRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.clouddms.v1.RestartMigrationJobRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RestartMigrationJobRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RestartMigrationJobRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GenerateSshScriptRequest. */ + interface IGenerateSshScriptRequest { + + /** GenerateSshScriptRequest migrationJob */ + migrationJob?: (string|null); + + /** GenerateSshScriptRequest vm */ + vm?: (string|null); + + /** GenerateSshScriptRequest vmCreationConfig */ + vmCreationConfig?: (google.cloud.clouddms.v1.IVmCreationConfig|null); + + /** GenerateSshScriptRequest vmSelectionConfig */ + vmSelectionConfig?: (google.cloud.clouddms.v1.IVmSelectionConfig|null); + + /** GenerateSshScriptRequest vmPort */ + vmPort?: (number|null); + } + + /** Represents a GenerateSshScriptRequest. */ + class GenerateSshScriptRequest implements IGenerateSshScriptRequest { + + /** + * Constructs a new GenerateSshScriptRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.clouddms.v1.IGenerateSshScriptRequest); + + /** GenerateSshScriptRequest migrationJob. */ + public migrationJob: string; + + /** GenerateSshScriptRequest vm. */ + public vm: string; + + /** GenerateSshScriptRequest vmCreationConfig. */ + public vmCreationConfig?: (google.cloud.clouddms.v1.IVmCreationConfig|null); + + /** GenerateSshScriptRequest vmSelectionConfig. */ + public vmSelectionConfig?: (google.cloud.clouddms.v1.IVmSelectionConfig|null); + + /** GenerateSshScriptRequest vmPort. */ + public vmPort: number; + + /** GenerateSshScriptRequest vmConfig. */ + public vmConfig?: ("vmCreationConfig"|"vmSelectionConfig"); + + /** + * Creates a new GenerateSshScriptRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GenerateSshScriptRequest instance + */ + public static create(properties?: google.cloud.clouddms.v1.IGenerateSshScriptRequest): google.cloud.clouddms.v1.GenerateSshScriptRequest; + + /** + * Encodes the specified GenerateSshScriptRequest message. Does not implicitly {@link google.cloud.clouddms.v1.GenerateSshScriptRequest.verify|verify} messages. + * @param message GenerateSshScriptRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.clouddms.v1.IGenerateSshScriptRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GenerateSshScriptRequest message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.GenerateSshScriptRequest.verify|verify} messages. + * @param message GenerateSshScriptRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.clouddms.v1.IGenerateSshScriptRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GenerateSshScriptRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GenerateSshScriptRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.clouddms.v1.GenerateSshScriptRequest; + + /** + * Decodes a GenerateSshScriptRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GenerateSshScriptRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.clouddms.v1.GenerateSshScriptRequest; + + /** + * Verifies a GenerateSshScriptRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GenerateSshScriptRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GenerateSshScriptRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.clouddms.v1.GenerateSshScriptRequest; + + /** + * Creates a plain object from a GenerateSshScriptRequest message. Also converts values to other types if specified. + * @param message GenerateSshScriptRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.clouddms.v1.GenerateSshScriptRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GenerateSshScriptRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GenerateSshScriptRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a VmCreationConfig. */ + interface IVmCreationConfig { + + /** VmCreationConfig vmMachineType */ + vmMachineType?: (string|null); + + /** VmCreationConfig vmZone */ + vmZone?: (string|null); + + /** VmCreationConfig subnet */ + subnet?: (string|null); + } + + /** Represents a VmCreationConfig. */ + class VmCreationConfig implements IVmCreationConfig { + + /** + * Constructs a new VmCreationConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.clouddms.v1.IVmCreationConfig); + + /** VmCreationConfig vmMachineType. */ + public vmMachineType: string; + + /** VmCreationConfig vmZone. */ + public vmZone: string; + + /** VmCreationConfig subnet. */ + public subnet: string; + + /** + * Creates a new VmCreationConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns VmCreationConfig instance + */ + public static create(properties?: google.cloud.clouddms.v1.IVmCreationConfig): google.cloud.clouddms.v1.VmCreationConfig; + + /** + * Encodes the specified VmCreationConfig message. Does not implicitly {@link google.cloud.clouddms.v1.VmCreationConfig.verify|verify} messages. + * @param message VmCreationConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.clouddms.v1.IVmCreationConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VmCreationConfig message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.VmCreationConfig.verify|verify} messages. + * @param message VmCreationConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.clouddms.v1.IVmCreationConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VmCreationConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VmCreationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.clouddms.v1.VmCreationConfig; + + /** + * Decodes a VmCreationConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VmCreationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.clouddms.v1.VmCreationConfig; + + /** + * Verifies a VmCreationConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a VmCreationConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VmCreationConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.clouddms.v1.VmCreationConfig; + + /** + * Creates a plain object from a VmCreationConfig message. Also converts values to other types if specified. + * @param message VmCreationConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.clouddms.v1.VmCreationConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VmCreationConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VmCreationConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a VmSelectionConfig. */ + interface IVmSelectionConfig { + + /** VmSelectionConfig vmZone */ + vmZone?: (string|null); + } + + /** Represents a VmSelectionConfig. */ + class VmSelectionConfig implements IVmSelectionConfig { + + /** + * Constructs a new VmSelectionConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.clouddms.v1.IVmSelectionConfig); + + /** VmSelectionConfig vmZone. */ + public vmZone: string; + + /** + * Creates a new VmSelectionConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns VmSelectionConfig instance + */ + public static create(properties?: google.cloud.clouddms.v1.IVmSelectionConfig): google.cloud.clouddms.v1.VmSelectionConfig; + + /** + * Encodes the specified VmSelectionConfig message. Does not implicitly {@link google.cloud.clouddms.v1.VmSelectionConfig.verify|verify} messages. + * @param message VmSelectionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.clouddms.v1.IVmSelectionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VmSelectionConfig message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.VmSelectionConfig.verify|verify} messages. + * @param message VmSelectionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.clouddms.v1.IVmSelectionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VmSelectionConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VmSelectionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.clouddms.v1.VmSelectionConfig; + + /** + * Decodes a VmSelectionConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VmSelectionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.clouddms.v1.VmSelectionConfig; + + /** + * Verifies a VmSelectionConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a VmSelectionConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VmSelectionConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.clouddms.v1.VmSelectionConfig; + + /** + * Creates a plain object from a VmSelectionConfig message. Also converts values to other types if specified. + * @param message VmSelectionConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.clouddms.v1.VmSelectionConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VmSelectionConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VmSelectionConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SshScript. */ + interface ISshScript { + + /** SshScript script */ + script?: (string|null); + } + + /** Represents a SshScript. */ + class SshScript implements ISshScript { + + /** + * Constructs a new SshScript. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.clouddms.v1.ISshScript); + + /** SshScript script. */ + public script: string; + + /** + * Creates a new SshScript instance using the specified properties. + * @param [properties] Properties to set + * @returns SshScript instance + */ + public static create(properties?: google.cloud.clouddms.v1.ISshScript): google.cloud.clouddms.v1.SshScript; + + /** + * Encodes the specified SshScript message. Does not implicitly {@link google.cloud.clouddms.v1.SshScript.verify|verify} messages. + * @param message SshScript message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.clouddms.v1.ISshScript, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SshScript message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.SshScript.verify|verify} messages. + * @param message SshScript message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.clouddms.v1.ISshScript, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SshScript message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SshScript + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.clouddms.v1.SshScript; + + /** + * Decodes a SshScript message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SshScript + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.clouddms.v1.SshScript; + + /** + * Verifies a SshScript message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SshScript message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SshScript + */ + public static fromObject(object: { [k: string]: any }): google.cloud.clouddms.v1.SshScript; + + /** + * Creates a plain object from a SshScript message. Also converts values to other types if specified. + * @param message SshScript + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.clouddms.v1.SshScript, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SshScript to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SshScript + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListConnectionProfilesRequest. */ + interface IListConnectionProfilesRequest { + + /** ListConnectionProfilesRequest parent */ + parent?: (string|null); + + /** ListConnectionProfilesRequest pageSize */ + pageSize?: (number|null); + + /** ListConnectionProfilesRequest pageToken */ + pageToken?: (string|null); + + /** ListConnectionProfilesRequest filter */ + filter?: (string|null); + + /** ListConnectionProfilesRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListConnectionProfilesRequest. */ + class ListConnectionProfilesRequest implements IListConnectionProfilesRequest { + + /** + * Constructs a new ListConnectionProfilesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.clouddms.v1.IListConnectionProfilesRequest); + + /** ListConnectionProfilesRequest parent. */ + public parent: string; + + /** ListConnectionProfilesRequest pageSize. */ + public pageSize: number; + + /** ListConnectionProfilesRequest pageToken. */ + public pageToken: string; + + /** ListConnectionProfilesRequest filter. */ + public filter: string; + + /** ListConnectionProfilesRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListConnectionProfilesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListConnectionProfilesRequest instance + */ + public static create(properties?: google.cloud.clouddms.v1.IListConnectionProfilesRequest): google.cloud.clouddms.v1.ListConnectionProfilesRequest; + + /** + * Encodes the specified ListConnectionProfilesRequest message. Does not implicitly {@link google.cloud.clouddms.v1.ListConnectionProfilesRequest.verify|verify} messages. + * @param message ListConnectionProfilesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.clouddms.v1.IListConnectionProfilesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListConnectionProfilesRequest message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.ListConnectionProfilesRequest.verify|verify} messages. + * @param message ListConnectionProfilesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.clouddms.v1.IListConnectionProfilesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListConnectionProfilesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListConnectionProfilesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.clouddms.v1.ListConnectionProfilesRequest; + + /** + * Decodes a ListConnectionProfilesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListConnectionProfilesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.clouddms.v1.ListConnectionProfilesRequest; + + /** + * Verifies a ListConnectionProfilesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListConnectionProfilesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListConnectionProfilesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.clouddms.v1.ListConnectionProfilesRequest; + + /** + * Creates a plain object from a ListConnectionProfilesRequest message. Also converts values to other types if specified. + * @param message ListConnectionProfilesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.clouddms.v1.ListConnectionProfilesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListConnectionProfilesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListConnectionProfilesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListConnectionProfilesResponse. */ + interface IListConnectionProfilesResponse { + + /** ListConnectionProfilesResponse connectionProfiles */ + connectionProfiles?: (google.cloud.clouddms.v1.IConnectionProfile[]|null); + + /** ListConnectionProfilesResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListConnectionProfilesResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListConnectionProfilesResponse. */ + class ListConnectionProfilesResponse implements IListConnectionProfilesResponse { + + /** + * Constructs a new ListConnectionProfilesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.clouddms.v1.IListConnectionProfilesResponse); + + /** ListConnectionProfilesResponse connectionProfiles. */ + public connectionProfiles: google.cloud.clouddms.v1.IConnectionProfile[]; + + /** ListConnectionProfilesResponse nextPageToken. */ + public nextPageToken: string; + + /** ListConnectionProfilesResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListConnectionProfilesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListConnectionProfilesResponse instance + */ + public static create(properties?: google.cloud.clouddms.v1.IListConnectionProfilesResponse): google.cloud.clouddms.v1.ListConnectionProfilesResponse; + + /** + * Encodes the specified ListConnectionProfilesResponse message. Does not implicitly {@link google.cloud.clouddms.v1.ListConnectionProfilesResponse.verify|verify} messages. + * @param message ListConnectionProfilesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.clouddms.v1.IListConnectionProfilesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListConnectionProfilesResponse message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.ListConnectionProfilesResponse.verify|verify} messages. + * @param message ListConnectionProfilesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.clouddms.v1.IListConnectionProfilesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListConnectionProfilesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListConnectionProfilesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.clouddms.v1.ListConnectionProfilesResponse; + + /** + * Decodes a ListConnectionProfilesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListConnectionProfilesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.clouddms.v1.ListConnectionProfilesResponse; + + /** + * Verifies a ListConnectionProfilesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListConnectionProfilesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListConnectionProfilesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.clouddms.v1.ListConnectionProfilesResponse; + + /** + * Creates a plain object from a ListConnectionProfilesResponse message. Also converts values to other types if specified. + * @param message ListConnectionProfilesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.clouddms.v1.ListConnectionProfilesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListConnectionProfilesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListConnectionProfilesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetConnectionProfileRequest. */ + interface IGetConnectionProfileRequest { + + /** GetConnectionProfileRequest name */ + name?: (string|null); + } + + /** Represents a GetConnectionProfileRequest. */ + class GetConnectionProfileRequest implements IGetConnectionProfileRequest { + + /** + * Constructs a new GetConnectionProfileRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.clouddms.v1.IGetConnectionProfileRequest); + + /** GetConnectionProfileRequest name. */ + public name: string; + + /** + * Creates a new GetConnectionProfileRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetConnectionProfileRequest instance + */ + public static create(properties?: google.cloud.clouddms.v1.IGetConnectionProfileRequest): google.cloud.clouddms.v1.GetConnectionProfileRequest; + + /** + * Encodes the specified GetConnectionProfileRequest message. Does not implicitly {@link google.cloud.clouddms.v1.GetConnectionProfileRequest.verify|verify} messages. + * @param message GetConnectionProfileRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.clouddms.v1.IGetConnectionProfileRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetConnectionProfileRequest message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.GetConnectionProfileRequest.verify|verify} messages. + * @param message GetConnectionProfileRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.clouddms.v1.IGetConnectionProfileRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetConnectionProfileRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetConnectionProfileRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.clouddms.v1.GetConnectionProfileRequest; + + /** + * Decodes a GetConnectionProfileRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetConnectionProfileRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.clouddms.v1.GetConnectionProfileRequest; + + /** + * Verifies a GetConnectionProfileRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetConnectionProfileRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetConnectionProfileRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.clouddms.v1.GetConnectionProfileRequest; + + /** + * Creates a plain object from a GetConnectionProfileRequest message. Also converts values to other types if specified. + * @param message GetConnectionProfileRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.clouddms.v1.GetConnectionProfileRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetConnectionProfileRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetConnectionProfileRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateConnectionProfileRequest. */ + interface ICreateConnectionProfileRequest { + + /** CreateConnectionProfileRequest parent */ + parent?: (string|null); + + /** CreateConnectionProfileRequest connectionProfileId */ + connectionProfileId?: (string|null); + + /** CreateConnectionProfileRequest connectionProfile */ + connectionProfile?: (google.cloud.clouddms.v1.IConnectionProfile|null); + + /** CreateConnectionProfileRequest requestId */ + requestId?: (string|null); + } + + /** Represents a CreateConnectionProfileRequest. */ + class CreateConnectionProfileRequest implements ICreateConnectionProfileRequest { + + /** + * Constructs a new CreateConnectionProfileRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.clouddms.v1.ICreateConnectionProfileRequest); + + /** CreateConnectionProfileRequest parent. */ + public parent: string; + + /** CreateConnectionProfileRequest connectionProfileId. */ + public connectionProfileId: string; + + /** CreateConnectionProfileRequest connectionProfile. */ + public connectionProfile?: (google.cloud.clouddms.v1.IConnectionProfile|null); + + /** CreateConnectionProfileRequest requestId. */ + public requestId: string; + + /** + * Creates a new CreateConnectionProfileRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateConnectionProfileRequest instance + */ + public static create(properties?: google.cloud.clouddms.v1.ICreateConnectionProfileRequest): google.cloud.clouddms.v1.CreateConnectionProfileRequest; + + /** + * Encodes the specified CreateConnectionProfileRequest message. Does not implicitly {@link google.cloud.clouddms.v1.CreateConnectionProfileRequest.verify|verify} messages. + * @param message CreateConnectionProfileRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.clouddms.v1.ICreateConnectionProfileRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateConnectionProfileRequest message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.CreateConnectionProfileRequest.verify|verify} messages. + * @param message CreateConnectionProfileRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.clouddms.v1.ICreateConnectionProfileRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateConnectionProfileRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateConnectionProfileRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.clouddms.v1.CreateConnectionProfileRequest; + + /** + * Decodes a CreateConnectionProfileRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateConnectionProfileRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.clouddms.v1.CreateConnectionProfileRequest; + + /** + * Verifies a CreateConnectionProfileRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateConnectionProfileRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateConnectionProfileRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.clouddms.v1.CreateConnectionProfileRequest; + + /** + * Creates a plain object from a CreateConnectionProfileRequest message. Also converts values to other types if specified. + * @param message CreateConnectionProfileRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.clouddms.v1.CreateConnectionProfileRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateConnectionProfileRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateConnectionProfileRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateConnectionProfileRequest. */ + interface IUpdateConnectionProfileRequest { + + /** UpdateConnectionProfileRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateConnectionProfileRequest connectionProfile */ + connectionProfile?: (google.cloud.clouddms.v1.IConnectionProfile|null); + + /** UpdateConnectionProfileRequest requestId */ + requestId?: (string|null); + } + + /** Represents an UpdateConnectionProfileRequest. */ + class UpdateConnectionProfileRequest implements IUpdateConnectionProfileRequest { + + /** + * Constructs a new UpdateConnectionProfileRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.clouddms.v1.IUpdateConnectionProfileRequest); + + /** UpdateConnectionProfileRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateConnectionProfileRequest connectionProfile. */ + public connectionProfile?: (google.cloud.clouddms.v1.IConnectionProfile|null); + + /** UpdateConnectionProfileRequest requestId. */ + public requestId: string; + + /** + * Creates a new UpdateConnectionProfileRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateConnectionProfileRequest instance + */ + public static create(properties?: google.cloud.clouddms.v1.IUpdateConnectionProfileRequest): google.cloud.clouddms.v1.UpdateConnectionProfileRequest; + + /** + * Encodes the specified UpdateConnectionProfileRequest message. Does not implicitly {@link google.cloud.clouddms.v1.UpdateConnectionProfileRequest.verify|verify} messages. + * @param message UpdateConnectionProfileRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.clouddms.v1.IUpdateConnectionProfileRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateConnectionProfileRequest message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.UpdateConnectionProfileRequest.verify|verify} messages. + * @param message UpdateConnectionProfileRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.clouddms.v1.IUpdateConnectionProfileRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateConnectionProfileRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateConnectionProfileRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.clouddms.v1.UpdateConnectionProfileRequest; + + /** + * Decodes an UpdateConnectionProfileRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateConnectionProfileRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.clouddms.v1.UpdateConnectionProfileRequest; + + /** + * Verifies an UpdateConnectionProfileRequest message. + * @param message Plain 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 UpdateConnectionProfileRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateConnectionProfileRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.clouddms.v1.UpdateConnectionProfileRequest; + + /** + * Creates a plain object from an UpdateConnectionProfileRequest message. Also converts values to other types if specified. + * @param message UpdateConnectionProfileRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.clouddms.v1.UpdateConnectionProfileRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateConnectionProfileRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateConnectionProfileRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteConnectionProfileRequest. */ + interface IDeleteConnectionProfileRequest { + + /** DeleteConnectionProfileRequest name */ + name?: (string|null); + + /** DeleteConnectionProfileRequest requestId */ + requestId?: (string|null); + + /** DeleteConnectionProfileRequest force */ + force?: (boolean|null); + } + + /** Represents a DeleteConnectionProfileRequest. */ + class DeleteConnectionProfileRequest implements IDeleteConnectionProfileRequest { + + /** + * Constructs a new DeleteConnectionProfileRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.clouddms.v1.IDeleteConnectionProfileRequest); + + /** DeleteConnectionProfileRequest name. */ + public name: string; + + /** DeleteConnectionProfileRequest requestId. */ + public requestId: string; + + /** DeleteConnectionProfileRequest force. */ + public force: boolean; + + /** + * Creates a new DeleteConnectionProfileRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteConnectionProfileRequest instance + */ + public static create(properties?: google.cloud.clouddms.v1.IDeleteConnectionProfileRequest): google.cloud.clouddms.v1.DeleteConnectionProfileRequest; + + /** + * Encodes the specified DeleteConnectionProfileRequest message. Does not implicitly {@link google.cloud.clouddms.v1.DeleteConnectionProfileRequest.verify|verify} messages. + * @param message DeleteConnectionProfileRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.clouddms.v1.IDeleteConnectionProfileRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteConnectionProfileRequest message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.DeleteConnectionProfileRequest.verify|verify} messages. + * @param message DeleteConnectionProfileRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.clouddms.v1.IDeleteConnectionProfileRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteConnectionProfileRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteConnectionProfileRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.clouddms.v1.DeleteConnectionProfileRequest; + + /** + * Decodes a DeleteConnectionProfileRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteConnectionProfileRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.clouddms.v1.DeleteConnectionProfileRequest; + + /** + * Verifies a DeleteConnectionProfileRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteConnectionProfileRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteConnectionProfileRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.clouddms.v1.DeleteConnectionProfileRequest; + + /** + * Creates a plain object from a DeleteConnectionProfileRequest message. Also converts values to other types if specified. + * @param message DeleteConnectionProfileRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.clouddms.v1.DeleteConnectionProfileRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteConnectionProfileRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteConnectionProfileRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OperationMetadata. */ + interface IOperationMetadata { + + /** OperationMetadata createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata endTime */ + endTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata target */ + target?: (string|null); + + /** OperationMetadata verb */ + verb?: (string|null); + + /** OperationMetadata statusMessage */ + statusMessage?: (string|null); + + /** OperationMetadata requestedCancellation */ + requestedCancellation?: (boolean|null); + + /** OperationMetadata apiVersion */ + apiVersion?: (string|null); + } + + /** Represents an OperationMetadata. */ + class OperationMetadata implements IOperationMetadata { + + /** + * Constructs a new OperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.clouddms.v1.IOperationMetadata); + + /** OperationMetadata createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata target. */ + public target: string; + + /** OperationMetadata verb. */ + public verb: string; + + /** OperationMetadata statusMessage. */ + public statusMessage: string; + + /** OperationMetadata requestedCancellation. */ + public requestedCancellation: boolean; + + /** OperationMetadata apiVersion. */ + public apiVersion: string; + + /** + * Creates a new OperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns OperationMetadata instance + */ + public static create(properties?: google.cloud.clouddms.v1.IOperationMetadata): google.cloud.clouddms.v1.OperationMetadata; + + /** + * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.clouddms.v1.OperationMetadata.verify|verify} messages. + * @param message OperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.clouddms.v1.IOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.OperationMetadata.verify|verify} messages. + * @param message OperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.clouddms.v1.IOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OperationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.clouddms.v1.OperationMetadata; + + /** + * Decodes an OperationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.clouddms.v1.OperationMetadata; + + /** + * Verifies an OperationMetadata message. + * @param message Plain 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 OperationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OperationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.clouddms.v1.OperationMetadata; + + /** + * Creates a plain object from an OperationMetadata message. Also converts values to other types if specified. + * @param message OperationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.clouddms.v1.OperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OperationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OperationMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SslConfig. */ + interface ISslConfig { + + /** SslConfig type */ + type?: (google.cloud.clouddms.v1.SslConfig.SslType|keyof typeof google.cloud.clouddms.v1.SslConfig.SslType|null); + + /** SslConfig clientKey */ + clientKey?: (string|null); + + /** SslConfig clientCertificate */ + clientCertificate?: (string|null); + + /** SslConfig caCertificate */ + caCertificate?: (string|null); + } + + /** Represents a SslConfig. */ + class SslConfig implements ISslConfig { + + /** + * Constructs a new SslConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.clouddms.v1.ISslConfig); + + /** SslConfig type. */ + public type: (google.cloud.clouddms.v1.SslConfig.SslType|keyof typeof google.cloud.clouddms.v1.SslConfig.SslType); + + /** SslConfig clientKey. */ + public clientKey: string; + + /** SslConfig clientCertificate. */ + public clientCertificate: string; + + /** SslConfig caCertificate. */ + public caCertificate: string; + + /** + * Creates a new SslConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns SslConfig instance + */ + public static create(properties?: google.cloud.clouddms.v1.ISslConfig): google.cloud.clouddms.v1.SslConfig; + + /** + * Encodes the specified SslConfig message. Does not implicitly {@link google.cloud.clouddms.v1.SslConfig.verify|verify} messages. + * @param message SslConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.clouddms.v1.ISslConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SslConfig message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.SslConfig.verify|verify} messages. + * @param message SslConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.clouddms.v1.ISslConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SslConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SslConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.clouddms.v1.SslConfig; + + /** + * Decodes a SslConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SslConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.clouddms.v1.SslConfig; + + /** + * Verifies a SslConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SslConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SslConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.clouddms.v1.SslConfig; + + /** + * Creates a plain object from a SslConfig message. Also converts values to other types if specified. + * @param message SslConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.clouddms.v1.SslConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SslConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SslConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SslConfig { + + /** SslType enum. */ + enum SslType { + SSL_TYPE_UNSPECIFIED = 0, + SERVER_ONLY = 1, + SERVER_CLIENT = 2 + } + } + + /** Properties of a MySqlConnectionProfile. */ + interface IMySqlConnectionProfile { + + /** MySqlConnectionProfile host */ + host?: (string|null); + + /** MySqlConnectionProfile port */ + port?: (number|null); + + /** MySqlConnectionProfile username */ + username?: (string|null); + + /** MySqlConnectionProfile password */ + password?: (string|null); + + /** MySqlConnectionProfile passwordSet */ + passwordSet?: (boolean|null); + + /** MySqlConnectionProfile ssl */ + ssl?: (google.cloud.clouddms.v1.ISslConfig|null); + + /** MySqlConnectionProfile cloudSqlId */ + cloudSqlId?: (string|null); + } + + /** Represents a MySqlConnectionProfile. */ + class MySqlConnectionProfile implements IMySqlConnectionProfile { + + /** + * Constructs a new MySqlConnectionProfile. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.clouddms.v1.IMySqlConnectionProfile); + + /** MySqlConnectionProfile host. */ + public host: string; + + /** MySqlConnectionProfile port. */ + public port: number; + + /** MySqlConnectionProfile username. */ + public username: string; + + /** MySqlConnectionProfile password. */ + public password: string; + + /** MySqlConnectionProfile passwordSet. */ + public passwordSet: boolean; + + /** MySqlConnectionProfile ssl. */ + public ssl?: (google.cloud.clouddms.v1.ISslConfig|null); + + /** MySqlConnectionProfile cloudSqlId. */ + public cloudSqlId: string; + + /** + * Creates a new MySqlConnectionProfile instance using the specified properties. + * @param [properties] Properties to set + * @returns MySqlConnectionProfile instance + */ + public static create(properties?: google.cloud.clouddms.v1.IMySqlConnectionProfile): google.cloud.clouddms.v1.MySqlConnectionProfile; + + /** + * Encodes the specified MySqlConnectionProfile message. Does not implicitly {@link google.cloud.clouddms.v1.MySqlConnectionProfile.verify|verify} messages. + * @param message MySqlConnectionProfile message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.clouddms.v1.IMySqlConnectionProfile, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MySqlConnectionProfile message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.MySqlConnectionProfile.verify|verify} messages. + * @param message MySqlConnectionProfile message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.clouddms.v1.IMySqlConnectionProfile, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MySqlConnectionProfile message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MySqlConnectionProfile + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.clouddms.v1.MySqlConnectionProfile; + + /** + * Decodes a MySqlConnectionProfile message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MySqlConnectionProfile + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.clouddms.v1.MySqlConnectionProfile; + + /** + * Verifies a MySqlConnectionProfile message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MySqlConnectionProfile message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MySqlConnectionProfile + */ + public static fromObject(object: { [k: string]: any }): google.cloud.clouddms.v1.MySqlConnectionProfile; + + /** + * Creates a plain object from a MySqlConnectionProfile message. Also converts values to other types if specified. + * @param message MySqlConnectionProfile + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.clouddms.v1.MySqlConnectionProfile, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MySqlConnectionProfile to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MySqlConnectionProfile + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PostgreSqlConnectionProfile. */ + interface IPostgreSqlConnectionProfile { + + /** PostgreSqlConnectionProfile host */ + host?: (string|null); + + /** PostgreSqlConnectionProfile port */ + port?: (number|null); + + /** PostgreSqlConnectionProfile username */ + username?: (string|null); + + /** PostgreSqlConnectionProfile password */ + password?: (string|null); + + /** PostgreSqlConnectionProfile passwordSet */ + passwordSet?: (boolean|null); + + /** PostgreSqlConnectionProfile ssl */ + ssl?: (google.cloud.clouddms.v1.ISslConfig|null); + + /** PostgreSqlConnectionProfile cloudSqlId */ + cloudSqlId?: (string|null); + } + + /** Represents a PostgreSqlConnectionProfile. */ + class PostgreSqlConnectionProfile implements IPostgreSqlConnectionProfile { + + /** + * Constructs a new PostgreSqlConnectionProfile. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.clouddms.v1.IPostgreSqlConnectionProfile); + + /** PostgreSqlConnectionProfile host. */ + public host: string; + + /** PostgreSqlConnectionProfile port. */ + public port: number; + + /** PostgreSqlConnectionProfile username. */ + public username: string; + + /** PostgreSqlConnectionProfile password. */ + public password: string; + + /** PostgreSqlConnectionProfile passwordSet. */ + public passwordSet: boolean; + + /** PostgreSqlConnectionProfile ssl. */ + public ssl?: (google.cloud.clouddms.v1.ISslConfig|null); + + /** PostgreSqlConnectionProfile cloudSqlId. */ + public cloudSqlId: string; + + /** + * Creates a new PostgreSqlConnectionProfile instance using the specified properties. + * @param [properties] Properties to set + * @returns PostgreSqlConnectionProfile instance + */ + public static create(properties?: google.cloud.clouddms.v1.IPostgreSqlConnectionProfile): google.cloud.clouddms.v1.PostgreSqlConnectionProfile; + + /** + * Encodes the specified PostgreSqlConnectionProfile message. Does not implicitly {@link google.cloud.clouddms.v1.PostgreSqlConnectionProfile.verify|verify} messages. + * @param message PostgreSqlConnectionProfile message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.clouddms.v1.IPostgreSqlConnectionProfile, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PostgreSqlConnectionProfile message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.PostgreSqlConnectionProfile.verify|verify} messages. + * @param message PostgreSqlConnectionProfile message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.clouddms.v1.IPostgreSqlConnectionProfile, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PostgreSqlConnectionProfile message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PostgreSqlConnectionProfile + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.clouddms.v1.PostgreSqlConnectionProfile; + + /** + * Decodes a PostgreSqlConnectionProfile message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PostgreSqlConnectionProfile + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.clouddms.v1.PostgreSqlConnectionProfile; + + /** + * Verifies a PostgreSqlConnectionProfile message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PostgreSqlConnectionProfile message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PostgreSqlConnectionProfile + */ + public static fromObject(object: { [k: string]: any }): google.cloud.clouddms.v1.PostgreSqlConnectionProfile; + + /** + * Creates a plain object from a PostgreSqlConnectionProfile message. Also converts values to other types if specified. + * @param message PostgreSqlConnectionProfile + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.clouddms.v1.PostgreSqlConnectionProfile, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PostgreSqlConnectionProfile to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PostgreSqlConnectionProfile + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CloudSqlConnectionProfile. */ + interface ICloudSqlConnectionProfile { + + /** CloudSqlConnectionProfile cloudSqlId */ + cloudSqlId?: (string|null); + + /** CloudSqlConnectionProfile settings */ + settings?: (google.cloud.clouddms.v1.ICloudSqlSettings|null); + + /** CloudSqlConnectionProfile privateIp */ + privateIp?: (string|null); + + /** CloudSqlConnectionProfile publicIp */ + publicIp?: (string|null); + } + + /** Represents a CloudSqlConnectionProfile. */ + class CloudSqlConnectionProfile implements ICloudSqlConnectionProfile { + + /** + * Constructs a new CloudSqlConnectionProfile. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.clouddms.v1.ICloudSqlConnectionProfile); + + /** CloudSqlConnectionProfile cloudSqlId. */ + public cloudSqlId: string; + + /** CloudSqlConnectionProfile settings. */ + public settings?: (google.cloud.clouddms.v1.ICloudSqlSettings|null); + + /** CloudSqlConnectionProfile privateIp. */ + public privateIp: string; + + /** CloudSqlConnectionProfile publicIp. */ + public publicIp: string; + + /** + * Creates a new CloudSqlConnectionProfile instance using the specified properties. + * @param [properties] Properties to set + * @returns CloudSqlConnectionProfile instance + */ + public static create(properties?: google.cloud.clouddms.v1.ICloudSqlConnectionProfile): google.cloud.clouddms.v1.CloudSqlConnectionProfile; + + /** + * Encodes the specified CloudSqlConnectionProfile message. Does not implicitly {@link google.cloud.clouddms.v1.CloudSqlConnectionProfile.verify|verify} messages. + * @param message CloudSqlConnectionProfile message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.clouddms.v1.ICloudSqlConnectionProfile, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CloudSqlConnectionProfile message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.CloudSqlConnectionProfile.verify|verify} messages. + * @param message CloudSqlConnectionProfile message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.clouddms.v1.ICloudSqlConnectionProfile, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CloudSqlConnectionProfile message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CloudSqlConnectionProfile + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.clouddms.v1.CloudSqlConnectionProfile; + + /** + * Decodes a CloudSqlConnectionProfile message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CloudSqlConnectionProfile + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.clouddms.v1.CloudSqlConnectionProfile; + + /** + * Verifies a CloudSqlConnectionProfile message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CloudSqlConnectionProfile message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CloudSqlConnectionProfile + */ + public static fromObject(object: { [k: string]: any }): google.cloud.clouddms.v1.CloudSqlConnectionProfile; + + /** + * Creates a plain object from a CloudSqlConnectionProfile message. Also converts values to other types if specified. + * @param message CloudSqlConnectionProfile + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.clouddms.v1.CloudSqlConnectionProfile, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CloudSqlConnectionProfile to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CloudSqlConnectionProfile + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SqlAclEntry. */ + interface ISqlAclEntry { + + /** SqlAclEntry value */ + value?: (string|null); + + /** SqlAclEntry expireTime */ + expireTime?: (google.protobuf.ITimestamp|null); + + /** SqlAclEntry ttl */ + ttl?: (google.protobuf.IDuration|null); + + /** SqlAclEntry label */ + label?: (string|null); + } + + /** Represents a SqlAclEntry. */ + class SqlAclEntry implements ISqlAclEntry { + + /** + * Constructs a new SqlAclEntry. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.clouddms.v1.ISqlAclEntry); + + /** SqlAclEntry value. */ + public value: string; + + /** SqlAclEntry expireTime. */ + public expireTime?: (google.protobuf.ITimestamp|null); + + /** SqlAclEntry ttl. */ + public ttl?: (google.protobuf.IDuration|null); + + /** SqlAclEntry label. */ + public label: string; + + /** SqlAclEntry expiration. */ + public expiration?: ("expireTime"|"ttl"); + + /** + * Creates a new SqlAclEntry instance using the specified properties. + * @param [properties] Properties to set + * @returns SqlAclEntry instance + */ + public static create(properties?: google.cloud.clouddms.v1.ISqlAclEntry): google.cloud.clouddms.v1.SqlAclEntry; + + /** + * Encodes the specified SqlAclEntry message. Does not implicitly {@link google.cloud.clouddms.v1.SqlAclEntry.verify|verify} messages. + * @param message SqlAclEntry message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.clouddms.v1.ISqlAclEntry, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SqlAclEntry message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.SqlAclEntry.verify|verify} messages. + * @param message SqlAclEntry message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.clouddms.v1.ISqlAclEntry, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SqlAclEntry message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SqlAclEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.clouddms.v1.SqlAclEntry; + + /** + * Decodes a SqlAclEntry message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SqlAclEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.clouddms.v1.SqlAclEntry; + + /** + * Verifies a SqlAclEntry message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SqlAclEntry message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SqlAclEntry + */ + public static fromObject(object: { [k: string]: any }): google.cloud.clouddms.v1.SqlAclEntry; + + /** + * Creates a plain object from a SqlAclEntry message. Also converts values to other types if specified. + * @param message SqlAclEntry + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.clouddms.v1.SqlAclEntry, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SqlAclEntry to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SqlAclEntry + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SqlIpConfig. */ + interface ISqlIpConfig { + + /** SqlIpConfig enableIpv4 */ + enableIpv4?: (google.protobuf.IBoolValue|null); + + /** SqlIpConfig privateNetwork */ + privateNetwork?: (string|null); + + /** SqlIpConfig requireSsl */ + requireSsl?: (google.protobuf.IBoolValue|null); + + /** SqlIpConfig authorizedNetworks */ + authorizedNetworks?: (google.cloud.clouddms.v1.ISqlAclEntry[]|null); + } + + /** Represents a SqlIpConfig. */ + class SqlIpConfig implements ISqlIpConfig { + + /** + * Constructs a new SqlIpConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.clouddms.v1.ISqlIpConfig); + + /** SqlIpConfig enableIpv4. */ + public enableIpv4?: (google.protobuf.IBoolValue|null); + + /** SqlIpConfig privateNetwork. */ + public privateNetwork: string; + + /** SqlIpConfig requireSsl. */ + public requireSsl?: (google.protobuf.IBoolValue|null); + + /** SqlIpConfig authorizedNetworks. */ + public authorizedNetworks: google.cloud.clouddms.v1.ISqlAclEntry[]; + + /** + * Creates a new SqlIpConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns SqlIpConfig instance + */ + public static create(properties?: google.cloud.clouddms.v1.ISqlIpConfig): google.cloud.clouddms.v1.SqlIpConfig; + + /** + * Encodes the specified SqlIpConfig message. Does not implicitly {@link google.cloud.clouddms.v1.SqlIpConfig.verify|verify} messages. + * @param message SqlIpConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.clouddms.v1.ISqlIpConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SqlIpConfig message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.SqlIpConfig.verify|verify} messages. + * @param message SqlIpConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.clouddms.v1.ISqlIpConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SqlIpConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SqlIpConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.clouddms.v1.SqlIpConfig; + + /** + * Decodes a SqlIpConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SqlIpConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.clouddms.v1.SqlIpConfig; + + /** + * Verifies a SqlIpConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SqlIpConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SqlIpConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.clouddms.v1.SqlIpConfig; + + /** + * Creates a plain object from a SqlIpConfig message. Also converts values to other types if specified. + * @param message SqlIpConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.clouddms.v1.SqlIpConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SqlIpConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SqlIpConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CloudSqlSettings. */ + interface ICloudSqlSettings { + + /** CloudSqlSettings databaseVersion */ + databaseVersion?: (google.cloud.clouddms.v1.CloudSqlSettings.SqlDatabaseVersion|keyof typeof google.cloud.clouddms.v1.CloudSqlSettings.SqlDatabaseVersion|null); + + /** CloudSqlSettings userLabels */ + userLabels?: ({ [k: string]: string }|null); + + /** CloudSqlSettings tier */ + tier?: (string|null); + + /** CloudSqlSettings storageAutoResizeLimit */ + storageAutoResizeLimit?: (google.protobuf.IInt64Value|null); + + /** CloudSqlSettings activationPolicy */ + activationPolicy?: (google.cloud.clouddms.v1.CloudSqlSettings.SqlActivationPolicy|keyof typeof google.cloud.clouddms.v1.CloudSqlSettings.SqlActivationPolicy|null); + + /** CloudSqlSettings ipConfig */ + ipConfig?: (google.cloud.clouddms.v1.ISqlIpConfig|null); + + /** CloudSqlSettings autoStorageIncrease */ + autoStorageIncrease?: (google.protobuf.IBoolValue|null); + + /** CloudSqlSettings databaseFlags */ + databaseFlags?: ({ [k: string]: string }|null); + + /** CloudSqlSettings dataDiskType */ + dataDiskType?: (google.cloud.clouddms.v1.CloudSqlSettings.SqlDataDiskType|keyof typeof google.cloud.clouddms.v1.CloudSqlSettings.SqlDataDiskType|null); + + /** CloudSqlSettings dataDiskSizeGb */ + dataDiskSizeGb?: (google.protobuf.IInt64Value|null); + + /** CloudSqlSettings zone */ + zone?: (string|null); + + /** CloudSqlSettings sourceId */ + sourceId?: (string|null); + + /** CloudSqlSettings rootPassword */ + rootPassword?: (string|null); + + /** CloudSqlSettings rootPasswordSet */ + rootPasswordSet?: (boolean|null); + + /** CloudSqlSettings collation */ + collation?: (string|null); + } + + /** Represents a CloudSqlSettings. */ + class CloudSqlSettings implements ICloudSqlSettings { + + /** + * Constructs a new CloudSqlSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.clouddms.v1.ICloudSqlSettings); + + /** CloudSqlSettings databaseVersion. */ + public databaseVersion: (google.cloud.clouddms.v1.CloudSqlSettings.SqlDatabaseVersion|keyof typeof google.cloud.clouddms.v1.CloudSqlSettings.SqlDatabaseVersion); + + /** CloudSqlSettings userLabels. */ + public userLabels: { [k: string]: string }; + + /** CloudSqlSettings tier. */ + public tier: string; + + /** CloudSqlSettings storageAutoResizeLimit. */ + public storageAutoResizeLimit?: (google.protobuf.IInt64Value|null); + + /** CloudSqlSettings activationPolicy. */ + public activationPolicy: (google.cloud.clouddms.v1.CloudSqlSettings.SqlActivationPolicy|keyof typeof google.cloud.clouddms.v1.CloudSqlSettings.SqlActivationPolicy); + + /** CloudSqlSettings ipConfig. */ + public ipConfig?: (google.cloud.clouddms.v1.ISqlIpConfig|null); + + /** CloudSqlSettings autoStorageIncrease. */ + public autoStorageIncrease?: (google.protobuf.IBoolValue|null); + + /** CloudSqlSettings databaseFlags. */ + public databaseFlags: { [k: string]: string }; + + /** CloudSqlSettings dataDiskType. */ + public dataDiskType: (google.cloud.clouddms.v1.CloudSqlSettings.SqlDataDiskType|keyof typeof google.cloud.clouddms.v1.CloudSqlSettings.SqlDataDiskType); + + /** CloudSqlSettings dataDiskSizeGb. */ + public dataDiskSizeGb?: (google.protobuf.IInt64Value|null); + + /** CloudSqlSettings zone. */ + public zone: string; + + /** CloudSqlSettings sourceId. */ + public sourceId: string; + + /** CloudSqlSettings rootPassword. */ + public rootPassword: string; + + /** CloudSqlSettings rootPasswordSet. */ + public rootPasswordSet: boolean; + + /** CloudSqlSettings collation. */ + public collation: string; + + /** + * Creates a new CloudSqlSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns CloudSqlSettings instance + */ + public static create(properties?: google.cloud.clouddms.v1.ICloudSqlSettings): google.cloud.clouddms.v1.CloudSqlSettings; + + /** + * Encodes the specified CloudSqlSettings message. Does not implicitly {@link google.cloud.clouddms.v1.CloudSqlSettings.verify|verify} messages. + * @param message CloudSqlSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.clouddms.v1.ICloudSqlSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CloudSqlSettings message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.CloudSqlSettings.verify|verify} messages. + * @param message CloudSqlSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.clouddms.v1.ICloudSqlSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CloudSqlSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CloudSqlSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.clouddms.v1.CloudSqlSettings; + + /** + * Decodes a CloudSqlSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CloudSqlSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.clouddms.v1.CloudSqlSettings; + + /** + * Verifies a CloudSqlSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CloudSqlSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CloudSqlSettings + */ + public static fromObject(object: { [k: string]: any }): google.cloud.clouddms.v1.CloudSqlSettings; + + /** + * Creates a plain object from a CloudSqlSettings message. Also converts values to other types if specified. + * @param message CloudSqlSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.clouddms.v1.CloudSqlSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CloudSqlSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CloudSqlSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace CloudSqlSettings { + + /** SqlActivationPolicy enum. */ + enum SqlActivationPolicy { + SQL_ACTIVATION_POLICY_UNSPECIFIED = 0, + ALWAYS = 1, + NEVER = 2 + } + + /** SqlDataDiskType enum. */ + enum SqlDataDiskType { + SQL_DATA_DISK_TYPE_UNSPECIFIED = 0, + PD_SSD = 1, + PD_HDD = 2 + } + + /** SqlDatabaseVersion enum. */ + enum SqlDatabaseVersion { + SQL_DATABASE_VERSION_UNSPECIFIED = 0, + MYSQL_5_6 = 1, + MYSQL_5_7 = 2, + POSTGRES_9_6 = 3, + POSTGRES_11 = 4, + POSTGRES_10 = 5, + MYSQL_8_0 = 6, + POSTGRES_12 = 7, + POSTGRES_13 = 8 + } + } + + /** Properties of a StaticIpConnectivity. */ + interface IStaticIpConnectivity { + } + + /** Represents a StaticIpConnectivity. */ + class StaticIpConnectivity implements IStaticIpConnectivity { + + /** + * Constructs a new StaticIpConnectivity. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.clouddms.v1.IStaticIpConnectivity); + + /** + * Creates a new StaticIpConnectivity instance using the specified properties. + * @param [properties] Properties to set + * @returns StaticIpConnectivity instance + */ + public static create(properties?: google.cloud.clouddms.v1.IStaticIpConnectivity): google.cloud.clouddms.v1.StaticIpConnectivity; + + /** + * Encodes the specified StaticIpConnectivity message. Does not implicitly {@link google.cloud.clouddms.v1.StaticIpConnectivity.verify|verify} messages. + * @param message StaticIpConnectivity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.clouddms.v1.IStaticIpConnectivity, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StaticIpConnectivity message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.StaticIpConnectivity.verify|verify} messages. + * @param message StaticIpConnectivity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.clouddms.v1.IStaticIpConnectivity, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StaticIpConnectivity message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StaticIpConnectivity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.clouddms.v1.StaticIpConnectivity; + + /** + * Decodes a StaticIpConnectivity message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StaticIpConnectivity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.clouddms.v1.StaticIpConnectivity; + + /** + * Verifies a StaticIpConnectivity message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StaticIpConnectivity message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StaticIpConnectivity + */ + public static fromObject(object: { [k: string]: any }): google.cloud.clouddms.v1.StaticIpConnectivity; + + /** + * Creates a plain object from a StaticIpConnectivity message. Also converts values to other types if specified. + * @param message StaticIpConnectivity + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.clouddms.v1.StaticIpConnectivity, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StaticIpConnectivity to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StaticIpConnectivity + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ReverseSshConnectivity. */ + interface IReverseSshConnectivity { + + /** ReverseSshConnectivity vmIp */ + vmIp?: (string|null); + + /** ReverseSshConnectivity vmPort */ + vmPort?: (number|null); + + /** ReverseSshConnectivity vm */ + vm?: (string|null); + + /** ReverseSshConnectivity vpc */ + vpc?: (string|null); + } + + /** Represents a ReverseSshConnectivity. */ + class ReverseSshConnectivity implements IReverseSshConnectivity { + + /** + * Constructs a new ReverseSshConnectivity. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.clouddms.v1.IReverseSshConnectivity); + + /** ReverseSshConnectivity vmIp. */ + public vmIp: string; + + /** ReverseSshConnectivity vmPort. */ + public vmPort: number; + + /** ReverseSshConnectivity vm. */ + public vm: string; + + /** ReverseSshConnectivity vpc. */ + public vpc: string; + + /** + * Creates a new ReverseSshConnectivity instance using the specified properties. + * @param [properties] Properties to set + * @returns ReverseSshConnectivity instance + */ + public static create(properties?: google.cloud.clouddms.v1.IReverseSshConnectivity): google.cloud.clouddms.v1.ReverseSshConnectivity; + + /** + * Encodes the specified ReverseSshConnectivity message. Does not implicitly {@link google.cloud.clouddms.v1.ReverseSshConnectivity.verify|verify} messages. + * @param message ReverseSshConnectivity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.clouddms.v1.IReverseSshConnectivity, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReverseSshConnectivity message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.ReverseSshConnectivity.verify|verify} messages. + * @param message ReverseSshConnectivity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.clouddms.v1.IReverseSshConnectivity, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReverseSshConnectivity message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReverseSshConnectivity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.clouddms.v1.ReverseSshConnectivity; + + /** + * Decodes a ReverseSshConnectivity message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReverseSshConnectivity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.clouddms.v1.ReverseSshConnectivity; + + /** + * Verifies a ReverseSshConnectivity message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReverseSshConnectivity message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReverseSshConnectivity + */ + public static fromObject(object: { [k: string]: any }): google.cloud.clouddms.v1.ReverseSshConnectivity; + + /** + * Creates a plain object from a ReverseSshConnectivity message. Also converts values to other types if specified. + * @param message ReverseSshConnectivity + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.clouddms.v1.ReverseSshConnectivity, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReverseSshConnectivity to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReverseSshConnectivity + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a VpcPeeringConnectivity. */ + interface IVpcPeeringConnectivity { + + /** VpcPeeringConnectivity vpc */ + vpc?: (string|null); + } + + /** Represents a VpcPeeringConnectivity. */ + class VpcPeeringConnectivity implements IVpcPeeringConnectivity { + + /** + * Constructs a new VpcPeeringConnectivity. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.clouddms.v1.IVpcPeeringConnectivity); + + /** VpcPeeringConnectivity vpc. */ + public vpc: string; + + /** + * Creates a new VpcPeeringConnectivity instance using the specified properties. + * @param [properties] Properties to set + * @returns VpcPeeringConnectivity instance + */ + public static create(properties?: google.cloud.clouddms.v1.IVpcPeeringConnectivity): google.cloud.clouddms.v1.VpcPeeringConnectivity; + + /** + * Encodes the specified VpcPeeringConnectivity message. Does not implicitly {@link google.cloud.clouddms.v1.VpcPeeringConnectivity.verify|verify} messages. + * @param message VpcPeeringConnectivity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.clouddms.v1.IVpcPeeringConnectivity, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VpcPeeringConnectivity message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.VpcPeeringConnectivity.verify|verify} messages. + * @param message VpcPeeringConnectivity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.clouddms.v1.IVpcPeeringConnectivity, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VpcPeeringConnectivity message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VpcPeeringConnectivity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.clouddms.v1.VpcPeeringConnectivity; + + /** + * Decodes a VpcPeeringConnectivity message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VpcPeeringConnectivity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.clouddms.v1.VpcPeeringConnectivity; + + /** + * Verifies a VpcPeeringConnectivity message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a VpcPeeringConnectivity message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VpcPeeringConnectivity + */ + public static fromObject(object: { [k: string]: any }): google.cloud.clouddms.v1.VpcPeeringConnectivity; + + /** + * Creates a plain object from a VpcPeeringConnectivity message. Also converts values to other types if specified. + * @param message VpcPeeringConnectivity + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.clouddms.v1.VpcPeeringConnectivity, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VpcPeeringConnectivity to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VpcPeeringConnectivity + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DatabaseType. */ + interface IDatabaseType { + + /** DatabaseType provider */ + provider?: (google.cloud.clouddms.v1.DatabaseProvider|keyof typeof google.cloud.clouddms.v1.DatabaseProvider|null); + + /** DatabaseType engine */ + engine?: (google.cloud.clouddms.v1.DatabaseEngine|keyof typeof google.cloud.clouddms.v1.DatabaseEngine|null); + } + + /** Represents a DatabaseType. */ + class DatabaseType implements IDatabaseType { + + /** + * Constructs a new DatabaseType. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.clouddms.v1.IDatabaseType); + + /** DatabaseType provider. */ + public provider: (google.cloud.clouddms.v1.DatabaseProvider|keyof typeof google.cloud.clouddms.v1.DatabaseProvider); + + /** DatabaseType engine. */ + public engine: (google.cloud.clouddms.v1.DatabaseEngine|keyof typeof google.cloud.clouddms.v1.DatabaseEngine); + + /** + * Creates a new DatabaseType instance using the specified properties. + * @param [properties] Properties to set + * @returns DatabaseType instance + */ + public static create(properties?: google.cloud.clouddms.v1.IDatabaseType): google.cloud.clouddms.v1.DatabaseType; + + /** + * Encodes the specified DatabaseType message. Does not implicitly {@link google.cloud.clouddms.v1.DatabaseType.verify|verify} messages. + * @param message DatabaseType message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.clouddms.v1.IDatabaseType, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DatabaseType message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.DatabaseType.verify|verify} messages. + * @param message DatabaseType message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.clouddms.v1.IDatabaseType, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DatabaseType message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DatabaseType + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.clouddms.v1.DatabaseType; + + /** + * Decodes a DatabaseType message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DatabaseType + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.clouddms.v1.DatabaseType; + + /** + * Verifies a DatabaseType message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DatabaseType message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DatabaseType + */ + public static fromObject(object: { [k: string]: any }): google.cloud.clouddms.v1.DatabaseType; + + /** + * Creates a plain object from a DatabaseType message. Also converts values to other types if specified. + * @param message DatabaseType + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.clouddms.v1.DatabaseType, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DatabaseType to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DatabaseType + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MigrationJob. */ + interface IMigrationJob { + + /** MigrationJob name */ + name?: (string|null); + + /** MigrationJob createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** MigrationJob updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** MigrationJob labels */ + labels?: ({ [k: string]: string }|null); + + /** MigrationJob displayName */ + displayName?: (string|null); + + /** MigrationJob state */ + state?: (google.cloud.clouddms.v1.MigrationJob.State|keyof typeof google.cloud.clouddms.v1.MigrationJob.State|null); + + /** MigrationJob phase */ + phase?: (google.cloud.clouddms.v1.MigrationJob.Phase|keyof typeof google.cloud.clouddms.v1.MigrationJob.Phase|null); + + /** MigrationJob type */ + type?: (google.cloud.clouddms.v1.MigrationJob.Type|keyof typeof google.cloud.clouddms.v1.MigrationJob.Type|null); + + /** MigrationJob dumpPath */ + dumpPath?: (string|null); + + /** MigrationJob source */ + source?: (string|null); + + /** MigrationJob destination */ + destination?: (string|null); + + /** MigrationJob reverseSshConnectivity */ + reverseSshConnectivity?: (google.cloud.clouddms.v1.IReverseSshConnectivity|null); + + /** MigrationJob vpcPeeringConnectivity */ + vpcPeeringConnectivity?: (google.cloud.clouddms.v1.IVpcPeeringConnectivity|null); + + /** MigrationJob staticIpConnectivity */ + staticIpConnectivity?: (google.cloud.clouddms.v1.IStaticIpConnectivity|null); + + /** MigrationJob duration */ + duration?: (google.protobuf.IDuration|null); + + /** MigrationJob error */ + error?: (google.rpc.IStatus|null); + + /** MigrationJob sourceDatabase */ + sourceDatabase?: (google.cloud.clouddms.v1.IDatabaseType|null); + + /** MigrationJob destinationDatabase */ + destinationDatabase?: (google.cloud.clouddms.v1.IDatabaseType|null); + + /** MigrationJob endTime */ + endTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a MigrationJob. */ + class MigrationJob implements IMigrationJob { + + /** + * Constructs a new MigrationJob. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.clouddms.v1.IMigrationJob); + + /** MigrationJob name. */ + public name: string; + + /** MigrationJob createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** MigrationJob updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** MigrationJob labels. */ + public labels: { [k: string]: string }; + + /** MigrationJob displayName. */ + public displayName: string; + + /** MigrationJob state. */ + public state: (google.cloud.clouddms.v1.MigrationJob.State|keyof typeof google.cloud.clouddms.v1.MigrationJob.State); + + /** MigrationJob phase. */ + public phase: (google.cloud.clouddms.v1.MigrationJob.Phase|keyof typeof google.cloud.clouddms.v1.MigrationJob.Phase); + + /** MigrationJob type. */ + public type: (google.cloud.clouddms.v1.MigrationJob.Type|keyof typeof google.cloud.clouddms.v1.MigrationJob.Type); + + /** MigrationJob dumpPath. */ + public dumpPath: string; + + /** MigrationJob source. */ + public source: string; + + /** MigrationJob destination. */ + public destination: string; + + /** MigrationJob reverseSshConnectivity. */ + public reverseSshConnectivity?: (google.cloud.clouddms.v1.IReverseSshConnectivity|null); + + /** MigrationJob vpcPeeringConnectivity. */ + public vpcPeeringConnectivity?: (google.cloud.clouddms.v1.IVpcPeeringConnectivity|null); + + /** MigrationJob staticIpConnectivity. */ + public staticIpConnectivity?: (google.cloud.clouddms.v1.IStaticIpConnectivity|null); + + /** MigrationJob duration. */ + public duration?: (google.protobuf.IDuration|null); + + /** MigrationJob error. */ + public error?: (google.rpc.IStatus|null); + + /** MigrationJob sourceDatabase. */ + public sourceDatabase?: (google.cloud.clouddms.v1.IDatabaseType|null); + + /** MigrationJob destinationDatabase. */ + public destinationDatabase?: (google.cloud.clouddms.v1.IDatabaseType|null); + + /** MigrationJob endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** MigrationJob connectivity. */ + public connectivity?: ("reverseSshConnectivity"|"vpcPeeringConnectivity"|"staticIpConnectivity"); + + /** + * Creates a new MigrationJob instance using the specified properties. + * @param [properties] Properties to set + * @returns MigrationJob instance + */ + public static create(properties?: google.cloud.clouddms.v1.IMigrationJob): google.cloud.clouddms.v1.MigrationJob; + + /** + * Encodes the specified MigrationJob message. Does not implicitly {@link google.cloud.clouddms.v1.MigrationJob.verify|verify} messages. + * @param message MigrationJob message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.clouddms.v1.IMigrationJob, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MigrationJob message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.MigrationJob.verify|verify} messages. + * @param message MigrationJob message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.clouddms.v1.IMigrationJob, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MigrationJob message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MigrationJob + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.clouddms.v1.MigrationJob; + + /** + * Decodes a MigrationJob message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MigrationJob + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.clouddms.v1.MigrationJob; + + /** + * Verifies a MigrationJob message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MigrationJob message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MigrationJob + */ + public static fromObject(object: { [k: string]: any }): google.cloud.clouddms.v1.MigrationJob; + + /** + * Creates a plain object from a MigrationJob message. Also converts values to other types if specified. + * @param message MigrationJob + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.clouddms.v1.MigrationJob, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MigrationJob to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MigrationJob + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace MigrationJob { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + MAINTENANCE = 1, + DRAFT = 2, + CREATING = 3, + NOT_STARTED = 4, + RUNNING = 5, + FAILED = 6, + COMPLETED = 7, + DELETING = 8, + STOPPING = 9, + STOPPED = 10, + DELETED = 11, + UPDATING = 12, + STARTING = 13, + RESTARTING = 14, + RESUMING = 15 + } + + /** Phase enum. */ + enum Phase { + PHASE_UNSPECIFIED = 0, + FULL_DUMP = 1, + CDC = 2, + PROMOTE_IN_PROGRESS = 3, + WAITING_FOR_SOURCE_WRITES_TO_STOP = 4, + PREPARING_THE_DUMP = 5 + } + + /** Type enum. */ + enum Type { + TYPE_UNSPECIFIED = 0, + ONE_TIME = 1, + CONTINUOUS = 2 + } + } + + /** Properties of a ConnectionProfile. */ + interface IConnectionProfile { + + /** ConnectionProfile name */ + name?: (string|null); + + /** ConnectionProfile createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** ConnectionProfile updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** ConnectionProfile labels */ + labels?: ({ [k: string]: string }|null); + + /** ConnectionProfile state */ + state?: (google.cloud.clouddms.v1.ConnectionProfile.State|keyof typeof google.cloud.clouddms.v1.ConnectionProfile.State|null); + + /** ConnectionProfile displayName */ + displayName?: (string|null); + + /** ConnectionProfile mysql */ + mysql?: (google.cloud.clouddms.v1.IMySqlConnectionProfile|null); + + /** ConnectionProfile postgresql */ + postgresql?: (google.cloud.clouddms.v1.IPostgreSqlConnectionProfile|null); + + /** ConnectionProfile cloudsql */ + cloudsql?: (google.cloud.clouddms.v1.ICloudSqlConnectionProfile|null); + + /** ConnectionProfile error */ + error?: (google.rpc.IStatus|null); + + /** ConnectionProfile provider */ + provider?: (google.cloud.clouddms.v1.DatabaseProvider|keyof typeof google.cloud.clouddms.v1.DatabaseProvider|null); + } + + /** Represents a ConnectionProfile. */ + class ConnectionProfile implements IConnectionProfile { + + /** + * Constructs a new ConnectionProfile. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.clouddms.v1.IConnectionProfile); + + /** ConnectionProfile name. */ + public name: string; + + /** ConnectionProfile createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** ConnectionProfile updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** ConnectionProfile labels. */ + public labels: { [k: string]: string }; + + /** ConnectionProfile state. */ + public state: (google.cloud.clouddms.v1.ConnectionProfile.State|keyof typeof google.cloud.clouddms.v1.ConnectionProfile.State); + + /** ConnectionProfile displayName. */ + public displayName: string; + + /** ConnectionProfile mysql. */ + public mysql?: (google.cloud.clouddms.v1.IMySqlConnectionProfile|null); + + /** ConnectionProfile postgresql. */ + public postgresql?: (google.cloud.clouddms.v1.IPostgreSqlConnectionProfile|null); + + /** ConnectionProfile cloudsql. */ + public cloudsql?: (google.cloud.clouddms.v1.ICloudSqlConnectionProfile|null); + + /** ConnectionProfile error. */ + public error?: (google.rpc.IStatus|null); + + /** ConnectionProfile provider. */ + public provider: (google.cloud.clouddms.v1.DatabaseProvider|keyof typeof google.cloud.clouddms.v1.DatabaseProvider); + + /** ConnectionProfile connectionProfile. */ + public connectionProfile?: ("mysql"|"postgresql"|"cloudsql"); + + /** + * Creates a new ConnectionProfile instance using the specified properties. + * @param [properties] Properties to set + * @returns ConnectionProfile instance + */ + public static create(properties?: google.cloud.clouddms.v1.IConnectionProfile): google.cloud.clouddms.v1.ConnectionProfile; + + /** + * Encodes the specified ConnectionProfile message. Does not implicitly {@link google.cloud.clouddms.v1.ConnectionProfile.verify|verify} messages. + * @param message ConnectionProfile message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.clouddms.v1.IConnectionProfile, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ConnectionProfile message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.ConnectionProfile.verify|verify} messages. + * @param message ConnectionProfile message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.clouddms.v1.IConnectionProfile, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ConnectionProfile message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ConnectionProfile + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.clouddms.v1.ConnectionProfile; + + /** + * Decodes a ConnectionProfile message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ConnectionProfile + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.clouddms.v1.ConnectionProfile; + + /** + * Verifies a ConnectionProfile message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ConnectionProfile message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ConnectionProfile + */ + public static fromObject(object: { [k: string]: any }): google.cloud.clouddms.v1.ConnectionProfile; + + /** + * Creates a plain object from a ConnectionProfile message. Also converts values to other types if specified. + * @param message ConnectionProfile + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.clouddms.v1.ConnectionProfile, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ConnectionProfile to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ConnectionProfile + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ConnectionProfile { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + DRAFT = 1, + CREATING = 2, + READY = 3, + UPDATING = 4, + DELETING = 5, + DELETED = 6, + FAILED = 7 + } + } + + /** Properties of a MigrationJobVerificationError. */ + interface IMigrationJobVerificationError { + + /** MigrationJobVerificationError errorCode */ + errorCode?: (google.cloud.clouddms.v1.MigrationJobVerificationError.ErrorCode|keyof typeof google.cloud.clouddms.v1.MigrationJobVerificationError.ErrorCode|null); + + /** MigrationJobVerificationError errorMessage */ + errorMessage?: (string|null); + + /** MigrationJobVerificationError errorDetailMessage */ + errorDetailMessage?: (string|null); + } + + /** Represents a MigrationJobVerificationError. */ + class MigrationJobVerificationError implements IMigrationJobVerificationError { + + /** + * Constructs a new MigrationJobVerificationError. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.clouddms.v1.IMigrationJobVerificationError); + + /** MigrationJobVerificationError errorCode. */ + public errorCode: (google.cloud.clouddms.v1.MigrationJobVerificationError.ErrorCode|keyof typeof google.cloud.clouddms.v1.MigrationJobVerificationError.ErrorCode); + + /** MigrationJobVerificationError errorMessage. */ + public errorMessage: string; + + /** MigrationJobVerificationError errorDetailMessage. */ + public errorDetailMessage: string; + + /** + * Creates a new MigrationJobVerificationError instance using the specified properties. + * @param [properties] Properties to set + * @returns MigrationJobVerificationError instance + */ + public static create(properties?: google.cloud.clouddms.v1.IMigrationJobVerificationError): google.cloud.clouddms.v1.MigrationJobVerificationError; + + /** + * Encodes the specified MigrationJobVerificationError message. Does not implicitly {@link google.cloud.clouddms.v1.MigrationJobVerificationError.verify|verify} messages. + * @param message MigrationJobVerificationError message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.clouddms.v1.IMigrationJobVerificationError, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MigrationJobVerificationError message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.MigrationJobVerificationError.verify|verify} messages. + * @param message MigrationJobVerificationError message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.clouddms.v1.IMigrationJobVerificationError, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MigrationJobVerificationError message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MigrationJobVerificationError + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.clouddms.v1.MigrationJobVerificationError; + + /** + * Decodes a MigrationJobVerificationError message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MigrationJobVerificationError + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.clouddms.v1.MigrationJobVerificationError; + + /** + * Verifies a MigrationJobVerificationError message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MigrationJobVerificationError message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MigrationJobVerificationError + */ + public static fromObject(object: { [k: string]: any }): google.cloud.clouddms.v1.MigrationJobVerificationError; + + /** + * Creates a plain object from a MigrationJobVerificationError message. Also converts values to other types if specified. + * @param message MigrationJobVerificationError + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.clouddms.v1.MigrationJobVerificationError, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MigrationJobVerificationError to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MigrationJobVerificationError + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace MigrationJobVerificationError { + + /** ErrorCode enum. */ + enum ErrorCode { + ERROR_CODE_UNSPECIFIED = 0, + CONNECTION_FAILURE = 1, + AUTHENTICATION_FAILURE = 2, + INVALID_CONNECTION_PROFILE_CONFIG = 3, + VERSION_INCOMPATIBILITY = 4, + CONNECTION_PROFILE_TYPES_INCOMPATIBILITY = 5, + NO_PGLOGICAL_INSTALLED = 7, + PGLOGICAL_NODE_ALREADY_EXISTS = 8, + INVALID_WAL_LEVEL = 9, + INVALID_SHARED_PRELOAD_LIBRARY = 10, + INSUFFICIENT_MAX_REPLICATION_SLOTS = 11, + INSUFFICIENT_MAX_WAL_SENDERS = 12, + INSUFFICIENT_MAX_WORKER_PROCESSES = 13, + UNSUPPORTED_EXTENSIONS = 14, + UNSUPPORTED_MIGRATION_TYPE = 15, + INVALID_RDS_LOGICAL_REPLICATION = 16, + UNSUPPORTED_GTID_MODE = 17, + UNSUPPORTED_TABLE_DEFINITION = 18, + UNSUPPORTED_DEFINER = 19, + CANT_RESTART_RUNNING_MIGRATION = 21 + } + } + + /** DatabaseEngine enum. */ + enum DatabaseEngine { + DATABASE_ENGINE_UNSPECIFIED = 0, + MYSQL = 1, + POSTGRESQL = 2 + } + + /** DatabaseProvider enum. */ + enum DatabaseProvider { + DATABASE_PROVIDER_UNSPECIFIED = 0, + CLOUDSQL = 1, + RDS = 2 + } + } + } + } + + /** Namespace api. */ + namespace api { + + /** Properties of a Http. */ + interface IHttp { + + /** Http rules */ + rules?: (google.api.IHttpRule[]|null); + + /** Http fullyDecodeReservedExpansion */ + fullyDecodeReservedExpansion?: (boolean|null); + } + + /** Represents a Http. */ + class Http implements IHttp { + + /** + * Constructs a new Http. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IHttp); + + /** Http rules. */ + public rules: google.api.IHttpRule[]; + + /** Http fullyDecodeReservedExpansion. */ + public fullyDecodeReservedExpansion: boolean; + + /** + * Creates a new Http instance using the specified properties. + * @param [properties] Properties to set + * @returns Http instance + */ + public static create(properties?: google.api.IHttp): google.api.Http; + + /** + * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @param message Http message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @param message Http message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Http message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.Http; + + /** + * Decodes a Http message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.Http; + + /** + * Verifies a Http message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Http message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Http + */ + public static fromObject(object: { [k: string]: any }): google.api.Http; + + /** + * Creates a plain object from a Http message. Also converts values to other types if specified. + * @param message Http + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.Http, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Http to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Http + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a HttpRule. */ + interface IHttpRule { + + /** HttpRule selector */ + selector?: (string|null); + + /** HttpRule get */ + get?: (string|null); + + /** HttpRule put */ + put?: (string|null); + + /** HttpRule post */ + post?: (string|null); + + /** HttpRule delete */ + "delete"?: (string|null); + + /** HttpRule patch */ + patch?: (string|null); + + /** HttpRule custom */ + custom?: (google.api.ICustomHttpPattern|null); + + /** HttpRule body */ + body?: (string|null); + + /** HttpRule responseBody */ + responseBody?: (string|null); + + /** HttpRule additionalBindings */ + additionalBindings?: (google.api.IHttpRule[]|null); + } + + /** Represents a HttpRule. */ + class HttpRule implements IHttpRule { + + /** + * Constructs a new HttpRule. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IHttpRule); + + /** HttpRule selector. */ + public selector: string; + + /** HttpRule get. */ + public get?: (string|null); + + /** HttpRule put. */ + public put?: (string|null); + + /** HttpRule post. */ + public post?: (string|null); + + /** HttpRule delete. */ + public delete?: (string|null); + + /** HttpRule patch. */ + public patch?: (string|null); + + /** HttpRule custom. */ + public custom?: (google.api.ICustomHttpPattern|null); + + /** HttpRule body. */ + public body: string; + + /** HttpRule responseBody. */ + public responseBody: string; + + /** HttpRule additionalBindings. */ + public additionalBindings: google.api.IHttpRule[]; + + /** HttpRule pattern. */ + public pattern?: ("get"|"put"|"post"|"delete"|"patch"|"custom"); + + /** + * Creates a new HttpRule instance using the specified properties. + * @param [properties] Properties to set + * @returns HttpRule instance + */ + public static create(properties?: google.api.IHttpRule): google.api.HttpRule; + + /** + * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @param message HttpRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @param message HttpRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HttpRule message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.HttpRule; + + /** + * Decodes a HttpRule message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.HttpRule; + + /** + * Verifies a HttpRule message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HttpRule + */ + public static fromObject(object: { [k: string]: any }): google.api.HttpRule; + + /** + * Creates a plain object from a HttpRule message. Also converts values to other types if specified. + * @param message HttpRule + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.HttpRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HttpRule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for HttpRule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomHttpPattern. */ + interface ICustomHttpPattern { + + /** CustomHttpPattern kind */ + kind?: (string|null); + + /** CustomHttpPattern path */ + path?: (string|null); + } + + /** Represents a CustomHttpPattern. */ + class CustomHttpPattern implements ICustomHttpPattern { + + /** + * Constructs a new CustomHttpPattern. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ICustomHttpPattern); + + /** CustomHttpPattern kind. */ + public kind: string; + + /** CustomHttpPattern path. */ + public path: string; + + /** + * Creates a new CustomHttpPattern instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomHttpPattern instance + */ + public static create(properties?: google.api.ICustomHttpPattern): google.api.CustomHttpPattern; + + /** + * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @param message CustomHttpPattern message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @param message CustomHttpPattern message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CustomHttpPattern; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CustomHttpPattern; + + /** + * Verifies a CustomHttpPattern message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CustomHttpPattern + */ + public static fromObject(object: { [k: string]: any }): google.api.CustomHttpPattern; + + /** + * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. + * @param message CustomHttpPattern + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.CustomHttpPattern, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CustomHttpPattern to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CustomHttpPattern + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** FieldBehavior enum. */ + enum FieldBehavior { + FIELD_BEHAVIOR_UNSPECIFIED = 0, + OPTIONAL = 1, + REQUIRED = 2, + OUTPUT_ONLY = 3, + INPUT_ONLY = 4, + IMMUTABLE = 5, + UNORDERED_LIST = 6, + NON_EMPTY_DEFAULT = 7 + } + + /** Properties of a ResourceDescriptor. */ + interface IResourceDescriptor { + + /** ResourceDescriptor type */ + type?: (string|null); + + /** ResourceDescriptor pattern */ + pattern?: (string[]|null); + + /** ResourceDescriptor nameField */ + nameField?: (string|null); + + /** ResourceDescriptor history */ + history?: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History|null); + + /** ResourceDescriptor plural */ + plural?: (string|null); + + /** ResourceDescriptor singular */ + singular?: (string|null); + + /** ResourceDescriptor style */ + style?: (google.api.ResourceDescriptor.Style[]|null); + } + + /** Represents a ResourceDescriptor. */ + class ResourceDescriptor implements IResourceDescriptor { + + /** + * Constructs a new ResourceDescriptor. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IResourceDescriptor); + + /** ResourceDescriptor type. */ + public type: string; + + /** ResourceDescriptor pattern. */ + public pattern: string[]; + + /** ResourceDescriptor nameField. */ + public nameField: string; + + /** ResourceDescriptor history. */ + public history: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History); + + /** ResourceDescriptor plural. */ + public plural: string; + + /** ResourceDescriptor singular. */ + public singular: string; + + /** ResourceDescriptor style. */ + public style: google.api.ResourceDescriptor.Style[]; + + /** + * Creates a new ResourceDescriptor instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourceDescriptor instance + */ + public static create(properties?: google.api.IResourceDescriptor): google.api.ResourceDescriptor; + + /** + * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @param message ResourceDescriptor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @param message ResourceDescriptor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ResourceDescriptor; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ResourceDescriptor; + + /** + * Verifies a ResourceDescriptor message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourceDescriptor + */ + public static fromObject(object: { [k: string]: any }): google.api.ResourceDescriptor; + + /** + * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. + * @param message ResourceDescriptor + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.ResourceDescriptor, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourceDescriptor to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResourceDescriptor + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ResourceDescriptor { + + /** History enum. */ + enum History { + HISTORY_UNSPECIFIED = 0, + ORIGINALLY_SINGLE_PATTERN = 1, + FUTURE_MULTI_PATTERN = 2 + } + + /** Style enum. */ + enum Style { + STYLE_UNSPECIFIED = 0, + DECLARATIVE_FRIENDLY = 1 + } + } + + /** Properties of a ResourceReference. */ + interface IResourceReference { + + /** ResourceReference type */ + type?: (string|null); + + /** ResourceReference childType */ + childType?: (string|null); + } + + /** Represents a ResourceReference. */ + class ResourceReference implements IResourceReference { + + /** + * Constructs a new ResourceReference. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IResourceReference); + + /** ResourceReference type. */ + public type: string; + + /** ResourceReference childType. */ + public childType: string; + + /** + * Creates a new ResourceReference instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourceReference instance + */ + public static create(properties?: google.api.IResourceReference): google.api.ResourceReference; + + /** + * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @param message ResourceReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @param message ResourceReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourceReference message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ResourceReference; + + /** + * Decodes a ResourceReference message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ResourceReference; + + /** + * Verifies a ResourceReference message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourceReference + */ + public static fromObject(object: { [k: string]: any }): google.api.ResourceReference; + + /** + * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. + * @param message ResourceReference + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.ResourceReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourceReference to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResourceReference + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace protobuf. */ + namespace protobuf { + + /** Properties of a FileDescriptorSet. */ + interface IFileDescriptorSet { + + /** FileDescriptorSet file */ + file?: (google.protobuf.IFileDescriptorProto[]|null); + } + + /** Represents a FileDescriptorSet. */ + class FileDescriptorSet implements IFileDescriptorSet { + + /** + * Constructs a new FileDescriptorSet. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileDescriptorSet); + + /** FileDescriptorSet file. */ + public file: google.protobuf.IFileDescriptorProto[]; + + /** + * Creates a new FileDescriptorSet instance using the specified properties. + * @param [properties] Properties to set + * @returns FileDescriptorSet instance + */ + public static create(properties?: google.protobuf.IFileDescriptorSet): google.protobuf.FileDescriptorSet; + + /** + * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @param message FileDescriptorSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @param message FileDescriptorSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileDescriptorSet; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileDescriptorSet; + + /** + * Verifies a FileDescriptorSet message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileDescriptorSet + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorSet; + + /** + * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. + * @param message FileDescriptorSet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileDescriptorSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileDescriptorSet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FileDescriptorSet + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FileDescriptorProto. */ + interface IFileDescriptorProto { + + /** FileDescriptorProto name */ + name?: (string|null); + + /** FileDescriptorProto package */ + "package"?: (string|null); + + /** FileDescriptorProto dependency */ + dependency?: (string[]|null); + + /** FileDescriptorProto publicDependency */ + publicDependency?: (number[]|null); + + /** FileDescriptorProto weakDependency */ + weakDependency?: (number[]|null); + + /** FileDescriptorProto messageType */ + messageType?: (google.protobuf.IDescriptorProto[]|null); + + /** FileDescriptorProto enumType */ + enumType?: (google.protobuf.IEnumDescriptorProto[]|null); + + /** FileDescriptorProto service */ + service?: (google.protobuf.IServiceDescriptorProto[]|null); + + /** FileDescriptorProto extension */ + extension?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** FileDescriptorProto options */ + options?: (google.protobuf.IFileOptions|null); + + /** FileDescriptorProto sourceCodeInfo */ + sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); + + /** FileDescriptorProto syntax */ + syntax?: (string|null); + + /** FileDescriptorProto edition */ + edition?: (string|null); + } + + /** Represents a FileDescriptorProto. */ + class FileDescriptorProto implements IFileDescriptorProto { + + /** + * Constructs a new FileDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileDescriptorProto); + + /** FileDescriptorProto name. */ + public name: string; + + /** FileDescriptorProto package. */ + public package: string; + + /** FileDescriptorProto dependency. */ + public dependency: string[]; + + /** FileDescriptorProto publicDependency. */ + public publicDependency: number[]; + + /** FileDescriptorProto weakDependency. */ + public weakDependency: number[]; + + /** FileDescriptorProto messageType. */ + public messageType: google.protobuf.IDescriptorProto[]; + + /** FileDescriptorProto enumType. */ + public enumType: google.protobuf.IEnumDescriptorProto[]; + + /** FileDescriptorProto service. */ + public service: google.protobuf.IServiceDescriptorProto[]; + + /** FileDescriptorProto extension. */ + public extension: google.protobuf.IFieldDescriptorProto[]; + + /** FileDescriptorProto options. */ + public options?: (google.protobuf.IFileOptions|null); + + /** FileDescriptorProto sourceCodeInfo. */ + public sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); + + /** FileDescriptorProto syntax. */ + public syntax: string; + + /** FileDescriptorProto edition. */ + public edition: string; + + /** + * Creates a new FileDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns FileDescriptorProto instance + */ + public static create(properties?: google.protobuf.IFileDescriptorProto): google.protobuf.FileDescriptorProto; + + /** + * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @param message FileDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @param message FileDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileDescriptorProto; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileDescriptorProto; + + /** + * Verifies a FileDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorProto; + + /** + * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. + * @param message FileDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FileDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DescriptorProto. */ + interface IDescriptorProto { + + /** DescriptorProto name */ + name?: (string|null); + + /** DescriptorProto field */ + field?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** DescriptorProto extension */ + extension?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** DescriptorProto nestedType */ + nestedType?: (google.protobuf.IDescriptorProto[]|null); + + /** DescriptorProto enumType */ + enumType?: (google.protobuf.IEnumDescriptorProto[]|null); + + /** DescriptorProto extensionRange */ + extensionRange?: (google.protobuf.DescriptorProto.IExtensionRange[]|null); + + /** DescriptorProto oneofDecl */ + oneofDecl?: (google.protobuf.IOneofDescriptorProto[]|null); + + /** DescriptorProto options */ + options?: (google.protobuf.IMessageOptions|null); + + /** DescriptorProto reservedRange */ + reservedRange?: (google.protobuf.DescriptorProto.IReservedRange[]|null); + + /** DescriptorProto reservedName */ + reservedName?: (string[]|null); + } + + /** Represents a DescriptorProto. */ + class DescriptorProto implements IDescriptorProto { + + /** + * Constructs a new DescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IDescriptorProto); + + /** DescriptorProto name. */ + public name: string; + + /** DescriptorProto field. */ + public field: google.protobuf.IFieldDescriptorProto[]; + + /** DescriptorProto extension. */ + public extension: google.protobuf.IFieldDescriptorProto[]; + + /** DescriptorProto nestedType. */ + public nestedType: google.protobuf.IDescriptorProto[]; + + /** DescriptorProto enumType. */ + public enumType: google.protobuf.IEnumDescriptorProto[]; + + /** DescriptorProto extensionRange. */ + public extensionRange: google.protobuf.DescriptorProto.IExtensionRange[]; + + /** DescriptorProto oneofDecl. */ + public oneofDecl: google.protobuf.IOneofDescriptorProto[]; + + /** DescriptorProto options. */ + public options?: (google.protobuf.IMessageOptions|null); + + /** DescriptorProto reservedRange. */ + public reservedRange: google.protobuf.DescriptorProto.IReservedRange[]; + + /** DescriptorProto reservedName. */ + public reservedName: string[]; + + /** + * Creates a new DescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns DescriptorProto instance + */ + public static create(properties?: google.protobuf.IDescriptorProto): google.protobuf.DescriptorProto; + + /** + * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @param message DescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @param message DescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto; + + /** + * Verifies a DescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto; + + /** + * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. + * @param message DescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace DescriptorProto { + + /** Properties of an ExtensionRange. */ + interface IExtensionRange { + + /** ExtensionRange start */ + start?: (number|null); + + /** ExtensionRange end */ + end?: (number|null); + + /** ExtensionRange options */ + options?: (google.protobuf.IExtensionRangeOptions|null); + } + + /** Represents an ExtensionRange. */ + class ExtensionRange implements IExtensionRange { + + /** + * Constructs a new ExtensionRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.DescriptorProto.IExtensionRange); + + /** ExtensionRange start. */ + public start: number; + + /** ExtensionRange end. */ + public end: number; + + /** ExtensionRange options. */ + public options?: (google.protobuf.IExtensionRangeOptions|null); + + /** + * Creates a new ExtensionRange instance using the specified properties. + * @param [properties] Properties to set + * @returns ExtensionRange instance + */ + public static create(properties?: google.protobuf.DescriptorProto.IExtensionRange): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @param message ExtensionRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @param message ExtensionRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Verifies an ExtensionRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExtensionRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. + * @param message ExtensionRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto.ExtensionRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExtensionRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExtensionRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ReservedRange. */ + interface IReservedRange { + + /** ReservedRange start */ + start?: (number|null); + + /** ReservedRange end */ + end?: (number|null); + } + + /** Represents a ReservedRange. */ + class ReservedRange implements IReservedRange { + + /** + * Constructs a new ReservedRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.DescriptorProto.IReservedRange); + + /** ReservedRange start. */ + public start: number; + + /** ReservedRange end. */ + public end: number; + + /** + * Creates a new ReservedRange instance using the specified properties. + * @param [properties] Properties to set + * @returns ReservedRange instance + */ + public static create(properties?: google.protobuf.DescriptorProto.IReservedRange): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @param message ReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @param message ReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReservedRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Decodes a ReservedRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Verifies a ReservedRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReservedRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. + * @param message ReservedRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto.ReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReservedRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReservedRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an ExtensionRangeOptions. */ + interface IExtensionRangeOptions { + + /** ExtensionRangeOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an ExtensionRangeOptions. */ + class ExtensionRangeOptions implements IExtensionRangeOptions { + + /** + * Constructs a new ExtensionRangeOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IExtensionRangeOptions); + + /** ExtensionRangeOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new ExtensionRangeOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns ExtensionRangeOptions instance + */ + public static create(properties?: google.protobuf.IExtensionRangeOptions): google.protobuf.ExtensionRangeOptions; + + /** + * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @param message ExtensionRangeOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @param message ExtensionRangeOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ExtensionRangeOptions; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ExtensionRangeOptions; + + /** + * Verifies an ExtensionRangeOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExtensionRangeOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ExtensionRangeOptions; + + /** + * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. + * @param message ExtensionRangeOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ExtensionRangeOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExtensionRangeOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExtensionRangeOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FieldDescriptorProto. */ + interface IFieldDescriptorProto { + + /** FieldDescriptorProto name */ + name?: (string|null); + + /** FieldDescriptorProto number */ + number?: (number|null); + + /** FieldDescriptorProto label */ + label?: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label|null); + + /** FieldDescriptorProto type */ + type?: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type|null); + + /** FieldDescriptorProto typeName */ + typeName?: (string|null); + + /** FieldDescriptorProto extendee */ + extendee?: (string|null); + + /** FieldDescriptorProto defaultValue */ + defaultValue?: (string|null); + + /** FieldDescriptorProto oneofIndex */ + oneofIndex?: (number|null); + + /** FieldDescriptorProto jsonName */ + jsonName?: (string|null); + + /** FieldDescriptorProto options */ + options?: (google.protobuf.IFieldOptions|null); + + /** FieldDescriptorProto proto3Optional */ + proto3Optional?: (boolean|null); + } + + /** Represents a FieldDescriptorProto. */ + class FieldDescriptorProto implements IFieldDescriptorProto { + + /** + * Constructs a new FieldDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldDescriptorProto); + + /** FieldDescriptorProto name. */ + public name: string; + + /** FieldDescriptorProto number. */ + public number: number; + + /** FieldDescriptorProto label. */ + public label: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label); + + /** FieldDescriptorProto type. */ + public type: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type); + + /** FieldDescriptorProto typeName. */ + public typeName: string; + + /** FieldDescriptorProto extendee. */ + public extendee: string; + + /** FieldDescriptorProto defaultValue. */ + public defaultValue: string; + + /** FieldDescriptorProto oneofIndex. */ + public oneofIndex: number; + + /** FieldDescriptorProto jsonName. */ + public jsonName: string; + + /** FieldDescriptorProto options. */ + public options?: (google.protobuf.IFieldOptions|null); + + /** FieldDescriptorProto proto3Optional. */ + public proto3Optional: boolean; + + /** + * Creates a new FieldDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldDescriptorProto instance + */ + public static create(properties?: google.protobuf.IFieldDescriptorProto): google.protobuf.FieldDescriptorProto; + + /** + * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @param message FieldDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @param message FieldDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldDescriptorProto; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldDescriptorProto; + + /** + * Verifies a FieldDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldDescriptorProto; + + /** + * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. + * @param message FieldDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FieldDescriptorProto { + + /** Type enum. */ + enum Type { + TYPE_DOUBLE = 1, + TYPE_FLOAT = 2, + TYPE_INT64 = 3, + TYPE_UINT64 = 4, + TYPE_INT32 = 5, + TYPE_FIXED64 = 6, + TYPE_FIXED32 = 7, + TYPE_BOOL = 8, + TYPE_STRING = 9, + TYPE_GROUP = 10, + TYPE_MESSAGE = 11, + TYPE_BYTES = 12, + TYPE_UINT32 = 13, + TYPE_ENUM = 14, + TYPE_SFIXED32 = 15, + TYPE_SFIXED64 = 16, + TYPE_SINT32 = 17, + TYPE_SINT64 = 18 + } + + /** Label enum. */ + enum Label { + LABEL_OPTIONAL = 1, + LABEL_REQUIRED = 2, + LABEL_REPEATED = 3 + } + } + + /** Properties of an OneofDescriptorProto. */ + interface IOneofDescriptorProto { + + /** OneofDescriptorProto name */ + name?: (string|null); + + /** OneofDescriptorProto options */ + options?: (google.protobuf.IOneofOptions|null); + } + + /** Represents an OneofDescriptorProto. */ + class OneofDescriptorProto implements IOneofDescriptorProto { + + /** + * Constructs a new OneofDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IOneofDescriptorProto); + + /** OneofDescriptorProto name. */ + public name: string; + + /** OneofDescriptorProto options. */ + public options?: (google.protobuf.IOneofOptions|null); + + /** + * Creates a new OneofDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns OneofDescriptorProto instance + */ + public static create(properties?: google.protobuf.IOneofDescriptorProto): google.protobuf.OneofDescriptorProto; + + /** + * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @param message OneofDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @param message OneofDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofDescriptorProto; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofDescriptorProto; + + /** + * Verifies an OneofDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OneofDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.OneofDescriptorProto; + + /** + * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. + * @param message OneofDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.OneofDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OneofDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OneofDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnumDescriptorProto. */ + interface IEnumDescriptorProto { + + /** EnumDescriptorProto name */ + name?: (string|null); + + /** EnumDescriptorProto value */ + value?: (google.protobuf.IEnumValueDescriptorProto[]|null); + + /** EnumDescriptorProto options */ + options?: (google.protobuf.IEnumOptions|null); + + /** EnumDescriptorProto reservedRange */ + reservedRange?: (google.protobuf.EnumDescriptorProto.IEnumReservedRange[]|null); + + /** EnumDescriptorProto reservedName */ + reservedName?: (string[]|null); + } + + /** Represents an EnumDescriptorProto. */ + class EnumDescriptorProto implements IEnumDescriptorProto { + + /** + * Constructs a new EnumDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumDescriptorProto); + + /** EnumDescriptorProto name. */ + public name: string; + + /** EnumDescriptorProto value. */ + public value: google.protobuf.IEnumValueDescriptorProto[]; + + /** EnumDescriptorProto options. */ + public options?: (google.protobuf.IEnumOptions|null); + + /** EnumDescriptorProto reservedRange. */ + public reservedRange: google.protobuf.EnumDescriptorProto.IEnumReservedRange[]; + + /** EnumDescriptorProto reservedName. */ + public reservedName: string[]; + + /** + * Creates a new EnumDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumDescriptorProto instance + */ + public static create(properties?: google.protobuf.IEnumDescriptorProto): google.protobuf.EnumDescriptorProto; + + /** + * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @param message EnumDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @param message EnumDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto; + + /** + * Verifies an EnumDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto; + + /** + * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. + * @param message EnumDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace EnumDescriptorProto { + + /** Properties of an EnumReservedRange. */ + interface IEnumReservedRange { + + /** EnumReservedRange start */ + start?: (number|null); + + /** EnumReservedRange end */ + end?: (number|null); + } + + /** Represents an EnumReservedRange. */ + class EnumReservedRange implements IEnumReservedRange { + + /** + * Constructs a new EnumReservedRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange); + + /** EnumReservedRange start. */ + public start: number; + + /** EnumReservedRange end. */ + public end: number; + + /** + * Creates a new EnumReservedRange instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumReservedRange instance + */ + public static create(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @param message EnumReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @param message EnumReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Verifies an EnumReservedRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumReservedRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. + * @param message EnumReservedRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumDescriptorProto.EnumReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumReservedRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumReservedRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an EnumValueDescriptorProto. */ + interface IEnumValueDescriptorProto { + + /** EnumValueDescriptorProto name */ + name?: (string|null); + + /** EnumValueDescriptorProto number */ + number?: (number|null); + + /** EnumValueDescriptorProto options */ + options?: (google.protobuf.IEnumValueOptions|null); + } + + /** Represents an EnumValueDescriptorProto. */ + class EnumValueDescriptorProto implements IEnumValueDescriptorProto { + + /** + * Constructs a new EnumValueDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumValueDescriptorProto); + + /** EnumValueDescriptorProto name. */ + public name: string; + + /** EnumValueDescriptorProto number. */ + public number: number; + + /** EnumValueDescriptorProto options. */ + public options?: (google.protobuf.IEnumValueOptions|null); + + /** + * Creates a new EnumValueDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumValueDescriptorProto instance + */ + public static create(properties?: google.protobuf.IEnumValueDescriptorProto): google.protobuf.EnumValueDescriptorProto; + + /** + * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @param message EnumValueDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @param message EnumValueDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueDescriptorProto; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueDescriptorProto; + + /** + * Verifies an EnumValueDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumValueDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueDescriptorProto; + + /** + * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. + * @param message EnumValueDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumValueDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumValueDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumValueDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceDescriptorProto. */ + interface IServiceDescriptorProto { + + /** ServiceDescriptorProto name */ + name?: (string|null); + + /** ServiceDescriptorProto method */ + method?: (google.protobuf.IMethodDescriptorProto[]|null); + + /** ServiceDescriptorProto options */ + options?: (google.protobuf.IServiceOptions|null); + } + + /** Represents a ServiceDescriptorProto. */ + class ServiceDescriptorProto implements IServiceDescriptorProto { + + /** + * Constructs a new ServiceDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceDescriptorProto); + + /** ServiceDescriptorProto name. */ + public name: string; + + /** ServiceDescriptorProto method. */ + public method: google.protobuf.IMethodDescriptorProto[]; + + /** ServiceDescriptorProto options. */ + public options?: (google.protobuf.IServiceOptions|null); + + /** + * Creates a new ServiceDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceDescriptorProto instance + */ + public static create(properties?: google.protobuf.IServiceDescriptorProto): google.protobuf.ServiceDescriptorProto; + + /** + * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @param message ServiceDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @param message ServiceDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceDescriptorProto; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceDescriptorProto; + + /** + * Verifies a ServiceDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceDescriptorProto; + + /** + * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. + * @param message ServiceDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ServiceDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ServiceDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MethodDescriptorProto. */ + interface IMethodDescriptorProto { + + /** MethodDescriptorProto name */ + name?: (string|null); + + /** MethodDescriptorProto inputType */ + inputType?: (string|null); + + /** MethodDescriptorProto outputType */ + outputType?: (string|null); + + /** MethodDescriptorProto options */ + options?: (google.protobuf.IMethodOptions|null); + + /** MethodDescriptorProto clientStreaming */ + clientStreaming?: (boolean|null); + + /** MethodDescriptorProto serverStreaming */ + serverStreaming?: (boolean|null); + } + + /** Represents a MethodDescriptorProto. */ + class MethodDescriptorProto implements IMethodDescriptorProto { + + /** + * Constructs a new MethodDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMethodDescriptorProto); + + /** MethodDescriptorProto name. */ + public name: string; + + /** MethodDescriptorProto inputType. */ + public inputType: string; + + /** MethodDescriptorProto outputType. */ + public outputType: string; + + /** MethodDescriptorProto options. */ + public options?: (google.protobuf.IMethodOptions|null); + + /** MethodDescriptorProto clientStreaming. */ + public clientStreaming: boolean; + + /** MethodDescriptorProto serverStreaming. */ + public serverStreaming: boolean; + + /** + * Creates a new MethodDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodDescriptorProto instance + */ + public static create(properties?: google.protobuf.IMethodDescriptorProto): google.protobuf.MethodDescriptorProto; + + /** + * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @param message MethodDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @param message MethodDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodDescriptorProto; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodDescriptorProto; + + /** + * Verifies a MethodDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MethodDescriptorProto; + + /** + * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. + * @param message MethodDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MethodDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MethodDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FileOptions. */ + interface IFileOptions { + + /** FileOptions javaPackage */ + javaPackage?: (string|null); + + /** FileOptions javaOuterClassname */ + javaOuterClassname?: (string|null); + + /** FileOptions javaMultipleFiles */ + javaMultipleFiles?: (boolean|null); + + /** FileOptions javaGenerateEqualsAndHash */ + javaGenerateEqualsAndHash?: (boolean|null); + + /** FileOptions javaStringCheckUtf8 */ + javaStringCheckUtf8?: (boolean|null); + + /** FileOptions optimizeFor */ + optimizeFor?: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode|null); + + /** FileOptions goPackage */ + goPackage?: (string|null); + + /** FileOptions ccGenericServices */ + ccGenericServices?: (boolean|null); + + /** FileOptions javaGenericServices */ + javaGenericServices?: (boolean|null); + + /** FileOptions pyGenericServices */ + pyGenericServices?: (boolean|null); + + /** FileOptions phpGenericServices */ + phpGenericServices?: (boolean|null); + + /** FileOptions deprecated */ + deprecated?: (boolean|null); + + /** FileOptions ccEnableArenas */ + ccEnableArenas?: (boolean|null); + + /** FileOptions objcClassPrefix */ + objcClassPrefix?: (string|null); + + /** FileOptions csharpNamespace */ + csharpNamespace?: (string|null); + + /** FileOptions swiftPrefix */ + swiftPrefix?: (string|null); + + /** FileOptions phpClassPrefix */ + phpClassPrefix?: (string|null); + + /** FileOptions phpNamespace */ + phpNamespace?: (string|null); + + /** FileOptions phpMetadataNamespace */ + phpMetadataNamespace?: (string|null); + + /** FileOptions rubyPackage */ + rubyPackage?: (string|null); + + /** FileOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** FileOptions .google.api.resourceDefinition */ + ".google.api.resourceDefinition"?: (google.api.IResourceDescriptor[]|null); + } + + /** Represents a FileOptions. */ + class FileOptions implements IFileOptions { + + /** + * Constructs a new FileOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileOptions); + + /** FileOptions javaPackage. */ + public javaPackage: string; + + /** FileOptions javaOuterClassname. */ + public javaOuterClassname: string; + + /** FileOptions javaMultipleFiles. */ + public javaMultipleFiles: boolean; + + /** FileOptions javaGenerateEqualsAndHash. */ + public javaGenerateEqualsAndHash: boolean; + + /** FileOptions javaStringCheckUtf8. */ + public javaStringCheckUtf8: boolean; + + /** FileOptions optimizeFor. */ + public optimizeFor: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode); + + /** FileOptions goPackage. */ + public goPackage: string; + + /** FileOptions ccGenericServices. */ + public ccGenericServices: boolean; + + /** FileOptions javaGenericServices. */ + public javaGenericServices: boolean; + + /** FileOptions pyGenericServices. */ + public pyGenericServices: boolean; + + /** FileOptions phpGenericServices. */ + public phpGenericServices: boolean; + + /** FileOptions deprecated. */ + public deprecated: boolean; + + /** FileOptions ccEnableArenas. */ + public ccEnableArenas: boolean; + + /** FileOptions objcClassPrefix. */ + public objcClassPrefix: string; + + /** FileOptions csharpNamespace. */ + public csharpNamespace: string; + + /** FileOptions swiftPrefix. */ + public swiftPrefix: string; + + /** FileOptions phpClassPrefix. */ + public phpClassPrefix: string; + + /** FileOptions phpNamespace. */ + public phpNamespace: string; + + /** FileOptions phpMetadataNamespace. */ + public phpMetadataNamespace: string; + + /** FileOptions rubyPackage. */ + public rubyPackage: string; + + /** FileOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new FileOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns FileOptions instance + */ + public static create(properties?: google.protobuf.IFileOptions): google.protobuf.FileOptions; + + /** + * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @param message FileOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @param message FileOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileOptions; + + /** + * Decodes a FileOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileOptions; + + /** + * Verifies a FileOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileOptions; + + /** + * Creates a plain object from a FileOptions message. Also converts values to other types if specified. + * @param message FileOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FileOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FileOptions { + + /** OptimizeMode enum. */ + enum OptimizeMode { + SPEED = 1, + CODE_SIZE = 2, + LITE_RUNTIME = 3 + } + } + + /** Properties of a MessageOptions. */ + interface IMessageOptions { + + /** MessageOptions messageSetWireFormat */ + messageSetWireFormat?: (boolean|null); + + /** MessageOptions noStandardDescriptorAccessor */ + noStandardDescriptorAccessor?: (boolean|null); + + /** MessageOptions deprecated */ + deprecated?: (boolean|null); + + /** MessageOptions mapEntry */ + mapEntry?: (boolean|null); + + /** MessageOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** MessageOptions .google.api.resource */ + ".google.api.resource"?: (google.api.IResourceDescriptor|null); + } + + /** Represents a MessageOptions. */ + class MessageOptions implements IMessageOptions { + + /** + * Constructs a new MessageOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMessageOptions); + + /** MessageOptions messageSetWireFormat. */ + public messageSetWireFormat: boolean; + + /** MessageOptions noStandardDescriptorAccessor. */ + public noStandardDescriptorAccessor: boolean; + + /** MessageOptions deprecated. */ + public deprecated: boolean; + + /** MessageOptions mapEntry. */ + public mapEntry: boolean; + + /** MessageOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new MessageOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns MessageOptions instance + */ + public static create(properties?: google.protobuf.IMessageOptions): google.protobuf.MessageOptions; + + /** + * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @param message MessageOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @param message MessageOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MessageOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MessageOptions; + + /** + * Decodes a MessageOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MessageOptions; + + /** + * Verifies a MessageOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MessageOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MessageOptions; + + /** + * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. + * @param message MessageOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MessageOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MessageOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MessageOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FieldOptions. */ + interface IFieldOptions { + + /** FieldOptions ctype */ + ctype?: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType|null); + + /** FieldOptions packed */ + packed?: (boolean|null); + + /** FieldOptions jstype */ + jstype?: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType|null); + + /** FieldOptions lazy */ + lazy?: (boolean|null); + + /** FieldOptions unverifiedLazy */ + unverifiedLazy?: (boolean|null); + + /** FieldOptions deprecated */ + deprecated?: (boolean|null); + + /** FieldOptions weak */ + weak?: (boolean|null); + + /** FieldOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** FieldOptions .google.api.fieldBehavior */ + ".google.api.fieldBehavior"?: (google.api.FieldBehavior[]|null); + + /** FieldOptions .google.api.resourceReference */ + ".google.api.resourceReference"?: (google.api.IResourceReference|null); + } + + /** Represents a FieldOptions. */ + class FieldOptions implements IFieldOptions { + + /** + * Constructs a new FieldOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldOptions); + + /** FieldOptions ctype. */ + public ctype: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType); + + /** FieldOptions packed. */ + public packed: boolean; + + /** FieldOptions jstype. */ + public jstype: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType); + + /** FieldOptions lazy. */ + public lazy: boolean; + + /** FieldOptions unverifiedLazy. */ + public unverifiedLazy: boolean; + + /** FieldOptions deprecated. */ + public deprecated: boolean; + + /** FieldOptions weak. */ + public weak: boolean; + + /** FieldOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new FieldOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldOptions instance + */ + public static create(properties?: google.protobuf.IFieldOptions): google.protobuf.FieldOptions; + + /** + * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @param message FieldOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @param message FieldOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldOptions; + + /** + * Decodes a FieldOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldOptions; + + /** + * Verifies a FieldOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions; + + /** + * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. + * @param message FieldOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FieldOptions { + + /** CType enum. */ + enum CType { + STRING = 0, + CORD = 1, + STRING_PIECE = 2 + } + + /** JSType enum. */ + enum JSType { + JS_NORMAL = 0, + JS_STRING = 1, + JS_NUMBER = 2 + } + } + + /** Properties of an OneofOptions. */ + interface IOneofOptions { + + /** OneofOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an OneofOptions. */ + class OneofOptions implements IOneofOptions { + + /** + * Constructs a new OneofOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IOneofOptions); + + /** OneofOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new OneofOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns OneofOptions instance + */ + public static create(properties?: google.protobuf.IOneofOptions): google.protobuf.OneofOptions; + + /** + * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @param message OneofOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @param message OneofOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OneofOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofOptions; + + /** + * Decodes an OneofOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofOptions; + + /** + * Verifies an OneofOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OneofOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.OneofOptions; + + /** + * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. + * @param message OneofOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.OneofOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OneofOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OneofOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnumOptions. */ + interface IEnumOptions { + + /** EnumOptions allowAlias */ + allowAlias?: (boolean|null); + + /** EnumOptions deprecated */ + deprecated?: (boolean|null); + + /** EnumOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an EnumOptions. */ + class EnumOptions implements IEnumOptions { + + /** + * Constructs a new EnumOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumOptions); + + /** EnumOptions allowAlias. */ + public allowAlias: boolean; + + /** EnumOptions deprecated. */ + public deprecated: boolean; + + /** EnumOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new EnumOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumOptions instance + */ + public static create(properties?: google.protobuf.IEnumOptions): google.protobuf.EnumOptions; + + /** + * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @param message EnumOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @param message EnumOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumOptions; + + /** + * Decodes an EnumOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumOptions; + + /** + * Verifies an EnumOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumOptions; + + /** + * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. + * @param message EnumOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnumValueOptions. */ + interface IEnumValueOptions { + + /** EnumValueOptions deprecated */ + deprecated?: (boolean|null); + + /** EnumValueOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an EnumValueOptions. */ + class EnumValueOptions implements IEnumValueOptions { + + /** + * Constructs a new EnumValueOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumValueOptions); + + /** EnumValueOptions deprecated. */ + public deprecated: boolean; + + /** EnumValueOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new EnumValueOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumValueOptions instance + */ + public static create(properties?: google.protobuf.IEnumValueOptions): google.protobuf.EnumValueOptions; + + /** + * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @param message EnumValueOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @param message EnumValueOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueOptions; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueOptions; + + /** + * Verifies an EnumValueOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumValueOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueOptions; + + /** + * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. + * @param message EnumValueOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumValueOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumValueOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumValueOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceOptions. */ + interface IServiceOptions { + + /** ServiceOptions deprecated */ + deprecated?: (boolean|null); + + /** ServiceOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** ServiceOptions .google.api.defaultHost */ + ".google.api.defaultHost"?: (string|null); + + /** ServiceOptions .google.api.oauthScopes */ + ".google.api.oauthScopes"?: (string|null); + } + + /** Represents a ServiceOptions. */ + class ServiceOptions implements IServiceOptions { + + /** + * Constructs a new ServiceOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceOptions); + + /** ServiceOptions deprecated. */ + public deprecated: boolean; + + /** ServiceOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new ServiceOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceOptions instance + */ + public static create(properties?: google.protobuf.IServiceOptions): google.protobuf.ServiceOptions; + + /** + * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @param message ServiceOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @param message ServiceOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceOptions; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceOptions; + + /** + * Verifies a ServiceOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceOptions; + + /** + * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. + * @param message ServiceOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ServiceOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ServiceOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MethodOptions. */ + interface IMethodOptions { + + /** MethodOptions deprecated */ + deprecated?: (boolean|null); + + /** MethodOptions idempotencyLevel */ + idempotencyLevel?: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel|null); + + /** MethodOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** MethodOptions .google.api.http */ + ".google.api.http"?: (google.api.IHttpRule|null); + + /** MethodOptions .google.api.methodSignature */ + ".google.api.methodSignature"?: (string[]|null); + + /** MethodOptions .google.longrunning.operationInfo */ + ".google.longrunning.operationInfo"?: (google.longrunning.IOperationInfo|null); + } + + /** Represents a MethodOptions. */ + class MethodOptions implements IMethodOptions { + + /** + * Constructs a new MethodOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMethodOptions); + + /** MethodOptions deprecated. */ + public deprecated: boolean; + + /** MethodOptions idempotencyLevel. */ + public idempotencyLevel: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel); + + /** MethodOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new MethodOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodOptions instance + */ + public static create(properties?: google.protobuf.IMethodOptions): google.protobuf.MethodOptions; + + /** + * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @param message MethodOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @param message MethodOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodOptions; + + /** + * Decodes a MethodOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodOptions; + + /** + * Verifies a MethodOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MethodOptions; + + /** + * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. + * @param message MethodOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MethodOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MethodOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace MethodOptions { + + /** IdempotencyLevel enum. */ + enum IdempotencyLevel { + IDEMPOTENCY_UNKNOWN = 0, + NO_SIDE_EFFECTS = 1, + IDEMPOTENT = 2 + } + } + + /** Properties of an UninterpretedOption. */ + interface IUninterpretedOption { + + /** UninterpretedOption name */ + name?: (google.protobuf.UninterpretedOption.INamePart[]|null); + + /** UninterpretedOption identifierValue */ + identifierValue?: (string|null); + + /** UninterpretedOption positiveIntValue */ + positiveIntValue?: (number|Long|string|null); + + /** UninterpretedOption negativeIntValue */ + negativeIntValue?: (number|Long|string|null); + + /** UninterpretedOption doubleValue */ + doubleValue?: (number|null); + + /** UninterpretedOption stringValue */ + stringValue?: (Uint8Array|string|null); + + /** UninterpretedOption aggregateValue */ + aggregateValue?: (string|null); + } + + /** Represents an UninterpretedOption. */ + class UninterpretedOption implements IUninterpretedOption { + + /** + * Constructs a new UninterpretedOption. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IUninterpretedOption); + + /** UninterpretedOption name. */ + public name: google.protobuf.UninterpretedOption.INamePart[]; + + /** UninterpretedOption identifierValue. */ + public identifierValue: string; + + /** UninterpretedOption positiveIntValue. */ + public positiveIntValue: (number|Long|string); + + /** UninterpretedOption negativeIntValue. */ + public negativeIntValue: (number|Long|string); + + /** UninterpretedOption doubleValue. */ + public doubleValue: number; + + /** UninterpretedOption stringValue. */ + public stringValue: (Uint8Array|string); + + /** UninterpretedOption aggregateValue. */ + public aggregateValue: string; + + /** + * Creates a new UninterpretedOption instance using the specified properties. + * @param [properties] Properties to set + * @returns UninterpretedOption instance + */ + public static create(properties?: google.protobuf.IUninterpretedOption): google.protobuf.UninterpretedOption; + + /** + * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @param message UninterpretedOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @param message UninterpretedOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption; + + /** + * Verifies an UninterpretedOption message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UninterpretedOption + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption; + + /** + * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. + * @param message UninterpretedOption + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UninterpretedOption, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UninterpretedOption to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UninterpretedOption + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace UninterpretedOption { + + /** Properties of a NamePart. */ + interface INamePart { + + /** NamePart namePart */ + namePart: string; + + /** NamePart isExtension */ + isExtension: boolean; + } + + /** Represents a NamePart. */ + class NamePart implements INamePart { + + /** + * Constructs a new NamePart. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.UninterpretedOption.INamePart); + + /** NamePart namePart. */ + public namePart: string; + + /** NamePart isExtension. */ + public isExtension: boolean; + + /** + * Creates a new NamePart instance using the specified properties. + * @param [properties] Properties to set + * @returns NamePart instance + */ + public static create(properties?: google.protobuf.UninterpretedOption.INamePart): google.protobuf.UninterpretedOption.NamePart; + + /** + * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @param message NamePart message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @param message NamePart message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NamePart message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption.NamePart; + + /** + * Decodes a NamePart message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption.NamePart; + + /** + * Verifies a NamePart message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NamePart message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NamePart + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption.NamePart; + + /** + * Creates a plain object from a NamePart message. Also converts values to other types if specified. + * @param message NamePart + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UninterpretedOption.NamePart, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NamePart to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NamePart + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a SourceCodeInfo. */ + interface ISourceCodeInfo { + + /** SourceCodeInfo location */ + location?: (google.protobuf.SourceCodeInfo.ILocation[]|null); + } + + /** Represents a SourceCodeInfo. */ + class SourceCodeInfo implements ISourceCodeInfo { + + /** + * Constructs a new SourceCodeInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ISourceCodeInfo); + + /** SourceCodeInfo location. */ + public location: google.protobuf.SourceCodeInfo.ILocation[]; + + /** + * Creates a new SourceCodeInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns SourceCodeInfo instance + */ + public static create(properties?: google.protobuf.ISourceCodeInfo): google.protobuf.SourceCodeInfo; + + /** + * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @param message SourceCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @param message SourceCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo; + + /** + * Verifies a SourceCodeInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SourceCodeInfo + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo; + + /** + * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. + * @param message SourceCodeInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.SourceCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SourceCodeInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SourceCodeInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SourceCodeInfo { + + /** Properties of a Location. */ + interface ILocation { + + /** Location path */ + path?: (number[]|null); + + /** Location span */ + span?: (number[]|null); + + /** Location leadingComments */ + leadingComments?: (string|null); + + /** Location trailingComments */ + trailingComments?: (string|null); + + /** Location leadingDetachedComments */ + leadingDetachedComments?: (string[]|null); + } + + /** Represents a Location. */ + class Location implements ILocation { + + /** + * Constructs a new Location. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.SourceCodeInfo.ILocation); + + /** Location path. */ + public path: number[]; + + /** Location span. */ + public span: number[]; + + /** Location leadingComments. */ + public leadingComments: string; + + /** Location trailingComments. */ + public trailingComments: string; + + /** Location leadingDetachedComments. */ + public leadingDetachedComments: string[]; + + /** + * Creates a new Location instance using the specified properties. + * @param [properties] Properties to set + * @returns Location instance + */ + public static create(properties?: google.protobuf.SourceCodeInfo.ILocation): google.protobuf.SourceCodeInfo.Location; + + /** + * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @param message Location message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @param message Location message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Location message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo.Location; + + /** + * Decodes a Location message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo.Location; + + /** + * Verifies a Location message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Location message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Location + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo.Location; + + /** + * Creates a plain object from a Location message. Also converts values to other types if specified. + * @param message Location + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.SourceCodeInfo.Location, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Location to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Location + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a GeneratedCodeInfo. */ + interface IGeneratedCodeInfo { + + /** GeneratedCodeInfo annotation */ + annotation?: (google.protobuf.GeneratedCodeInfo.IAnnotation[]|null); + } + + /** Represents a GeneratedCodeInfo. */ + class GeneratedCodeInfo implements IGeneratedCodeInfo { + + /** + * Constructs a new GeneratedCodeInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IGeneratedCodeInfo); + + /** GeneratedCodeInfo annotation. */ + public annotation: google.protobuf.GeneratedCodeInfo.IAnnotation[]; + + /** + * Creates a new GeneratedCodeInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns GeneratedCodeInfo instance + */ + public static create(properties?: google.protobuf.IGeneratedCodeInfo): google.protobuf.GeneratedCodeInfo; + + /** + * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @param message GeneratedCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @param message GeneratedCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo; + + /** + * Verifies a GeneratedCodeInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GeneratedCodeInfo + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo; + + /** + * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. + * @param message GeneratedCodeInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.GeneratedCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GeneratedCodeInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GeneratedCodeInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace GeneratedCodeInfo { + + /** Properties of an Annotation. */ + interface IAnnotation { + + /** Annotation path */ + path?: (number[]|null); + + /** Annotation sourceFile */ + sourceFile?: (string|null); + + /** Annotation begin */ + begin?: (number|null); + + /** Annotation end */ + end?: (number|null); + + /** Annotation semantic */ + semantic?: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null); + } + + /** Represents an Annotation. */ + class Annotation implements IAnnotation { + + /** + * Constructs a new Annotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation); + + /** Annotation path. */ + public path: number[]; + + /** Annotation sourceFile. */ + public sourceFile: string; + + /** Annotation begin. */ + public begin: number; + + /** Annotation end. */ + public end: number; + + /** Annotation semantic. */ + public semantic: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic); + + /** + * Creates a new Annotation instance using the specified properties. + * @param [properties] Properties to set + * @returns Annotation instance + */ + public static create(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @param message Annotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @param message Annotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Annotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Decodes an Annotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Verifies an Annotation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Annotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Annotation + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Creates a plain object from an Annotation message. Also converts values to other types if specified. + * @param message Annotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.GeneratedCodeInfo.Annotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Annotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Annotation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Annotation { + + /** Semantic enum. */ + enum Semantic { + NONE = 0, + SET = 1, + ALIAS = 2 + } + } + } + + /** Properties of a Duration. */ + interface IDuration { + + /** Duration seconds */ + seconds?: (number|Long|string|null); + + /** Duration nanos */ + nanos?: (number|null); + } + + /** Represents a Duration. */ + class Duration implements IDuration { + + /** + * Constructs a new Duration. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IDuration); + + /** Duration seconds. */ + public seconds: (number|Long|string); + + /** Duration nanos. */ + public nanos: number; + + /** + * Creates a new Duration instance using the specified properties. + * @param [properties] Properties to set + * @returns Duration instance + */ + public static create(properties?: google.protobuf.IDuration): google.protobuf.Duration; + + /** + * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @param message Duration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @param message Duration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Duration; + + /** + * Decodes a Duration message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Duration; + + /** + * Verifies a Duration message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Duration message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Duration + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Duration; + + /** + * Creates a plain object from a Duration message. Also converts values to other types if specified. + * @param message Duration + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Duration, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Duration to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Duration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Timestamp. */ + interface ITimestamp { + + /** Timestamp seconds */ + seconds?: (number|Long|string|null); + + /** Timestamp nanos */ + nanos?: (number|null); + } + + /** Represents a Timestamp. */ + class Timestamp implements ITimestamp { + + /** + * Constructs a new Timestamp. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ITimestamp); + + /** Timestamp seconds. */ + public seconds: (number|Long|string); + + /** Timestamp nanos. */ + public nanos: number; + + /** + * Creates a new Timestamp instance using the specified properties. + * @param [properties] Properties to set + * @returns Timestamp instance + */ + public static create(properties?: google.protobuf.ITimestamp): google.protobuf.Timestamp; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @param message Timestamp message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @param message Timestamp message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Timestamp; + + /** + * Decodes a Timestamp message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Timestamp; + + /** + * Verifies a Timestamp message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Timestamp + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Timestamp; + + /** + * Creates a plain object from a Timestamp message. Also converts values to other types if specified. + * @param message Timestamp + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Timestamp, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Timestamp to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Timestamp + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DoubleValue. */ + interface IDoubleValue { + + /** DoubleValue value */ + value?: (number|null); + } + + /** Represents a DoubleValue. */ + class DoubleValue implements IDoubleValue { + + /** + * Constructs a new DoubleValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IDoubleValue); + + /** DoubleValue value. */ + public value: number; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @param [properties] Properties to set + * @returns DoubleValue instance + */ + public static create(properties?: google.protobuf.IDoubleValue): google.protobuf.DoubleValue; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @param message DoubleValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IDoubleValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DoubleValue message, length delimited. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @param message DoubleValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IDoubleValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DoubleValue; + + /** + * Decodes a DoubleValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DoubleValue; + + /** + * Verifies a DoubleValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DoubleValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DoubleValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DoubleValue; + + /** + * Creates a plain object from a DoubleValue message. Also converts values to other types if specified. + * @param message DoubleValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DoubleValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DoubleValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DoubleValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FloatValue. */ + interface IFloatValue { + + /** FloatValue value */ + value?: (number|null); + } + + /** Represents a FloatValue. */ + class FloatValue implements IFloatValue { + + /** + * Constructs a new FloatValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFloatValue); + + /** FloatValue value. */ + public value: number; + + /** + * Creates a new FloatValue instance using the specified properties. + * @param [properties] Properties to set + * @returns FloatValue instance + */ + public static create(properties?: google.protobuf.IFloatValue): google.protobuf.FloatValue; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @param message FloatValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFloatValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FloatValue message, length delimited. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @param message FloatValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFloatValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FloatValue; + + /** + * Decodes a FloatValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FloatValue; + + /** + * Verifies a FloatValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FloatValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FloatValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FloatValue; + + /** + * Creates a plain object from a FloatValue message. Also converts values to other types if specified. + * @param message FloatValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FloatValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FloatValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FloatValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Int64Value. */ + interface IInt64Value { + + /** Int64Value value */ + value?: (number|Long|string|null); + } + + /** Represents an Int64Value. */ + class Int64Value implements IInt64Value { + + /** + * Constructs a new Int64Value. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IInt64Value); + + /** Int64Value value. */ + public value: (number|Long|string); + + /** + * Creates a new Int64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int64Value instance + */ + public static create(properties?: google.protobuf.IInt64Value): google.protobuf.Int64Value; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @param message Int64Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IInt64Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Int64Value message, length delimited. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @param message Int64Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IInt64Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Int64Value; + + /** + * Decodes an Int64Value message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Int64Value; + + /** + * Verifies an Int64Value message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Int64Value message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Int64Value + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Int64Value; + + /** + * Creates a plain object from an Int64Value message. Also converts values to other types if specified. + * @param message Int64Value + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Int64Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Int64Value to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Int64Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a UInt64Value. */ + interface IUInt64Value { + + /** UInt64Value value */ + value?: (number|Long|string|null); + } + + /** Represents a UInt64Value. */ + class UInt64Value implements IUInt64Value { + + /** + * Constructs a new UInt64Value. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IUInt64Value); + + /** UInt64Value value. */ + public value: (number|Long|string); + + /** + * Creates a new UInt64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt64Value instance + */ + public static create(properties?: google.protobuf.IUInt64Value): google.protobuf.UInt64Value; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @param message UInt64Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IUInt64Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UInt64Value message, length delimited. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @param message UInt64Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IUInt64Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UInt64Value; + + /** + * Decodes a UInt64Value message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UInt64Value; + + /** + * Verifies a UInt64Value message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a UInt64Value message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UInt64Value + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UInt64Value; + + /** + * Creates a plain object from a UInt64Value message. Also converts values to other types if specified. + * @param message UInt64Value + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UInt64Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UInt64Value to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UInt64Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Int32Value. */ + interface IInt32Value { + + /** Int32Value value */ + value?: (number|null); + } + + /** Represents an Int32Value. */ + class Int32Value implements IInt32Value { + + /** + * Constructs a new Int32Value. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IInt32Value); + + /** Int32Value value. */ + public value: number; + + /** + * Creates a new Int32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int32Value instance + */ + public static create(properties?: google.protobuf.IInt32Value): google.protobuf.Int32Value; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @param message Int32Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IInt32Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Int32Value message, length delimited. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @param message Int32Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IInt32Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Int32Value; + + /** + * Decodes an Int32Value message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Int32Value; + + /** + * Verifies an Int32Value message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Int32Value message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Int32Value + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Int32Value; + + /** + * Creates a plain object from an Int32Value message. Also converts values to other types if specified. + * @param message Int32Value + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Int32Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Int32Value to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Int32Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a UInt32Value. */ + interface IUInt32Value { + + /** UInt32Value value */ + value?: (number|null); + } + + /** Represents a UInt32Value. */ + class UInt32Value implements IUInt32Value { + + /** + * Constructs a new UInt32Value. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IUInt32Value); + + /** UInt32Value value. */ + public value: number; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt32Value instance + */ + public static create(properties?: google.protobuf.IUInt32Value): google.protobuf.UInt32Value; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @param message UInt32Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IUInt32Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UInt32Value message, length delimited. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @param message UInt32Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IUInt32Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UInt32Value; + + /** + * Decodes a UInt32Value message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UInt32Value; + + /** + * Verifies a UInt32Value message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a UInt32Value message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UInt32Value + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UInt32Value; + + /** + * Creates a plain object from a UInt32Value message. Also converts values to other types if specified. + * @param message UInt32Value + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UInt32Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UInt32Value to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UInt32Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BoolValue. */ + interface IBoolValue { + + /** BoolValue value */ + value?: (boolean|null); + } + + /** Represents a BoolValue. */ + class BoolValue implements IBoolValue { + + /** + * Constructs a new BoolValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IBoolValue); + + /** BoolValue value. */ + public value: boolean; + + /** + * Creates a new BoolValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BoolValue instance + */ + public static create(properties?: google.protobuf.IBoolValue): google.protobuf.BoolValue; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @param message BoolValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IBoolValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BoolValue message, length delimited. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @param message BoolValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IBoolValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.BoolValue; + + /** + * Decodes a BoolValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.BoolValue; + + /** + * Verifies a BoolValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BoolValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BoolValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.BoolValue; + + /** + * Creates a plain object from a BoolValue message. Also converts values to other types if specified. + * @param message BoolValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.BoolValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BoolValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BoolValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StringValue. */ + interface IStringValue { + + /** StringValue value */ + value?: (string|null); + } + + /** Represents a StringValue. */ + class StringValue implements IStringValue { + + /** + * Constructs a new StringValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IStringValue); + + /** StringValue value. */ + public value: string; + + /** + * Creates a new StringValue instance using the specified properties. + * @param [properties] Properties to set + * @returns StringValue instance + */ + public static create(properties?: google.protobuf.IStringValue): google.protobuf.StringValue; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @param message StringValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IStringValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StringValue message, length delimited. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @param message StringValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IStringValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.StringValue; + + /** + * Decodes a StringValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.StringValue; + + /** + * Verifies a StringValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StringValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StringValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.StringValue; + + /** + * Creates a plain object from a StringValue message. Also converts values to other types if specified. + * @param message StringValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.StringValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StringValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StringValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BytesValue. */ + interface IBytesValue { + + /** BytesValue value */ + value?: (Uint8Array|string|null); + } + + /** Represents a BytesValue. */ + class BytesValue implements IBytesValue { + + /** + * Constructs a new BytesValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IBytesValue); + + /** BytesValue value. */ + public value: (Uint8Array|string); + + /** + * Creates a new BytesValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BytesValue instance + */ + public static create(properties?: google.protobuf.IBytesValue): google.protobuf.BytesValue; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @param message BytesValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IBytesValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BytesValue message, length delimited. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @param message BytesValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IBytesValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.BytesValue; + + /** + * Decodes a BytesValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.BytesValue; + + /** + * Verifies a BytesValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BytesValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BytesValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.BytesValue; + + /** + * Creates a plain object from a BytesValue message. Also converts values to other types if specified. + * @param message BytesValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.BytesValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BytesValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BytesValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** 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 an Empty. */ + interface IEmpty { + } + + /** Represents an Empty. */ + class Empty implements IEmpty { + + /** + * Constructs a new Empty. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEmpty); + + /** + * Creates a new Empty instance using the specified properties. + * @param [properties] Properties to set + * @returns Empty instance + */ + public static create(properties?: google.protobuf.IEmpty): google.protobuf.Empty; + + /** + * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @param message Empty message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @param message Empty message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Empty message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Empty; + + /** + * Decodes an Empty message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Empty; + + /** + * Verifies an Empty message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Empty message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Empty + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Empty; + + /** + * Creates a plain object from an Empty message. Also converts values to other types if specified. + * @param message Empty + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Empty, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Empty to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Empty + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FieldMask. */ + interface IFieldMask { + + /** FieldMask paths */ + paths?: (string[]|null); + } + + /** Represents a FieldMask. */ + class FieldMask implements IFieldMask { + + /** + * Constructs a new FieldMask. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldMask); + + /** FieldMask paths. */ + public paths: string[]; + + /** + * Creates a new FieldMask instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldMask instance + */ + public static create(properties?: google.protobuf.IFieldMask): google.protobuf.FieldMask; + + /** + * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @param message FieldMask message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldMask, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @param message FieldMask message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldMask, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldMask message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldMask; + + /** + * Decodes a FieldMask message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldMask; + + /** + * Verifies a FieldMask message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldMask message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldMask + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldMask; + + /** + * Creates a plain object from a FieldMask message. Also converts values to other types if specified. + * @param message FieldMask + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldMask, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldMask to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldMask + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace rpc. */ + namespace rpc { + + /** Properties of a Status. */ + interface IStatus { + + /** Status code */ + code?: (number|null); + + /** Status message */ + message?: (string|null); + + /** Status details */ + details?: (google.protobuf.IAny[]|null); + } + + /** Represents a Status. */ + class Status implements IStatus { + + /** + * Constructs a new Status. + * @param [properties] Properties to set + */ + constructor(properties?: google.rpc.IStatus); + + /** Status code. */ + public code: number; + + /** Status message. */ + public message: string; + + /** Status details. */ + public details: google.protobuf.IAny[]; + + /** + * Creates a new Status instance using the specified properties. + * @param [properties] Properties to set + * @returns Status instance + */ + public static create(properties?: google.rpc.IStatus): google.rpc.Status; + + /** + * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @param message Status message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @param message Status message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Status message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.rpc.Status; + + /** + * Decodes a Status message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.rpc.Status; + + /** + * Verifies a Status message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Status message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Status + */ + public static fromObject(object: { [k: string]: any }): google.rpc.Status; + + /** + * Creates a plain object from a Status message. Also converts values to other types if specified. + * @param message Status + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.rpc.Status, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Status to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Status + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace longrunning. */ + namespace longrunning { + + /** Represents an Operations */ + class Operations extends $protobuf.rpc.Service { + + /** + * Constructs a new Operations service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new Operations service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): Operations; + + /** + * Calls ListOperations. + * @param request ListOperationsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListOperationsResponse + */ + public listOperations(request: google.longrunning.IListOperationsRequest, callback: google.longrunning.Operations.ListOperationsCallback): void; + + /** + * Calls ListOperations. + * @param request ListOperationsRequest message or plain object + * @returns Promise + */ + public listOperations(request: google.longrunning.IListOperationsRequest): Promise; + + /** + * Calls GetOperation. + * @param request GetOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public getOperation(request: google.longrunning.IGetOperationRequest, callback: google.longrunning.Operations.GetOperationCallback): void; + + /** + * Calls GetOperation. + * @param request GetOperationRequest message or plain object + * @returns Promise + */ + public getOperation(request: google.longrunning.IGetOperationRequest): Promise; + + /** + * Calls DeleteOperation. + * @param request DeleteOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteOperation(request: google.longrunning.IDeleteOperationRequest, callback: google.longrunning.Operations.DeleteOperationCallback): void; + + /** + * Calls DeleteOperation. + * @param request DeleteOperationRequest message or plain object + * @returns Promise + */ + public deleteOperation(request: google.longrunning.IDeleteOperationRequest): Promise; + + /** + * Calls CancelOperation. + * @param request CancelOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public cancelOperation(request: google.longrunning.ICancelOperationRequest, callback: google.longrunning.Operations.CancelOperationCallback): void; + + /** + * Calls CancelOperation. + * @param request CancelOperationRequest message or plain object + * @returns Promise + */ + public cancelOperation(request: google.longrunning.ICancelOperationRequest): Promise; + + /** + * Calls WaitOperation. + * @param request WaitOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public waitOperation(request: google.longrunning.IWaitOperationRequest, callback: google.longrunning.Operations.WaitOperationCallback): void; + + /** + * Calls WaitOperation. + * @param request WaitOperationRequest message or plain object + * @returns Promise + */ + public waitOperation(request: google.longrunning.IWaitOperationRequest): Promise; + } + + namespace Operations { + + /** + * Callback as used by {@link google.longrunning.Operations|listOperations}. + * @param error Error, if any + * @param [response] ListOperationsResponse + */ + type ListOperationsCallback = (error: (Error|null), response?: google.longrunning.ListOperationsResponse) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|getOperation}. + * @param error Error, if any + * @param [response] Operation + */ + type GetOperationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|deleteOperation}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteOperationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|cancelOperation}. + * @param error Error, if any + * @param [response] Empty + */ + type CancelOperationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|waitOperation}. + * @param error Error, if any + * @param [response] Operation + */ + type WaitOperationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + } + + /** Properties of an Operation. */ + interface IOperation { + + /** Operation name */ + name?: (string|null); + + /** Operation metadata */ + metadata?: (google.protobuf.IAny|null); + + /** Operation done */ + done?: (boolean|null); + + /** Operation error */ + error?: (google.rpc.IStatus|null); + + /** Operation response */ + response?: (google.protobuf.IAny|null); + } + + /** Represents an Operation. */ + class Operation implements IOperation { + + /** + * Constructs a new Operation. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IOperation); + + /** Operation name. */ + public name: string; + + /** Operation metadata. */ + public metadata?: (google.protobuf.IAny|null); + + /** Operation done. */ + public done: boolean; + + /** Operation error. */ + public error?: (google.rpc.IStatus|null); + + /** Operation response. */ + public response?: (google.protobuf.IAny|null); + + /** Operation result. */ + public result?: ("error"|"response"); + + /** + * Creates a new Operation instance using the specified properties. + * @param [properties] Properties to set + * @returns Operation instance + */ + public static create(properties?: google.longrunning.IOperation): google.longrunning.Operation; + + /** + * Encodes the specified Operation message. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @param message Operation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IOperation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Operation message, length delimited. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @param message Operation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IOperation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Operation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.Operation; + + /** + * Decodes an Operation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.Operation; + + /** + * Verifies an Operation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Operation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Operation + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.Operation; + + /** + * Creates a plain object from an Operation message. Also converts values to other types if specified. + * @param message Operation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.Operation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Operation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Operation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetOperationRequest. */ + interface IGetOperationRequest { + + /** GetOperationRequest name */ + name?: (string|null); + } + + /** Represents a GetOperationRequest. */ + class GetOperationRequest implements IGetOperationRequest { + + /** + * Constructs a new GetOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IGetOperationRequest); + + /** GetOperationRequest name. */ + public name: string; + + /** + * Creates a new GetOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetOperationRequest instance + */ + public static create(properties?: google.longrunning.IGetOperationRequest): google.longrunning.GetOperationRequest; + + /** + * Encodes the specified GetOperationRequest message. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @param message GetOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IGetOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @param message GetOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IGetOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.GetOperationRequest; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.GetOperationRequest; + + /** + * Verifies a GetOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.GetOperationRequest; + + /** + * Creates a plain object from a GetOperationRequest message. Also converts values to other types if specified. + * @param message GetOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.GetOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListOperationsRequest. */ + interface IListOperationsRequest { + + /** ListOperationsRequest name */ + name?: (string|null); + + /** ListOperationsRequest filter */ + filter?: (string|null); + + /** ListOperationsRequest pageSize */ + pageSize?: (number|null); + + /** ListOperationsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListOperationsRequest. */ + class ListOperationsRequest implements IListOperationsRequest { + + /** + * Constructs a new ListOperationsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IListOperationsRequest); + + /** ListOperationsRequest name. */ + public name: string; + + /** ListOperationsRequest filter. */ + public filter: string; + + /** ListOperationsRequest pageSize. */ + public pageSize: number; + + /** ListOperationsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListOperationsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListOperationsRequest instance + */ + public static create(properties?: google.longrunning.IListOperationsRequest): google.longrunning.ListOperationsRequest; + + /** + * Encodes the specified ListOperationsRequest message. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @param message ListOperationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IListOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListOperationsRequest message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @param message ListOperationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IListOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.ListOperationsRequest; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.ListOperationsRequest; + + /** + * Verifies a ListOperationsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListOperationsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListOperationsRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.ListOperationsRequest; + + /** + * Creates a plain object from a ListOperationsRequest message. Also converts values to other types if specified. + * @param message ListOperationsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.ListOperationsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListOperationsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListOperationsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListOperationsResponse. */ + interface IListOperationsResponse { + + /** ListOperationsResponse operations */ + operations?: (google.longrunning.IOperation[]|null); + + /** ListOperationsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListOperationsResponse. */ + class ListOperationsResponse implements IListOperationsResponse { + + /** + * Constructs a new ListOperationsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IListOperationsResponse); + + /** ListOperationsResponse operations. */ + public operations: google.longrunning.IOperation[]; + + /** ListOperationsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListOperationsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListOperationsResponse instance + */ + public static create(properties?: google.longrunning.IListOperationsResponse): google.longrunning.ListOperationsResponse; + + /** + * Encodes the specified ListOperationsResponse message. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @param message ListOperationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IListOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListOperationsResponse message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @param message ListOperationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IListOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.ListOperationsResponse; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.ListOperationsResponse; + + /** + * Verifies a ListOperationsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListOperationsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListOperationsResponse + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.ListOperationsResponse; + + /** + * Creates a plain object from a ListOperationsResponse message. Also converts values to other types if specified. + * @param message ListOperationsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.ListOperationsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListOperationsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListOperationsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CancelOperationRequest. */ + interface ICancelOperationRequest { + + /** CancelOperationRequest name */ + name?: (string|null); + } + + /** Represents a CancelOperationRequest. */ + class CancelOperationRequest implements ICancelOperationRequest { + + /** + * Constructs a new CancelOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.ICancelOperationRequest); + + /** CancelOperationRequest name. */ + public name: string; + + /** + * Creates a new CancelOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CancelOperationRequest instance + */ + public static create(properties?: google.longrunning.ICancelOperationRequest): google.longrunning.CancelOperationRequest; + + /** + * Encodes the specified CancelOperationRequest message. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @param message CancelOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.ICancelOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CancelOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @param message CancelOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.ICancelOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.CancelOperationRequest; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.CancelOperationRequest; + + /** + * Verifies a CancelOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CancelOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CancelOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.CancelOperationRequest; + + /** + * Creates a plain object from a CancelOperationRequest message. Also converts values to other types if specified. + * @param message CancelOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.CancelOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CancelOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CancelOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteOperationRequest. */ + interface IDeleteOperationRequest { + + /** DeleteOperationRequest name */ + name?: (string|null); + } + + /** Represents a DeleteOperationRequest. */ + class DeleteOperationRequest implements IDeleteOperationRequest { + + /** + * Constructs a new DeleteOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IDeleteOperationRequest); + + /** DeleteOperationRequest name. */ + public name: string; + + /** + * Creates a new DeleteOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteOperationRequest instance + */ + public static create(properties?: google.longrunning.IDeleteOperationRequest): google.longrunning.DeleteOperationRequest; + + /** + * Encodes the specified DeleteOperationRequest message. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @param message DeleteOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IDeleteOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @param message DeleteOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IDeleteOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.DeleteOperationRequest; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.DeleteOperationRequest; + + /** + * Verifies a DeleteOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.DeleteOperationRequest; + + /** + * Creates a plain object from a DeleteOperationRequest message. Also converts values to other types if specified. + * @param message DeleteOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.DeleteOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a WaitOperationRequest. */ + interface IWaitOperationRequest { + + /** WaitOperationRequest name */ + name?: (string|null); + + /** WaitOperationRequest timeout */ + timeout?: (google.protobuf.IDuration|null); + } + + /** Represents a WaitOperationRequest. */ + class WaitOperationRequest implements IWaitOperationRequest { + + /** + * Constructs a new WaitOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IWaitOperationRequest); + + /** WaitOperationRequest name. */ + public name: string; + + /** WaitOperationRequest timeout. */ + public timeout?: (google.protobuf.IDuration|null); + + /** + * Creates a new WaitOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns WaitOperationRequest instance + */ + public static create(properties?: google.longrunning.IWaitOperationRequest): google.longrunning.WaitOperationRequest; + + /** + * Encodes the specified WaitOperationRequest message. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @param message WaitOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IWaitOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WaitOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @param message WaitOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IWaitOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.WaitOperationRequest; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.WaitOperationRequest; + + /** + * Verifies a WaitOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WaitOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WaitOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.WaitOperationRequest; + + /** + * Creates a plain object from a WaitOperationRequest message. Also converts values to other types if specified. + * @param message WaitOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.WaitOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WaitOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WaitOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OperationInfo. */ + interface IOperationInfo { + + /** OperationInfo responseType */ + responseType?: (string|null); + + /** OperationInfo metadataType */ + metadataType?: (string|null); + } + + /** Represents an OperationInfo. */ + class OperationInfo implements IOperationInfo { + + /** + * Constructs a new OperationInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IOperationInfo); + + /** OperationInfo responseType. */ + public responseType: string; + + /** OperationInfo metadataType. */ + public metadataType: string; + + /** + * Creates a new OperationInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns OperationInfo instance + */ + public static create(properties?: google.longrunning.IOperationInfo): google.longrunning.OperationInfo; + + /** + * Encodes the specified OperationInfo message. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @param message OperationInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IOperationInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OperationInfo message, length delimited. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @param message OperationInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IOperationInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OperationInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.OperationInfo; + + /** + * Decodes an OperationInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.OperationInfo; + + /** + * Verifies an OperationInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OperationInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OperationInfo + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.OperationInfo; + + /** + * Creates a plain object from an OperationInfo message. Also converts values to other types if specified. + * @param message OperationInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.OperationInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OperationInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OperationInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } +} diff --git a/packages/google-cloud-clouddms/protos/protos.js b/packages/google-cloud-clouddms/protos/protos.js new file mode 100644 index 00000000000..d73b9bb181d --- /dev/null +++ b/packages/google-cloud-clouddms/protos/protos.js @@ -0,0 +1,28532 @@ +// 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_dms_protos || ($protobuf.roots._google_cloud_dms_protos = {}); + + $root.google = (function() { + + /** + * Namespace google. + * @exports google + * @namespace + */ + var google = {}; + + google.cloud = (function() { + + /** + * Namespace cloud. + * @memberof google + * @namespace + */ + var cloud = {}; + + cloud.clouddms = (function() { + + /** + * Namespace clouddms. + * @memberof google.cloud + * @namespace + */ + var clouddms = {}; + + clouddms.v1 = (function() { + + /** + * Namespace v1. + * @memberof google.cloud.clouddms + * @namespace + */ + var v1 = {}; + + v1.DataMigrationService = (function() { + + /** + * Constructs a new DataMigrationService service. + * @memberof google.cloud.clouddms.v1 + * @classdesc Represents a DataMigrationService + * @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 DataMigrationService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (DataMigrationService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = DataMigrationService; + + /** + * Creates new DataMigrationService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.clouddms.v1.DataMigrationService + * @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 {DataMigrationService} RPC service. Useful where requests and/or responses are streamed. + */ + DataMigrationService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.clouddms.v1.DataMigrationService|listMigrationJobs}. + * @memberof google.cloud.clouddms.v1.DataMigrationService + * @typedef ListMigrationJobsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.clouddms.v1.ListMigrationJobsResponse} [response] ListMigrationJobsResponse + */ + + /** + * Calls ListMigrationJobs. + * @function listMigrationJobs + * @memberof google.cloud.clouddms.v1.DataMigrationService + * @instance + * @param {google.cloud.clouddms.v1.IListMigrationJobsRequest} request ListMigrationJobsRequest message or plain object + * @param {google.cloud.clouddms.v1.DataMigrationService.ListMigrationJobsCallback} callback Node-style callback called with the error, if any, and ListMigrationJobsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataMigrationService.prototype.listMigrationJobs = function listMigrationJobs(request, callback) { + return this.rpcCall(listMigrationJobs, $root.google.cloud.clouddms.v1.ListMigrationJobsRequest, $root.google.cloud.clouddms.v1.ListMigrationJobsResponse, request, callback); + }, "name", { value: "ListMigrationJobs" }); + + /** + * Calls ListMigrationJobs. + * @function listMigrationJobs + * @memberof google.cloud.clouddms.v1.DataMigrationService + * @instance + * @param {google.cloud.clouddms.v1.IListMigrationJobsRequest} request ListMigrationJobsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.clouddms.v1.DataMigrationService|getMigrationJob}. + * @memberof google.cloud.clouddms.v1.DataMigrationService + * @typedef GetMigrationJobCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.clouddms.v1.MigrationJob} [response] MigrationJob + */ + + /** + * Calls GetMigrationJob. + * @function getMigrationJob + * @memberof google.cloud.clouddms.v1.DataMigrationService + * @instance + * @param {google.cloud.clouddms.v1.IGetMigrationJobRequest} request GetMigrationJobRequest message or plain object + * @param {google.cloud.clouddms.v1.DataMigrationService.GetMigrationJobCallback} callback Node-style callback called with the error, if any, and MigrationJob + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataMigrationService.prototype.getMigrationJob = function getMigrationJob(request, callback) { + return this.rpcCall(getMigrationJob, $root.google.cloud.clouddms.v1.GetMigrationJobRequest, $root.google.cloud.clouddms.v1.MigrationJob, request, callback); + }, "name", { value: "GetMigrationJob" }); + + /** + * Calls GetMigrationJob. + * @function getMigrationJob + * @memberof google.cloud.clouddms.v1.DataMigrationService + * @instance + * @param {google.cloud.clouddms.v1.IGetMigrationJobRequest} request GetMigrationJobRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.clouddms.v1.DataMigrationService|createMigrationJob}. + * @memberof google.cloud.clouddms.v1.DataMigrationService + * @typedef CreateMigrationJobCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateMigrationJob. + * @function createMigrationJob + * @memberof google.cloud.clouddms.v1.DataMigrationService + * @instance + * @param {google.cloud.clouddms.v1.ICreateMigrationJobRequest} request CreateMigrationJobRequest message or plain object + * @param {google.cloud.clouddms.v1.DataMigrationService.CreateMigrationJobCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataMigrationService.prototype.createMigrationJob = function createMigrationJob(request, callback) { + return this.rpcCall(createMigrationJob, $root.google.cloud.clouddms.v1.CreateMigrationJobRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateMigrationJob" }); + + /** + * Calls CreateMigrationJob. + * @function createMigrationJob + * @memberof google.cloud.clouddms.v1.DataMigrationService + * @instance + * @param {google.cloud.clouddms.v1.ICreateMigrationJobRequest} request CreateMigrationJobRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.clouddms.v1.DataMigrationService|updateMigrationJob}. + * @memberof google.cloud.clouddms.v1.DataMigrationService + * @typedef UpdateMigrationJobCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateMigrationJob. + * @function updateMigrationJob + * @memberof google.cloud.clouddms.v1.DataMigrationService + * @instance + * @param {google.cloud.clouddms.v1.IUpdateMigrationJobRequest} request UpdateMigrationJobRequest message or plain object + * @param {google.cloud.clouddms.v1.DataMigrationService.UpdateMigrationJobCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataMigrationService.prototype.updateMigrationJob = function updateMigrationJob(request, callback) { + return this.rpcCall(updateMigrationJob, $root.google.cloud.clouddms.v1.UpdateMigrationJobRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateMigrationJob" }); + + /** + * Calls UpdateMigrationJob. + * @function updateMigrationJob + * @memberof google.cloud.clouddms.v1.DataMigrationService + * @instance + * @param {google.cloud.clouddms.v1.IUpdateMigrationJobRequest} request UpdateMigrationJobRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.clouddms.v1.DataMigrationService|deleteMigrationJob}. + * @memberof google.cloud.clouddms.v1.DataMigrationService + * @typedef DeleteMigrationJobCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteMigrationJob. + * @function deleteMigrationJob + * @memberof google.cloud.clouddms.v1.DataMigrationService + * @instance + * @param {google.cloud.clouddms.v1.IDeleteMigrationJobRequest} request DeleteMigrationJobRequest message or plain object + * @param {google.cloud.clouddms.v1.DataMigrationService.DeleteMigrationJobCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataMigrationService.prototype.deleteMigrationJob = function deleteMigrationJob(request, callback) { + return this.rpcCall(deleteMigrationJob, $root.google.cloud.clouddms.v1.DeleteMigrationJobRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteMigrationJob" }); + + /** + * Calls DeleteMigrationJob. + * @function deleteMigrationJob + * @memberof google.cloud.clouddms.v1.DataMigrationService + * @instance + * @param {google.cloud.clouddms.v1.IDeleteMigrationJobRequest} request DeleteMigrationJobRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.clouddms.v1.DataMigrationService|startMigrationJob}. + * @memberof google.cloud.clouddms.v1.DataMigrationService + * @typedef StartMigrationJobCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls StartMigrationJob. + * @function startMigrationJob + * @memberof google.cloud.clouddms.v1.DataMigrationService + * @instance + * @param {google.cloud.clouddms.v1.IStartMigrationJobRequest} request StartMigrationJobRequest message or plain object + * @param {google.cloud.clouddms.v1.DataMigrationService.StartMigrationJobCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataMigrationService.prototype.startMigrationJob = function startMigrationJob(request, callback) { + return this.rpcCall(startMigrationJob, $root.google.cloud.clouddms.v1.StartMigrationJobRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "StartMigrationJob" }); + + /** + * Calls StartMigrationJob. + * @function startMigrationJob + * @memberof google.cloud.clouddms.v1.DataMigrationService + * @instance + * @param {google.cloud.clouddms.v1.IStartMigrationJobRequest} request StartMigrationJobRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.clouddms.v1.DataMigrationService|stopMigrationJob}. + * @memberof google.cloud.clouddms.v1.DataMigrationService + * @typedef StopMigrationJobCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls StopMigrationJob. + * @function stopMigrationJob + * @memberof google.cloud.clouddms.v1.DataMigrationService + * @instance + * @param {google.cloud.clouddms.v1.IStopMigrationJobRequest} request StopMigrationJobRequest message or plain object + * @param {google.cloud.clouddms.v1.DataMigrationService.StopMigrationJobCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataMigrationService.prototype.stopMigrationJob = function stopMigrationJob(request, callback) { + return this.rpcCall(stopMigrationJob, $root.google.cloud.clouddms.v1.StopMigrationJobRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "StopMigrationJob" }); + + /** + * Calls StopMigrationJob. + * @function stopMigrationJob + * @memberof google.cloud.clouddms.v1.DataMigrationService + * @instance + * @param {google.cloud.clouddms.v1.IStopMigrationJobRequest} request StopMigrationJobRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.clouddms.v1.DataMigrationService|resumeMigrationJob}. + * @memberof google.cloud.clouddms.v1.DataMigrationService + * @typedef ResumeMigrationJobCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls ResumeMigrationJob. + * @function resumeMigrationJob + * @memberof google.cloud.clouddms.v1.DataMigrationService + * @instance + * @param {google.cloud.clouddms.v1.IResumeMigrationJobRequest} request ResumeMigrationJobRequest message or plain object + * @param {google.cloud.clouddms.v1.DataMigrationService.ResumeMigrationJobCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataMigrationService.prototype.resumeMigrationJob = function resumeMigrationJob(request, callback) { + return this.rpcCall(resumeMigrationJob, $root.google.cloud.clouddms.v1.ResumeMigrationJobRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "ResumeMigrationJob" }); + + /** + * Calls ResumeMigrationJob. + * @function resumeMigrationJob + * @memberof google.cloud.clouddms.v1.DataMigrationService + * @instance + * @param {google.cloud.clouddms.v1.IResumeMigrationJobRequest} request ResumeMigrationJobRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.clouddms.v1.DataMigrationService|promoteMigrationJob}. + * @memberof google.cloud.clouddms.v1.DataMigrationService + * @typedef PromoteMigrationJobCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls PromoteMigrationJob. + * @function promoteMigrationJob + * @memberof google.cloud.clouddms.v1.DataMigrationService + * @instance + * @param {google.cloud.clouddms.v1.IPromoteMigrationJobRequest} request PromoteMigrationJobRequest message or plain object + * @param {google.cloud.clouddms.v1.DataMigrationService.PromoteMigrationJobCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataMigrationService.prototype.promoteMigrationJob = function promoteMigrationJob(request, callback) { + return this.rpcCall(promoteMigrationJob, $root.google.cloud.clouddms.v1.PromoteMigrationJobRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "PromoteMigrationJob" }); + + /** + * Calls PromoteMigrationJob. + * @function promoteMigrationJob + * @memberof google.cloud.clouddms.v1.DataMigrationService + * @instance + * @param {google.cloud.clouddms.v1.IPromoteMigrationJobRequest} request PromoteMigrationJobRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.clouddms.v1.DataMigrationService|verifyMigrationJob}. + * @memberof google.cloud.clouddms.v1.DataMigrationService + * @typedef VerifyMigrationJobCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls VerifyMigrationJob. + * @function verifyMigrationJob + * @memberof google.cloud.clouddms.v1.DataMigrationService + * @instance + * @param {google.cloud.clouddms.v1.IVerifyMigrationJobRequest} request VerifyMigrationJobRequest message or plain object + * @param {google.cloud.clouddms.v1.DataMigrationService.VerifyMigrationJobCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataMigrationService.prototype.verifyMigrationJob = function verifyMigrationJob(request, callback) { + return this.rpcCall(verifyMigrationJob, $root.google.cloud.clouddms.v1.VerifyMigrationJobRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "VerifyMigrationJob" }); + + /** + * Calls VerifyMigrationJob. + * @function verifyMigrationJob + * @memberof google.cloud.clouddms.v1.DataMigrationService + * @instance + * @param {google.cloud.clouddms.v1.IVerifyMigrationJobRequest} request VerifyMigrationJobRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.clouddms.v1.DataMigrationService|restartMigrationJob}. + * @memberof google.cloud.clouddms.v1.DataMigrationService + * @typedef RestartMigrationJobCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls RestartMigrationJob. + * @function restartMigrationJob + * @memberof google.cloud.clouddms.v1.DataMigrationService + * @instance + * @param {google.cloud.clouddms.v1.IRestartMigrationJobRequest} request RestartMigrationJobRequest message or plain object + * @param {google.cloud.clouddms.v1.DataMigrationService.RestartMigrationJobCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataMigrationService.prototype.restartMigrationJob = function restartMigrationJob(request, callback) { + return this.rpcCall(restartMigrationJob, $root.google.cloud.clouddms.v1.RestartMigrationJobRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "RestartMigrationJob" }); + + /** + * Calls RestartMigrationJob. + * @function restartMigrationJob + * @memberof google.cloud.clouddms.v1.DataMigrationService + * @instance + * @param {google.cloud.clouddms.v1.IRestartMigrationJobRequest} request RestartMigrationJobRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.clouddms.v1.DataMigrationService|generateSshScript}. + * @memberof google.cloud.clouddms.v1.DataMigrationService + * @typedef GenerateSshScriptCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.clouddms.v1.SshScript} [response] SshScript + */ + + /** + * Calls GenerateSshScript. + * @function generateSshScript + * @memberof google.cloud.clouddms.v1.DataMigrationService + * @instance + * @param {google.cloud.clouddms.v1.IGenerateSshScriptRequest} request GenerateSshScriptRequest message or plain object + * @param {google.cloud.clouddms.v1.DataMigrationService.GenerateSshScriptCallback} callback Node-style callback called with the error, if any, and SshScript + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataMigrationService.prototype.generateSshScript = function generateSshScript(request, callback) { + return this.rpcCall(generateSshScript, $root.google.cloud.clouddms.v1.GenerateSshScriptRequest, $root.google.cloud.clouddms.v1.SshScript, request, callback); + }, "name", { value: "GenerateSshScript" }); + + /** + * Calls GenerateSshScript. + * @function generateSshScript + * @memberof google.cloud.clouddms.v1.DataMigrationService + * @instance + * @param {google.cloud.clouddms.v1.IGenerateSshScriptRequest} request GenerateSshScriptRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.clouddms.v1.DataMigrationService|listConnectionProfiles}. + * @memberof google.cloud.clouddms.v1.DataMigrationService + * @typedef ListConnectionProfilesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.clouddms.v1.ListConnectionProfilesResponse} [response] ListConnectionProfilesResponse + */ + + /** + * Calls ListConnectionProfiles. + * @function listConnectionProfiles + * @memberof google.cloud.clouddms.v1.DataMigrationService + * @instance + * @param {google.cloud.clouddms.v1.IListConnectionProfilesRequest} request ListConnectionProfilesRequest message or plain object + * @param {google.cloud.clouddms.v1.DataMigrationService.ListConnectionProfilesCallback} callback Node-style callback called with the error, if any, and ListConnectionProfilesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataMigrationService.prototype.listConnectionProfiles = function listConnectionProfiles(request, callback) { + return this.rpcCall(listConnectionProfiles, $root.google.cloud.clouddms.v1.ListConnectionProfilesRequest, $root.google.cloud.clouddms.v1.ListConnectionProfilesResponse, request, callback); + }, "name", { value: "ListConnectionProfiles" }); + + /** + * Calls ListConnectionProfiles. + * @function listConnectionProfiles + * @memberof google.cloud.clouddms.v1.DataMigrationService + * @instance + * @param {google.cloud.clouddms.v1.IListConnectionProfilesRequest} request ListConnectionProfilesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.clouddms.v1.DataMigrationService|getConnectionProfile}. + * @memberof google.cloud.clouddms.v1.DataMigrationService + * @typedef GetConnectionProfileCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.clouddms.v1.ConnectionProfile} [response] ConnectionProfile + */ + + /** + * Calls GetConnectionProfile. + * @function getConnectionProfile + * @memberof google.cloud.clouddms.v1.DataMigrationService + * @instance + * @param {google.cloud.clouddms.v1.IGetConnectionProfileRequest} request GetConnectionProfileRequest message or plain object + * @param {google.cloud.clouddms.v1.DataMigrationService.GetConnectionProfileCallback} callback Node-style callback called with the error, if any, and ConnectionProfile + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataMigrationService.prototype.getConnectionProfile = function getConnectionProfile(request, callback) { + return this.rpcCall(getConnectionProfile, $root.google.cloud.clouddms.v1.GetConnectionProfileRequest, $root.google.cloud.clouddms.v1.ConnectionProfile, request, callback); + }, "name", { value: "GetConnectionProfile" }); + + /** + * Calls GetConnectionProfile. + * @function getConnectionProfile + * @memberof google.cloud.clouddms.v1.DataMigrationService + * @instance + * @param {google.cloud.clouddms.v1.IGetConnectionProfileRequest} request GetConnectionProfileRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.clouddms.v1.DataMigrationService|createConnectionProfile}. + * @memberof google.cloud.clouddms.v1.DataMigrationService + * @typedef CreateConnectionProfileCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateConnectionProfile. + * @function createConnectionProfile + * @memberof google.cloud.clouddms.v1.DataMigrationService + * @instance + * @param {google.cloud.clouddms.v1.ICreateConnectionProfileRequest} request CreateConnectionProfileRequest message or plain object + * @param {google.cloud.clouddms.v1.DataMigrationService.CreateConnectionProfileCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataMigrationService.prototype.createConnectionProfile = function createConnectionProfile(request, callback) { + return this.rpcCall(createConnectionProfile, $root.google.cloud.clouddms.v1.CreateConnectionProfileRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateConnectionProfile" }); + + /** + * Calls CreateConnectionProfile. + * @function createConnectionProfile + * @memberof google.cloud.clouddms.v1.DataMigrationService + * @instance + * @param {google.cloud.clouddms.v1.ICreateConnectionProfileRequest} request CreateConnectionProfileRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.clouddms.v1.DataMigrationService|updateConnectionProfile}. + * @memberof google.cloud.clouddms.v1.DataMigrationService + * @typedef UpdateConnectionProfileCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateConnectionProfile. + * @function updateConnectionProfile + * @memberof google.cloud.clouddms.v1.DataMigrationService + * @instance + * @param {google.cloud.clouddms.v1.IUpdateConnectionProfileRequest} request UpdateConnectionProfileRequest message or plain object + * @param {google.cloud.clouddms.v1.DataMigrationService.UpdateConnectionProfileCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataMigrationService.prototype.updateConnectionProfile = function updateConnectionProfile(request, callback) { + return this.rpcCall(updateConnectionProfile, $root.google.cloud.clouddms.v1.UpdateConnectionProfileRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateConnectionProfile" }); + + /** + * Calls UpdateConnectionProfile. + * @function updateConnectionProfile + * @memberof google.cloud.clouddms.v1.DataMigrationService + * @instance + * @param {google.cloud.clouddms.v1.IUpdateConnectionProfileRequest} request UpdateConnectionProfileRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.clouddms.v1.DataMigrationService|deleteConnectionProfile}. + * @memberof google.cloud.clouddms.v1.DataMigrationService + * @typedef DeleteConnectionProfileCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteConnectionProfile. + * @function deleteConnectionProfile + * @memberof google.cloud.clouddms.v1.DataMigrationService + * @instance + * @param {google.cloud.clouddms.v1.IDeleteConnectionProfileRequest} request DeleteConnectionProfileRequest message or plain object + * @param {google.cloud.clouddms.v1.DataMigrationService.DeleteConnectionProfileCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataMigrationService.prototype.deleteConnectionProfile = function deleteConnectionProfile(request, callback) { + return this.rpcCall(deleteConnectionProfile, $root.google.cloud.clouddms.v1.DeleteConnectionProfileRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteConnectionProfile" }); + + /** + * Calls DeleteConnectionProfile. + * @function deleteConnectionProfile + * @memberof google.cloud.clouddms.v1.DataMigrationService + * @instance + * @param {google.cloud.clouddms.v1.IDeleteConnectionProfileRequest} request DeleteConnectionProfileRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return DataMigrationService; + })(); + + v1.ListMigrationJobsRequest = (function() { + + /** + * Properties of a ListMigrationJobsRequest. + * @memberof google.cloud.clouddms.v1 + * @interface IListMigrationJobsRequest + * @property {string|null} [parent] ListMigrationJobsRequest parent + * @property {number|null} [pageSize] ListMigrationJobsRequest pageSize + * @property {string|null} [pageToken] ListMigrationJobsRequest pageToken + * @property {string|null} [filter] ListMigrationJobsRequest filter + * @property {string|null} [orderBy] ListMigrationJobsRequest orderBy + */ + + /** + * Constructs a new ListMigrationJobsRequest. + * @memberof google.cloud.clouddms.v1 + * @classdesc Represents a ListMigrationJobsRequest. + * @implements IListMigrationJobsRequest + * @constructor + * @param {google.cloud.clouddms.v1.IListMigrationJobsRequest=} [properties] Properties to set + */ + function ListMigrationJobsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListMigrationJobsRequest parent. + * @member {string} parent + * @memberof google.cloud.clouddms.v1.ListMigrationJobsRequest + * @instance + */ + ListMigrationJobsRequest.prototype.parent = ""; + + /** + * ListMigrationJobsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.clouddms.v1.ListMigrationJobsRequest + * @instance + */ + ListMigrationJobsRequest.prototype.pageSize = 0; + + /** + * ListMigrationJobsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.clouddms.v1.ListMigrationJobsRequest + * @instance + */ + ListMigrationJobsRequest.prototype.pageToken = ""; + + /** + * ListMigrationJobsRequest filter. + * @member {string} filter + * @memberof google.cloud.clouddms.v1.ListMigrationJobsRequest + * @instance + */ + ListMigrationJobsRequest.prototype.filter = ""; + + /** + * ListMigrationJobsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.clouddms.v1.ListMigrationJobsRequest + * @instance + */ + ListMigrationJobsRequest.prototype.orderBy = ""; + + /** + * Creates a new ListMigrationJobsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.clouddms.v1.ListMigrationJobsRequest + * @static + * @param {google.cloud.clouddms.v1.IListMigrationJobsRequest=} [properties] Properties to set + * @returns {google.cloud.clouddms.v1.ListMigrationJobsRequest} ListMigrationJobsRequest instance + */ + ListMigrationJobsRequest.create = function create(properties) { + return new ListMigrationJobsRequest(properties); + }; + + /** + * Encodes the specified ListMigrationJobsRequest message. Does not implicitly {@link google.cloud.clouddms.v1.ListMigrationJobsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.clouddms.v1.ListMigrationJobsRequest + * @static + * @param {google.cloud.clouddms.v1.IListMigrationJobsRequest} message ListMigrationJobsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListMigrationJobsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); + return writer; + }; + + /** + * Encodes the specified ListMigrationJobsRequest message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.ListMigrationJobsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.clouddms.v1.ListMigrationJobsRequest + * @static + * @param {google.cloud.clouddms.v1.IListMigrationJobsRequest} message ListMigrationJobsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListMigrationJobsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListMigrationJobsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.clouddms.v1.ListMigrationJobsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.clouddms.v1.ListMigrationJobsRequest} ListMigrationJobsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListMigrationJobsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.clouddms.v1.ListMigrationJobsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListMigrationJobsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.clouddms.v1.ListMigrationJobsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.clouddms.v1.ListMigrationJobsRequest} ListMigrationJobsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListMigrationJobsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListMigrationJobsRequest message. + * @function verify + * @memberof google.cloud.clouddms.v1.ListMigrationJobsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListMigrationJobsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + return null; + }; + + /** + * Creates a ListMigrationJobsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.clouddms.v1.ListMigrationJobsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.clouddms.v1.ListMigrationJobsRequest} ListMigrationJobsRequest + */ + ListMigrationJobsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.clouddms.v1.ListMigrationJobsRequest) + return object; + var message = new $root.google.cloud.clouddms.v1.ListMigrationJobsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + return message; + }; + + /** + * Creates a plain object from a ListMigrationJobsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.clouddms.v1.ListMigrationJobsRequest + * @static + * @param {google.cloud.clouddms.v1.ListMigrationJobsRequest} message ListMigrationJobsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListMigrationJobsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.orderBy = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + return object; + }; + + /** + * Converts this ListMigrationJobsRequest to JSON. + * @function toJSON + * @memberof google.cloud.clouddms.v1.ListMigrationJobsRequest + * @instance + * @returns {Object.} JSON object + */ + ListMigrationJobsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListMigrationJobsRequest + * @function getTypeUrl + * @memberof google.cloud.clouddms.v1.ListMigrationJobsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListMigrationJobsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.clouddms.v1.ListMigrationJobsRequest"; + }; + + return ListMigrationJobsRequest; + })(); + + v1.ListMigrationJobsResponse = (function() { + + /** + * Properties of a ListMigrationJobsResponse. + * @memberof google.cloud.clouddms.v1 + * @interface IListMigrationJobsResponse + * @property {Array.|null} [migrationJobs] ListMigrationJobsResponse migrationJobs + * @property {string|null} [nextPageToken] ListMigrationJobsResponse nextPageToken + * @property {Array.|null} [unreachable] ListMigrationJobsResponse unreachable + */ + + /** + * Constructs a new ListMigrationJobsResponse. + * @memberof google.cloud.clouddms.v1 + * @classdesc Represents a ListMigrationJobsResponse. + * @implements IListMigrationJobsResponse + * @constructor + * @param {google.cloud.clouddms.v1.IListMigrationJobsResponse=} [properties] Properties to set + */ + function ListMigrationJobsResponse(properties) { + this.migrationJobs = []; + this.unreachable = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListMigrationJobsResponse migrationJobs. + * @member {Array.} migrationJobs + * @memberof google.cloud.clouddms.v1.ListMigrationJobsResponse + * @instance + */ + ListMigrationJobsResponse.prototype.migrationJobs = $util.emptyArray; + + /** + * ListMigrationJobsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.clouddms.v1.ListMigrationJobsResponse + * @instance + */ + ListMigrationJobsResponse.prototype.nextPageToken = ""; + + /** + * ListMigrationJobsResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.clouddms.v1.ListMigrationJobsResponse + * @instance + */ + ListMigrationJobsResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListMigrationJobsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.clouddms.v1.ListMigrationJobsResponse + * @static + * @param {google.cloud.clouddms.v1.IListMigrationJobsResponse=} [properties] Properties to set + * @returns {google.cloud.clouddms.v1.ListMigrationJobsResponse} ListMigrationJobsResponse instance + */ + ListMigrationJobsResponse.create = function create(properties) { + return new ListMigrationJobsResponse(properties); + }; + + /** + * Encodes the specified ListMigrationJobsResponse message. Does not implicitly {@link google.cloud.clouddms.v1.ListMigrationJobsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.clouddms.v1.ListMigrationJobsResponse + * @static + * @param {google.cloud.clouddms.v1.IListMigrationJobsResponse} message ListMigrationJobsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListMigrationJobsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.migrationJobs != null && message.migrationJobs.length) + for (var i = 0; i < message.migrationJobs.length; ++i) + $root.google.cloud.clouddms.v1.MigrationJob.encode(message.migrationJobs[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.unreachable != null && message.unreachable.length) + for (var i = 0; i < message.unreachable.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); + return writer; + }; + + /** + * Encodes the specified ListMigrationJobsResponse message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.ListMigrationJobsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.clouddms.v1.ListMigrationJobsResponse + * @static + * @param {google.cloud.clouddms.v1.IListMigrationJobsResponse} message ListMigrationJobsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListMigrationJobsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListMigrationJobsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.clouddms.v1.ListMigrationJobsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.clouddms.v1.ListMigrationJobsResponse} ListMigrationJobsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListMigrationJobsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.clouddms.v1.ListMigrationJobsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.migrationJobs && message.migrationJobs.length)) + message.migrationJobs = []; + message.migrationJobs.push($root.google.cloud.clouddms.v1.MigrationJob.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 3: { + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListMigrationJobsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.clouddms.v1.ListMigrationJobsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.clouddms.v1.ListMigrationJobsResponse} ListMigrationJobsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListMigrationJobsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListMigrationJobsResponse message. + * @function verify + * @memberof google.cloud.clouddms.v1.ListMigrationJobsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListMigrationJobsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.migrationJobs != null && message.hasOwnProperty("migrationJobs")) { + if (!Array.isArray(message.migrationJobs)) + return "migrationJobs: array expected"; + for (var i = 0; i < message.migrationJobs.length; ++i) { + var error = $root.google.cloud.clouddms.v1.MigrationJob.verify(message.migrationJobs[i]); + if (error) + return "migrationJobs." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.unreachable != null && message.hasOwnProperty("unreachable")) { + if (!Array.isArray(message.unreachable)) + return "unreachable: array expected"; + for (var i = 0; i < message.unreachable.length; ++i) + if (!$util.isString(message.unreachable[i])) + return "unreachable: string[] expected"; + } + return null; + }; + + /** + * Creates a ListMigrationJobsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.clouddms.v1.ListMigrationJobsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.clouddms.v1.ListMigrationJobsResponse} ListMigrationJobsResponse + */ + ListMigrationJobsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.clouddms.v1.ListMigrationJobsResponse) + return object; + var message = new $root.google.cloud.clouddms.v1.ListMigrationJobsResponse(); + if (object.migrationJobs) { + if (!Array.isArray(object.migrationJobs)) + throw TypeError(".google.cloud.clouddms.v1.ListMigrationJobsResponse.migrationJobs: array expected"); + message.migrationJobs = []; + for (var i = 0; i < object.migrationJobs.length; ++i) { + if (typeof object.migrationJobs[i] !== "object") + throw TypeError(".google.cloud.clouddms.v1.ListMigrationJobsResponse.migrationJobs: object expected"); + message.migrationJobs[i] = $root.google.cloud.clouddms.v1.MigrationJob.fromObject(object.migrationJobs[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.clouddms.v1.ListMigrationJobsResponse.unreachable: array expected"); + message.unreachable = []; + for (var i = 0; i < object.unreachable.length; ++i) + message.unreachable[i] = String(object.unreachable[i]); + } + return message; + }; + + /** + * Creates a plain object from a ListMigrationJobsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.clouddms.v1.ListMigrationJobsResponse + * @static + * @param {google.cloud.clouddms.v1.ListMigrationJobsResponse} message ListMigrationJobsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListMigrationJobsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.migrationJobs = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.migrationJobs && message.migrationJobs.length) { + object.migrationJobs = []; + for (var j = 0; j < message.migrationJobs.length; ++j) + object.migrationJobs[j] = $root.google.cloud.clouddms.v1.MigrationJob.toObject(message.migrationJobs[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.unreachable && message.unreachable.length) { + object.unreachable = []; + for (var j = 0; j < message.unreachable.length; ++j) + object.unreachable[j] = message.unreachable[j]; + } + return object; + }; + + /** + * Converts this ListMigrationJobsResponse to JSON. + * @function toJSON + * @memberof google.cloud.clouddms.v1.ListMigrationJobsResponse + * @instance + * @returns {Object.} JSON object + */ + ListMigrationJobsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListMigrationJobsResponse + * @function getTypeUrl + * @memberof google.cloud.clouddms.v1.ListMigrationJobsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListMigrationJobsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.clouddms.v1.ListMigrationJobsResponse"; + }; + + return ListMigrationJobsResponse; + })(); + + v1.GetMigrationJobRequest = (function() { + + /** + * Properties of a GetMigrationJobRequest. + * @memberof google.cloud.clouddms.v1 + * @interface IGetMigrationJobRequest + * @property {string|null} [name] GetMigrationJobRequest name + */ + + /** + * Constructs a new GetMigrationJobRequest. + * @memberof google.cloud.clouddms.v1 + * @classdesc Represents a GetMigrationJobRequest. + * @implements IGetMigrationJobRequest + * @constructor + * @param {google.cloud.clouddms.v1.IGetMigrationJobRequest=} [properties] Properties to set + */ + function GetMigrationJobRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetMigrationJobRequest name. + * @member {string} name + * @memberof google.cloud.clouddms.v1.GetMigrationJobRequest + * @instance + */ + GetMigrationJobRequest.prototype.name = ""; + + /** + * Creates a new GetMigrationJobRequest instance using the specified properties. + * @function create + * @memberof google.cloud.clouddms.v1.GetMigrationJobRequest + * @static + * @param {google.cloud.clouddms.v1.IGetMigrationJobRequest=} [properties] Properties to set + * @returns {google.cloud.clouddms.v1.GetMigrationJobRequest} GetMigrationJobRequest instance + */ + GetMigrationJobRequest.create = function create(properties) { + return new GetMigrationJobRequest(properties); + }; + + /** + * Encodes the specified GetMigrationJobRequest message. Does not implicitly {@link google.cloud.clouddms.v1.GetMigrationJobRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.clouddms.v1.GetMigrationJobRequest + * @static + * @param {google.cloud.clouddms.v1.IGetMigrationJobRequest} message GetMigrationJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetMigrationJobRequest.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 GetMigrationJobRequest message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.GetMigrationJobRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.clouddms.v1.GetMigrationJobRequest + * @static + * @param {google.cloud.clouddms.v1.IGetMigrationJobRequest} message GetMigrationJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetMigrationJobRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetMigrationJobRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.clouddms.v1.GetMigrationJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.clouddms.v1.GetMigrationJobRequest} GetMigrationJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetMigrationJobRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.clouddms.v1.GetMigrationJobRequest(); + 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 GetMigrationJobRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.clouddms.v1.GetMigrationJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.clouddms.v1.GetMigrationJobRequest} GetMigrationJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetMigrationJobRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetMigrationJobRequest message. + * @function verify + * @memberof google.cloud.clouddms.v1.GetMigrationJobRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetMigrationJobRequest.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 GetMigrationJobRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.clouddms.v1.GetMigrationJobRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.clouddms.v1.GetMigrationJobRequest} GetMigrationJobRequest + */ + GetMigrationJobRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.clouddms.v1.GetMigrationJobRequest) + return object; + var message = new $root.google.cloud.clouddms.v1.GetMigrationJobRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetMigrationJobRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.clouddms.v1.GetMigrationJobRequest + * @static + * @param {google.cloud.clouddms.v1.GetMigrationJobRequest} message GetMigrationJobRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetMigrationJobRequest.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 GetMigrationJobRequest to JSON. + * @function toJSON + * @memberof google.cloud.clouddms.v1.GetMigrationJobRequest + * @instance + * @returns {Object.} JSON object + */ + GetMigrationJobRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetMigrationJobRequest + * @function getTypeUrl + * @memberof google.cloud.clouddms.v1.GetMigrationJobRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetMigrationJobRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.clouddms.v1.GetMigrationJobRequest"; + }; + + return GetMigrationJobRequest; + })(); + + v1.CreateMigrationJobRequest = (function() { + + /** + * Properties of a CreateMigrationJobRequest. + * @memberof google.cloud.clouddms.v1 + * @interface ICreateMigrationJobRequest + * @property {string|null} [parent] CreateMigrationJobRequest parent + * @property {string|null} [migrationJobId] CreateMigrationJobRequest migrationJobId + * @property {google.cloud.clouddms.v1.IMigrationJob|null} [migrationJob] CreateMigrationJobRequest migrationJob + * @property {string|null} [requestId] CreateMigrationJobRequest requestId + */ + + /** + * Constructs a new CreateMigrationJobRequest. + * @memberof google.cloud.clouddms.v1 + * @classdesc Represents a CreateMigrationJobRequest. + * @implements ICreateMigrationJobRequest + * @constructor + * @param {google.cloud.clouddms.v1.ICreateMigrationJobRequest=} [properties] Properties to set + */ + function CreateMigrationJobRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateMigrationJobRequest parent. + * @member {string} parent + * @memberof google.cloud.clouddms.v1.CreateMigrationJobRequest + * @instance + */ + CreateMigrationJobRequest.prototype.parent = ""; + + /** + * CreateMigrationJobRequest migrationJobId. + * @member {string} migrationJobId + * @memberof google.cloud.clouddms.v1.CreateMigrationJobRequest + * @instance + */ + CreateMigrationJobRequest.prototype.migrationJobId = ""; + + /** + * CreateMigrationJobRequest migrationJob. + * @member {google.cloud.clouddms.v1.IMigrationJob|null|undefined} migrationJob + * @memberof google.cloud.clouddms.v1.CreateMigrationJobRequest + * @instance + */ + CreateMigrationJobRequest.prototype.migrationJob = null; + + /** + * CreateMigrationJobRequest requestId. + * @member {string} requestId + * @memberof google.cloud.clouddms.v1.CreateMigrationJobRequest + * @instance + */ + CreateMigrationJobRequest.prototype.requestId = ""; + + /** + * Creates a new CreateMigrationJobRequest instance using the specified properties. + * @function create + * @memberof google.cloud.clouddms.v1.CreateMigrationJobRequest + * @static + * @param {google.cloud.clouddms.v1.ICreateMigrationJobRequest=} [properties] Properties to set + * @returns {google.cloud.clouddms.v1.CreateMigrationJobRequest} CreateMigrationJobRequest instance + */ + CreateMigrationJobRequest.create = function create(properties) { + return new CreateMigrationJobRequest(properties); + }; + + /** + * Encodes the specified CreateMigrationJobRequest message. Does not implicitly {@link google.cloud.clouddms.v1.CreateMigrationJobRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.clouddms.v1.CreateMigrationJobRequest + * @static + * @param {google.cloud.clouddms.v1.ICreateMigrationJobRequest} message CreateMigrationJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateMigrationJobRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.migrationJobId != null && Object.hasOwnProperty.call(message, "migrationJobId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.migrationJobId); + if (message.migrationJob != null && Object.hasOwnProperty.call(message, "migrationJob")) + $root.google.cloud.clouddms.v1.MigrationJob.encode(message.migrationJob, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified CreateMigrationJobRequest message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.CreateMigrationJobRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.clouddms.v1.CreateMigrationJobRequest + * @static + * @param {google.cloud.clouddms.v1.ICreateMigrationJobRequest} message CreateMigrationJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateMigrationJobRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateMigrationJobRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.clouddms.v1.CreateMigrationJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.clouddms.v1.CreateMigrationJobRequest} CreateMigrationJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateMigrationJobRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.clouddms.v1.CreateMigrationJobRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.migrationJobId = reader.string(); + break; + } + case 3: { + message.migrationJob = $root.google.cloud.clouddms.v1.MigrationJob.decode(reader, reader.uint32()); + break; + } + case 4: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateMigrationJobRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.clouddms.v1.CreateMigrationJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.clouddms.v1.CreateMigrationJobRequest} CreateMigrationJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateMigrationJobRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateMigrationJobRequest message. + * @function verify + * @memberof google.cloud.clouddms.v1.CreateMigrationJobRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateMigrationJobRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.migrationJobId != null && message.hasOwnProperty("migrationJobId")) + if (!$util.isString(message.migrationJobId)) + return "migrationJobId: string expected"; + if (message.migrationJob != null && message.hasOwnProperty("migrationJob")) { + var error = $root.google.cloud.clouddms.v1.MigrationJob.verify(message.migrationJob); + if (error) + return "migrationJob." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a CreateMigrationJobRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.clouddms.v1.CreateMigrationJobRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.clouddms.v1.CreateMigrationJobRequest} CreateMigrationJobRequest + */ + CreateMigrationJobRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.clouddms.v1.CreateMigrationJobRequest) + return object; + var message = new $root.google.cloud.clouddms.v1.CreateMigrationJobRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.migrationJobId != null) + message.migrationJobId = String(object.migrationJobId); + if (object.migrationJob != null) { + if (typeof object.migrationJob !== "object") + throw TypeError(".google.cloud.clouddms.v1.CreateMigrationJobRequest.migrationJob: object expected"); + message.migrationJob = $root.google.cloud.clouddms.v1.MigrationJob.fromObject(object.migrationJob); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a CreateMigrationJobRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.clouddms.v1.CreateMigrationJobRequest + * @static + * @param {google.cloud.clouddms.v1.CreateMigrationJobRequest} message CreateMigrationJobRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateMigrationJobRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.migrationJobId = ""; + object.migrationJob = null; + object.requestId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.migrationJobId != null && message.hasOwnProperty("migrationJobId")) + object.migrationJobId = message.migrationJobId; + if (message.migrationJob != null && message.hasOwnProperty("migrationJob")) + object.migrationJob = $root.google.cloud.clouddms.v1.MigrationJob.toObject(message.migrationJob, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this CreateMigrationJobRequest to JSON. + * @function toJSON + * @memberof google.cloud.clouddms.v1.CreateMigrationJobRequest + * @instance + * @returns {Object.} JSON object + */ + CreateMigrationJobRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateMigrationJobRequest + * @function getTypeUrl + * @memberof google.cloud.clouddms.v1.CreateMigrationJobRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateMigrationJobRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.clouddms.v1.CreateMigrationJobRequest"; + }; + + return CreateMigrationJobRequest; + })(); + + v1.UpdateMigrationJobRequest = (function() { + + /** + * Properties of an UpdateMigrationJobRequest. + * @memberof google.cloud.clouddms.v1 + * @interface IUpdateMigrationJobRequest + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateMigrationJobRequest updateMask + * @property {google.cloud.clouddms.v1.IMigrationJob|null} [migrationJob] UpdateMigrationJobRequest migrationJob + * @property {string|null} [requestId] UpdateMigrationJobRequest requestId + */ + + /** + * Constructs a new UpdateMigrationJobRequest. + * @memberof google.cloud.clouddms.v1 + * @classdesc Represents an UpdateMigrationJobRequest. + * @implements IUpdateMigrationJobRequest + * @constructor + * @param {google.cloud.clouddms.v1.IUpdateMigrationJobRequest=} [properties] Properties to set + */ + function UpdateMigrationJobRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateMigrationJobRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.clouddms.v1.UpdateMigrationJobRequest + * @instance + */ + UpdateMigrationJobRequest.prototype.updateMask = null; + + /** + * UpdateMigrationJobRequest migrationJob. + * @member {google.cloud.clouddms.v1.IMigrationJob|null|undefined} migrationJob + * @memberof google.cloud.clouddms.v1.UpdateMigrationJobRequest + * @instance + */ + UpdateMigrationJobRequest.prototype.migrationJob = null; + + /** + * UpdateMigrationJobRequest requestId. + * @member {string} requestId + * @memberof google.cloud.clouddms.v1.UpdateMigrationJobRequest + * @instance + */ + UpdateMigrationJobRequest.prototype.requestId = ""; + + /** + * Creates a new UpdateMigrationJobRequest instance using the specified properties. + * @function create + * @memberof google.cloud.clouddms.v1.UpdateMigrationJobRequest + * @static + * @param {google.cloud.clouddms.v1.IUpdateMigrationJobRequest=} [properties] Properties to set + * @returns {google.cloud.clouddms.v1.UpdateMigrationJobRequest} UpdateMigrationJobRequest instance + */ + UpdateMigrationJobRequest.create = function create(properties) { + return new UpdateMigrationJobRequest(properties); + }; + + /** + * Encodes the specified UpdateMigrationJobRequest message. Does not implicitly {@link google.cloud.clouddms.v1.UpdateMigrationJobRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.clouddms.v1.UpdateMigrationJobRequest + * @static + * @param {google.cloud.clouddms.v1.IUpdateMigrationJobRequest} message UpdateMigrationJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateMigrationJobRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.migrationJob != null && Object.hasOwnProperty.call(message, "migrationJob")) + $root.google.cloud.clouddms.v1.MigrationJob.encode(message.migrationJob, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified UpdateMigrationJobRequest message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.UpdateMigrationJobRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.clouddms.v1.UpdateMigrationJobRequest + * @static + * @param {google.cloud.clouddms.v1.IUpdateMigrationJobRequest} message UpdateMigrationJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateMigrationJobRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateMigrationJobRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.clouddms.v1.UpdateMigrationJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.clouddms.v1.UpdateMigrationJobRequest} UpdateMigrationJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateMigrationJobRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.clouddms.v1.UpdateMigrationJobRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 2: { + message.migrationJob = $root.google.cloud.clouddms.v1.MigrationJob.decode(reader, reader.uint32()); + break; + } + case 3: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateMigrationJobRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.clouddms.v1.UpdateMigrationJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.clouddms.v1.UpdateMigrationJobRequest} UpdateMigrationJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateMigrationJobRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateMigrationJobRequest message. + * @function verify + * @memberof google.cloud.clouddms.v1.UpdateMigrationJobRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateMigrationJobRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.migrationJob != null && message.hasOwnProperty("migrationJob")) { + var error = $root.google.cloud.clouddms.v1.MigrationJob.verify(message.migrationJob); + if (error) + return "migrationJob." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates an UpdateMigrationJobRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.clouddms.v1.UpdateMigrationJobRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.clouddms.v1.UpdateMigrationJobRequest} UpdateMigrationJobRequest + */ + UpdateMigrationJobRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.clouddms.v1.UpdateMigrationJobRequest) + return object; + var message = new $root.google.cloud.clouddms.v1.UpdateMigrationJobRequest(); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.clouddms.v1.UpdateMigrationJobRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.migrationJob != null) { + if (typeof object.migrationJob !== "object") + throw TypeError(".google.cloud.clouddms.v1.UpdateMigrationJobRequest.migrationJob: object expected"); + message.migrationJob = $root.google.cloud.clouddms.v1.MigrationJob.fromObject(object.migrationJob); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from an UpdateMigrationJobRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.clouddms.v1.UpdateMigrationJobRequest + * @static + * @param {google.cloud.clouddms.v1.UpdateMigrationJobRequest} message UpdateMigrationJobRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateMigrationJobRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.updateMask = null; + object.migrationJob = null; + object.requestId = ""; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.migrationJob != null && message.hasOwnProperty("migrationJob")) + object.migrationJob = $root.google.cloud.clouddms.v1.MigrationJob.toObject(message.migrationJob, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this UpdateMigrationJobRequest to JSON. + * @function toJSON + * @memberof google.cloud.clouddms.v1.UpdateMigrationJobRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateMigrationJobRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateMigrationJobRequest + * @function getTypeUrl + * @memberof google.cloud.clouddms.v1.UpdateMigrationJobRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateMigrationJobRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.clouddms.v1.UpdateMigrationJobRequest"; + }; + + return UpdateMigrationJobRequest; + })(); + + v1.DeleteMigrationJobRequest = (function() { + + /** + * Properties of a DeleteMigrationJobRequest. + * @memberof google.cloud.clouddms.v1 + * @interface IDeleteMigrationJobRequest + * @property {string|null} [name] DeleteMigrationJobRequest name + * @property {string|null} [requestId] DeleteMigrationJobRequest requestId + * @property {boolean|null} [force] DeleteMigrationJobRequest force + */ + + /** + * Constructs a new DeleteMigrationJobRequest. + * @memberof google.cloud.clouddms.v1 + * @classdesc Represents a DeleteMigrationJobRequest. + * @implements IDeleteMigrationJobRequest + * @constructor + * @param {google.cloud.clouddms.v1.IDeleteMigrationJobRequest=} [properties] Properties to set + */ + function DeleteMigrationJobRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteMigrationJobRequest name. + * @member {string} name + * @memberof google.cloud.clouddms.v1.DeleteMigrationJobRequest + * @instance + */ + DeleteMigrationJobRequest.prototype.name = ""; + + /** + * DeleteMigrationJobRequest requestId. + * @member {string} requestId + * @memberof google.cloud.clouddms.v1.DeleteMigrationJobRequest + * @instance + */ + DeleteMigrationJobRequest.prototype.requestId = ""; + + /** + * DeleteMigrationJobRequest force. + * @member {boolean} force + * @memberof google.cloud.clouddms.v1.DeleteMigrationJobRequest + * @instance + */ + DeleteMigrationJobRequest.prototype.force = false; + + /** + * Creates a new DeleteMigrationJobRequest instance using the specified properties. + * @function create + * @memberof google.cloud.clouddms.v1.DeleteMigrationJobRequest + * @static + * @param {google.cloud.clouddms.v1.IDeleteMigrationJobRequest=} [properties] Properties to set + * @returns {google.cloud.clouddms.v1.DeleteMigrationJobRequest} DeleteMigrationJobRequest instance + */ + DeleteMigrationJobRequest.create = function create(properties) { + return new DeleteMigrationJobRequest(properties); + }; + + /** + * Encodes the specified DeleteMigrationJobRequest message. Does not implicitly {@link google.cloud.clouddms.v1.DeleteMigrationJobRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.clouddms.v1.DeleteMigrationJobRequest + * @static + * @param {google.cloud.clouddms.v1.IDeleteMigrationJobRequest} message DeleteMigrationJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteMigrationJobRequest.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.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); + if (message.force != null && Object.hasOwnProperty.call(message, "force")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.force); + return writer; + }; + + /** + * Encodes the specified DeleteMigrationJobRequest message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.DeleteMigrationJobRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.clouddms.v1.DeleteMigrationJobRequest + * @static + * @param {google.cloud.clouddms.v1.IDeleteMigrationJobRequest} message DeleteMigrationJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteMigrationJobRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteMigrationJobRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.clouddms.v1.DeleteMigrationJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.clouddms.v1.DeleteMigrationJobRequest} DeleteMigrationJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteMigrationJobRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.clouddms.v1.DeleteMigrationJobRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.requestId = reader.string(); + break; + } + case 3: { + message.force = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteMigrationJobRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.clouddms.v1.DeleteMigrationJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.clouddms.v1.DeleteMigrationJobRequest} DeleteMigrationJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteMigrationJobRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteMigrationJobRequest message. + * @function verify + * @memberof google.cloud.clouddms.v1.DeleteMigrationJobRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteMigrationJobRequest.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.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.force != null && message.hasOwnProperty("force")) + if (typeof message.force !== "boolean") + return "force: boolean expected"; + return null; + }; + + /** + * Creates a DeleteMigrationJobRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.clouddms.v1.DeleteMigrationJobRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.clouddms.v1.DeleteMigrationJobRequest} DeleteMigrationJobRequest + */ + DeleteMigrationJobRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.clouddms.v1.DeleteMigrationJobRequest) + return object; + var message = new $root.google.cloud.clouddms.v1.DeleteMigrationJobRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.force != null) + message.force = Boolean(object.force); + return message; + }; + + /** + * Creates a plain object from a DeleteMigrationJobRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.clouddms.v1.DeleteMigrationJobRequest + * @static + * @param {google.cloud.clouddms.v1.DeleteMigrationJobRequest} message DeleteMigrationJobRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteMigrationJobRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.requestId = ""; + object.force = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.force != null && message.hasOwnProperty("force")) + object.force = message.force; + return object; + }; + + /** + * Converts this DeleteMigrationJobRequest to JSON. + * @function toJSON + * @memberof google.cloud.clouddms.v1.DeleteMigrationJobRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteMigrationJobRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteMigrationJobRequest + * @function getTypeUrl + * @memberof google.cloud.clouddms.v1.DeleteMigrationJobRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteMigrationJobRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.clouddms.v1.DeleteMigrationJobRequest"; + }; + + return DeleteMigrationJobRequest; + })(); + + v1.StartMigrationJobRequest = (function() { + + /** + * Properties of a StartMigrationJobRequest. + * @memberof google.cloud.clouddms.v1 + * @interface IStartMigrationJobRequest + * @property {string|null} [name] StartMigrationJobRequest name + */ + + /** + * Constructs a new StartMigrationJobRequest. + * @memberof google.cloud.clouddms.v1 + * @classdesc Represents a StartMigrationJobRequest. + * @implements IStartMigrationJobRequest + * @constructor + * @param {google.cloud.clouddms.v1.IStartMigrationJobRequest=} [properties] Properties to set + */ + function StartMigrationJobRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StartMigrationJobRequest name. + * @member {string} name + * @memberof google.cloud.clouddms.v1.StartMigrationJobRequest + * @instance + */ + StartMigrationJobRequest.prototype.name = ""; + + /** + * Creates a new StartMigrationJobRequest instance using the specified properties. + * @function create + * @memberof google.cloud.clouddms.v1.StartMigrationJobRequest + * @static + * @param {google.cloud.clouddms.v1.IStartMigrationJobRequest=} [properties] Properties to set + * @returns {google.cloud.clouddms.v1.StartMigrationJobRequest} StartMigrationJobRequest instance + */ + StartMigrationJobRequest.create = function create(properties) { + return new StartMigrationJobRequest(properties); + }; + + /** + * Encodes the specified StartMigrationJobRequest message. Does not implicitly {@link google.cloud.clouddms.v1.StartMigrationJobRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.clouddms.v1.StartMigrationJobRequest + * @static + * @param {google.cloud.clouddms.v1.IStartMigrationJobRequest} message StartMigrationJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StartMigrationJobRequest.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 StartMigrationJobRequest message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.StartMigrationJobRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.clouddms.v1.StartMigrationJobRequest + * @static + * @param {google.cloud.clouddms.v1.IStartMigrationJobRequest} message StartMigrationJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StartMigrationJobRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StartMigrationJobRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.clouddms.v1.StartMigrationJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.clouddms.v1.StartMigrationJobRequest} StartMigrationJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StartMigrationJobRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.clouddms.v1.StartMigrationJobRequest(); + 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 StartMigrationJobRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.clouddms.v1.StartMigrationJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.clouddms.v1.StartMigrationJobRequest} StartMigrationJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StartMigrationJobRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StartMigrationJobRequest message. + * @function verify + * @memberof google.cloud.clouddms.v1.StartMigrationJobRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StartMigrationJobRequest.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 StartMigrationJobRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.clouddms.v1.StartMigrationJobRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.clouddms.v1.StartMigrationJobRequest} StartMigrationJobRequest + */ + StartMigrationJobRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.clouddms.v1.StartMigrationJobRequest) + return object; + var message = new $root.google.cloud.clouddms.v1.StartMigrationJobRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a StartMigrationJobRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.clouddms.v1.StartMigrationJobRequest + * @static + * @param {google.cloud.clouddms.v1.StartMigrationJobRequest} message StartMigrationJobRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StartMigrationJobRequest.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 StartMigrationJobRequest to JSON. + * @function toJSON + * @memberof google.cloud.clouddms.v1.StartMigrationJobRequest + * @instance + * @returns {Object.} JSON object + */ + StartMigrationJobRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StartMigrationJobRequest + * @function getTypeUrl + * @memberof google.cloud.clouddms.v1.StartMigrationJobRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StartMigrationJobRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.clouddms.v1.StartMigrationJobRequest"; + }; + + return StartMigrationJobRequest; + })(); + + v1.StopMigrationJobRequest = (function() { + + /** + * Properties of a StopMigrationJobRequest. + * @memberof google.cloud.clouddms.v1 + * @interface IStopMigrationJobRequest + * @property {string|null} [name] StopMigrationJobRequest name + */ + + /** + * Constructs a new StopMigrationJobRequest. + * @memberof google.cloud.clouddms.v1 + * @classdesc Represents a StopMigrationJobRequest. + * @implements IStopMigrationJobRequest + * @constructor + * @param {google.cloud.clouddms.v1.IStopMigrationJobRequest=} [properties] Properties to set + */ + function StopMigrationJobRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StopMigrationJobRequest name. + * @member {string} name + * @memberof google.cloud.clouddms.v1.StopMigrationJobRequest + * @instance + */ + StopMigrationJobRequest.prototype.name = ""; + + /** + * Creates a new StopMigrationJobRequest instance using the specified properties. + * @function create + * @memberof google.cloud.clouddms.v1.StopMigrationJobRequest + * @static + * @param {google.cloud.clouddms.v1.IStopMigrationJobRequest=} [properties] Properties to set + * @returns {google.cloud.clouddms.v1.StopMigrationJobRequest} StopMigrationJobRequest instance + */ + StopMigrationJobRequest.create = function create(properties) { + return new StopMigrationJobRequest(properties); + }; + + /** + * Encodes the specified StopMigrationJobRequest message. Does not implicitly {@link google.cloud.clouddms.v1.StopMigrationJobRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.clouddms.v1.StopMigrationJobRequest + * @static + * @param {google.cloud.clouddms.v1.IStopMigrationJobRequest} message StopMigrationJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StopMigrationJobRequest.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 StopMigrationJobRequest message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.StopMigrationJobRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.clouddms.v1.StopMigrationJobRequest + * @static + * @param {google.cloud.clouddms.v1.IStopMigrationJobRequest} message StopMigrationJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StopMigrationJobRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StopMigrationJobRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.clouddms.v1.StopMigrationJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.clouddms.v1.StopMigrationJobRequest} StopMigrationJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StopMigrationJobRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.clouddms.v1.StopMigrationJobRequest(); + 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 StopMigrationJobRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.clouddms.v1.StopMigrationJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.clouddms.v1.StopMigrationJobRequest} StopMigrationJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StopMigrationJobRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StopMigrationJobRequest message. + * @function verify + * @memberof google.cloud.clouddms.v1.StopMigrationJobRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StopMigrationJobRequest.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 StopMigrationJobRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.clouddms.v1.StopMigrationJobRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.clouddms.v1.StopMigrationJobRequest} StopMigrationJobRequest + */ + StopMigrationJobRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.clouddms.v1.StopMigrationJobRequest) + return object; + var message = new $root.google.cloud.clouddms.v1.StopMigrationJobRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a StopMigrationJobRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.clouddms.v1.StopMigrationJobRequest + * @static + * @param {google.cloud.clouddms.v1.StopMigrationJobRequest} message StopMigrationJobRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StopMigrationJobRequest.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 StopMigrationJobRequest to JSON. + * @function toJSON + * @memberof google.cloud.clouddms.v1.StopMigrationJobRequest + * @instance + * @returns {Object.} JSON object + */ + StopMigrationJobRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StopMigrationJobRequest + * @function getTypeUrl + * @memberof google.cloud.clouddms.v1.StopMigrationJobRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StopMigrationJobRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.clouddms.v1.StopMigrationJobRequest"; + }; + + return StopMigrationJobRequest; + })(); + + v1.ResumeMigrationJobRequest = (function() { + + /** + * Properties of a ResumeMigrationJobRequest. + * @memberof google.cloud.clouddms.v1 + * @interface IResumeMigrationJobRequest + * @property {string|null} [name] ResumeMigrationJobRequest name + */ + + /** + * Constructs a new ResumeMigrationJobRequest. + * @memberof google.cloud.clouddms.v1 + * @classdesc Represents a ResumeMigrationJobRequest. + * @implements IResumeMigrationJobRequest + * @constructor + * @param {google.cloud.clouddms.v1.IResumeMigrationJobRequest=} [properties] Properties to set + */ + function ResumeMigrationJobRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResumeMigrationJobRequest name. + * @member {string} name + * @memberof google.cloud.clouddms.v1.ResumeMigrationJobRequest + * @instance + */ + ResumeMigrationJobRequest.prototype.name = ""; + + /** + * Creates a new ResumeMigrationJobRequest instance using the specified properties. + * @function create + * @memberof google.cloud.clouddms.v1.ResumeMigrationJobRequest + * @static + * @param {google.cloud.clouddms.v1.IResumeMigrationJobRequest=} [properties] Properties to set + * @returns {google.cloud.clouddms.v1.ResumeMigrationJobRequest} ResumeMigrationJobRequest instance + */ + ResumeMigrationJobRequest.create = function create(properties) { + return new ResumeMigrationJobRequest(properties); + }; + + /** + * Encodes the specified ResumeMigrationJobRequest message. Does not implicitly {@link google.cloud.clouddms.v1.ResumeMigrationJobRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.clouddms.v1.ResumeMigrationJobRequest + * @static + * @param {google.cloud.clouddms.v1.IResumeMigrationJobRequest} message ResumeMigrationJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResumeMigrationJobRequest.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 ResumeMigrationJobRequest message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.ResumeMigrationJobRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.clouddms.v1.ResumeMigrationJobRequest + * @static + * @param {google.cloud.clouddms.v1.IResumeMigrationJobRequest} message ResumeMigrationJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResumeMigrationJobRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResumeMigrationJobRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.clouddms.v1.ResumeMigrationJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.clouddms.v1.ResumeMigrationJobRequest} ResumeMigrationJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResumeMigrationJobRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.clouddms.v1.ResumeMigrationJobRequest(); + 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 ResumeMigrationJobRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.clouddms.v1.ResumeMigrationJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.clouddms.v1.ResumeMigrationJobRequest} ResumeMigrationJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResumeMigrationJobRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResumeMigrationJobRequest message. + * @function verify + * @memberof google.cloud.clouddms.v1.ResumeMigrationJobRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResumeMigrationJobRequest.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 ResumeMigrationJobRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.clouddms.v1.ResumeMigrationJobRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.clouddms.v1.ResumeMigrationJobRequest} ResumeMigrationJobRequest + */ + ResumeMigrationJobRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.clouddms.v1.ResumeMigrationJobRequest) + return object; + var message = new $root.google.cloud.clouddms.v1.ResumeMigrationJobRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a ResumeMigrationJobRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.clouddms.v1.ResumeMigrationJobRequest + * @static + * @param {google.cloud.clouddms.v1.ResumeMigrationJobRequest} message ResumeMigrationJobRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResumeMigrationJobRequest.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 ResumeMigrationJobRequest to JSON. + * @function toJSON + * @memberof google.cloud.clouddms.v1.ResumeMigrationJobRequest + * @instance + * @returns {Object.} JSON object + */ + ResumeMigrationJobRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ResumeMigrationJobRequest + * @function getTypeUrl + * @memberof google.cloud.clouddms.v1.ResumeMigrationJobRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResumeMigrationJobRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.clouddms.v1.ResumeMigrationJobRequest"; + }; + + return ResumeMigrationJobRequest; + })(); + + v1.PromoteMigrationJobRequest = (function() { + + /** + * Properties of a PromoteMigrationJobRequest. + * @memberof google.cloud.clouddms.v1 + * @interface IPromoteMigrationJobRequest + * @property {string|null} [name] PromoteMigrationJobRequest name + */ + + /** + * Constructs a new PromoteMigrationJobRequest. + * @memberof google.cloud.clouddms.v1 + * @classdesc Represents a PromoteMigrationJobRequest. + * @implements IPromoteMigrationJobRequest + * @constructor + * @param {google.cloud.clouddms.v1.IPromoteMigrationJobRequest=} [properties] Properties to set + */ + function PromoteMigrationJobRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PromoteMigrationJobRequest name. + * @member {string} name + * @memberof google.cloud.clouddms.v1.PromoteMigrationJobRequest + * @instance + */ + PromoteMigrationJobRequest.prototype.name = ""; + + /** + * Creates a new PromoteMigrationJobRequest instance using the specified properties. + * @function create + * @memberof google.cloud.clouddms.v1.PromoteMigrationJobRequest + * @static + * @param {google.cloud.clouddms.v1.IPromoteMigrationJobRequest=} [properties] Properties to set + * @returns {google.cloud.clouddms.v1.PromoteMigrationJobRequest} PromoteMigrationJobRequest instance + */ + PromoteMigrationJobRequest.create = function create(properties) { + return new PromoteMigrationJobRequest(properties); + }; + + /** + * Encodes the specified PromoteMigrationJobRequest message. Does not implicitly {@link google.cloud.clouddms.v1.PromoteMigrationJobRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.clouddms.v1.PromoteMigrationJobRequest + * @static + * @param {google.cloud.clouddms.v1.IPromoteMigrationJobRequest} message PromoteMigrationJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PromoteMigrationJobRequest.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 PromoteMigrationJobRequest message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.PromoteMigrationJobRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.clouddms.v1.PromoteMigrationJobRequest + * @static + * @param {google.cloud.clouddms.v1.IPromoteMigrationJobRequest} message PromoteMigrationJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PromoteMigrationJobRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PromoteMigrationJobRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.clouddms.v1.PromoteMigrationJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.clouddms.v1.PromoteMigrationJobRequest} PromoteMigrationJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PromoteMigrationJobRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.clouddms.v1.PromoteMigrationJobRequest(); + 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 PromoteMigrationJobRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.clouddms.v1.PromoteMigrationJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.clouddms.v1.PromoteMigrationJobRequest} PromoteMigrationJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PromoteMigrationJobRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PromoteMigrationJobRequest message. + * @function verify + * @memberof google.cloud.clouddms.v1.PromoteMigrationJobRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PromoteMigrationJobRequest.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 PromoteMigrationJobRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.clouddms.v1.PromoteMigrationJobRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.clouddms.v1.PromoteMigrationJobRequest} PromoteMigrationJobRequest + */ + PromoteMigrationJobRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.clouddms.v1.PromoteMigrationJobRequest) + return object; + var message = new $root.google.cloud.clouddms.v1.PromoteMigrationJobRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a PromoteMigrationJobRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.clouddms.v1.PromoteMigrationJobRequest + * @static + * @param {google.cloud.clouddms.v1.PromoteMigrationJobRequest} message PromoteMigrationJobRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PromoteMigrationJobRequest.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 PromoteMigrationJobRequest to JSON. + * @function toJSON + * @memberof google.cloud.clouddms.v1.PromoteMigrationJobRequest + * @instance + * @returns {Object.} JSON object + */ + PromoteMigrationJobRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PromoteMigrationJobRequest + * @function getTypeUrl + * @memberof google.cloud.clouddms.v1.PromoteMigrationJobRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PromoteMigrationJobRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.clouddms.v1.PromoteMigrationJobRequest"; + }; + + return PromoteMigrationJobRequest; + })(); + + v1.VerifyMigrationJobRequest = (function() { + + /** + * Properties of a VerifyMigrationJobRequest. + * @memberof google.cloud.clouddms.v1 + * @interface IVerifyMigrationJobRequest + * @property {string|null} [name] VerifyMigrationJobRequest name + */ + + /** + * Constructs a new VerifyMigrationJobRequest. + * @memberof google.cloud.clouddms.v1 + * @classdesc Represents a VerifyMigrationJobRequest. + * @implements IVerifyMigrationJobRequest + * @constructor + * @param {google.cloud.clouddms.v1.IVerifyMigrationJobRequest=} [properties] Properties to set + */ + function VerifyMigrationJobRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * VerifyMigrationJobRequest name. + * @member {string} name + * @memberof google.cloud.clouddms.v1.VerifyMigrationJobRequest + * @instance + */ + VerifyMigrationJobRequest.prototype.name = ""; + + /** + * Creates a new VerifyMigrationJobRequest instance using the specified properties. + * @function create + * @memberof google.cloud.clouddms.v1.VerifyMigrationJobRequest + * @static + * @param {google.cloud.clouddms.v1.IVerifyMigrationJobRequest=} [properties] Properties to set + * @returns {google.cloud.clouddms.v1.VerifyMigrationJobRequest} VerifyMigrationJobRequest instance + */ + VerifyMigrationJobRequest.create = function create(properties) { + return new VerifyMigrationJobRequest(properties); + }; + + /** + * Encodes the specified VerifyMigrationJobRequest message. Does not implicitly {@link google.cloud.clouddms.v1.VerifyMigrationJobRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.clouddms.v1.VerifyMigrationJobRequest + * @static + * @param {google.cloud.clouddms.v1.IVerifyMigrationJobRequest} message VerifyMigrationJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VerifyMigrationJobRequest.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 VerifyMigrationJobRequest message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.VerifyMigrationJobRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.clouddms.v1.VerifyMigrationJobRequest + * @static + * @param {google.cloud.clouddms.v1.IVerifyMigrationJobRequest} message VerifyMigrationJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VerifyMigrationJobRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VerifyMigrationJobRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.clouddms.v1.VerifyMigrationJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.clouddms.v1.VerifyMigrationJobRequest} VerifyMigrationJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VerifyMigrationJobRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.clouddms.v1.VerifyMigrationJobRequest(); + 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 VerifyMigrationJobRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.clouddms.v1.VerifyMigrationJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.clouddms.v1.VerifyMigrationJobRequest} VerifyMigrationJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VerifyMigrationJobRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VerifyMigrationJobRequest message. + * @function verify + * @memberof google.cloud.clouddms.v1.VerifyMigrationJobRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VerifyMigrationJobRequest.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 VerifyMigrationJobRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.clouddms.v1.VerifyMigrationJobRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.clouddms.v1.VerifyMigrationJobRequest} VerifyMigrationJobRequest + */ + VerifyMigrationJobRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.clouddms.v1.VerifyMigrationJobRequest) + return object; + var message = new $root.google.cloud.clouddms.v1.VerifyMigrationJobRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a VerifyMigrationJobRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.clouddms.v1.VerifyMigrationJobRequest + * @static + * @param {google.cloud.clouddms.v1.VerifyMigrationJobRequest} message VerifyMigrationJobRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VerifyMigrationJobRequest.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 VerifyMigrationJobRequest to JSON. + * @function toJSON + * @memberof google.cloud.clouddms.v1.VerifyMigrationJobRequest + * @instance + * @returns {Object.} JSON object + */ + VerifyMigrationJobRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VerifyMigrationJobRequest + * @function getTypeUrl + * @memberof google.cloud.clouddms.v1.VerifyMigrationJobRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VerifyMigrationJobRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.clouddms.v1.VerifyMigrationJobRequest"; + }; + + return VerifyMigrationJobRequest; + })(); + + v1.RestartMigrationJobRequest = (function() { + + /** + * Properties of a RestartMigrationJobRequest. + * @memberof google.cloud.clouddms.v1 + * @interface IRestartMigrationJobRequest + * @property {string|null} [name] RestartMigrationJobRequest name + */ + + /** + * Constructs a new RestartMigrationJobRequest. + * @memberof google.cloud.clouddms.v1 + * @classdesc Represents a RestartMigrationJobRequest. + * @implements IRestartMigrationJobRequest + * @constructor + * @param {google.cloud.clouddms.v1.IRestartMigrationJobRequest=} [properties] Properties to set + */ + function RestartMigrationJobRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RestartMigrationJobRequest name. + * @member {string} name + * @memberof google.cloud.clouddms.v1.RestartMigrationJobRequest + * @instance + */ + RestartMigrationJobRequest.prototype.name = ""; + + /** + * Creates a new RestartMigrationJobRequest instance using the specified properties. + * @function create + * @memberof google.cloud.clouddms.v1.RestartMigrationJobRequest + * @static + * @param {google.cloud.clouddms.v1.IRestartMigrationJobRequest=} [properties] Properties to set + * @returns {google.cloud.clouddms.v1.RestartMigrationJobRequest} RestartMigrationJobRequest instance + */ + RestartMigrationJobRequest.create = function create(properties) { + return new RestartMigrationJobRequest(properties); + }; + + /** + * Encodes the specified RestartMigrationJobRequest message. Does not implicitly {@link google.cloud.clouddms.v1.RestartMigrationJobRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.clouddms.v1.RestartMigrationJobRequest + * @static + * @param {google.cloud.clouddms.v1.IRestartMigrationJobRequest} message RestartMigrationJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RestartMigrationJobRequest.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 RestartMigrationJobRequest message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.RestartMigrationJobRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.clouddms.v1.RestartMigrationJobRequest + * @static + * @param {google.cloud.clouddms.v1.IRestartMigrationJobRequest} message RestartMigrationJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RestartMigrationJobRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RestartMigrationJobRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.clouddms.v1.RestartMigrationJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.clouddms.v1.RestartMigrationJobRequest} RestartMigrationJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RestartMigrationJobRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.clouddms.v1.RestartMigrationJobRequest(); + 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 RestartMigrationJobRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.clouddms.v1.RestartMigrationJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.clouddms.v1.RestartMigrationJobRequest} RestartMigrationJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RestartMigrationJobRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RestartMigrationJobRequest message. + * @function verify + * @memberof google.cloud.clouddms.v1.RestartMigrationJobRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RestartMigrationJobRequest.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 RestartMigrationJobRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.clouddms.v1.RestartMigrationJobRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.clouddms.v1.RestartMigrationJobRequest} RestartMigrationJobRequest + */ + RestartMigrationJobRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.clouddms.v1.RestartMigrationJobRequest) + return object; + var message = new $root.google.cloud.clouddms.v1.RestartMigrationJobRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a RestartMigrationJobRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.clouddms.v1.RestartMigrationJobRequest + * @static + * @param {google.cloud.clouddms.v1.RestartMigrationJobRequest} message RestartMigrationJobRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RestartMigrationJobRequest.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 RestartMigrationJobRequest to JSON. + * @function toJSON + * @memberof google.cloud.clouddms.v1.RestartMigrationJobRequest + * @instance + * @returns {Object.} JSON object + */ + RestartMigrationJobRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RestartMigrationJobRequest + * @function getTypeUrl + * @memberof google.cloud.clouddms.v1.RestartMigrationJobRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RestartMigrationJobRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.clouddms.v1.RestartMigrationJobRequest"; + }; + + return RestartMigrationJobRequest; + })(); + + v1.GenerateSshScriptRequest = (function() { + + /** + * Properties of a GenerateSshScriptRequest. + * @memberof google.cloud.clouddms.v1 + * @interface IGenerateSshScriptRequest + * @property {string|null} [migrationJob] GenerateSshScriptRequest migrationJob + * @property {string|null} [vm] GenerateSshScriptRequest vm + * @property {google.cloud.clouddms.v1.IVmCreationConfig|null} [vmCreationConfig] GenerateSshScriptRequest vmCreationConfig + * @property {google.cloud.clouddms.v1.IVmSelectionConfig|null} [vmSelectionConfig] GenerateSshScriptRequest vmSelectionConfig + * @property {number|null} [vmPort] GenerateSshScriptRequest vmPort + */ + + /** + * Constructs a new GenerateSshScriptRequest. + * @memberof google.cloud.clouddms.v1 + * @classdesc Represents a GenerateSshScriptRequest. + * @implements IGenerateSshScriptRequest + * @constructor + * @param {google.cloud.clouddms.v1.IGenerateSshScriptRequest=} [properties] Properties to set + */ + function GenerateSshScriptRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GenerateSshScriptRequest migrationJob. + * @member {string} migrationJob + * @memberof google.cloud.clouddms.v1.GenerateSshScriptRequest + * @instance + */ + GenerateSshScriptRequest.prototype.migrationJob = ""; + + /** + * GenerateSshScriptRequest vm. + * @member {string} vm + * @memberof google.cloud.clouddms.v1.GenerateSshScriptRequest + * @instance + */ + GenerateSshScriptRequest.prototype.vm = ""; + + /** + * GenerateSshScriptRequest vmCreationConfig. + * @member {google.cloud.clouddms.v1.IVmCreationConfig|null|undefined} vmCreationConfig + * @memberof google.cloud.clouddms.v1.GenerateSshScriptRequest + * @instance + */ + GenerateSshScriptRequest.prototype.vmCreationConfig = null; + + /** + * GenerateSshScriptRequest vmSelectionConfig. + * @member {google.cloud.clouddms.v1.IVmSelectionConfig|null|undefined} vmSelectionConfig + * @memberof google.cloud.clouddms.v1.GenerateSshScriptRequest + * @instance + */ + GenerateSshScriptRequest.prototype.vmSelectionConfig = null; + + /** + * GenerateSshScriptRequest vmPort. + * @member {number} vmPort + * @memberof google.cloud.clouddms.v1.GenerateSshScriptRequest + * @instance + */ + GenerateSshScriptRequest.prototype.vmPort = 0; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GenerateSshScriptRequest vmConfig. + * @member {"vmCreationConfig"|"vmSelectionConfig"|undefined} vmConfig + * @memberof google.cloud.clouddms.v1.GenerateSshScriptRequest + * @instance + */ + Object.defineProperty(GenerateSshScriptRequest.prototype, "vmConfig", { + get: $util.oneOfGetter($oneOfFields = ["vmCreationConfig", "vmSelectionConfig"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GenerateSshScriptRequest instance using the specified properties. + * @function create + * @memberof google.cloud.clouddms.v1.GenerateSshScriptRequest + * @static + * @param {google.cloud.clouddms.v1.IGenerateSshScriptRequest=} [properties] Properties to set + * @returns {google.cloud.clouddms.v1.GenerateSshScriptRequest} GenerateSshScriptRequest instance + */ + GenerateSshScriptRequest.create = function create(properties) { + return new GenerateSshScriptRequest(properties); + }; + + /** + * Encodes the specified GenerateSshScriptRequest message. Does not implicitly {@link google.cloud.clouddms.v1.GenerateSshScriptRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.clouddms.v1.GenerateSshScriptRequest + * @static + * @param {google.cloud.clouddms.v1.IGenerateSshScriptRequest} message GenerateSshScriptRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenerateSshScriptRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.migrationJob != null && Object.hasOwnProperty.call(message, "migrationJob")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.migrationJob); + if (message.vm != null && Object.hasOwnProperty.call(message, "vm")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.vm); + if (message.vmPort != null && Object.hasOwnProperty.call(message, "vmPort")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.vmPort); + if (message.vmCreationConfig != null && Object.hasOwnProperty.call(message, "vmCreationConfig")) + $root.google.cloud.clouddms.v1.VmCreationConfig.encode(message.vmCreationConfig, writer.uint32(/* id 100, wireType 2 =*/802).fork()).ldelim(); + if (message.vmSelectionConfig != null && Object.hasOwnProperty.call(message, "vmSelectionConfig")) + $root.google.cloud.clouddms.v1.VmSelectionConfig.encode(message.vmSelectionConfig, writer.uint32(/* id 101, wireType 2 =*/810).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GenerateSshScriptRequest message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.GenerateSshScriptRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.clouddms.v1.GenerateSshScriptRequest + * @static + * @param {google.cloud.clouddms.v1.IGenerateSshScriptRequest} message GenerateSshScriptRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenerateSshScriptRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GenerateSshScriptRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.clouddms.v1.GenerateSshScriptRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.clouddms.v1.GenerateSshScriptRequest} GenerateSshScriptRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenerateSshScriptRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.clouddms.v1.GenerateSshScriptRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.migrationJob = reader.string(); + break; + } + case 2: { + message.vm = reader.string(); + break; + } + case 100: { + message.vmCreationConfig = $root.google.cloud.clouddms.v1.VmCreationConfig.decode(reader, reader.uint32()); + break; + } + case 101: { + message.vmSelectionConfig = $root.google.cloud.clouddms.v1.VmSelectionConfig.decode(reader, reader.uint32()); + break; + } + case 3: { + message.vmPort = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GenerateSshScriptRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.clouddms.v1.GenerateSshScriptRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.clouddms.v1.GenerateSshScriptRequest} GenerateSshScriptRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenerateSshScriptRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GenerateSshScriptRequest message. + * @function verify + * @memberof google.cloud.clouddms.v1.GenerateSshScriptRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GenerateSshScriptRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.migrationJob != null && message.hasOwnProperty("migrationJob")) + if (!$util.isString(message.migrationJob)) + return "migrationJob: string expected"; + if (message.vm != null && message.hasOwnProperty("vm")) + if (!$util.isString(message.vm)) + return "vm: string expected"; + if (message.vmCreationConfig != null && message.hasOwnProperty("vmCreationConfig")) { + properties.vmConfig = 1; + { + var error = $root.google.cloud.clouddms.v1.VmCreationConfig.verify(message.vmCreationConfig); + if (error) + return "vmCreationConfig." + error; + } + } + if (message.vmSelectionConfig != null && message.hasOwnProperty("vmSelectionConfig")) { + if (properties.vmConfig === 1) + return "vmConfig: multiple values"; + properties.vmConfig = 1; + { + var error = $root.google.cloud.clouddms.v1.VmSelectionConfig.verify(message.vmSelectionConfig); + if (error) + return "vmSelectionConfig." + error; + } + } + if (message.vmPort != null && message.hasOwnProperty("vmPort")) + if (!$util.isInteger(message.vmPort)) + return "vmPort: integer expected"; + return null; + }; + + /** + * Creates a GenerateSshScriptRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.clouddms.v1.GenerateSshScriptRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.clouddms.v1.GenerateSshScriptRequest} GenerateSshScriptRequest + */ + GenerateSshScriptRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.clouddms.v1.GenerateSshScriptRequest) + return object; + var message = new $root.google.cloud.clouddms.v1.GenerateSshScriptRequest(); + if (object.migrationJob != null) + message.migrationJob = String(object.migrationJob); + if (object.vm != null) + message.vm = String(object.vm); + if (object.vmCreationConfig != null) { + if (typeof object.vmCreationConfig !== "object") + throw TypeError(".google.cloud.clouddms.v1.GenerateSshScriptRequest.vmCreationConfig: object expected"); + message.vmCreationConfig = $root.google.cloud.clouddms.v1.VmCreationConfig.fromObject(object.vmCreationConfig); + } + if (object.vmSelectionConfig != null) { + if (typeof object.vmSelectionConfig !== "object") + throw TypeError(".google.cloud.clouddms.v1.GenerateSshScriptRequest.vmSelectionConfig: object expected"); + message.vmSelectionConfig = $root.google.cloud.clouddms.v1.VmSelectionConfig.fromObject(object.vmSelectionConfig); + } + if (object.vmPort != null) + message.vmPort = object.vmPort | 0; + return message; + }; + + /** + * Creates a plain object from a GenerateSshScriptRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.clouddms.v1.GenerateSshScriptRequest + * @static + * @param {google.cloud.clouddms.v1.GenerateSshScriptRequest} message GenerateSshScriptRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GenerateSshScriptRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.migrationJob = ""; + object.vm = ""; + object.vmPort = 0; + } + if (message.migrationJob != null && message.hasOwnProperty("migrationJob")) + object.migrationJob = message.migrationJob; + if (message.vm != null && message.hasOwnProperty("vm")) + object.vm = message.vm; + if (message.vmPort != null && message.hasOwnProperty("vmPort")) + object.vmPort = message.vmPort; + if (message.vmCreationConfig != null && message.hasOwnProperty("vmCreationConfig")) { + object.vmCreationConfig = $root.google.cloud.clouddms.v1.VmCreationConfig.toObject(message.vmCreationConfig, options); + if (options.oneofs) + object.vmConfig = "vmCreationConfig"; + } + if (message.vmSelectionConfig != null && message.hasOwnProperty("vmSelectionConfig")) { + object.vmSelectionConfig = $root.google.cloud.clouddms.v1.VmSelectionConfig.toObject(message.vmSelectionConfig, options); + if (options.oneofs) + object.vmConfig = "vmSelectionConfig"; + } + return object; + }; + + /** + * Converts this GenerateSshScriptRequest to JSON. + * @function toJSON + * @memberof google.cloud.clouddms.v1.GenerateSshScriptRequest + * @instance + * @returns {Object.} JSON object + */ + GenerateSshScriptRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GenerateSshScriptRequest + * @function getTypeUrl + * @memberof google.cloud.clouddms.v1.GenerateSshScriptRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GenerateSshScriptRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.clouddms.v1.GenerateSshScriptRequest"; + }; + + return GenerateSshScriptRequest; + })(); + + v1.VmCreationConfig = (function() { + + /** + * Properties of a VmCreationConfig. + * @memberof google.cloud.clouddms.v1 + * @interface IVmCreationConfig + * @property {string|null} [vmMachineType] VmCreationConfig vmMachineType + * @property {string|null} [vmZone] VmCreationConfig vmZone + * @property {string|null} [subnet] VmCreationConfig subnet + */ + + /** + * Constructs a new VmCreationConfig. + * @memberof google.cloud.clouddms.v1 + * @classdesc Represents a VmCreationConfig. + * @implements IVmCreationConfig + * @constructor + * @param {google.cloud.clouddms.v1.IVmCreationConfig=} [properties] Properties to set + */ + function VmCreationConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * VmCreationConfig vmMachineType. + * @member {string} vmMachineType + * @memberof google.cloud.clouddms.v1.VmCreationConfig + * @instance + */ + VmCreationConfig.prototype.vmMachineType = ""; + + /** + * VmCreationConfig vmZone. + * @member {string} vmZone + * @memberof google.cloud.clouddms.v1.VmCreationConfig + * @instance + */ + VmCreationConfig.prototype.vmZone = ""; + + /** + * VmCreationConfig subnet. + * @member {string} subnet + * @memberof google.cloud.clouddms.v1.VmCreationConfig + * @instance + */ + VmCreationConfig.prototype.subnet = ""; + + /** + * Creates a new VmCreationConfig instance using the specified properties. + * @function create + * @memberof google.cloud.clouddms.v1.VmCreationConfig + * @static + * @param {google.cloud.clouddms.v1.IVmCreationConfig=} [properties] Properties to set + * @returns {google.cloud.clouddms.v1.VmCreationConfig} VmCreationConfig instance + */ + VmCreationConfig.create = function create(properties) { + return new VmCreationConfig(properties); + }; + + /** + * Encodes the specified VmCreationConfig message. Does not implicitly {@link google.cloud.clouddms.v1.VmCreationConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.clouddms.v1.VmCreationConfig + * @static + * @param {google.cloud.clouddms.v1.IVmCreationConfig} message VmCreationConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VmCreationConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.vmMachineType != null && Object.hasOwnProperty.call(message, "vmMachineType")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.vmMachineType); + if (message.vmZone != null && Object.hasOwnProperty.call(message, "vmZone")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.vmZone); + if (message.subnet != null && Object.hasOwnProperty.call(message, "subnet")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.subnet); + return writer; + }; + + /** + * Encodes the specified VmCreationConfig message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.VmCreationConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.clouddms.v1.VmCreationConfig + * @static + * @param {google.cloud.clouddms.v1.IVmCreationConfig} message VmCreationConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VmCreationConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VmCreationConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.clouddms.v1.VmCreationConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.clouddms.v1.VmCreationConfig} VmCreationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VmCreationConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.clouddms.v1.VmCreationConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.vmMachineType = reader.string(); + break; + } + case 2: { + message.vmZone = reader.string(); + break; + } + case 3: { + message.subnet = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VmCreationConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.clouddms.v1.VmCreationConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.clouddms.v1.VmCreationConfig} VmCreationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VmCreationConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VmCreationConfig message. + * @function verify + * @memberof google.cloud.clouddms.v1.VmCreationConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VmCreationConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.vmMachineType != null && message.hasOwnProperty("vmMachineType")) + if (!$util.isString(message.vmMachineType)) + return "vmMachineType: string expected"; + if (message.vmZone != null && message.hasOwnProperty("vmZone")) + if (!$util.isString(message.vmZone)) + return "vmZone: string expected"; + if (message.subnet != null && message.hasOwnProperty("subnet")) + if (!$util.isString(message.subnet)) + return "subnet: string expected"; + return null; + }; + + /** + * Creates a VmCreationConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.clouddms.v1.VmCreationConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.clouddms.v1.VmCreationConfig} VmCreationConfig + */ + VmCreationConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.clouddms.v1.VmCreationConfig) + return object; + var message = new $root.google.cloud.clouddms.v1.VmCreationConfig(); + if (object.vmMachineType != null) + message.vmMachineType = String(object.vmMachineType); + if (object.vmZone != null) + message.vmZone = String(object.vmZone); + if (object.subnet != null) + message.subnet = String(object.subnet); + return message; + }; + + /** + * Creates a plain object from a VmCreationConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.clouddms.v1.VmCreationConfig + * @static + * @param {google.cloud.clouddms.v1.VmCreationConfig} message VmCreationConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VmCreationConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.vmMachineType = ""; + object.vmZone = ""; + object.subnet = ""; + } + if (message.vmMachineType != null && message.hasOwnProperty("vmMachineType")) + object.vmMachineType = message.vmMachineType; + if (message.vmZone != null && message.hasOwnProperty("vmZone")) + object.vmZone = message.vmZone; + if (message.subnet != null && message.hasOwnProperty("subnet")) + object.subnet = message.subnet; + return object; + }; + + /** + * Converts this VmCreationConfig to JSON. + * @function toJSON + * @memberof google.cloud.clouddms.v1.VmCreationConfig + * @instance + * @returns {Object.} JSON object + */ + VmCreationConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VmCreationConfig + * @function getTypeUrl + * @memberof google.cloud.clouddms.v1.VmCreationConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VmCreationConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.clouddms.v1.VmCreationConfig"; + }; + + return VmCreationConfig; + })(); + + v1.VmSelectionConfig = (function() { + + /** + * Properties of a VmSelectionConfig. + * @memberof google.cloud.clouddms.v1 + * @interface IVmSelectionConfig + * @property {string|null} [vmZone] VmSelectionConfig vmZone + */ + + /** + * Constructs a new VmSelectionConfig. + * @memberof google.cloud.clouddms.v1 + * @classdesc Represents a VmSelectionConfig. + * @implements IVmSelectionConfig + * @constructor + * @param {google.cloud.clouddms.v1.IVmSelectionConfig=} [properties] Properties to set + */ + function VmSelectionConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * VmSelectionConfig vmZone. + * @member {string} vmZone + * @memberof google.cloud.clouddms.v1.VmSelectionConfig + * @instance + */ + VmSelectionConfig.prototype.vmZone = ""; + + /** + * Creates a new VmSelectionConfig instance using the specified properties. + * @function create + * @memberof google.cloud.clouddms.v1.VmSelectionConfig + * @static + * @param {google.cloud.clouddms.v1.IVmSelectionConfig=} [properties] Properties to set + * @returns {google.cloud.clouddms.v1.VmSelectionConfig} VmSelectionConfig instance + */ + VmSelectionConfig.create = function create(properties) { + return new VmSelectionConfig(properties); + }; + + /** + * Encodes the specified VmSelectionConfig message. Does not implicitly {@link google.cloud.clouddms.v1.VmSelectionConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.clouddms.v1.VmSelectionConfig + * @static + * @param {google.cloud.clouddms.v1.IVmSelectionConfig} message VmSelectionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VmSelectionConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.vmZone != null && Object.hasOwnProperty.call(message, "vmZone")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.vmZone); + return writer; + }; + + /** + * Encodes the specified VmSelectionConfig message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.VmSelectionConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.clouddms.v1.VmSelectionConfig + * @static + * @param {google.cloud.clouddms.v1.IVmSelectionConfig} message VmSelectionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VmSelectionConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VmSelectionConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.clouddms.v1.VmSelectionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.clouddms.v1.VmSelectionConfig} VmSelectionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VmSelectionConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.clouddms.v1.VmSelectionConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.vmZone = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VmSelectionConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.clouddms.v1.VmSelectionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.clouddms.v1.VmSelectionConfig} VmSelectionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VmSelectionConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VmSelectionConfig message. + * @function verify + * @memberof google.cloud.clouddms.v1.VmSelectionConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VmSelectionConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.vmZone != null && message.hasOwnProperty("vmZone")) + if (!$util.isString(message.vmZone)) + return "vmZone: string expected"; + return null; + }; + + /** + * Creates a VmSelectionConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.clouddms.v1.VmSelectionConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.clouddms.v1.VmSelectionConfig} VmSelectionConfig + */ + VmSelectionConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.clouddms.v1.VmSelectionConfig) + return object; + var message = new $root.google.cloud.clouddms.v1.VmSelectionConfig(); + if (object.vmZone != null) + message.vmZone = String(object.vmZone); + return message; + }; + + /** + * Creates a plain object from a VmSelectionConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.clouddms.v1.VmSelectionConfig + * @static + * @param {google.cloud.clouddms.v1.VmSelectionConfig} message VmSelectionConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VmSelectionConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.vmZone = ""; + if (message.vmZone != null && message.hasOwnProperty("vmZone")) + object.vmZone = message.vmZone; + return object; + }; + + /** + * Converts this VmSelectionConfig to JSON. + * @function toJSON + * @memberof google.cloud.clouddms.v1.VmSelectionConfig + * @instance + * @returns {Object.} JSON object + */ + VmSelectionConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VmSelectionConfig + * @function getTypeUrl + * @memberof google.cloud.clouddms.v1.VmSelectionConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VmSelectionConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.clouddms.v1.VmSelectionConfig"; + }; + + return VmSelectionConfig; + })(); + + v1.SshScript = (function() { + + /** + * Properties of a SshScript. + * @memberof google.cloud.clouddms.v1 + * @interface ISshScript + * @property {string|null} [script] SshScript script + */ + + /** + * Constructs a new SshScript. + * @memberof google.cloud.clouddms.v1 + * @classdesc Represents a SshScript. + * @implements ISshScript + * @constructor + * @param {google.cloud.clouddms.v1.ISshScript=} [properties] Properties to set + */ + function SshScript(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SshScript script. + * @member {string} script + * @memberof google.cloud.clouddms.v1.SshScript + * @instance + */ + SshScript.prototype.script = ""; + + /** + * Creates a new SshScript instance using the specified properties. + * @function create + * @memberof google.cloud.clouddms.v1.SshScript + * @static + * @param {google.cloud.clouddms.v1.ISshScript=} [properties] Properties to set + * @returns {google.cloud.clouddms.v1.SshScript} SshScript instance + */ + SshScript.create = function create(properties) { + return new SshScript(properties); + }; + + /** + * Encodes the specified SshScript message. Does not implicitly {@link google.cloud.clouddms.v1.SshScript.verify|verify} messages. + * @function encode + * @memberof google.cloud.clouddms.v1.SshScript + * @static + * @param {google.cloud.clouddms.v1.ISshScript} message SshScript message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SshScript.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.script != null && Object.hasOwnProperty.call(message, "script")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.script); + return writer; + }; + + /** + * Encodes the specified SshScript message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.SshScript.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.clouddms.v1.SshScript + * @static + * @param {google.cloud.clouddms.v1.ISshScript} message SshScript message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SshScript.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SshScript message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.clouddms.v1.SshScript + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.clouddms.v1.SshScript} SshScript + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SshScript.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.clouddms.v1.SshScript(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.script = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SshScript message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.clouddms.v1.SshScript + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.clouddms.v1.SshScript} SshScript + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SshScript.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SshScript message. + * @function verify + * @memberof google.cloud.clouddms.v1.SshScript + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SshScript.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.script != null && message.hasOwnProperty("script")) + if (!$util.isString(message.script)) + return "script: string expected"; + return null; + }; + + /** + * Creates a SshScript message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.clouddms.v1.SshScript + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.clouddms.v1.SshScript} SshScript + */ + SshScript.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.clouddms.v1.SshScript) + return object; + var message = new $root.google.cloud.clouddms.v1.SshScript(); + if (object.script != null) + message.script = String(object.script); + return message; + }; + + /** + * Creates a plain object from a SshScript message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.clouddms.v1.SshScript + * @static + * @param {google.cloud.clouddms.v1.SshScript} message SshScript + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SshScript.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.script = ""; + if (message.script != null && message.hasOwnProperty("script")) + object.script = message.script; + return object; + }; + + /** + * Converts this SshScript to JSON. + * @function toJSON + * @memberof google.cloud.clouddms.v1.SshScript + * @instance + * @returns {Object.} JSON object + */ + SshScript.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SshScript + * @function getTypeUrl + * @memberof google.cloud.clouddms.v1.SshScript + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SshScript.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.clouddms.v1.SshScript"; + }; + + return SshScript; + })(); + + v1.ListConnectionProfilesRequest = (function() { + + /** + * Properties of a ListConnectionProfilesRequest. + * @memberof google.cloud.clouddms.v1 + * @interface IListConnectionProfilesRequest + * @property {string|null} [parent] ListConnectionProfilesRequest parent + * @property {number|null} [pageSize] ListConnectionProfilesRequest pageSize + * @property {string|null} [pageToken] ListConnectionProfilesRequest pageToken + * @property {string|null} [filter] ListConnectionProfilesRequest filter + * @property {string|null} [orderBy] ListConnectionProfilesRequest orderBy + */ + + /** + * Constructs a new ListConnectionProfilesRequest. + * @memberof google.cloud.clouddms.v1 + * @classdesc Represents a ListConnectionProfilesRequest. + * @implements IListConnectionProfilesRequest + * @constructor + * @param {google.cloud.clouddms.v1.IListConnectionProfilesRequest=} [properties] Properties to set + */ + function ListConnectionProfilesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListConnectionProfilesRequest parent. + * @member {string} parent + * @memberof google.cloud.clouddms.v1.ListConnectionProfilesRequest + * @instance + */ + ListConnectionProfilesRequest.prototype.parent = ""; + + /** + * ListConnectionProfilesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.clouddms.v1.ListConnectionProfilesRequest + * @instance + */ + ListConnectionProfilesRequest.prototype.pageSize = 0; + + /** + * ListConnectionProfilesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.clouddms.v1.ListConnectionProfilesRequest + * @instance + */ + ListConnectionProfilesRequest.prototype.pageToken = ""; + + /** + * ListConnectionProfilesRequest filter. + * @member {string} filter + * @memberof google.cloud.clouddms.v1.ListConnectionProfilesRequest + * @instance + */ + ListConnectionProfilesRequest.prototype.filter = ""; + + /** + * ListConnectionProfilesRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.clouddms.v1.ListConnectionProfilesRequest + * @instance + */ + ListConnectionProfilesRequest.prototype.orderBy = ""; + + /** + * Creates a new ListConnectionProfilesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.clouddms.v1.ListConnectionProfilesRequest + * @static + * @param {google.cloud.clouddms.v1.IListConnectionProfilesRequest=} [properties] Properties to set + * @returns {google.cloud.clouddms.v1.ListConnectionProfilesRequest} ListConnectionProfilesRequest instance + */ + ListConnectionProfilesRequest.create = function create(properties) { + return new ListConnectionProfilesRequest(properties); + }; + + /** + * Encodes the specified ListConnectionProfilesRequest message. Does not implicitly {@link google.cloud.clouddms.v1.ListConnectionProfilesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.clouddms.v1.ListConnectionProfilesRequest + * @static + * @param {google.cloud.clouddms.v1.IListConnectionProfilesRequest} message ListConnectionProfilesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListConnectionProfilesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); + return writer; + }; + + /** + * Encodes the specified ListConnectionProfilesRequest message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.ListConnectionProfilesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.clouddms.v1.ListConnectionProfilesRequest + * @static + * @param {google.cloud.clouddms.v1.IListConnectionProfilesRequest} message ListConnectionProfilesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListConnectionProfilesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListConnectionProfilesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.clouddms.v1.ListConnectionProfilesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.clouddms.v1.ListConnectionProfilesRequest} ListConnectionProfilesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListConnectionProfilesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.clouddms.v1.ListConnectionProfilesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListConnectionProfilesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.clouddms.v1.ListConnectionProfilesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.clouddms.v1.ListConnectionProfilesRequest} ListConnectionProfilesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListConnectionProfilesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListConnectionProfilesRequest message. + * @function verify + * @memberof google.cloud.clouddms.v1.ListConnectionProfilesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListConnectionProfilesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + return null; + }; + + /** + * Creates a ListConnectionProfilesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.clouddms.v1.ListConnectionProfilesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.clouddms.v1.ListConnectionProfilesRequest} ListConnectionProfilesRequest + */ + ListConnectionProfilesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.clouddms.v1.ListConnectionProfilesRequest) + return object; + var message = new $root.google.cloud.clouddms.v1.ListConnectionProfilesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + return message; + }; + + /** + * Creates a plain object from a ListConnectionProfilesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.clouddms.v1.ListConnectionProfilesRequest + * @static + * @param {google.cloud.clouddms.v1.ListConnectionProfilesRequest} message ListConnectionProfilesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListConnectionProfilesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.orderBy = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + return object; + }; + + /** + * Converts this ListConnectionProfilesRequest to JSON. + * @function toJSON + * @memberof google.cloud.clouddms.v1.ListConnectionProfilesRequest + * @instance + * @returns {Object.} JSON object + */ + ListConnectionProfilesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListConnectionProfilesRequest + * @function getTypeUrl + * @memberof google.cloud.clouddms.v1.ListConnectionProfilesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListConnectionProfilesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.clouddms.v1.ListConnectionProfilesRequest"; + }; + + return ListConnectionProfilesRequest; + })(); + + v1.ListConnectionProfilesResponse = (function() { + + /** + * Properties of a ListConnectionProfilesResponse. + * @memberof google.cloud.clouddms.v1 + * @interface IListConnectionProfilesResponse + * @property {Array.|null} [connectionProfiles] ListConnectionProfilesResponse connectionProfiles + * @property {string|null} [nextPageToken] ListConnectionProfilesResponse nextPageToken + * @property {Array.|null} [unreachable] ListConnectionProfilesResponse unreachable + */ + + /** + * Constructs a new ListConnectionProfilesResponse. + * @memberof google.cloud.clouddms.v1 + * @classdesc Represents a ListConnectionProfilesResponse. + * @implements IListConnectionProfilesResponse + * @constructor + * @param {google.cloud.clouddms.v1.IListConnectionProfilesResponse=} [properties] Properties to set + */ + function ListConnectionProfilesResponse(properties) { + this.connectionProfiles = []; + this.unreachable = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListConnectionProfilesResponse connectionProfiles. + * @member {Array.} connectionProfiles + * @memberof google.cloud.clouddms.v1.ListConnectionProfilesResponse + * @instance + */ + ListConnectionProfilesResponse.prototype.connectionProfiles = $util.emptyArray; + + /** + * ListConnectionProfilesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.clouddms.v1.ListConnectionProfilesResponse + * @instance + */ + ListConnectionProfilesResponse.prototype.nextPageToken = ""; + + /** + * ListConnectionProfilesResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.clouddms.v1.ListConnectionProfilesResponse + * @instance + */ + ListConnectionProfilesResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListConnectionProfilesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.clouddms.v1.ListConnectionProfilesResponse + * @static + * @param {google.cloud.clouddms.v1.IListConnectionProfilesResponse=} [properties] Properties to set + * @returns {google.cloud.clouddms.v1.ListConnectionProfilesResponse} ListConnectionProfilesResponse instance + */ + ListConnectionProfilesResponse.create = function create(properties) { + return new ListConnectionProfilesResponse(properties); + }; + + /** + * Encodes the specified ListConnectionProfilesResponse message. Does not implicitly {@link google.cloud.clouddms.v1.ListConnectionProfilesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.clouddms.v1.ListConnectionProfilesResponse + * @static + * @param {google.cloud.clouddms.v1.IListConnectionProfilesResponse} message ListConnectionProfilesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListConnectionProfilesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.connectionProfiles != null && message.connectionProfiles.length) + for (var i = 0; i < message.connectionProfiles.length; ++i) + $root.google.cloud.clouddms.v1.ConnectionProfile.encode(message.connectionProfiles[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.unreachable != null && message.unreachable.length) + for (var i = 0; i < message.unreachable.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); + return writer; + }; + + /** + * Encodes the specified ListConnectionProfilesResponse message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.ListConnectionProfilesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.clouddms.v1.ListConnectionProfilesResponse + * @static + * @param {google.cloud.clouddms.v1.IListConnectionProfilesResponse} message ListConnectionProfilesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListConnectionProfilesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListConnectionProfilesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.clouddms.v1.ListConnectionProfilesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.clouddms.v1.ListConnectionProfilesResponse} ListConnectionProfilesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListConnectionProfilesResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.clouddms.v1.ListConnectionProfilesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.connectionProfiles && message.connectionProfiles.length)) + message.connectionProfiles = []; + message.connectionProfiles.push($root.google.cloud.clouddms.v1.ConnectionProfile.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 3: { + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListConnectionProfilesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.clouddms.v1.ListConnectionProfilesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.clouddms.v1.ListConnectionProfilesResponse} ListConnectionProfilesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListConnectionProfilesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListConnectionProfilesResponse message. + * @function verify + * @memberof google.cloud.clouddms.v1.ListConnectionProfilesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListConnectionProfilesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.connectionProfiles != null && message.hasOwnProperty("connectionProfiles")) { + if (!Array.isArray(message.connectionProfiles)) + return "connectionProfiles: array expected"; + for (var i = 0; i < message.connectionProfiles.length; ++i) { + var error = $root.google.cloud.clouddms.v1.ConnectionProfile.verify(message.connectionProfiles[i]); + if (error) + return "connectionProfiles." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.unreachable != null && message.hasOwnProperty("unreachable")) { + if (!Array.isArray(message.unreachable)) + return "unreachable: array expected"; + for (var i = 0; i < message.unreachable.length; ++i) + if (!$util.isString(message.unreachable[i])) + return "unreachable: string[] expected"; + } + return null; + }; + + /** + * Creates a ListConnectionProfilesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.clouddms.v1.ListConnectionProfilesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.clouddms.v1.ListConnectionProfilesResponse} ListConnectionProfilesResponse + */ + ListConnectionProfilesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.clouddms.v1.ListConnectionProfilesResponse) + return object; + var message = new $root.google.cloud.clouddms.v1.ListConnectionProfilesResponse(); + if (object.connectionProfiles) { + if (!Array.isArray(object.connectionProfiles)) + throw TypeError(".google.cloud.clouddms.v1.ListConnectionProfilesResponse.connectionProfiles: array expected"); + message.connectionProfiles = []; + for (var i = 0; i < object.connectionProfiles.length; ++i) { + if (typeof object.connectionProfiles[i] !== "object") + throw TypeError(".google.cloud.clouddms.v1.ListConnectionProfilesResponse.connectionProfiles: object expected"); + message.connectionProfiles[i] = $root.google.cloud.clouddms.v1.ConnectionProfile.fromObject(object.connectionProfiles[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.clouddms.v1.ListConnectionProfilesResponse.unreachable: array expected"); + message.unreachable = []; + for (var i = 0; i < object.unreachable.length; ++i) + message.unreachable[i] = String(object.unreachable[i]); + } + return message; + }; + + /** + * Creates a plain object from a ListConnectionProfilesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.clouddms.v1.ListConnectionProfilesResponse + * @static + * @param {google.cloud.clouddms.v1.ListConnectionProfilesResponse} message ListConnectionProfilesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListConnectionProfilesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.connectionProfiles = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.connectionProfiles && message.connectionProfiles.length) { + object.connectionProfiles = []; + for (var j = 0; j < message.connectionProfiles.length; ++j) + object.connectionProfiles[j] = $root.google.cloud.clouddms.v1.ConnectionProfile.toObject(message.connectionProfiles[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.unreachable && message.unreachable.length) { + object.unreachable = []; + for (var j = 0; j < message.unreachable.length; ++j) + object.unreachable[j] = message.unreachable[j]; + } + return object; + }; + + /** + * Converts this ListConnectionProfilesResponse to JSON. + * @function toJSON + * @memberof google.cloud.clouddms.v1.ListConnectionProfilesResponse + * @instance + * @returns {Object.} JSON object + */ + ListConnectionProfilesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListConnectionProfilesResponse + * @function getTypeUrl + * @memberof google.cloud.clouddms.v1.ListConnectionProfilesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListConnectionProfilesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.clouddms.v1.ListConnectionProfilesResponse"; + }; + + return ListConnectionProfilesResponse; + })(); + + v1.GetConnectionProfileRequest = (function() { + + /** + * Properties of a GetConnectionProfileRequest. + * @memberof google.cloud.clouddms.v1 + * @interface IGetConnectionProfileRequest + * @property {string|null} [name] GetConnectionProfileRequest name + */ + + /** + * Constructs a new GetConnectionProfileRequest. + * @memberof google.cloud.clouddms.v1 + * @classdesc Represents a GetConnectionProfileRequest. + * @implements IGetConnectionProfileRequest + * @constructor + * @param {google.cloud.clouddms.v1.IGetConnectionProfileRequest=} [properties] Properties to set + */ + function GetConnectionProfileRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetConnectionProfileRequest name. + * @member {string} name + * @memberof google.cloud.clouddms.v1.GetConnectionProfileRequest + * @instance + */ + GetConnectionProfileRequest.prototype.name = ""; + + /** + * Creates a new GetConnectionProfileRequest instance using the specified properties. + * @function create + * @memberof google.cloud.clouddms.v1.GetConnectionProfileRequest + * @static + * @param {google.cloud.clouddms.v1.IGetConnectionProfileRequest=} [properties] Properties to set + * @returns {google.cloud.clouddms.v1.GetConnectionProfileRequest} GetConnectionProfileRequest instance + */ + GetConnectionProfileRequest.create = function create(properties) { + return new GetConnectionProfileRequest(properties); + }; + + /** + * Encodes the specified GetConnectionProfileRequest message. Does not implicitly {@link google.cloud.clouddms.v1.GetConnectionProfileRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.clouddms.v1.GetConnectionProfileRequest + * @static + * @param {google.cloud.clouddms.v1.IGetConnectionProfileRequest} message GetConnectionProfileRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetConnectionProfileRequest.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 GetConnectionProfileRequest message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.GetConnectionProfileRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.clouddms.v1.GetConnectionProfileRequest + * @static + * @param {google.cloud.clouddms.v1.IGetConnectionProfileRequest} message GetConnectionProfileRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetConnectionProfileRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetConnectionProfileRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.clouddms.v1.GetConnectionProfileRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.clouddms.v1.GetConnectionProfileRequest} GetConnectionProfileRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetConnectionProfileRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.clouddms.v1.GetConnectionProfileRequest(); + 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 GetConnectionProfileRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.clouddms.v1.GetConnectionProfileRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.clouddms.v1.GetConnectionProfileRequest} GetConnectionProfileRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetConnectionProfileRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetConnectionProfileRequest message. + * @function verify + * @memberof google.cloud.clouddms.v1.GetConnectionProfileRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetConnectionProfileRequest.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 GetConnectionProfileRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.clouddms.v1.GetConnectionProfileRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.clouddms.v1.GetConnectionProfileRequest} GetConnectionProfileRequest + */ + GetConnectionProfileRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.clouddms.v1.GetConnectionProfileRequest) + return object; + var message = new $root.google.cloud.clouddms.v1.GetConnectionProfileRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetConnectionProfileRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.clouddms.v1.GetConnectionProfileRequest + * @static + * @param {google.cloud.clouddms.v1.GetConnectionProfileRequest} message GetConnectionProfileRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetConnectionProfileRequest.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 GetConnectionProfileRequest to JSON. + * @function toJSON + * @memberof google.cloud.clouddms.v1.GetConnectionProfileRequest + * @instance + * @returns {Object.} JSON object + */ + GetConnectionProfileRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetConnectionProfileRequest + * @function getTypeUrl + * @memberof google.cloud.clouddms.v1.GetConnectionProfileRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetConnectionProfileRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.clouddms.v1.GetConnectionProfileRequest"; + }; + + return GetConnectionProfileRequest; + })(); + + v1.CreateConnectionProfileRequest = (function() { + + /** + * Properties of a CreateConnectionProfileRequest. + * @memberof google.cloud.clouddms.v1 + * @interface ICreateConnectionProfileRequest + * @property {string|null} [parent] CreateConnectionProfileRequest parent + * @property {string|null} [connectionProfileId] CreateConnectionProfileRequest connectionProfileId + * @property {google.cloud.clouddms.v1.IConnectionProfile|null} [connectionProfile] CreateConnectionProfileRequest connectionProfile + * @property {string|null} [requestId] CreateConnectionProfileRequest requestId + */ + + /** + * Constructs a new CreateConnectionProfileRequest. + * @memberof google.cloud.clouddms.v1 + * @classdesc Represents a CreateConnectionProfileRequest. + * @implements ICreateConnectionProfileRequest + * @constructor + * @param {google.cloud.clouddms.v1.ICreateConnectionProfileRequest=} [properties] Properties to set + */ + function CreateConnectionProfileRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateConnectionProfileRequest parent. + * @member {string} parent + * @memberof google.cloud.clouddms.v1.CreateConnectionProfileRequest + * @instance + */ + CreateConnectionProfileRequest.prototype.parent = ""; + + /** + * CreateConnectionProfileRequest connectionProfileId. + * @member {string} connectionProfileId + * @memberof google.cloud.clouddms.v1.CreateConnectionProfileRequest + * @instance + */ + CreateConnectionProfileRequest.prototype.connectionProfileId = ""; + + /** + * CreateConnectionProfileRequest connectionProfile. + * @member {google.cloud.clouddms.v1.IConnectionProfile|null|undefined} connectionProfile + * @memberof google.cloud.clouddms.v1.CreateConnectionProfileRequest + * @instance + */ + CreateConnectionProfileRequest.prototype.connectionProfile = null; + + /** + * CreateConnectionProfileRequest requestId. + * @member {string} requestId + * @memberof google.cloud.clouddms.v1.CreateConnectionProfileRequest + * @instance + */ + CreateConnectionProfileRequest.prototype.requestId = ""; + + /** + * Creates a new CreateConnectionProfileRequest instance using the specified properties. + * @function create + * @memberof google.cloud.clouddms.v1.CreateConnectionProfileRequest + * @static + * @param {google.cloud.clouddms.v1.ICreateConnectionProfileRequest=} [properties] Properties to set + * @returns {google.cloud.clouddms.v1.CreateConnectionProfileRequest} CreateConnectionProfileRequest instance + */ + CreateConnectionProfileRequest.create = function create(properties) { + return new CreateConnectionProfileRequest(properties); + }; + + /** + * Encodes the specified CreateConnectionProfileRequest message. Does not implicitly {@link google.cloud.clouddms.v1.CreateConnectionProfileRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.clouddms.v1.CreateConnectionProfileRequest + * @static + * @param {google.cloud.clouddms.v1.ICreateConnectionProfileRequest} message CreateConnectionProfileRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateConnectionProfileRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.connectionProfileId != null && Object.hasOwnProperty.call(message, "connectionProfileId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.connectionProfileId); + if (message.connectionProfile != null && Object.hasOwnProperty.call(message, "connectionProfile")) + $root.google.cloud.clouddms.v1.ConnectionProfile.encode(message.connectionProfile, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified CreateConnectionProfileRequest message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.CreateConnectionProfileRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.clouddms.v1.CreateConnectionProfileRequest + * @static + * @param {google.cloud.clouddms.v1.ICreateConnectionProfileRequest} message CreateConnectionProfileRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateConnectionProfileRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateConnectionProfileRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.clouddms.v1.CreateConnectionProfileRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.clouddms.v1.CreateConnectionProfileRequest} CreateConnectionProfileRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateConnectionProfileRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.clouddms.v1.CreateConnectionProfileRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.connectionProfileId = reader.string(); + break; + } + case 3: { + message.connectionProfile = $root.google.cloud.clouddms.v1.ConnectionProfile.decode(reader, reader.uint32()); + break; + } + case 4: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateConnectionProfileRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.clouddms.v1.CreateConnectionProfileRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.clouddms.v1.CreateConnectionProfileRequest} CreateConnectionProfileRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateConnectionProfileRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateConnectionProfileRequest message. + * @function verify + * @memberof google.cloud.clouddms.v1.CreateConnectionProfileRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateConnectionProfileRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.connectionProfileId != null && message.hasOwnProperty("connectionProfileId")) + if (!$util.isString(message.connectionProfileId)) + return "connectionProfileId: string expected"; + if (message.connectionProfile != null && message.hasOwnProperty("connectionProfile")) { + var error = $root.google.cloud.clouddms.v1.ConnectionProfile.verify(message.connectionProfile); + if (error) + return "connectionProfile." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a CreateConnectionProfileRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.clouddms.v1.CreateConnectionProfileRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.clouddms.v1.CreateConnectionProfileRequest} CreateConnectionProfileRequest + */ + CreateConnectionProfileRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.clouddms.v1.CreateConnectionProfileRequest) + return object; + var message = new $root.google.cloud.clouddms.v1.CreateConnectionProfileRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.connectionProfileId != null) + message.connectionProfileId = String(object.connectionProfileId); + if (object.connectionProfile != null) { + if (typeof object.connectionProfile !== "object") + throw TypeError(".google.cloud.clouddms.v1.CreateConnectionProfileRequest.connectionProfile: object expected"); + message.connectionProfile = $root.google.cloud.clouddms.v1.ConnectionProfile.fromObject(object.connectionProfile); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a CreateConnectionProfileRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.clouddms.v1.CreateConnectionProfileRequest + * @static + * @param {google.cloud.clouddms.v1.CreateConnectionProfileRequest} message CreateConnectionProfileRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateConnectionProfileRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.connectionProfileId = ""; + object.connectionProfile = null; + object.requestId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.connectionProfileId != null && message.hasOwnProperty("connectionProfileId")) + object.connectionProfileId = message.connectionProfileId; + if (message.connectionProfile != null && message.hasOwnProperty("connectionProfile")) + object.connectionProfile = $root.google.cloud.clouddms.v1.ConnectionProfile.toObject(message.connectionProfile, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this CreateConnectionProfileRequest to JSON. + * @function toJSON + * @memberof google.cloud.clouddms.v1.CreateConnectionProfileRequest + * @instance + * @returns {Object.} JSON object + */ + CreateConnectionProfileRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateConnectionProfileRequest + * @function getTypeUrl + * @memberof google.cloud.clouddms.v1.CreateConnectionProfileRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateConnectionProfileRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.clouddms.v1.CreateConnectionProfileRequest"; + }; + + return CreateConnectionProfileRequest; + })(); + + v1.UpdateConnectionProfileRequest = (function() { + + /** + * Properties of an UpdateConnectionProfileRequest. + * @memberof google.cloud.clouddms.v1 + * @interface IUpdateConnectionProfileRequest + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateConnectionProfileRequest updateMask + * @property {google.cloud.clouddms.v1.IConnectionProfile|null} [connectionProfile] UpdateConnectionProfileRequest connectionProfile + * @property {string|null} [requestId] UpdateConnectionProfileRequest requestId + */ + + /** + * Constructs a new UpdateConnectionProfileRequest. + * @memberof google.cloud.clouddms.v1 + * @classdesc Represents an UpdateConnectionProfileRequest. + * @implements IUpdateConnectionProfileRequest + * @constructor + * @param {google.cloud.clouddms.v1.IUpdateConnectionProfileRequest=} [properties] Properties to set + */ + function UpdateConnectionProfileRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateConnectionProfileRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.clouddms.v1.UpdateConnectionProfileRequest + * @instance + */ + UpdateConnectionProfileRequest.prototype.updateMask = null; + + /** + * UpdateConnectionProfileRequest connectionProfile. + * @member {google.cloud.clouddms.v1.IConnectionProfile|null|undefined} connectionProfile + * @memberof google.cloud.clouddms.v1.UpdateConnectionProfileRequest + * @instance + */ + UpdateConnectionProfileRequest.prototype.connectionProfile = null; + + /** + * UpdateConnectionProfileRequest requestId. + * @member {string} requestId + * @memberof google.cloud.clouddms.v1.UpdateConnectionProfileRequest + * @instance + */ + UpdateConnectionProfileRequest.prototype.requestId = ""; + + /** + * Creates a new UpdateConnectionProfileRequest instance using the specified properties. + * @function create + * @memberof google.cloud.clouddms.v1.UpdateConnectionProfileRequest + * @static + * @param {google.cloud.clouddms.v1.IUpdateConnectionProfileRequest=} [properties] Properties to set + * @returns {google.cloud.clouddms.v1.UpdateConnectionProfileRequest} UpdateConnectionProfileRequest instance + */ + UpdateConnectionProfileRequest.create = function create(properties) { + return new UpdateConnectionProfileRequest(properties); + }; + + /** + * Encodes the specified UpdateConnectionProfileRequest message. Does not implicitly {@link google.cloud.clouddms.v1.UpdateConnectionProfileRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.clouddms.v1.UpdateConnectionProfileRequest + * @static + * @param {google.cloud.clouddms.v1.IUpdateConnectionProfileRequest} message UpdateConnectionProfileRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateConnectionProfileRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.connectionProfile != null && Object.hasOwnProperty.call(message, "connectionProfile")) + $root.google.cloud.clouddms.v1.ConnectionProfile.encode(message.connectionProfile, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified UpdateConnectionProfileRequest message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.UpdateConnectionProfileRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.clouddms.v1.UpdateConnectionProfileRequest + * @static + * @param {google.cloud.clouddms.v1.IUpdateConnectionProfileRequest} message UpdateConnectionProfileRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateConnectionProfileRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateConnectionProfileRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.clouddms.v1.UpdateConnectionProfileRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.clouddms.v1.UpdateConnectionProfileRequest} UpdateConnectionProfileRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateConnectionProfileRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.clouddms.v1.UpdateConnectionProfileRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 2: { + message.connectionProfile = $root.google.cloud.clouddms.v1.ConnectionProfile.decode(reader, reader.uint32()); + break; + } + case 3: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateConnectionProfileRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.clouddms.v1.UpdateConnectionProfileRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.clouddms.v1.UpdateConnectionProfileRequest} UpdateConnectionProfileRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateConnectionProfileRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateConnectionProfileRequest message. + * @function verify + * @memberof google.cloud.clouddms.v1.UpdateConnectionProfileRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateConnectionProfileRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.connectionProfile != null && message.hasOwnProperty("connectionProfile")) { + var error = $root.google.cloud.clouddms.v1.ConnectionProfile.verify(message.connectionProfile); + if (error) + return "connectionProfile." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates an UpdateConnectionProfileRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.clouddms.v1.UpdateConnectionProfileRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.clouddms.v1.UpdateConnectionProfileRequest} UpdateConnectionProfileRequest + */ + UpdateConnectionProfileRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.clouddms.v1.UpdateConnectionProfileRequest) + return object; + var message = new $root.google.cloud.clouddms.v1.UpdateConnectionProfileRequest(); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.clouddms.v1.UpdateConnectionProfileRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.connectionProfile != null) { + if (typeof object.connectionProfile !== "object") + throw TypeError(".google.cloud.clouddms.v1.UpdateConnectionProfileRequest.connectionProfile: object expected"); + message.connectionProfile = $root.google.cloud.clouddms.v1.ConnectionProfile.fromObject(object.connectionProfile); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from an UpdateConnectionProfileRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.clouddms.v1.UpdateConnectionProfileRequest + * @static + * @param {google.cloud.clouddms.v1.UpdateConnectionProfileRequest} message UpdateConnectionProfileRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateConnectionProfileRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.updateMask = null; + object.connectionProfile = null; + object.requestId = ""; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.connectionProfile != null && message.hasOwnProperty("connectionProfile")) + object.connectionProfile = $root.google.cloud.clouddms.v1.ConnectionProfile.toObject(message.connectionProfile, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this UpdateConnectionProfileRequest to JSON. + * @function toJSON + * @memberof google.cloud.clouddms.v1.UpdateConnectionProfileRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateConnectionProfileRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateConnectionProfileRequest + * @function getTypeUrl + * @memberof google.cloud.clouddms.v1.UpdateConnectionProfileRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateConnectionProfileRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.clouddms.v1.UpdateConnectionProfileRequest"; + }; + + return UpdateConnectionProfileRequest; + })(); + + v1.DeleteConnectionProfileRequest = (function() { + + /** + * Properties of a DeleteConnectionProfileRequest. + * @memberof google.cloud.clouddms.v1 + * @interface IDeleteConnectionProfileRequest + * @property {string|null} [name] DeleteConnectionProfileRequest name + * @property {string|null} [requestId] DeleteConnectionProfileRequest requestId + * @property {boolean|null} [force] DeleteConnectionProfileRequest force + */ + + /** + * Constructs a new DeleteConnectionProfileRequest. + * @memberof google.cloud.clouddms.v1 + * @classdesc Represents a DeleteConnectionProfileRequest. + * @implements IDeleteConnectionProfileRequest + * @constructor + * @param {google.cloud.clouddms.v1.IDeleteConnectionProfileRequest=} [properties] Properties to set + */ + function DeleteConnectionProfileRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteConnectionProfileRequest name. + * @member {string} name + * @memberof google.cloud.clouddms.v1.DeleteConnectionProfileRequest + * @instance + */ + DeleteConnectionProfileRequest.prototype.name = ""; + + /** + * DeleteConnectionProfileRequest requestId. + * @member {string} requestId + * @memberof google.cloud.clouddms.v1.DeleteConnectionProfileRequest + * @instance + */ + DeleteConnectionProfileRequest.prototype.requestId = ""; + + /** + * DeleteConnectionProfileRequest force. + * @member {boolean} force + * @memberof google.cloud.clouddms.v1.DeleteConnectionProfileRequest + * @instance + */ + DeleteConnectionProfileRequest.prototype.force = false; + + /** + * Creates a new DeleteConnectionProfileRequest instance using the specified properties. + * @function create + * @memberof google.cloud.clouddms.v1.DeleteConnectionProfileRequest + * @static + * @param {google.cloud.clouddms.v1.IDeleteConnectionProfileRequest=} [properties] Properties to set + * @returns {google.cloud.clouddms.v1.DeleteConnectionProfileRequest} DeleteConnectionProfileRequest instance + */ + DeleteConnectionProfileRequest.create = function create(properties) { + return new DeleteConnectionProfileRequest(properties); + }; + + /** + * Encodes the specified DeleteConnectionProfileRequest message. Does not implicitly {@link google.cloud.clouddms.v1.DeleteConnectionProfileRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.clouddms.v1.DeleteConnectionProfileRequest + * @static + * @param {google.cloud.clouddms.v1.IDeleteConnectionProfileRequest} message DeleteConnectionProfileRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteConnectionProfileRequest.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.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); + if (message.force != null && Object.hasOwnProperty.call(message, "force")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.force); + return writer; + }; + + /** + * Encodes the specified DeleteConnectionProfileRequest message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.DeleteConnectionProfileRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.clouddms.v1.DeleteConnectionProfileRequest + * @static + * @param {google.cloud.clouddms.v1.IDeleteConnectionProfileRequest} message DeleteConnectionProfileRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteConnectionProfileRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteConnectionProfileRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.clouddms.v1.DeleteConnectionProfileRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.clouddms.v1.DeleteConnectionProfileRequest} DeleteConnectionProfileRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteConnectionProfileRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.clouddms.v1.DeleteConnectionProfileRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.requestId = reader.string(); + break; + } + case 3: { + message.force = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteConnectionProfileRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.clouddms.v1.DeleteConnectionProfileRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.clouddms.v1.DeleteConnectionProfileRequest} DeleteConnectionProfileRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteConnectionProfileRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteConnectionProfileRequest message. + * @function verify + * @memberof google.cloud.clouddms.v1.DeleteConnectionProfileRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteConnectionProfileRequest.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.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.force != null && message.hasOwnProperty("force")) + if (typeof message.force !== "boolean") + return "force: boolean expected"; + return null; + }; + + /** + * Creates a DeleteConnectionProfileRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.clouddms.v1.DeleteConnectionProfileRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.clouddms.v1.DeleteConnectionProfileRequest} DeleteConnectionProfileRequest + */ + DeleteConnectionProfileRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.clouddms.v1.DeleteConnectionProfileRequest) + return object; + var message = new $root.google.cloud.clouddms.v1.DeleteConnectionProfileRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.force != null) + message.force = Boolean(object.force); + return message; + }; + + /** + * Creates a plain object from a DeleteConnectionProfileRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.clouddms.v1.DeleteConnectionProfileRequest + * @static + * @param {google.cloud.clouddms.v1.DeleteConnectionProfileRequest} message DeleteConnectionProfileRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteConnectionProfileRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.requestId = ""; + object.force = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.force != null && message.hasOwnProperty("force")) + object.force = message.force; + return object; + }; + + /** + * Converts this DeleteConnectionProfileRequest to JSON. + * @function toJSON + * @memberof google.cloud.clouddms.v1.DeleteConnectionProfileRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteConnectionProfileRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteConnectionProfileRequest + * @function getTypeUrl + * @memberof google.cloud.clouddms.v1.DeleteConnectionProfileRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteConnectionProfileRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.clouddms.v1.DeleteConnectionProfileRequest"; + }; + + return DeleteConnectionProfileRequest; + })(); + + v1.OperationMetadata = (function() { + + /** + * Properties of an OperationMetadata. + * @memberof google.cloud.clouddms.v1 + * @interface IOperationMetadata + * @property {google.protobuf.ITimestamp|null} [createTime] OperationMetadata createTime + * @property {google.protobuf.ITimestamp|null} [endTime] OperationMetadata endTime + * @property {string|null} [target] OperationMetadata target + * @property {string|null} [verb] OperationMetadata verb + * @property {string|null} [statusMessage] OperationMetadata statusMessage + * @property {boolean|null} [requestedCancellation] OperationMetadata requestedCancellation + * @property {string|null} [apiVersion] OperationMetadata apiVersion + */ + + /** + * Constructs a new OperationMetadata. + * @memberof google.cloud.clouddms.v1 + * @classdesc Represents an OperationMetadata. + * @implements IOperationMetadata + * @constructor + * @param {google.cloud.clouddms.v1.IOperationMetadata=} [properties] Properties to set + */ + function OperationMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OperationMetadata createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.clouddms.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.createTime = null; + + /** + * OperationMetadata endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.clouddms.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.endTime = null; + + /** + * OperationMetadata target. + * @member {string} target + * @memberof google.cloud.clouddms.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.target = ""; + + /** + * OperationMetadata verb. + * @member {string} verb + * @memberof google.cloud.clouddms.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.verb = ""; + + /** + * OperationMetadata statusMessage. + * @member {string} statusMessage + * @memberof google.cloud.clouddms.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.statusMessage = ""; + + /** + * OperationMetadata requestedCancellation. + * @member {boolean} requestedCancellation + * @memberof google.cloud.clouddms.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.requestedCancellation = false; + + /** + * OperationMetadata apiVersion. + * @member {string} apiVersion + * @memberof google.cloud.clouddms.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.apiVersion = ""; + + /** + * Creates a new OperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.clouddms.v1.OperationMetadata + * @static + * @param {google.cloud.clouddms.v1.IOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.clouddms.v1.OperationMetadata} OperationMetadata instance + */ + OperationMetadata.create = function create(properties) { + return new OperationMetadata(properties); + }; + + /** + * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.clouddms.v1.OperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.clouddms.v1.OperationMetadata + * @static + * @param {google.cloud.clouddms.v1.IOperationMetadata} message OperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.target != null && Object.hasOwnProperty.call(message, "target")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.target); + if (message.verb != null && Object.hasOwnProperty.call(message, "verb")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.verb); + if (message.statusMessage != null && Object.hasOwnProperty.call(message, "statusMessage")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.statusMessage); + if (message.requestedCancellation != null && Object.hasOwnProperty.call(message, "requestedCancellation")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.requestedCancellation); + if (message.apiVersion != null && Object.hasOwnProperty.call(message, "apiVersion")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.apiVersion); + return writer; + }; + + /** + * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.OperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.clouddms.v1.OperationMetadata + * @static + * @param {google.cloud.clouddms.v1.IOperationMetadata} message OperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OperationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.clouddms.v1.OperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.clouddms.v1.OperationMetadata} OperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.clouddms.v1.OperationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 2: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.target = reader.string(); + break; + } + case 4: { + message.verb = reader.string(); + break; + } + case 5: { + message.statusMessage = reader.string(); + break; + } + case 6: { + message.requestedCancellation = reader.bool(); + break; + } + case 7: { + message.apiVersion = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OperationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.clouddms.v1.OperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.clouddms.v1.OperationMetadata} OperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OperationMetadata message. + * @function verify + * @memberof google.cloud.clouddms.v1.OperationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OperationMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + if (message.target != null && message.hasOwnProperty("target")) + if (!$util.isString(message.target)) + return "target: string expected"; + if (message.verb != null && message.hasOwnProperty("verb")) + if (!$util.isString(message.verb)) + return "verb: string expected"; + if (message.statusMessage != null && message.hasOwnProperty("statusMessage")) + if (!$util.isString(message.statusMessage)) + return "statusMessage: string expected"; + if (message.requestedCancellation != null && message.hasOwnProperty("requestedCancellation")) + if (typeof message.requestedCancellation !== "boolean") + return "requestedCancellation: boolean expected"; + if (message.apiVersion != null && message.hasOwnProperty("apiVersion")) + if (!$util.isString(message.apiVersion)) + return "apiVersion: string expected"; + return null; + }; + + /** + * Creates an OperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.clouddms.v1.OperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.clouddms.v1.OperationMetadata} OperationMetadata + */ + OperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.clouddms.v1.OperationMetadata) + return object; + var message = new $root.google.cloud.clouddms.v1.OperationMetadata(); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.clouddms.v1.OperationMetadata.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.cloud.clouddms.v1.OperationMetadata.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + if (object.target != null) + message.target = String(object.target); + if (object.verb != null) + message.verb = String(object.verb); + if (object.statusMessage != null) + message.statusMessage = String(object.statusMessage); + if (object.requestedCancellation != null) + message.requestedCancellation = Boolean(object.requestedCancellation); + if (object.apiVersion != null) + message.apiVersion = String(object.apiVersion); + return message; + }; + + /** + * Creates a plain object from an OperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.clouddms.v1.OperationMetadata + * @static + * @param {google.cloud.clouddms.v1.OperationMetadata} message OperationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OperationMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.createTime = null; + object.endTime = null; + object.target = ""; + object.verb = ""; + object.statusMessage = ""; + object.requestedCancellation = false; + object.apiVersion = ""; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + if (message.target != null && message.hasOwnProperty("target")) + object.target = message.target; + if (message.verb != null && message.hasOwnProperty("verb")) + object.verb = message.verb; + if (message.statusMessage != null && message.hasOwnProperty("statusMessage")) + object.statusMessage = message.statusMessage; + if (message.requestedCancellation != null && message.hasOwnProperty("requestedCancellation")) + object.requestedCancellation = message.requestedCancellation; + if (message.apiVersion != null && message.hasOwnProperty("apiVersion")) + object.apiVersion = message.apiVersion; + return object; + }; + + /** + * Converts this OperationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.clouddms.v1.OperationMetadata + * @instance + * @returns {Object.} JSON object + */ + OperationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OperationMetadata + * @function getTypeUrl + * @memberof google.cloud.clouddms.v1.OperationMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.clouddms.v1.OperationMetadata"; + }; + + return OperationMetadata; + })(); + + v1.SslConfig = (function() { + + /** + * Properties of a SslConfig. + * @memberof google.cloud.clouddms.v1 + * @interface ISslConfig + * @property {google.cloud.clouddms.v1.SslConfig.SslType|null} [type] SslConfig type + * @property {string|null} [clientKey] SslConfig clientKey + * @property {string|null} [clientCertificate] SslConfig clientCertificate + * @property {string|null} [caCertificate] SslConfig caCertificate + */ + + /** + * Constructs a new SslConfig. + * @memberof google.cloud.clouddms.v1 + * @classdesc Represents a SslConfig. + * @implements ISslConfig + * @constructor + * @param {google.cloud.clouddms.v1.ISslConfig=} [properties] Properties to set + */ + function SslConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SslConfig type. + * @member {google.cloud.clouddms.v1.SslConfig.SslType} type + * @memberof google.cloud.clouddms.v1.SslConfig + * @instance + */ + SslConfig.prototype.type = 0; + + /** + * SslConfig clientKey. + * @member {string} clientKey + * @memberof google.cloud.clouddms.v1.SslConfig + * @instance + */ + SslConfig.prototype.clientKey = ""; + + /** + * SslConfig clientCertificate. + * @member {string} clientCertificate + * @memberof google.cloud.clouddms.v1.SslConfig + * @instance + */ + SslConfig.prototype.clientCertificate = ""; + + /** + * SslConfig caCertificate. + * @member {string} caCertificate + * @memberof google.cloud.clouddms.v1.SslConfig + * @instance + */ + SslConfig.prototype.caCertificate = ""; + + /** + * Creates a new SslConfig instance using the specified properties. + * @function create + * @memberof google.cloud.clouddms.v1.SslConfig + * @static + * @param {google.cloud.clouddms.v1.ISslConfig=} [properties] Properties to set + * @returns {google.cloud.clouddms.v1.SslConfig} SslConfig instance + */ + SslConfig.create = function create(properties) { + return new SslConfig(properties); + }; + + /** + * Encodes the specified SslConfig message. Does not implicitly {@link google.cloud.clouddms.v1.SslConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.clouddms.v1.SslConfig + * @static + * @param {google.cloud.clouddms.v1.ISslConfig} message SslConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SslConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.type); + if (message.clientKey != null && Object.hasOwnProperty.call(message, "clientKey")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.clientKey); + if (message.clientCertificate != null && Object.hasOwnProperty.call(message, "clientCertificate")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.clientCertificate); + if (message.caCertificate != null && Object.hasOwnProperty.call(message, "caCertificate")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.caCertificate); + return writer; + }; + + /** + * Encodes the specified SslConfig message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.SslConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.clouddms.v1.SslConfig + * @static + * @param {google.cloud.clouddms.v1.ISslConfig} message SslConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SslConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SslConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.clouddms.v1.SslConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.clouddms.v1.SslConfig} SslConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SslConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.clouddms.v1.SslConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.type = reader.int32(); + break; + } + case 2: { + message.clientKey = reader.string(); + break; + } + case 3: { + message.clientCertificate = reader.string(); + break; + } + case 4: { + message.caCertificate = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SslConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.clouddms.v1.SslConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.clouddms.v1.SslConfig} SslConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SslConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SslConfig message. + * @function verify + * @memberof google.cloud.clouddms.v1.SslConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SslConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.clientKey != null && message.hasOwnProperty("clientKey")) + if (!$util.isString(message.clientKey)) + return "clientKey: string expected"; + if (message.clientCertificate != null && message.hasOwnProperty("clientCertificate")) + if (!$util.isString(message.clientCertificate)) + return "clientCertificate: string expected"; + if (message.caCertificate != null && message.hasOwnProperty("caCertificate")) + if (!$util.isString(message.caCertificate)) + return "caCertificate: string expected"; + return null; + }; + + /** + * Creates a SslConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.clouddms.v1.SslConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.clouddms.v1.SslConfig} SslConfig + */ + SslConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.clouddms.v1.SslConfig) + return object; + var message = new $root.google.cloud.clouddms.v1.SslConfig(); + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "SSL_TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "SERVER_ONLY": + case 1: + message.type = 1; + break; + case "SERVER_CLIENT": + case 2: + message.type = 2; + break; + } + if (object.clientKey != null) + message.clientKey = String(object.clientKey); + if (object.clientCertificate != null) + message.clientCertificate = String(object.clientCertificate); + if (object.caCertificate != null) + message.caCertificate = String(object.caCertificate); + return message; + }; + + /** + * Creates a plain object from a SslConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.clouddms.v1.SslConfig + * @static + * @param {google.cloud.clouddms.v1.SslConfig} message SslConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SslConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type = options.enums === String ? "SSL_TYPE_UNSPECIFIED" : 0; + object.clientKey = ""; + object.clientCertificate = ""; + object.caCertificate = ""; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.clouddms.v1.SslConfig.SslType[message.type] === undefined ? message.type : $root.google.cloud.clouddms.v1.SslConfig.SslType[message.type] : message.type; + if (message.clientKey != null && message.hasOwnProperty("clientKey")) + object.clientKey = message.clientKey; + if (message.clientCertificate != null && message.hasOwnProperty("clientCertificate")) + object.clientCertificate = message.clientCertificate; + if (message.caCertificate != null && message.hasOwnProperty("caCertificate")) + object.caCertificate = message.caCertificate; + return object; + }; + + /** + * Converts this SslConfig to JSON. + * @function toJSON + * @memberof google.cloud.clouddms.v1.SslConfig + * @instance + * @returns {Object.} JSON object + */ + SslConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SslConfig + * @function getTypeUrl + * @memberof google.cloud.clouddms.v1.SslConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SslConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.clouddms.v1.SslConfig"; + }; + + /** + * SslType enum. + * @name google.cloud.clouddms.v1.SslConfig.SslType + * @enum {number} + * @property {number} SSL_TYPE_UNSPECIFIED=0 SSL_TYPE_UNSPECIFIED value + * @property {number} SERVER_ONLY=1 SERVER_ONLY value + * @property {number} SERVER_CLIENT=2 SERVER_CLIENT value + */ + SslConfig.SslType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SSL_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "SERVER_ONLY"] = 1; + values[valuesById[2] = "SERVER_CLIENT"] = 2; + return values; + })(); + + return SslConfig; + })(); + + v1.MySqlConnectionProfile = (function() { + + /** + * Properties of a MySqlConnectionProfile. + * @memberof google.cloud.clouddms.v1 + * @interface IMySqlConnectionProfile + * @property {string|null} [host] MySqlConnectionProfile host + * @property {number|null} [port] MySqlConnectionProfile port + * @property {string|null} [username] MySqlConnectionProfile username + * @property {string|null} [password] MySqlConnectionProfile password + * @property {boolean|null} [passwordSet] MySqlConnectionProfile passwordSet + * @property {google.cloud.clouddms.v1.ISslConfig|null} [ssl] MySqlConnectionProfile ssl + * @property {string|null} [cloudSqlId] MySqlConnectionProfile cloudSqlId + */ + + /** + * Constructs a new MySqlConnectionProfile. + * @memberof google.cloud.clouddms.v1 + * @classdesc Represents a MySqlConnectionProfile. + * @implements IMySqlConnectionProfile + * @constructor + * @param {google.cloud.clouddms.v1.IMySqlConnectionProfile=} [properties] Properties to set + */ + function MySqlConnectionProfile(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MySqlConnectionProfile host. + * @member {string} host + * @memberof google.cloud.clouddms.v1.MySqlConnectionProfile + * @instance + */ + MySqlConnectionProfile.prototype.host = ""; + + /** + * MySqlConnectionProfile port. + * @member {number} port + * @memberof google.cloud.clouddms.v1.MySqlConnectionProfile + * @instance + */ + MySqlConnectionProfile.prototype.port = 0; + + /** + * MySqlConnectionProfile username. + * @member {string} username + * @memberof google.cloud.clouddms.v1.MySqlConnectionProfile + * @instance + */ + MySqlConnectionProfile.prototype.username = ""; + + /** + * MySqlConnectionProfile password. + * @member {string} password + * @memberof google.cloud.clouddms.v1.MySqlConnectionProfile + * @instance + */ + MySqlConnectionProfile.prototype.password = ""; + + /** + * MySqlConnectionProfile passwordSet. + * @member {boolean} passwordSet + * @memberof google.cloud.clouddms.v1.MySqlConnectionProfile + * @instance + */ + MySqlConnectionProfile.prototype.passwordSet = false; + + /** + * MySqlConnectionProfile ssl. + * @member {google.cloud.clouddms.v1.ISslConfig|null|undefined} ssl + * @memberof google.cloud.clouddms.v1.MySqlConnectionProfile + * @instance + */ + MySqlConnectionProfile.prototype.ssl = null; + + /** + * MySqlConnectionProfile cloudSqlId. + * @member {string} cloudSqlId + * @memberof google.cloud.clouddms.v1.MySqlConnectionProfile + * @instance + */ + MySqlConnectionProfile.prototype.cloudSqlId = ""; + + /** + * Creates a new MySqlConnectionProfile instance using the specified properties. + * @function create + * @memberof google.cloud.clouddms.v1.MySqlConnectionProfile + * @static + * @param {google.cloud.clouddms.v1.IMySqlConnectionProfile=} [properties] Properties to set + * @returns {google.cloud.clouddms.v1.MySqlConnectionProfile} MySqlConnectionProfile instance + */ + MySqlConnectionProfile.create = function create(properties) { + return new MySqlConnectionProfile(properties); + }; + + /** + * Encodes the specified MySqlConnectionProfile message. Does not implicitly {@link google.cloud.clouddms.v1.MySqlConnectionProfile.verify|verify} messages. + * @function encode + * @memberof google.cloud.clouddms.v1.MySqlConnectionProfile + * @static + * @param {google.cloud.clouddms.v1.IMySqlConnectionProfile} message MySqlConnectionProfile message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MySqlConnectionProfile.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.host != null && Object.hasOwnProperty.call(message, "host")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.host); + if (message.port != null && Object.hasOwnProperty.call(message, "port")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.port); + if (message.username != null && Object.hasOwnProperty.call(message, "username")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.username); + if (message.password != null && Object.hasOwnProperty.call(message, "password")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.password); + if (message.passwordSet != null && Object.hasOwnProperty.call(message, "passwordSet")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.passwordSet); + if (message.ssl != null && Object.hasOwnProperty.call(message, "ssl")) + $root.google.cloud.clouddms.v1.SslConfig.encode(message.ssl, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.cloudSqlId != null && Object.hasOwnProperty.call(message, "cloudSqlId")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.cloudSqlId); + return writer; + }; + + /** + * Encodes the specified MySqlConnectionProfile message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.MySqlConnectionProfile.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.clouddms.v1.MySqlConnectionProfile + * @static + * @param {google.cloud.clouddms.v1.IMySqlConnectionProfile} message MySqlConnectionProfile message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MySqlConnectionProfile.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MySqlConnectionProfile message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.clouddms.v1.MySqlConnectionProfile + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.clouddms.v1.MySqlConnectionProfile} MySqlConnectionProfile + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MySqlConnectionProfile.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.clouddms.v1.MySqlConnectionProfile(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.host = reader.string(); + break; + } + case 2: { + message.port = reader.int32(); + break; + } + case 3: { + message.username = reader.string(); + break; + } + case 4: { + message.password = reader.string(); + break; + } + case 5: { + message.passwordSet = reader.bool(); + break; + } + case 6: { + message.ssl = $root.google.cloud.clouddms.v1.SslConfig.decode(reader, reader.uint32()); + break; + } + case 7: { + message.cloudSqlId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MySqlConnectionProfile message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.clouddms.v1.MySqlConnectionProfile + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.clouddms.v1.MySqlConnectionProfile} MySqlConnectionProfile + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MySqlConnectionProfile.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MySqlConnectionProfile message. + * @function verify + * @memberof google.cloud.clouddms.v1.MySqlConnectionProfile + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MySqlConnectionProfile.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.host != null && message.hasOwnProperty("host")) + if (!$util.isString(message.host)) + return "host: string expected"; + if (message.port != null && message.hasOwnProperty("port")) + if (!$util.isInteger(message.port)) + return "port: integer expected"; + if (message.username != null && message.hasOwnProperty("username")) + if (!$util.isString(message.username)) + return "username: string expected"; + if (message.password != null && message.hasOwnProperty("password")) + if (!$util.isString(message.password)) + return "password: string expected"; + if (message.passwordSet != null && message.hasOwnProperty("passwordSet")) + if (typeof message.passwordSet !== "boolean") + return "passwordSet: boolean expected"; + if (message.ssl != null && message.hasOwnProperty("ssl")) { + var error = $root.google.cloud.clouddms.v1.SslConfig.verify(message.ssl); + if (error) + return "ssl." + error; + } + if (message.cloudSqlId != null && message.hasOwnProperty("cloudSqlId")) + if (!$util.isString(message.cloudSqlId)) + return "cloudSqlId: string expected"; + return null; + }; + + /** + * Creates a MySqlConnectionProfile message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.clouddms.v1.MySqlConnectionProfile + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.clouddms.v1.MySqlConnectionProfile} MySqlConnectionProfile + */ + MySqlConnectionProfile.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.clouddms.v1.MySqlConnectionProfile) + return object; + var message = new $root.google.cloud.clouddms.v1.MySqlConnectionProfile(); + if (object.host != null) + message.host = String(object.host); + if (object.port != null) + message.port = object.port | 0; + if (object.username != null) + message.username = String(object.username); + if (object.password != null) + message.password = String(object.password); + if (object.passwordSet != null) + message.passwordSet = Boolean(object.passwordSet); + if (object.ssl != null) { + if (typeof object.ssl !== "object") + throw TypeError(".google.cloud.clouddms.v1.MySqlConnectionProfile.ssl: object expected"); + message.ssl = $root.google.cloud.clouddms.v1.SslConfig.fromObject(object.ssl); + } + if (object.cloudSqlId != null) + message.cloudSqlId = String(object.cloudSqlId); + return message; + }; + + /** + * Creates a plain object from a MySqlConnectionProfile message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.clouddms.v1.MySqlConnectionProfile + * @static + * @param {google.cloud.clouddms.v1.MySqlConnectionProfile} message MySqlConnectionProfile + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MySqlConnectionProfile.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.host = ""; + object.port = 0; + object.username = ""; + object.password = ""; + object.passwordSet = false; + object.ssl = null; + object.cloudSqlId = ""; + } + if (message.host != null && message.hasOwnProperty("host")) + object.host = message.host; + if (message.port != null && message.hasOwnProperty("port")) + object.port = message.port; + if (message.username != null && message.hasOwnProperty("username")) + object.username = message.username; + if (message.password != null && message.hasOwnProperty("password")) + object.password = message.password; + if (message.passwordSet != null && message.hasOwnProperty("passwordSet")) + object.passwordSet = message.passwordSet; + if (message.ssl != null && message.hasOwnProperty("ssl")) + object.ssl = $root.google.cloud.clouddms.v1.SslConfig.toObject(message.ssl, options); + if (message.cloudSqlId != null && message.hasOwnProperty("cloudSqlId")) + object.cloudSqlId = message.cloudSqlId; + return object; + }; + + /** + * Converts this MySqlConnectionProfile to JSON. + * @function toJSON + * @memberof google.cloud.clouddms.v1.MySqlConnectionProfile + * @instance + * @returns {Object.} JSON object + */ + MySqlConnectionProfile.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MySqlConnectionProfile + * @function getTypeUrl + * @memberof google.cloud.clouddms.v1.MySqlConnectionProfile + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MySqlConnectionProfile.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.clouddms.v1.MySqlConnectionProfile"; + }; + + return MySqlConnectionProfile; + })(); + + v1.PostgreSqlConnectionProfile = (function() { + + /** + * Properties of a PostgreSqlConnectionProfile. + * @memberof google.cloud.clouddms.v1 + * @interface IPostgreSqlConnectionProfile + * @property {string|null} [host] PostgreSqlConnectionProfile host + * @property {number|null} [port] PostgreSqlConnectionProfile port + * @property {string|null} [username] PostgreSqlConnectionProfile username + * @property {string|null} [password] PostgreSqlConnectionProfile password + * @property {boolean|null} [passwordSet] PostgreSqlConnectionProfile passwordSet + * @property {google.cloud.clouddms.v1.ISslConfig|null} [ssl] PostgreSqlConnectionProfile ssl + * @property {string|null} [cloudSqlId] PostgreSqlConnectionProfile cloudSqlId + */ + + /** + * Constructs a new PostgreSqlConnectionProfile. + * @memberof google.cloud.clouddms.v1 + * @classdesc Represents a PostgreSqlConnectionProfile. + * @implements IPostgreSqlConnectionProfile + * @constructor + * @param {google.cloud.clouddms.v1.IPostgreSqlConnectionProfile=} [properties] Properties to set + */ + function PostgreSqlConnectionProfile(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PostgreSqlConnectionProfile host. + * @member {string} host + * @memberof google.cloud.clouddms.v1.PostgreSqlConnectionProfile + * @instance + */ + PostgreSqlConnectionProfile.prototype.host = ""; + + /** + * PostgreSqlConnectionProfile port. + * @member {number} port + * @memberof google.cloud.clouddms.v1.PostgreSqlConnectionProfile + * @instance + */ + PostgreSqlConnectionProfile.prototype.port = 0; + + /** + * PostgreSqlConnectionProfile username. + * @member {string} username + * @memberof google.cloud.clouddms.v1.PostgreSqlConnectionProfile + * @instance + */ + PostgreSqlConnectionProfile.prototype.username = ""; + + /** + * PostgreSqlConnectionProfile password. + * @member {string} password + * @memberof google.cloud.clouddms.v1.PostgreSqlConnectionProfile + * @instance + */ + PostgreSqlConnectionProfile.prototype.password = ""; + + /** + * PostgreSqlConnectionProfile passwordSet. + * @member {boolean} passwordSet + * @memberof google.cloud.clouddms.v1.PostgreSqlConnectionProfile + * @instance + */ + PostgreSqlConnectionProfile.prototype.passwordSet = false; + + /** + * PostgreSqlConnectionProfile ssl. + * @member {google.cloud.clouddms.v1.ISslConfig|null|undefined} ssl + * @memberof google.cloud.clouddms.v1.PostgreSqlConnectionProfile + * @instance + */ + PostgreSqlConnectionProfile.prototype.ssl = null; + + /** + * PostgreSqlConnectionProfile cloudSqlId. + * @member {string} cloudSqlId + * @memberof google.cloud.clouddms.v1.PostgreSqlConnectionProfile + * @instance + */ + PostgreSqlConnectionProfile.prototype.cloudSqlId = ""; + + /** + * Creates a new PostgreSqlConnectionProfile instance using the specified properties. + * @function create + * @memberof google.cloud.clouddms.v1.PostgreSqlConnectionProfile + * @static + * @param {google.cloud.clouddms.v1.IPostgreSqlConnectionProfile=} [properties] Properties to set + * @returns {google.cloud.clouddms.v1.PostgreSqlConnectionProfile} PostgreSqlConnectionProfile instance + */ + PostgreSqlConnectionProfile.create = function create(properties) { + return new PostgreSqlConnectionProfile(properties); + }; + + /** + * Encodes the specified PostgreSqlConnectionProfile message. Does not implicitly {@link google.cloud.clouddms.v1.PostgreSqlConnectionProfile.verify|verify} messages. + * @function encode + * @memberof google.cloud.clouddms.v1.PostgreSqlConnectionProfile + * @static + * @param {google.cloud.clouddms.v1.IPostgreSqlConnectionProfile} message PostgreSqlConnectionProfile message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PostgreSqlConnectionProfile.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.host != null && Object.hasOwnProperty.call(message, "host")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.host); + if (message.port != null && Object.hasOwnProperty.call(message, "port")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.port); + if (message.username != null && Object.hasOwnProperty.call(message, "username")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.username); + if (message.password != null && Object.hasOwnProperty.call(message, "password")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.password); + if (message.passwordSet != null && Object.hasOwnProperty.call(message, "passwordSet")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.passwordSet); + if (message.ssl != null && Object.hasOwnProperty.call(message, "ssl")) + $root.google.cloud.clouddms.v1.SslConfig.encode(message.ssl, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.cloudSqlId != null && Object.hasOwnProperty.call(message, "cloudSqlId")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.cloudSqlId); + return writer; + }; + + /** + * Encodes the specified PostgreSqlConnectionProfile message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.PostgreSqlConnectionProfile.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.clouddms.v1.PostgreSqlConnectionProfile + * @static + * @param {google.cloud.clouddms.v1.IPostgreSqlConnectionProfile} message PostgreSqlConnectionProfile message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PostgreSqlConnectionProfile.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PostgreSqlConnectionProfile message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.clouddms.v1.PostgreSqlConnectionProfile + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.clouddms.v1.PostgreSqlConnectionProfile} PostgreSqlConnectionProfile + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PostgreSqlConnectionProfile.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.clouddms.v1.PostgreSqlConnectionProfile(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.host = reader.string(); + break; + } + case 2: { + message.port = reader.int32(); + break; + } + case 3: { + message.username = reader.string(); + break; + } + case 4: { + message.password = reader.string(); + break; + } + case 5: { + message.passwordSet = reader.bool(); + break; + } + case 6: { + message.ssl = $root.google.cloud.clouddms.v1.SslConfig.decode(reader, reader.uint32()); + break; + } + case 7: { + message.cloudSqlId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PostgreSqlConnectionProfile message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.clouddms.v1.PostgreSqlConnectionProfile + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.clouddms.v1.PostgreSqlConnectionProfile} PostgreSqlConnectionProfile + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PostgreSqlConnectionProfile.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PostgreSqlConnectionProfile message. + * @function verify + * @memberof google.cloud.clouddms.v1.PostgreSqlConnectionProfile + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PostgreSqlConnectionProfile.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.host != null && message.hasOwnProperty("host")) + if (!$util.isString(message.host)) + return "host: string expected"; + if (message.port != null && message.hasOwnProperty("port")) + if (!$util.isInteger(message.port)) + return "port: integer expected"; + if (message.username != null && message.hasOwnProperty("username")) + if (!$util.isString(message.username)) + return "username: string expected"; + if (message.password != null && message.hasOwnProperty("password")) + if (!$util.isString(message.password)) + return "password: string expected"; + if (message.passwordSet != null && message.hasOwnProperty("passwordSet")) + if (typeof message.passwordSet !== "boolean") + return "passwordSet: boolean expected"; + if (message.ssl != null && message.hasOwnProperty("ssl")) { + var error = $root.google.cloud.clouddms.v1.SslConfig.verify(message.ssl); + if (error) + return "ssl." + error; + } + if (message.cloudSqlId != null && message.hasOwnProperty("cloudSqlId")) + if (!$util.isString(message.cloudSqlId)) + return "cloudSqlId: string expected"; + return null; + }; + + /** + * Creates a PostgreSqlConnectionProfile message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.clouddms.v1.PostgreSqlConnectionProfile + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.clouddms.v1.PostgreSqlConnectionProfile} PostgreSqlConnectionProfile + */ + PostgreSqlConnectionProfile.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.clouddms.v1.PostgreSqlConnectionProfile) + return object; + var message = new $root.google.cloud.clouddms.v1.PostgreSqlConnectionProfile(); + if (object.host != null) + message.host = String(object.host); + if (object.port != null) + message.port = object.port | 0; + if (object.username != null) + message.username = String(object.username); + if (object.password != null) + message.password = String(object.password); + if (object.passwordSet != null) + message.passwordSet = Boolean(object.passwordSet); + if (object.ssl != null) { + if (typeof object.ssl !== "object") + throw TypeError(".google.cloud.clouddms.v1.PostgreSqlConnectionProfile.ssl: object expected"); + message.ssl = $root.google.cloud.clouddms.v1.SslConfig.fromObject(object.ssl); + } + if (object.cloudSqlId != null) + message.cloudSqlId = String(object.cloudSqlId); + return message; + }; + + /** + * Creates a plain object from a PostgreSqlConnectionProfile message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.clouddms.v1.PostgreSqlConnectionProfile + * @static + * @param {google.cloud.clouddms.v1.PostgreSqlConnectionProfile} message PostgreSqlConnectionProfile + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PostgreSqlConnectionProfile.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.host = ""; + object.port = 0; + object.username = ""; + object.password = ""; + object.passwordSet = false; + object.ssl = null; + object.cloudSqlId = ""; + } + if (message.host != null && message.hasOwnProperty("host")) + object.host = message.host; + if (message.port != null && message.hasOwnProperty("port")) + object.port = message.port; + if (message.username != null && message.hasOwnProperty("username")) + object.username = message.username; + if (message.password != null && message.hasOwnProperty("password")) + object.password = message.password; + if (message.passwordSet != null && message.hasOwnProperty("passwordSet")) + object.passwordSet = message.passwordSet; + if (message.ssl != null && message.hasOwnProperty("ssl")) + object.ssl = $root.google.cloud.clouddms.v1.SslConfig.toObject(message.ssl, options); + if (message.cloudSqlId != null && message.hasOwnProperty("cloudSqlId")) + object.cloudSqlId = message.cloudSqlId; + return object; + }; + + /** + * Converts this PostgreSqlConnectionProfile to JSON. + * @function toJSON + * @memberof google.cloud.clouddms.v1.PostgreSqlConnectionProfile + * @instance + * @returns {Object.} JSON object + */ + PostgreSqlConnectionProfile.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PostgreSqlConnectionProfile + * @function getTypeUrl + * @memberof google.cloud.clouddms.v1.PostgreSqlConnectionProfile + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PostgreSqlConnectionProfile.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.clouddms.v1.PostgreSqlConnectionProfile"; + }; + + return PostgreSqlConnectionProfile; + })(); + + v1.CloudSqlConnectionProfile = (function() { + + /** + * Properties of a CloudSqlConnectionProfile. + * @memberof google.cloud.clouddms.v1 + * @interface ICloudSqlConnectionProfile + * @property {string|null} [cloudSqlId] CloudSqlConnectionProfile cloudSqlId + * @property {google.cloud.clouddms.v1.ICloudSqlSettings|null} [settings] CloudSqlConnectionProfile settings + * @property {string|null} [privateIp] CloudSqlConnectionProfile privateIp + * @property {string|null} [publicIp] CloudSqlConnectionProfile publicIp + */ + + /** + * Constructs a new CloudSqlConnectionProfile. + * @memberof google.cloud.clouddms.v1 + * @classdesc Represents a CloudSqlConnectionProfile. + * @implements ICloudSqlConnectionProfile + * @constructor + * @param {google.cloud.clouddms.v1.ICloudSqlConnectionProfile=} [properties] Properties to set + */ + function CloudSqlConnectionProfile(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CloudSqlConnectionProfile cloudSqlId. + * @member {string} cloudSqlId + * @memberof google.cloud.clouddms.v1.CloudSqlConnectionProfile + * @instance + */ + CloudSqlConnectionProfile.prototype.cloudSqlId = ""; + + /** + * CloudSqlConnectionProfile settings. + * @member {google.cloud.clouddms.v1.ICloudSqlSettings|null|undefined} settings + * @memberof google.cloud.clouddms.v1.CloudSqlConnectionProfile + * @instance + */ + CloudSqlConnectionProfile.prototype.settings = null; + + /** + * CloudSqlConnectionProfile privateIp. + * @member {string} privateIp + * @memberof google.cloud.clouddms.v1.CloudSqlConnectionProfile + * @instance + */ + CloudSqlConnectionProfile.prototype.privateIp = ""; + + /** + * CloudSqlConnectionProfile publicIp. + * @member {string} publicIp + * @memberof google.cloud.clouddms.v1.CloudSqlConnectionProfile + * @instance + */ + CloudSqlConnectionProfile.prototype.publicIp = ""; + + /** + * Creates a new CloudSqlConnectionProfile instance using the specified properties. + * @function create + * @memberof google.cloud.clouddms.v1.CloudSqlConnectionProfile + * @static + * @param {google.cloud.clouddms.v1.ICloudSqlConnectionProfile=} [properties] Properties to set + * @returns {google.cloud.clouddms.v1.CloudSqlConnectionProfile} CloudSqlConnectionProfile instance + */ + CloudSqlConnectionProfile.create = function create(properties) { + return new CloudSqlConnectionProfile(properties); + }; + + /** + * Encodes the specified CloudSqlConnectionProfile message. Does not implicitly {@link google.cloud.clouddms.v1.CloudSqlConnectionProfile.verify|verify} messages. + * @function encode + * @memberof google.cloud.clouddms.v1.CloudSqlConnectionProfile + * @static + * @param {google.cloud.clouddms.v1.ICloudSqlConnectionProfile} message CloudSqlConnectionProfile message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloudSqlConnectionProfile.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.cloudSqlId != null && Object.hasOwnProperty.call(message, "cloudSqlId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.cloudSqlId); + if (message.settings != null && Object.hasOwnProperty.call(message, "settings")) + $root.google.cloud.clouddms.v1.CloudSqlSettings.encode(message.settings, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.privateIp != null && Object.hasOwnProperty.call(message, "privateIp")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.privateIp); + if (message.publicIp != null && Object.hasOwnProperty.call(message, "publicIp")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.publicIp); + return writer; + }; + + /** + * Encodes the specified CloudSqlConnectionProfile message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.CloudSqlConnectionProfile.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.clouddms.v1.CloudSqlConnectionProfile + * @static + * @param {google.cloud.clouddms.v1.ICloudSqlConnectionProfile} message CloudSqlConnectionProfile message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloudSqlConnectionProfile.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CloudSqlConnectionProfile message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.clouddms.v1.CloudSqlConnectionProfile + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.clouddms.v1.CloudSqlConnectionProfile} CloudSqlConnectionProfile + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloudSqlConnectionProfile.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.clouddms.v1.CloudSqlConnectionProfile(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.cloudSqlId = reader.string(); + break; + } + case 2: { + message.settings = $root.google.cloud.clouddms.v1.CloudSqlSettings.decode(reader, reader.uint32()); + break; + } + case 3: { + message.privateIp = reader.string(); + break; + } + case 4: { + message.publicIp = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CloudSqlConnectionProfile message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.clouddms.v1.CloudSqlConnectionProfile + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.clouddms.v1.CloudSqlConnectionProfile} CloudSqlConnectionProfile + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloudSqlConnectionProfile.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CloudSqlConnectionProfile message. + * @function verify + * @memberof google.cloud.clouddms.v1.CloudSqlConnectionProfile + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CloudSqlConnectionProfile.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.cloudSqlId != null && message.hasOwnProperty("cloudSqlId")) + if (!$util.isString(message.cloudSqlId)) + return "cloudSqlId: string expected"; + if (message.settings != null && message.hasOwnProperty("settings")) { + var error = $root.google.cloud.clouddms.v1.CloudSqlSettings.verify(message.settings); + if (error) + return "settings." + error; + } + if (message.privateIp != null && message.hasOwnProperty("privateIp")) + if (!$util.isString(message.privateIp)) + return "privateIp: string expected"; + if (message.publicIp != null && message.hasOwnProperty("publicIp")) + if (!$util.isString(message.publicIp)) + return "publicIp: string expected"; + return null; + }; + + /** + * Creates a CloudSqlConnectionProfile message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.clouddms.v1.CloudSqlConnectionProfile + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.clouddms.v1.CloudSqlConnectionProfile} CloudSqlConnectionProfile + */ + CloudSqlConnectionProfile.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.clouddms.v1.CloudSqlConnectionProfile) + return object; + var message = new $root.google.cloud.clouddms.v1.CloudSqlConnectionProfile(); + if (object.cloudSqlId != null) + message.cloudSqlId = String(object.cloudSqlId); + if (object.settings != null) { + if (typeof object.settings !== "object") + throw TypeError(".google.cloud.clouddms.v1.CloudSqlConnectionProfile.settings: object expected"); + message.settings = $root.google.cloud.clouddms.v1.CloudSqlSettings.fromObject(object.settings); + } + if (object.privateIp != null) + message.privateIp = String(object.privateIp); + if (object.publicIp != null) + message.publicIp = String(object.publicIp); + return message; + }; + + /** + * Creates a plain object from a CloudSqlConnectionProfile message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.clouddms.v1.CloudSqlConnectionProfile + * @static + * @param {google.cloud.clouddms.v1.CloudSqlConnectionProfile} message CloudSqlConnectionProfile + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CloudSqlConnectionProfile.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.cloudSqlId = ""; + object.settings = null; + object.privateIp = ""; + object.publicIp = ""; + } + if (message.cloudSqlId != null && message.hasOwnProperty("cloudSqlId")) + object.cloudSqlId = message.cloudSqlId; + if (message.settings != null && message.hasOwnProperty("settings")) + object.settings = $root.google.cloud.clouddms.v1.CloudSqlSettings.toObject(message.settings, options); + if (message.privateIp != null && message.hasOwnProperty("privateIp")) + object.privateIp = message.privateIp; + if (message.publicIp != null && message.hasOwnProperty("publicIp")) + object.publicIp = message.publicIp; + return object; + }; + + /** + * Converts this CloudSqlConnectionProfile to JSON. + * @function toJSON + * @memberof google.cloud.clouddms.v1.CloudSqlConnectionProfile + * @instance + * @returns {Object.} JSON object + */ + CloudSqlConnectionProfile.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CloudSqlConnectionProfile + * @function getTypeUrl + * @memberof google.cloud.clouddms.v1.CloudSqlConnectionProfile + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CloudSqlConnectionProfile.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.clouddms.v1.CloudSqlConnectionProfile"; + }; + + return CloudSqlConnectionProfile; + })(); + + v1.SqlAclEntry = (function() { + + /** + * Properties of a SqlAclEntry. + * @memberof google.cloud.clouddms.v1 + * @interface ISqlAclEntry + * @property {string|null} [value] SqlAclEntry value + * @property {google.protobuf.ITimestamp|null} [expireTime] SqlAclEntry expireTime + * @property {google.protobuf.IDuration|null} [ttl] SqlAclEntry ttl + * @property {string|null} [label] SqlAclEntry label + */ + + /** + * Constructs a new SqlAclEntry. + * @memberof google.cloud.clouddms.v1 + * @classdesc Represents a SqlAclEntry. + * @implements ISqlAclEntry + * @constructor + * @param {google.cloud.clouddms.v1.ISqlAclEntry=} [properties] Properties to set + */ + function SqlAclEntry(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SqlAclEntry value. + * @member {string} value + * @memberof google.cloud.clouddms.v1.SqlAclEntry + * @instance + */ + SqlAclEntry.prototype.value = ""; + + /** + * SqlAclEntry expireTime. + * @member {google.protobuf.ITimestamp|null|undefined} expireTime + * @memberof google.cloud.clouddms.v1.SqlAclEntry + * @instance + */ + SqlAclEntry.prototype.expireTime = null; + + /** + * SqlAclEntry ttl. + * @member {google.protobuf.IDuration|null|undefined} ttl + * @memberof google.cloud.clouddms.v1.SqlAclEntry + * @instance + */ + SqlAclEntry.prototype.ttl = null; + + /** + * SqlAclEntry label. + * @member {string} label + * @memberof google.cloud.clouddms.v1.SqlAclEntry + * @instance + */ + SqlAclEntry.prototype.label = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SqlAclEntry expiration. + * @member {"expireTime"|"ttl"|undefined} expiration + * @memberof google.cloud.clouddms.v1.SqlAclEntry + * @instance + */ + Object.defineProperty(SqlAclEntry.prototype, "expiration", { + get: $util.oneOfGetter($oneOfFields = ["expireTime", "ttl"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SqlAclEntry instance using the specified properties. + * @function create + * @memberof google.cloud.clouddms.v1.SqlAclEntry + * @static + * @param {google.cloud.clouddms.v1.ISqlAclEntry=} [properties] Properties to set + * @returns {google.cloud.clouddms.v1.SqlAclEntry} SqlAclEntry instance + */ + SqlAclEntry.create = function create(properties) { + return new SqlAclEntry(properties); + }; + + /** + * Encodes the specified SqlAclEntry message. Does not implicitly {@link google.cloud.clouddms.v1.SqlAclEntry.verify|verify} messages. + * @function encode + * @memberof google.cloud.clouddms.v1.SqlAclEntry + * @static + * @param {google.cloud.clouddms.v1.ISqlAclEntry} message SqlAclEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SqlAclEntry.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.value); + if (message.label != null && Object.hasOwnProperty.call(message, "label")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.label); + if (message.expireTime != null && Object.hasOwnProperty.call(message, "expireTime")) + $root.google.protobuf.Timestamp.encode(message.expireTime, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.ttl != null && Object.hasOwnProperty.call(message, "ttl")) + $root.google.protobuf.Duration.encode(message.ttl, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SqlAclEntry message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.SqlAclEntry.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.clouddms.v1.SqlAclEntry + * @static + * @param {google.cloud.clouddms.v1.ISqlAclEntry} message SqlAclEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SqlAclEntry.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SqlAclEntry message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.clouddms.v1.SqlAclEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.clouddms.v1.SqlAclEntry} SqlAclEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SqlAclEntry.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.clouddms.v1.SqlAclEntry(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.value = reader.string(); + break; + } + case 10: { + message.expireTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 11: { + message.ttl = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 3: { + message.label = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SqlAclEntry message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.clouddms.v1.SqlAclEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.clouddms.v1.SqlAclEntry} SqlAclEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SqlAclEntry.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SqlAclEntry message. + * @function verify + * @memberof google.cloud.clouddms.v1.SqlAclEntry + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SqlAclEntry.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isString(message.value)) + return "value: string expected"; + if (message.expireTime != null && message.hasOwnProperty("expireTime")) { + properties.expiration = 1; + { + var error = $root.google.protobuf.Timestamp.verify(message.expireTime); + if (error) + return "expireTime." + error; + } + } + if (message.ttl != null && message.hasOwnProperty("ttl")) { + if (properties.expiration === 1) + return "expiration: multiple values"; + properties.expiration = 1; + { + var error = $root.google.protobuf.Duration.verify(message.ttl); + if (error) + return "ttl." + error; + } + } + if (message.label != null && message.hasOwnProperty("label")) + if (!$util.isString(message.label)) + return "label: string expected"; + return null; + }; + + /** + * Creates a SqlAclEntry message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.clouddms.v1.SqlAclEntry + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.clouddms.v1.SqlAclEntry} SqlAclEntry + */ + SqlAclEntry.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.clouddms.v1.SqlAclEntry) + return object; + var message = new $root.google.cloud.clouddms.v1.SqlAclEntry(); + if (object.value != null) + message.value = String(object.value); + if (object.expireTime != null) { + if (typeof object.expireTime !== "object") + throw TypeError(".google.cloud.clouddms.v1.SqlAclEntry.expireTime: object expected"); + message.expireTime = $root.google.protobuf.Timestamp.fromObject(object.expireTime); + } + if (object.ttl != null) { + if (typeof object.ttl !== "object") + throw TypeError(".google.cloud.clouddms.v1.SqlAclEntry.ttl: object expected"); + message.ttl = $root.google.protobuf.Duration.fromObject(object.ttl); + } + if (object.label != null) + message.label = String(object.label); + return message; + }; + + /** + * Creates a plain object from a SqlAclEntry message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.clouddms.v1.SqlAclEntry + * @static + * @param {google.cloud.clouddms.v1.SqlAclEntry} message SqlAclEntry + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SqlAclEntry.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.value = ""; + object.label = ""; + } + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + if (message.label != null && message.hasOwnProperty("label")) + object.label = message.label; + if (message.expireTime != null && message.hasOwnProperty("expireTime")) { + object.expireTime = $root.google.protobuf.Timestamp.toObject(message.expireTime, options); + if (options.oneofs) + object.expiration = "expireTime"; + } + if (message.ttl != null && message.hasOwnProperty("ttl")) { + object.ttl = $root.google.protobuf.Duration.toObject(message.ttl, options); + if (options.oneofs) + object.expiration = "ttl"; + } + return object; + }; + + /** + * Converts this SqlAclEntry to JSON. + * @function toJSON + * @memberof google.cloud.clouddms.v1.SqlAclEntry + * @instance + * @returns {Object.} JSON object + */ + SqlAclEntry.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SqlAclEntry + * @function getTypeUrl + * @memberof google.cloud.clouddms.v1.SqlAclEntry + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SqlAclEntry.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.clouddms.v1.SqlAclEntry"; + }; + + return SqlAclEntry; + })(); + + v1.SqlIpConfig = (function() { + + /** + * Properties of a SqlIpConfig. + * @memberof google.cloud.clouddms.v1 + * @interface ISqlIpConfig + * @property {google.protobuf.IBoolValue|null} [enableIpv4] SqlIpConfig enableIpv4 + * @property {string|null} [privateNetwork] SqlIpConfig privateNetwork + * @property {google.protobuf.IBoolValue|null} [requireSsl] SqlIpConfig requireSsl + * @property {Array.|null} [authorizedNetworks] SqlIpConfig authorizedNetworks + */ + + /** + * Constructs a new SqlIpConfig. + * @memberof google.cloud.clouddms.v1 + * @classdesc Represents a SqlIpConfig. + * @implements ISqlIpConfig + * @constructor + * @param {google.cloud.clouddms.v1.ISqlIpConfig=} [properties] Properties to set + */ + function SqlIpConfig(properties) { + this.authorizedNetworks = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SqlIpConfig enableIpv4. + * @member {google.protobuf.IBoolValue|null|undefined} enableIpv4 + * @memberof google.cloud.clouddms.v1.SqlIpConfig + * @instance + */ + SqlIpConfig.prototype.enableIpv4 = null; + + /** + * SqlIpConfig privateNetwork. + * @member {string} privateNetwork + * @memberof google.cloud.clouddms.v1.SqlIpConfig + * @instance + */ + SqlIpConfig.prototype.privateNetwork = ""; + + /** + * SqlIpConfig requireSsl. + * @member {google.protobuf.IBoolValue|null|undefined} requireSsl + * @memberof google.cloud.clouddms.v1.SqlIpConfig + * @instance + */ + SqlIpConfig.prototype.requireSsl = null; + + /** + * SqlIpConfig authorizedNetworks. + * @member {Array.} authorizedNetworks + * @memberof google.cloud.clouddms.v1.SqlIpConfig + * @instance + */ + SqlIpConfig.prototype.authorizedNetworks = $util.emptyArray; + + /** + * Creates a new SqlIpConfig instance using the specified properties. + * @function create + * @memberof google.cloud.clouddms.v1.SqlIpConfig + * @static + * @param {google.cloud.clouddms.v1.ISqlIpConfig=} [properties] Properties to set + * @returns {google.cloud.clouddms.v1.SqlIpConfig} SqlIpConfig instance + */ + SqlIpConfig.create = function create(properties) { + return new SqlIpConfig(properties); + }; + + /** + * Encodes the specified SqlIpConfig message. Does not implicitly {@link google.cloud.clouddms.v1.SqlIpConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.clouddms.v1.SqlIpConfig + * @static + * @param {google.cloud.clouddms.v1.ISqlIpConfig} message SqlIpConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SqlIpConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.enableIpv4 != null && Object.hasOwnProperty.call(message, "enableIpv4")) + $root.google.protobuf.BoolValue.encode(message.enableIpv4, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.privateNetwork != null && Object.hasOwnProperty.call(message, "privateNetwork")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.privateNetwork); + if (message.requireSsl != null && Object.hasOwnProperty.call(message, "requireSsl")) + $root.google.protobuf.BoolValue.encode(message.requireSsl, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.authorizedNetworks != null && message.authorizedNetworks.length) + for (var i = 0; i < message.authorizedNetworks.length; ++i) + $root.google.cloud.clouddms.v1.SqlAclEntry.encode(message.authorizedNetworks[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SqlIpConfig message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.SqlIpConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.clouddms.v1.SqlIpConfig + * @static + * @param {google.cloud.clouddms.v1.ISqlIpConfig} message SqlIpConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SqlIpConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SqlIpConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.clouddms.v1.SqlIpConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.clouddms.v1.SqlIpConfig} SqlIpConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SqlIpConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.clouddms.v1.SqlIpConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.enableIpv4 = $root.google.protobuf.BoolValue.decode(reader, reader.uint32()); + break; + } + case 2: { + message.privateNetwork = reader.string(); + break; + } + case 3: { + message.requireSsl = $root.google.protobuf.BoolValue.decode(reader, reader.uint32()); + break; + } + case 4: { + if (!(message.authorizedNetworks && message.authorizedNetworks.length)) + message.authorizedNetworks = []; + message.authorizedNetworks.push($root.google.cloud.clouddms.v1.SqlAclEntry.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SqlIpConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.clouddms.v1.SqlIpConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.clouddms.v1.SqlIpConfig} SqlIpConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SqlIpConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SqlIpConfig message. + * @function verify + * @memberof google.cloud.clouddms.v1.SqlIpConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SqlIpConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.enableIpv4 != null && message.hasOwnProperty("enableIpv4")) { + var error = $root.google.protobuf.BoolValue.verify(message.enableIpv4); + if (error) + return "enableIpv4." + error; + } + if (message.privateNetwork != null && message.hasOwnProperty("privateNetwork")) + if (!$util.isString(message.privateNetwork)) + return "privateNetwork: string expected"; + if (message.requireSsl != null && message.hasOwnProperty("requireSsl")) { + var error = $root.google.protobuf.BoolValue.verify(message.requireSsl); + if (error) + return "requireSsl." + error; + } + if (message.authorizedNetworks != null && message.hasOwnProperty("authorizedNetworks")) { + if (!Array.isArray(message.authorizedNetworks)) + return "authorizedNetworks: array expected"; + for (var i = 0; i < message.authorizedNetworks.length; ++i) { + var error = $root.google.cloud.clouddms.v1.SqlAclEntry.verify(message.authorizedNetworks[i]); + if (error) + return "authorizedNetworks." + error; + } + } + return null; + }; + + /** + * Creates a SqlIpConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.clouddms.v1.SqlIpConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.clouddms.v1.SqlIpConfig} SqlIpConfig + */ + SqlIpConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.clouddms.v1.SqlIpConfig) + return object; + var message = new $root.google.cloud.clouddms.v1.SqlIpConfig(); + if (object.enableIpv4 != null) { + if (typeof object.enableIpv4 !== "object") + throw TypeError(".google.cloud.clouddms.v1.SqlIpConfig.enableIpv4: object expected"); + message.enableIpv4 = $root.google.protobuf.BoolValue.fromObject(object.enableIpv4); + } + if (object.privateNetwork != null) + message.privateNetwork = String(object.privateNetwork); + if (object.requireSsl != null) { + if (typeof object.requireSsl !== "object") + throw TypeError(".google.cloud.clouddms.v1.SqlIpConfig.requireSsl: object expected"); + message.requireSsl = $root.google.protobuf.BoolValue.fromObject(object.requireSsl); + } + if (object.authorizedNetworks) { + if (!Array.isArray(object.authorizedNetworks)) + throw TypeError(".google.cloud.clouddms.v1.SqlIpConfig.authorizedNetworks: array expected"); + message.authorizedNetworks = []; + for (var i = 0; i < object.authorizedNetworks.length; ++i) { + if (typeof object.authorizedNetworks[i] !== "object") + throw TypeError(".google.cloud.clouddms.v1.SqlIpConfig.authorizedNetworks: object expected"); + message.authorizedNetworks[i] = $root.google.cloud.clouddms.v1.SqlAclEntry.fromObject(object.authorizedNetworks[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a SqlIpConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.clouddms.v1.SqlIpConfig + * @static + * @param {google.cloud.clouddms.v1.SqlIpConfig} message SqlIpConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SqlIpConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.authorizedNetworks = []; + if (options.defaults) { + object.enableIpv4 = null; + object.privateNetwork = ""; + object.requireSsl = null; + } + if (message.enableIpv4 != null && message.hasOwnProperty("enableIpv4")) + object.enableIpv4 = $root.google.protobuf.BoolValue.toObject(message.enableIpv4, options); + if (message.privateNetwork != null && message.hasOwnProperty("privateNetwork")) + object.privateNetwork = message.privateNetwork; + if (message.requireSsl != null && message.hasOwnProperty("requireSsl")) + object.requireSsl = $root.google.protobuf.BoolValue.toObject(message.requireSsl, options); + if (message.authorizedNetworks && message.authorizedNetworks.length) { + object.authorizedNetworks = []; + for (var j = 0; j < message.authorizedNetworks.length; ++j) + object.authorizedNetworks[j] = $root.google.cloud.clouddms.v1.SqlAclEntry.toObject(message.authorizedNetworks[j], options); + } + return object; + }; + + /** + * Converts this SqlIpConfig to JSON. + * @function toJSON + * @memberof google.cloud.clouddms.v1.SqlIpConfig + * @instance + * @returns {Object.} JSON object + */ + SqlIpConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SqlIpConfig + * @function getTypeUrl + * @memberof google.cloud.clouddms.v1.SqlIpConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SqlIpConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.clouddms.v1.SqlIpConfig"; + }; + + return SqlIpConfig; + })(); + + v1.CloudSqlSettings = (function() { + + /** + * Properties of a CloudSqlSettings. + * @memberof google.cloud.clouddms.v1 + * @interface ICloudSqlSettings + * @property {google.cloud.clouddms.v1.CloudSqlSettings.SqlDatabaseVersion|null} [databaseVersion] CloudSqlSettings databaseVersion + * @property {Object.|null} [userLabels] CloudSqlSettings userLabels + * @property {string|null} [tier] CloudSqlSettings tier + * @property {google.protobuf.IInt64Value|null} [storageAutoResizeLimit] CloudSqlSettings storageAutoResizeLimit + * @property {google.cloud.clouddms.v1.CloudSqlSettings.SqlActivationPolicy|null} [activationPolicy] CloudSqlSettings activationPolicy + * @property {google.cloud.clouddms.v1.ISqlIpConfig|null} [ipConfig] CloudSqlSettings ipConfig + * @property {google.protobuf.IBoolValue|null} [autoStorageIncrease] CloudSqlSettings autoStorageIncrease + * @property {Object.|null} [databaseFlags] CloudSqlSettings databaseFlags + * @property {google.cloud.clouddms.v1.CloudSqlSettings.SqlDataDiskType|null} [dataDiskType] CloudSqlSettings dataDiskType + * @property {google.protobuf.IInt64Value|null} [dataDiskSizeGb] CloudSqlSettings dataDiskSizeGb + * @property {string|null} [zone] CloudSqlSettings zone + * @property {string|null} [sourceId] CloudSqlSettings sourceId + * @property {string|null} [rootPassword] CloudSqlSettings rootPassword + * @property {boolean|null} [rootPasswordSet] CloudSqlSettings rootPasswordSet + * @property {string|null} [collation] CloudSqlSettings collation + */ + + /** + * Constructs a new CloudSqlSettings. + * @memberof google.cloud.clouddms.v1 + * @classdesc Represents a CloudSqlSettings. + * @implements ICloudSqlSettings + * @constructor + * @param {google.cloud.clouddms.v1.ICloudSqlSettings=} [properties] Properties to set + */ + function CloudSqlSettings(properties) { + this.userLabels = {}; + this.databaseFlags = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CloudSqlSettings databaseVersion. + * @member {google.cloud.clouddms.v1.CloudSqlSettings.SqlDatabaseVersion} databaseVersion + * @memberof google.cloud.clouddms.v1.CloudSqlSettings + * @instance + */ + CloudSqlSettings.prototype.databaseVersion = 0; + + /** + * CloudSqlSettings userLabels. + * @member {Object.} userLabels + * @memberof google.cloud.clouddms.v1.CloudSqlSettings + * @instance + */ + CloudSqlSettings.prototype.userLabels = $util.emptyObject; + + /** + * CloudSqlSettings tier. + * @member {string} tier + * @memberof google.cloud.clouddms.v1.CloudSqlSettings + * @instance + */ + CloudSqlSettings.prototype.tier = ""; + + /** + * CloudSqlSettings storageAutoResizeLimit. + * @member {google.protobuf.IInt64Value|null|undefined} storageAutoResizeLimit + * @memberof google.cloud.clouddms.v1.CloudSqlSettings + * @instance + */ + CloudSqlSettings.prototype.storageAutoResizeLimit = null; + + /** + * CloudSqlSettings activationPolicy. + * @member {google.cloud.clouddms.v1.CloudSqlSettings.SqlActivationPolicy} activationPolicy + * @memberof google.cloud.clouddms.v1.CloudSqlSettings + * @instance + */ + CloudSqlSettings.prototype.activationPolicy = 0; + + /** + * CloudSqlSettings ipConfig. + * @member {google.cloud.clouddms.v1.ISqlIpConfig|null|undefined} ipConfig + * @memberof google.cloud.clouddms.v1.CloudSqlSettings + * @instance + */ + CloudSqlSettings.prototype.ipConfig = null; + + /** + * CloudSqlSettings autoStorageIncrease. + * @member {google.protobuf.IBoolValue|null|undefined} autoStorageIncrease + * @memberof google.cloud.clouddms.v1.CloudSqlSettings + * @instance + */ + CloudSqlSettings.prototype.autoStorageIncrease = null; + + /** + * CloudSqlSettings databaseFlags. + * @member {Object.} databaseFlags + * @memberof google.cloud.clouddms.v1.CloudSqlSettings + * @instance + */ + CloudSqlSettings.prototype.databaseFlags = $util.emptyObject; + + /** + * CloudSqlSettings dataDiskType. + * @member {google.cloud.clouddms.v1.CloudSqlSettings.SqlDataDiskType} dataDiskType + * @memberof google.cloud.clouddms.v1.CloudSqlSettings + * @instance + */ + CloudSqlSettings.prototype.dataDiskType = 0; + + /** + * CloudSqlSettings dataDiskSizeGb. + * @member {google.protobuf.IInt64Value|null|undefined} dataDiskSizeGb + * @memberof google.cloud.clouddms.v1.CloudSqlSettings + * @instance + */ + CloudSqlSettings.prototype.dataDiskSizeGb = null; + + /** + * CloudSqlSettings zone. + * @member {string} zone + * @memberof google.cloud.clouddms.v1.CloudSqlSettings + * @instance + */ + CloudSqlSettings.prototype.zone = ""; + + /** + * CloudSqlSettings sourceId. + * @member {string} sourceId + * @memberof google.cloud.clouddms.v1.CloudSqlSettings + * @instance + */ + CloudSqlSettings.prototype.sourceId = ""; + + /** + * CloudSqlSettings rootPassword. + * @member {string} rootPassword + * @memberof google.cloud.clouddms.v1.CloudSqlSettings + * @instance + */ + CloudSqlSettings.prototype.rootPassword = ""; + + /** + * CloudSqlSettings rootPasswordSet. + * @member {boolean} rootPasswordSet + * @memberof google.cloud.clouddms.v1.CloudSqlSettings + * @instance + */ + CloudSqlSettings.prototype.rootPasswordSet = false; + + /** + * CloudSqlSettings collation. + * @member {string} collation + * @memberof google.cloud.clouddms.v1.CloudSqlSettings + * @instance + */ + CloudSqlSettings.prototype.collation = ""; + + /** + * Creates a new CloudSqlSettings instance using the specified properties. + * @function create + * @memberof google.cloud.clouddms.v1.CloudSqlSettings + * @static + * @param {google.cloud.clouddms.v1.ICloudSqlSettings=} [properties] Properties to set + * @returns {google.cloud.clouddms.v1.CloudSqlSettings} CloudSqlSettings instance + */ + CloudSqlSettings.create = function create(properties) { + return new CloudSqlSettings(properties); + }; + + /** + * Encodes the specified CloudSqlSettings message. Does not implicitly {@link google.cloud.clouddms.v1.CloudSqlSettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.clouddms.v1.CloudSqlSettings + * @static + * @param {google.cloud.clouddms.v1.ICloudSqlSettings} message CloudSqlSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloudSqlSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.databaseVersion != null && Object.hasOwnProperty.call(message, "databaseVersion")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.databaseVersion); + if (message.userLabels != null && Object.hasOwnProperty.call(message, "userLabels")) + for (var keys = Object.keys(message.userLabels), 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.userLabels[keys[i]]).ldelim(); + if (message.tier != null && Object.hasOwnProperty.call(message, "tier")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.tier); + if (message.storageAutoResizeLimit != null && Object.hasOwnProperty.call(message, "storageAutoResizeLimit")) + $root.google.protobuf.Int64Value.encode(message.storageAutoResizeLimit, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.activationPolicy != null && Object.hasOwnProperty.call(message, "activationPolicy")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.activationPolicy); + if (message.ipConfig != null && Object.hasOwnProperty.call(message, "ipConfig")) + $root.google.cloud.clouddms.v1.SqlIpConfig.encode(message.ipConfig, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.autoStorageIncrease != null && Object.hasOwnProperty.call(message, "autoStorageIncrease")) + $root.google.protobuf.BoolValue.encode(message.autoStorageIncrease, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.databaseFlags != null && Object.hasOwnProperty.call(message, "databaseFlags")) + for (var keys = Object.keys(message.databaseFlags), i = 0; i < keys.length; ++i) + writer.uint32(/* id 8, wireType 2 =*/66).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.databaseFlags[keys[i]]).ldelim(); + if (message.dataDiskType != null && Object.hasOwnProperty.call(message, "dataDiskType")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.dataDiskType); + if (message.dataDiskSizeGb != null && Object.hasOwnProperty.call(message, "dataDiskSizeGb")) + $root.google.protobuf.Int64Value.encode(message.dataDiskSizeGb, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.zone); + if (message.sourceId != null && Object.hasOwnProperty.call(message, "sourceId")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.sourceId); + if (message.rootPassword != null && Object.hasOwnProperty.call(message, "rootPassword")) + writer.uint32(/* id 13, wireType 2 =*/106).string(message.rootPassword); + if (message.rootPasswordSet != null && Object.hasOwnProperty.call(message, "rootPasswordSet")) + writer.uint32(/* id 14, wireType 0 =*/112).bool(message.rootPasswordSet); + if (message.collation != null && Object.hasOwnProperty.call(message, "collation")) + writer.uint32(/* id 15, wireType 2 =*/122).string(message.collation); + return writer; + }; + + /** + * Encodes the specified CloudSqlSettings message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.CloudSqlSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.clouddms.v1.CloudSqlSettings + * @static + * @param {google.cloud.clouddms.v1.ICloudSqlSettings} message CloudSqlSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloudSqlSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CloudSqlSettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.clouddms.v1.CloudSqlSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.clouddms.v1.CloudSqlSettings} CloudSqlSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloudSqlSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.clouddms.v1.CloudSqlSettings(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.databaseVersion = reader.int32(); + break; + } + case 2: { + if (message.userLabels === $util.emptyObject) + message.userLabels = {}; + 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.userLabels[key] = value; + break; + } + case 3: { + message.tier = reader.string(); + break; + } + case 4: { + message.storageAutoResizeLimit = $root.google.protobuf.Int64Value.decode(reader, reader.uint32()); + break; + } + case 5: { + message.activationPolicy = reader.int32(); + break; + } + case 6: { + message.ipConfig = $root.google.cloud.clouddms.v1.SqlIpConfig.decode(reader, reader.uint32()); + break; + } + case 7: { + message.autoStorageIncrease = $root.google.protobuf.BoolValue.decode(reader, reader.uint32()); + break; + } + case 8: { + if (message.databaseFlags === $util.emptyObject) + message.databaseFlags = {}; + 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.databaseFlags[key] = value; + break; + } + case 9: { + message.dataDiskType = reader.int32(); + break; + } + case 10: { + message.dataDiskSizeGb = $root.google.protobuf.Int64Value.decode(reader, reader.uint32()); + break; + } + case 11: { + message.zone = reader.string(); + break; + } + case 12: { + message.sourceId = reader.string(); + break; + } + case 13: { + message.rootPassword = reader.string(); + break; + } + case 14: { + message.rootPasswordSet = reader.bool(); + break; + } + case 15: { + message.collation = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CloudSqlSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.clouddms.v1.CloudSqlSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.clouddms.v1.CloudSqlSettings} CloudSqlSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloudSqlSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CloudSqlSettings message. + * @function verify + * @memberof google.cloud.clouddms.v1.CloudSqlSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CloudSqlSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.databaseVersion != null && message.hasOwnProperty("databaseVersion")) + switch (message.databaseVersion) { + default: + return "databaseVersion: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + break; + } + if (message.userLabels != null && message.hasOwnProperty("userLabels")) { + if (!$util.isObject(message.userLabels)) + return "userLabels: object expected"; + var key = Object.keys(message.userLabels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.userLabels[key[i]])) + return "userLabels: string{k:string} expected"; + } + if (message.tier != null && message.hasOwnProperty("tier")) + if (!$util.isString(message.tier)) + return "tier: string expected"; + if (message.storageAutoResizeLimit != null && message.hasOwnProperty("storageAutoResizeLimit")) { + var error = $root.google.protobuf.Int64Value.verify(message.storageAutoResizeLimit); + if (error) + return "storageAutoResizeLimit." + error; + } + if (message.activationPolicy != null && message.hasOwnProperty("activationPolicy")) + switch (message.activationPolicy) { + default: + return "activationPolicy: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.ipConfig != null && message.hasOwnProperty("ipConfig")) { + var error = $root.google.cloud.clouddms.v1.SqlIpConfig.verify(message.ipConfig); + if (error) + return "ipConfig." + error; + } + if (message.autoStorageIncrease != null && message.hasOwnProperty("autoStorageIncrease")) { + var error = $root.google.protobuf.BoolValue.verify(message.autoStorageIncrease); + if (error) + return "autoStorageIncrease." + error; + } + if (message.databaseFlags != null && message.hasOwnProperty("databaseFlags")) { + if (!$util.isObject(message.databaseFlags)) + return "databaseFlags: object expected"; + var key = Object.keys(message.databaseFlags); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.databaseFlags[key[i]])) + return "databaseFlags: string{k:string} expected"; + } + if (message.dataDiskType != null && message.hasOwnProperty("dataDiskType")) + switch (message.dataDiskType) { + default: + return "dataDiskType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.dataDiskSizeGb != null && message.hasOwnProperty("dataDiskSizeGb")) { + var error = $root.google.protobuf.Int64Value.verify(message.dataDiskSizeGb); + if (error) + return "dataDiskSizeGb." + error; + } + if (message.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: string expected"; + if (message.sourceId != null && message.hasOwnProperty("sourceId")) + if (!$util.isString(message.sourceId)) + return "sourceId: string expected"; + if (message.rootPassword != null && message.hasOwnProperty("rootPassword")) + if (!$util.isString(message.rootPassword)) + return "rootPassword: string expected"; + if (message.rootPasswordSet != null && message.hasOwnProperty("rootPasswordSet")) + if (typeof message.rootPasswordSet !== "boolean") + return "rootPasswordSet: boolean expected"; + if (message.collation != null && message.hasOwnProperty("collation")) + if (!$util.isString(message.collation)) + return "collation: string expected"; + return null; + }; + + /** + * Creates a CloudSqlSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.clouddms.v1.CloudSqlSettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.clouddms.v1.CloudSqlSettings} CloudSqlSettings + */ + CloudSqlSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.clouddms.v1.CloudSqlSettings) + return object; + var message = new $root.google.cloud.clouddms.v1.CloudSqlSettings(); + switch (object.databaseVersion) { + default: + if (typeof object.databaseVersion === "number") { + message.databaseVersion = object.databaseVersion; + break; + } + break; + case "SQL_DATABASE_VERSION_UNSPECIFIED": + case 0: + message.databaseVersion = 0; + break; + case "MYSQL_5_6": + case 1: + message.databaseVersion = 1; + break; + case "MYSQL_5_7": + case 2: + message.databaseVersion = 2; + break; + case "POSTGRES_9_6": + case 3: + message.databaseVersion = 3; + break; + case "POSTGRES_11": + case 4: + message.databaseVersion = 4; + break; + case "POSTGRES_10": + case 5: + message.databaseVersion = 5; + break; + case "MYSQL_8_0": + case 6: + message.databaseVersion = 6; + break; + case "POSTGRES_12": + case 7: + message.databaseVersion = 7; + break; + case "POSTGRES_13": + case 8: + message.databaseVersion = 8; + break; + } + if (object.userLabels) { + if (typeof object.userLabels !== "object") + throw TypeError(".google.cloud.clouddms.v1.CloudSqlSettings.userLabels: object expected"); + message.userLabels = {}; + for (var keys = Object.keys(object.userLabels), i = 0; i < keys.length; ++i) + message.userLabels[keys[i]] = String(object.userLabels[keys[i]]); + } + if (object.tier != null) + message.tier = String(object.tier); + if (object.storageAutoResizeLimit != null) { + if (typeof object.storageAutoResizeLimit !== "object") + throw TypeError(".google.cloud.clouddms.v1.CloudSqlSettings.storageAutoResizeLimit: object expected"); + message.storageAutoResizeLimit = $root.google.protobuf.Int64Value.fromObject(object.storageAutoResizeLimit); + } + switch (object.activationPolicy) { + default: + if (typeof object.activationPolicy === "number") { + message.activationPolicy = object.activationPolicy; + break; + } + break; + case "SQL_ACTIVATION_POLICY_UNSPECIFIED": + case 0: + message.activationPolicy = 0; + break; + case "ALWAYS": + case 1: + message.activationPolicy = 1; + break; + case "NEVER": + case 2: + message.activationPolicy = 2; + break; + } + if (object.ipConfig != null) { + if (typeof object.ipConfig !== "object") + throw TypeError(".google.cloud.clouddms.v1.CloudSqlSettings.ipConfig: object expected"); + message.ipConfig = $root.google.cloud.clouddms.v1.SqlIpConfig.fromObject(object.ipConfig); + } + if (object.autoStorageIncrease != null) { + if (typeof object.autoStorageIncrease !== "object") + throw TypeError(".google.cloud.clouddms.v1.CloudSqlSettings.autoStorageIncrease: object expected"); + message.autoStorageIncrease = $root.google.protobuf.BoolValue.fromObject(object.autoStorageIncrease); + } + if (object.databaseFlags) { + if (typeof object.databaseFlags !== "object") + throw TypeError(".google.cloud.clouddms.v1.CloudSqlSettings.databaseFlags: object expected"); + message.databaseFlags = {}; + for (var keys = Object.keys(object.databaseFlags), i = 0; i < keys.length; ++i) + message.databaseFlags[keys[i]] = String(object.databaseFlags[keys[i]]); + } + switch (object.dataDiskType) { + default: + if (typeof object.dataDiskType === "number") { + message.dataDiskType = object.dataDiskType; + break; + } + break; + case "SQL_DATA_DISK_TYPE_UNSPECIFIED": + case 0: + message.dataDiskType = 0; + break; + case "PD_SSD": + case 1: + message.dataDiskType = 1; + break; + case "PD_HDD": + case 2: + message.dataDiskType = 2; + break; + } + if (object.dataDiskSizeGb != null) { + if (typeof object.dataDiskSizeGb !== "object") + throw TypeError(".google.cloud.clouddms.v1.CloudSqlSettings.dataDiskSizeGb: object expected"); + message.dataDiskSizeGb = $root.google.protobuf.Int64Value.fromObject(object.dataDiskSizeGb); + } + if (object.zone != null) + message.zone = String(object.zone); + if (object.sourceId != null) + message.sourceId = String(object.sourceId); + if (object.rootPassword != null) + message.rootPassword = String(object.rootPassword); + if (object.rootPasswordSet != null) + message.rootPasswordSet = Boolean(object.rootPasswordSet); + if (object.collation != null) + message.collation = String(object.collation); + return message; + }; + + /** + * Creates a plain object from a CloudSqlSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.clouddms.v1.CloudSqlSettings + * @static + * @param {google.cloud.clouddms.v1.CloudSqlSettings} message CloudSqlSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CloudSqlSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) { + object.userLabels = {}; + object.databaseFlags = {}; + } + if (options.defaults) { + object.databaseVersion = options.enums === String ? "SQL_DATABASE_VERSION_UNSPECIFIED" : 0; + object.tier = ""; + object.storageAutoResizeLimit = null; + object.activationPolicy = options.enums === String ? "SQL_ACTIVATION_POLICY_UNSPECIFIED" : 0; + object.ipConfig = null; + object.autoStorageIncrease = null; + object.dataDiskType = options.enums === String ? "SQL_DATA_DISK_TYPE_UNSPECIFIED" : 0; + object.dataDiskSizeGb = null; + object.zone = ""; + object.sourceId = ""; + object.rootPassword = ""; + object.rootPasswordSet = false; + object.collation = ""; + } + if (message.databaseVersion != null && message.hasOwnProperty("databaseVersion")) + object.databaseVersion = options.enums === String ? $root.google.cloud.clouddms.v1.CloudSqlSettings.SqlDatabaseVersion[message.databaseVersion] === undefined ? message.databaseVersion : $root.google.cloud.clouddms.v1.CloudSqlSettings.SqlDatabaseVersion[message.databaseVersion] : message.databaseVersion; + var keys2; + if (message.userLabels && (keys2 = Object.keys(message.userLabels)).length) { + object.userLabels = {}; + for (var j = 0; j < keys2.length; ++j) + object.userLabels[keys2[j]] = message.userLabels[keys2[j]]; + } + if (message.tier != null && message.hasOwnProperty("tier")) + object.tier = message.tier; + if (message.storageAutoResizeLimit != null && message.hasOwnProperty("storageAutoResizeLimit")) + object.storageAutoResizeLimit = $root.google.protobuf.Int64Value.toObject(message.storageAutoResizeLimit, options); + if (message.activationPolicy != null && message.hasOwnProperty("activationPolicy")) + object.activationPolicy = options.enums === String ? $root.google.cloud.clouddms.v1.CloudSqlSettings.SqlActivationPolicy[message.activationPolicy] === undefined ? message.activationPolicy : $root.google.cloud.clouddms.v1.CloudSqlSettings.SqlActivationPolicy[message.activationPolicy] : message.activationPolicy; + if (message.ipConfig != null && message.hasOwnProperty("ipConfig")) + object.ipConfig = $root.google.cloud.clouddms.v1.SqlIpConfig.toObject(message.ipConfig, options); + if (message.autoStorageIncrease != null && message.hasOwnProperty("autoStorageIncrease")) + object.autoStorageIncrease = $root.google.protobuf.BoolValue.toObject(message.autoStorageIncrease, options); + if (message.databaseFlags && (keys2 = Object.keys(message.databaseFlags)).length) { + object.databaseFlags = {}; + for (var j = 0; j < keys2.length; ++j) + object.databaseFlags[keys2[j]] = message.databaseFlags[keys2[j]]; + } + if (message.dataDiskType != null && message.hasOwnProperty("dataDiskType")) + object.dataDiskType = options.enums === String ? $root.google.cloud.clouddms.v1.CloudSqlSettings.SqlDataDiskType[message.dataDiskType] === undefined ? message.dataDiskType : $root.google.cloud.clouddms.v1.CloudSqlSettings.SqlDataDiskType[message.dataDiskType] : message.dataDiskType; + if (message.dataDiskSizeGb != null && message.hasOwnProperty("dataDiskSizeGb")) + object.dataDiskSizeGb = $root.google.protobuf.Int64Value.toObject(message.dataDiskSizeGb, options); + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + if (message.sourceId != null && message.hasOwnProperty("sourceId")) + object.sourceId = message.sourceId; + if (message.rootPassword != null && message.hasOwnProperty("rootPassword")) + object.rootPassword = message.rootPassword; + if (message.rootPasswordSet != null && message.hasOwnProperty("rootPasswordSet")) + object.rootPasswordSet = message.rootPasswordSet; + if (message.collation != null && message.hasOwnProperty("collation")) + object.collation = message.collation; + return object; + }; + + /** + * Converts this CloudSqlSettings to JSON. + * @function toJSON + * @memberof google.cloud.clouddms.v1.CloudSqlSettings + * @instance + * @returns {Object.} JSON object + */ + CloudSqlSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CloudSqlSettings + * @function getTypeUrl + * @memberof google.cloud.clouddms.v1.CloudSqlSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CloudSqlSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.clouddms.v1.CloudSqlSettings"; + }; + + /** + * SqlActivationPolicy enum. + * @name google.cloud.clouddms.v1.CloudSqlSettings.SqlActivationPolicy + * @enum {number} + * @property {number} SQL_ACTIVATION_POLICY_UNSPECIFIED=0 SQL_ACTIVATION_POLICY_UNSPECIFIED value + * @property {number} ALWAYS=1 ALWAYS value + * @property {number} NEVER=2 NEVER value + */ + CloudSqlSettings.SqlActivationPolicy = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SQL_ACTIVATION_POLICY_UNSPECIFIED"] = 0; + values[valuesById[1] = "ALWAYS"] = 1; + values[valuesById[2] = "NEVER"] = 2; + return values; + })(); + + /** + * SqlDataDiskType enum. + * @name google.cloud.clouddms.v1.CloudSqlSettings.SqlDataDiskType + * @enum {number} + * @property {number} SQL_DATA_DISK_TYPE_UNSPECIFIED=0 SQL_DATA_DISK_TYPE_UNSPECIFIED value + * @property {number} PD_SSD=1 PD_SSD value + * @property {number} PD_HDD=2 PD_HDD value + */ + CloudSqlSettings.SqlDataDiskType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SQL_DATA_DISK_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "PD_SSD"] = 1; + values[valuesById[2] = "PD_HDD"] = 2; + return values; + })(); + + /** + * SqlDatabaseVersion enum. + * @name google.cloud.clouddms.v1.CloudSqlSettings.SqlDatabaseVersion + * @enum {number} + * @property {number} SQL_DATABASE_VERSION_UNSPECIFIED=0 SQL_DATABASE_VERSION_UNSPECIFIED value + * @property {number} MYSQL_5_6=1 MYSQL_5_6 value + * @property {number} MYSQL_5_7=2 MYSQL_5_7 value + * @property {number} POSTGRES_9_6=3 POSTGRES_9_6 value + * @property {number} POSTGRES_11=4 POSTGRES_11 value + * @property {number} POSTGRES_10=5 POSTGRES_10 value + * @property {number} MYSQL_8_0=6 MYSQL_8_0 value + * @property {number} POSTGRES_12=7 POSTGRES_12 value + * @property {number} POSTGRES_13=8 POSTGRES_13 value + */ + CloudSqlSettings.SqlDatabaseVersion = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SQL_DATABASE_VERSION_UNSPECIFIED"] = 0; + values[valuesById[1] = "MYSQL_5_6"] = 1; + values[valuesById[2] = "MYSQL_5_7"] = 2; + values[valuesById[3] = "POSTGRES_9_6"] = 3; + values[valuesById[4] = "POSTGRES_11"] = 4; + values[valuesById[5] = "POSTGRES_10"] = 5; + values[valuesById[6] = "MYSQL_8_0"] = 6; + values[valuesById[7] = "POSTGRES_12"] = 7; + values[valuesById[8] = "POSTGRES_13"] = 8; + return values; + })(); + + return CloudSqlSettings; + })(); + + v1.StaticIpConnectivity = (function() { + + /** + * Properties of a StaticIpConnectivity. + * @memberof google.cloud.clouddms.v1 + * @interface IStaticIpConnectivity + */ + + /** + * Constructs a new StaticIpConnectivity. + * @memberof google.cloud.clouddms.v1 + * @classdesc Represents a StaticIpConnectivity. + * @implements IStaticIpConnectivity + * @constructor + * @param {google.cloud.clouddms.v1.IStaticIpConnectivity=} [properties] Properties to set + */ + function StaticIpConnectivity(properties) { + if (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 StaticIpConnectivity instance using the specified properties. + * @function create + * @memberof google.cloud.clouddms.v1.StaticIpConnectivity + * @static + * @param {google.cloud.clouddms.v1.IStaticIpConnectivity=} [properties] Properties to set + * @returns {google.cloud.clouddms.v1.StaticIpConnectivity} StaticIpConnectivity instance + */ + StaticIpConnectivity.create = function create(properties) { + return new StaticIpConnectivity(properties); + }; + + /** + * Encodes the specified StaticIpConnectivity message. Does not implicitly {@link google.cloud.clouddms.v1.StaticIpConnectivity.verify|verify} messages. + * @function encode + * @memberof google.cloud.clouddms.v1.StaticIpConnectivity + * @static + * @param {google.cloud.clouddms.v1.IStaticIpConnectivity} message StaticIpConnectivity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StaticIpConnectivity.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified StaticIpConnectivity message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.StaticIpConnectivity.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.clouddms.v1.StaticIpConnectivity + * @static + * @param {google.cloud.clouddms.v1.IStaticIpConnectivity} message StaticIpConnectivity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StaticIpConnectivity.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StaticIpConnectivity message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.clouddms.v1.StaticIpConnectivity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.clouddms.v1.StaticIpConnectivity} StaticIpConnectivity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StaticIpConnectivity.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.clouddms.v1.StaticIpConnectivity(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StaticIpConnectivity message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.clouddms.v1.StaticIpConnectivity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.clouddms.v1.StaticIpConnectivity} StaticIpConnectivity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StaticIpConnectivity.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StaticIpConnectivity message. + * @function verify + * @memberof google.cloud.clouddms.v1.StaticIpConnectivity + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StaticIpConnectivity.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a StaticIpConnectivity message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.clouddms.v1.StaticIpConnectivity + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.clouddms.v1.StaticIpConnectivity} StaticIpConnectivity + */ + StaticIpConnectivity.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.clouddms.v1.StaticIpConnectivity) + return object; + return new $root.google.cloud.clouddms.v1.StaticIpConnectivity(); + }; + + /** + * Creates a plain object from a StaticIpConnectivity message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.clouddms.v1.StaticIpConnectivity + * @static + * @param {google.cloud.clouddms.v1.StaticIpConnectivity} message StaticIpConnectivity + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StaticIpConnectivity.toObject = function toObject() { + return {}; + }; + + /** + * Converts this StaticIpConnectivity to JSON. + * @function toJSON + * @memberof google.cloud.clouddms.v1.StaticIpConnectivity + * @instance + * @returns {Object.} JSON object + */ + StaticIpConnectivity.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StaticIpConnectivity + * @function getTypeUrl + * @memberof google.cloud.clouddms.v1.StaticIpConnectivity + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StaticIpConnectivity.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.clouddms.v1.StaticIpConnectivity"; + }; + + return StaticIpConnectivity; + })(); + + v1.ReverseSshConnectivity = (function() { + + /** + * Properties of a ReverseSshConnectivity. + * @memberof google.cloud.clouddms.v1 + * @interface IReverseSshConnectivity + * @property {string|null} [vmIp] ReverseSshConnectivity vmIp + * @property {number|null} [vmPort] ReverseSshConnectivity vmPort + * @property {string|null} [vm] ReverseSshConnectivity vm + * @property {string|null} [vpc] ReverseSshConnectivity vpc + */ + + /** + * Constructs a new ReverseSshConnectivity. + * @memberof google.cloud.clouddms.v1 + * @classdesc Represents a ReverseSshConnectivity. + * @implements IReverseSshConnectivity + * @constructor + * @param {google.cloud.clouddms.v1.IReverseSshConnectivity=} [properties] Properties to set + */ + function ReverseSshConnectivity(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReverseSshConnectivity vmIp. + * @member {string} vmIp + * @memberof google.cloud.clouddms.v1.ReverseSshConnectivity + * @instance + */ + ReverseSshConnectivity.prototype.vmIp = ""; + + /** + * ReverseSshConnectivity vmPort. + * @member {number} vmPort + * @memberof google.cloud.clouddms.v1.ReverseSshConnectivity + * @instance + */ + ReverseSshConnectivity.prototype.vmPort = 0; + + /** + * ReverseSshConnectivity vm. + * @member {string} vm + * @memberof google.cloud.clouddms.v1.ReverseSshConnectivity + * @instance + */ + ReverseSshConnectivity.prototype.vm = ""; + + /** + * ReverseSshConnectivity vpc. + * @member {string} vpc + * @memberof google.cloud.clouddms.v1.ReverseSshConnectivity + * @instance + */ + ReverseSshConnectivity.prototype.vpc = ""; + + /** + * Creates a new ReverseSshConnectivity instance using the specified properties. + * @function create + * @memberof google.cloud.clouddms.v1.ReverseSshConnectivity + * @static + * @param {google.cloud.clouddms.v1.IReverseSshConnectivity=} [properties] Properties to set + * @returns {google.cloud.clouddms.v1.ReverseSshConnectivity} ReverseSshConnectivity instance + */ + ReverseSshConnectivity.create = function create(properties) { + return new ReverseSshConnectivity(properties); + }; + + /** + * Encodes the specified ReverseSshConnectivity message. Does not implicitly {@link google.cloud.clouddms.v1.ReverseSshConnectivity.verify|verify} messages. + * @function encode + * @memberof google.cloud.clouddms.v1.ReverseSshConnectivity + * @static + * @param {google.cloud.clouddms.v1.IReverseSshConnectivity} message ReverseSshConnectivity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReverseSshConnectivity.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.vmIp != null && Object.hasOwnProperty.call(message, "vmIp")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.vmIp); + if (message.vmPort != null && Object.hasOwnProperty.call(message, "vmPort")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.vmPort); + if (message.vm != null && Object.hasOwnProperty.call(message, "vm")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.vm); + if (message.vpc != null && Object.hasOwnProperty.call(message, "vpc")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.vpc); + return writer; + }; + + /** + * Encodes the specified ReverseSshConnectivity message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.ReverseSshConnectivity.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.clouddms.v1.ReverseSshConnectivity + * @static + * @param {google.cloud.clouddms.v1.IReverseSshConnectivity} message ReverseSshConnectivity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReverseSshConnectivity.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReverseSshConnectivity message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.clouddms.v1.ReverseSshConnectivity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.clouddms.v1.ReverseSshConnectivity} ReverseSshConnectivity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReverseSshConnectivity.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.clouddms.v1.ReverseSshConnectivity(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.vmIp = reader.string(); + break; + } + case 2: { + message.vmPort = reader.int32(); + break; + } + case 3: { + message.vm = reader.string(); + break; + } + case 4: { + message.vpc = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReverseSshConnectivity message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.clouddms.v1.ReverseSshConnectivity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.clouddms.v1.ReverseSshConnectivity} ReverseSshConnectivity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReverseSshConnectivity.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReverseSshConnectivity message. + * @function verify + * @memberof google.cloud.clouddms.v1.ReverseSshConnectivity + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReverseSshConnectivity.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.vmIp != null && message.hasOwnProperty("vmIp")) + if (!$util.isString(message.vmIp)) + return "vmIp: string expected"; + if (message.vmPort != null && message.hasOwnProperty("vmPort")) + if (!$util.isInteger(message.vmPort)) + return "vmPort: integer expected"; + if (message.vm != null && message.hasOwnProperty("vm")) + if (!$util.isString(message.vm)) + return "vm: string expected"; + if (message.vpc != null && message.hasOwnProperty("vpc")) + if (!$util.isString(message.vpc)) + return "vpc: string expected"; + return null; + }; + + /** + * Creates a ReverseSshConnectivity message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.clouddms.v1.ReverseSshConnectivity + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.clouddms.v1.ReverseSshConnectivity} ReverseSshConnectivity + */ + ReverseSshConnectivity.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.clouddms.v1.ReverseSshConnectivity) + return object; + var message = new $root.google.cloud.clouddms.v1.ReverseSshConnectivity(); + if (object.vmIp != null) + message.vmIp = String(object.vmIp); + if (object.vmPort != null) + message.vmPort = object.vmPort | 0; + if (object.vm != null) + message.vm = String(object.vm); + if (object.vpc != null) + message.vpc = String(object.vpc); + return message; + }; + + /** + * Creates a plain object from a ReverseSshConnectivity message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.clouddms.v1.ReverseSshConnectivity + * @static + * @param {google.cloud.clouddms.v1.ReverseSshConnectivity} message ReverseSshConnectivity + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReverseSshConnectivity.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.vmIp = ""; + object.vmPort = 0; + object.vm = ""; + object.vpc = ""; + } + if (message.vmIp != null && message.hasOwnProperty("vmIp")) + object.vmIp = message.vmIp; + if (message.vmPort != null && message.hasOwnProperty("vmPort")) + object.vmPort = message.vmPort; + if (message.vm != null && message.hasOwnProperty("vm")) + object.vm = message.vm; + if (message.vpc != null && message.hasOwnProperty("vpc")) + object.vpc = message.vpc; + return object; + }; + + /** + * Converts this ReverseSshConnectivity to JSON. + * @function toJSON + * @memberof google.cloud.clouddms.v1.ReverseSshConnectivity + * @instance + * @returns {Object.} JSON object + */ + ReverseSshConnectivity.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReverseSshConnectivity + * @function getTypeUrl + * @memberof google.cloud.clouddms.v1.ReverseSshConnectivity + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReverseSshConnectivity.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.clouddms.v1.ReverseSshConnectivity"; + }; + + return ReverseSshConnectivity; + })(); + + v1.VpcPeeringConnectivity = (function() { + + /** + * Properties of a VpcPeeringConnectivity. + * @memberof google.cloud.clouddms.v1 + * @interface IVpcPeeringConnectivity + * @property {string|null} [vpc] VpcPeeringConnectivity vpc + */ + + /** + * Constructs a new VpcPeeringConnectivity. + * @memberof google.cloud.clouddms.v1 + * @classdesc Represents a VpcPeeringConnectivity. + * @implements IVpcPeeringConnectivity + * @constructor + * @param {google.cloud.clouddms.v1.IVpcPeeringConnectivity=} [properties] Properties to set + */ + function VpcPeeringConnectivity(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * VpcPeeringConnectivity vpc. + * @member {string} vpc + * @memberof google.cloud.clouddms.v1.VpcPeeringConnectivity + * @instance + */ + VpcPeeringConnectivity.prototype.vpc = ""; + + /** + * Creates a new VpcPeeringConnectivity instance using the specified properties. + * @function create + * @memberof google.cloud.clouddms.v1.VpcPeeringConnectivity + * @static + * @param {google.cloud.clouddms.v1.IVpcPeeringConnectivity=} [properties] Properties to set + * @returns {google.cloud.clouddms.v1.VpcPeeringConnectivity} VpcPeeringConnectivity instance + */ + VpcPeeringConnectivity.create = function create(properties) { + return new VpcPeeringConnectivity(properties); + }; + + /** + * Encodes the specified VpcPeeringConnectivity message. Does not implicitly {@link google.cloud.clouddms.v1.VpcPeeringConnectivity.verify|verify} messages. + * @function encode + * @memberof google.cloud.clouddms.v1.VpcPeeringConnectivity + * @static + * @param {google.cloud.clouddms.v1.IVpcPeeringConnectivity} message VpcPeeringConnectivity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VpcPeeringConnectivity.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.vpc != null && Object.hasOwnProperty.call(message, "vpc")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.vpc); + return writer; + }; + + /** + * Encodes the specified VpcPeeringConnectivity message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.VpcPeeringConnectivity.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.clouddms.v1.VpcPeeringConnectivity + * @static + * @param {google.cloud.clouddms.v1.IVpcPeeringConnectivity} message VpcPeeringConnectivity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VpcPeeringConnectivity.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VpcPeeringConnectivity message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.clouddms.v1.VpcPeeringConnectivity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.clouddms.v1.VpcPeeringConnectivity} VpcPeeringConnectivity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VpcPeeringConnectivity.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.clouddms.v1.VpcPeeringConnectivity(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.vpc = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VpcPeeringConnectivity message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.clouddms.v1.VpcPeeringConnectivity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.clouddms.v1.VpcPeeringConnectivity} VpcPeeringConnectivity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VpcPeeringConnectivity.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VpcPeeringConnectivity message. + * @function verify + * @memberof google.cloud.clouddms.v1.VpcPeeringConnectivity + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VpcPeeringConnectivity.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.vpc != null && message.hasOwnProperty("vpc")) + if (!$util.isString(message.vpc)) + return "vpc: string expected"; + return null; + }; + + /** + * Creates a VpcPeeringConnectivity message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.clouddms.v1.VpcPeeringConnectivity + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.clouddms.v1.VpcPeeringConnectivity} VpcPeeringConnectivity + */ + VpcPeeringConnectivity.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.clouddms.v1.VpcPeeringConnectivity) + return object; + var message = new $root.google.cloud.clouddms.v1.VpcPeeringConnectivity(); + if (object.vpc != null) + message.vpc = String(object.vpc); + return message; + }; + + /** + * Creates a plain object from a VpcPeeringConnectivity message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.clouddms.v1.VpcPeeringConnectivity + * @static + * @param {google.cloud.clouddms.v1.VpcPeeringConnectivity} message VpcPeeringConnectivity + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VpcPeeringConnectivity.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.vpc = ""; + if (message.vpc != null && message.hasOwnProperty("vpc")) + object.vpc = message.vpc; + return object; + }; + + /** + * Converts this VpcPeeringConnectivity to JSON. + * @function toJSON + * @memberof google.cloud.clouddms.v1.VpcPeeringConnectivity + * @instance + * @returns {Object.} JSON object + */ + VpcPeeringConnectivity.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VpcPeeringConnectivity + * @function getTypeUrl + * @memberof google.cloud.clouddms.v1.VpcPeeringConnectivity + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VpcPeeringConnectivity.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.clouddms.v1.VpcPeeringConnectivity"; + }; + + return VpcPeeringConnectivity; + })(); + + v1.DatabaseType = (function() { + + /** + * Properties of a DatabaseType. + * @memberof google.cloud.clouddms.v1 + * @interface IDatabaseType + * @property {google.cloud.clouddms.v1.DatabaseProvider|null} [provider] DatabaseType provider + * @property {google.cloud.clouddms.v1.DatabaseEngine|null} [engine] DatabaseType engine + */ + + /** + * Constructs a new DatabaseType. + * @memberof google.cloud.clouddms.v1 + * @classdesc Represents a DatabaseType. + * @implements IDatabaseType + * @constructor + * @param {google.cloud.clouddms.v1.IDatabaseType=} [properties] Properties to set + */ + function DatabaseType(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DatabaseType provider. + * @member {google.cloud.clouddms.v1.DatabaseProvider} provider + * @memberof google.cloud.clouddms.v1.DatabaseType + * @instance + */ + DatabaseType.prototype.provider = 0; + + /** + * DatabaseType engine. + * @member {google.cloud.clouddms.v1.DatabaseEngine} engine + * @memberof google.cloud.clouddms.v1.DatabaseType + * @instance + */ + DatabaseType.prototype.engine = 0; + + /** + * Creates a new DatabaseType instance using the specified properties. + * @function create + * @memberof google.cloud.clouddms.v1.DatabaseType + * @static + * @param {google.cloud.clouddms.v1.IDatabaseType=} [properties] Properties to set + * @returns {google.cloud.clouddms.v1.DatabaseType} DatabaseType instance + */ + DatabaseType.create = function create(properties) { + return new DatabaseType(properties); + }; + + /** + * Encodes the specified DatabaseType message. Does not implicitly {@link google.cloud.clouddms.v1.DatabaseType.verify|verify} messages. + * @function encode + * @memberof google.cloud.clouddms.v1.DatabaseType + * @static + * @param {google.cloud.clouddms.v1.IDatabaseType} message DatabaseType message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DatabaseType.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.provider != null && Object.hasOwnProperty.call(message, "provider")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.provider); + if (message.engine != null && Object.hasOwnProperty.call(message, "engine")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.engine); + return writer; + }; + + /** + * Encodes the specified DatabaseType message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.DatabaseType.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.clouddms.v1.DatabaseType + * @static + * @param {google.cloud.clouddms.v1.IDatabaseType} message DatabaseType message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DatabaseType.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DatabaseType message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.clouddms.v1.DatabaseType + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.clouddms.v1.DatabaseType} DatabaseType + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DatabaseType.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.clouddms.v1.DatabaseType(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.provider = reader.int32(); + break; + } + case 2: { + message.engine = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DatabaseType message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.clouddms.v1.DatabaseType + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.clouddms.v1.DatabaseType} DatabaseType + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DatabaseType.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DatabaseType message. + * @function verify + * @memberof google.cloud.clouddms.v1.DatabaseType + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DatabaseType.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.provider != null && message.hasOwnProperty("provider")) + switch (message.provider) { + default: + return "provider: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.engine != null && message.hasOwnProperty("engine")) + switch (message.engine) { + default: + return "engine: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a DatabaseType message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.clouddms.v1.DatabaseType + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.clouddms.v1.DatabaseType} DatabaseType + */ + DatabaseType.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.clouddms.v1.DatabaseType) + return object; + var message = new $root.google.cloud.clouddms.v1.DatabaseType(); + switch (object.provider) { + default: + if (typeof object.provider === "number") { + message.provider = object.provider; + break; + } + break; + case "DATABASE_PROVIDER_UNSPECIFIED": + case 0: + message.provider = 0; + break; + case "CLOUDSQL": + case 1: + message.provider = 1; + break; + case "RDS": + case 2: + message.provider = 2; + break; + } + switch (object.engine) { + default: + if (typeof object.engine === "number") { + message.engine = object.engine; + break; + } + break; + case "DATABASE_ENGINE_UNSPECIFIED": + case 0: + message.engine = 0; + break; + case "MYSQL": + case 1: + message.engine = 1; + break; + case "POSTGRESQL": + case 2: + message.engine = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a DatabaseType message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.clouddms.v1.DatabaseType + * @static + * @param {google.cloud.clouddms.v1.DatabaseType} message DatabaseType + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DatabaseType.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.provider = options.enums === String ? "DATABASE_PROVIDER_UNSPECIFIED" : 0; + object.engine = options.enums === String ? "DATABASE_ENGINE_UNSPECIFIED" : 0; + } + if (message.provider != null && message.hasOwnProperty("provider")) + object.provider = options.enums === String ? $root.google.cloud.clouddms.v1.DatabaseProvider[message.provider] === undefined ? message.provider : $root.google.cloud.clouddms.v1.DatabaseProvider[message.provider] : message.provider; + if (message.engine != null && message.hasOwnProperty("engine")) + object.engine = options.enums === String ? $root.google.cloud.clouddms.v1.DatabaseEngine[message.engine] === undefined ? message.engine : $root.google.cloud.clouddms.v1.DatabaseEngine[message.engine] : message.engine; + return object; + }; + + /** + * Converts this DatabaseType to JSON. + * @function toJSON + * @memberof google.cloud.clouddms.v1.DatabaseType + * @instance + * @returns {Object.} JSON object + */ + DatabaseType.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DatabaseType + * @function getTypeUrl + * @memberof google.cloud.clouddms.v1.DatabaseType + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DatabaseType.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.clouddms.v1.DatabaseType"; + }; + + return DatabaseType; + })(); + + v1.MigrationJob = (function() { + + /** + * Properties of a MigrationJob. + * @memberof google.cloud.clouddms.v1 + * @interface IMigrationJob + * @property {string|null} [name] MigrationJob name + * @property {google.protobuf.ITimestamp|null} [createTime] MigrationJob createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] MigrationJob updateTime + * @property {Object.|null} [labels] MigrationJob labels + * @property {string|null} [displayName] MigrationJob displayName + * @property {google.cloud.clouddms.v1.MigrationJob.State|null} [state] MigrationJob state + * @property {google.cloud.clouddms.v1.MigrationJob.Phase|null} [phase] MigrationJob phase + * @property {google.cloud.clouddms.v1.MigrationJob.Type|null} [type] MigrationJob type + * @property {string|null} [dumpPath] MigrationJob dumpPath + * @property {string|null} [source] MigrationJob source + * @property {string|null} [destination] MigrationJob destination + * @property {google.cloud.clouddms.v1.IReverseSshConnectivity|null} [reverseSshConnectivity] MigrationJob reverseSshConnectivity + * @property {google.cloud.clouddms.v1.IVpcPeeringConnectivity|null} [vpcPeeringConnectivity] MigrationJob vpcPeeringConnectivity + * @property {google.cloud.clouddms.v1.IStaticIpConnectivity|null} [staticIpConnectivity] MigrationJob staticIpConnectivity + * @property {google.protobuf.IDuration|null} [duration] MigrationJob duration + * @property {google.rpc.IStatus|null} [error] MigrationJob error + * @property {google.cloud.clouddms.v1.IDatabaseType|null} [sourceDatabase] MigrationJob sourceDatabase + * @property {google.cloud.clouddms.v1.IDatabaseType|null} [destinationDatabase] MigrationJob destinationDatabase + * @property {google.protobuf.ITimestamp|null} [endTime] MigrationJob endTime + */ + + /** + * Constructs a new MigrationJob. + * @memberof google.cloud.clouddms.v1 + * @classdesc Represents a MigrationJob. + * @implements IMigrationJob + * @constructor + * @param {google.cloud.clouddms.v1.IMigrationJob=} [properties] Properties to set + */ + function MigrationJob(properties) { + this.labels = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MigrationJob name. + * @member {string} name + * @memberof google.cloud.clouddms.v1.MigrationJob + * @instance + */ + MigrationJob.prototype.name = ""; + + /** + * MigrationJob createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.clouddms.v1.MigrationJob + * @instance + */ + MigrationJob.prototype.createTime = null; + + /** + * MigrationJob updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.clouddms.v1.MigrationJob + * @instance + */ + MigrationJob.prototype.updateTime = null; + + /** + * MigrationJob labels. + * @member {Object.} labels + * @memberof google.cloud.clouddms.v1.MigrationJob + * @instance + */ + MigrationJob.prototype.labels = $util.emptyObject; + + /** + * MigrationJob displayName. + * @member {string} displayName + * @memberof google.cloud.clouddms.v1.MigrationJob + * @instance + */ + MigrationJob.prototype.displayName = ""; + + /** + * MigrationJob state. + * @member {google.cloud.clouddms.v1.MigrationJob.State} state + * @memberof google.cloud.clouddms.v1.MigrationJob + * @instance + */ + MigrationJob.prototype.state = 0; + + /** + * MigrationJob phase. + * @member {google.cloud.clouddms.v1.MigrationJob.Phase} phase + * @memberof google.cloud.clouddms.v1.MigrationJob + * @instance + */ + MigrationJob.prototype.phase = 0; + + /** + * MigrationJob type. + * @member {google.cloud.clouddms.v1.MigrationJob.Type} type + * @memberof google.cloud.clouddms.v1.MigrationJob + * @instance + */ + MigrationJob.prototype.type = 0; + + /** + * MigrationJob dumpPath. + * @member {string} dumpPath + * @memberof google.cloud.clouddms.v1.MigrationJob + * @instance + */ + MigrationJob.prototype.dumpPath = ""; + + /** + * MigrationJob source. + * @member {string} source + * @memberof google.cloud.clouddms.v1.MigrationJob + * @instance + */ + MigrationJob.prototype.source = ""; + + /** + * MigrationJob destination. + * @member {string} destination + * @memberof google.cloud.clouddms.v1.MigrationJob + * @instance + */ + MigrationJob.prototype.destination = ""; + + /** + * MigrationJob reverseSshConnectivity. + * @member {google.cloud.clouddms.v1.IReverseSshConnectivity|null|undefined} reverseSshConnectivity + * @memberof google.cloud.clouddms.v1.MigrationJob + * @instance + */ + MigrationJob.prototype.reverseSshConnectivity = null; + + /** + * MigrationJob vpcPeeringConnectivity. + * @member {google.cloud.clouddms.v1.IVpcPeeringConnectivity|null|undefined} vpcPeeringConnectivity + * @memberof google.cloud.clouddms.v1.MigrationJob + * @instance + */ + MigrationJob.prototype.vpcPeeringConnectivity = null; + + /** + * MigrationJob staticIpConnectivity. + * @member {google.cloud.clouddms.v1.IStaticIpConnectivity|null|undefined} staticIpConnectivity + * @memberof google.cloud.clouddms.v1.MigrationJob + * @instance + */ + MigrationJob.prototype.staticIpConnectivity = null; + + /** + * MigrationJob duration. + * @member {google.protobuf.IDuration|null|undefined} duration + * @memberof google.cloud.clouddms.v1.MigrationJob + * @instance + */ + MigrationJob.prototype.duration = null; + + /** + * MigrationJob error. + * @member {google.rpc.IStatus|null|undefined} error + * @memberof google.cloud.clouddms.v1.MigrationJob + * @instance + */ + MigrationJob.prototype.error = null; + + /** + * MigrationJob sourceDatabase. + * @member {google.cloud.clouddms.v1.IDatabaseType|null|undefined} sourceDatabase + * @memberof google.cloud.clouddms.v1.MigrationJob + * @instance + */ + MigrationJob.prototype.sourceDatabase = null; + + /** + * MigrationJob destinationDatabase. + * @member {google.cloud.clouddms.v1.IDatabaseType|null|undefined} destinationDatabase + * @memberof google.cloud.clouddms.v1.MigrationJob + * @instance + */ + MigrationJob.prototype.destinationDatabase = null; + + /** + * MigrationJob endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.clouddms.v1.MigrationJob + * @instance + */ + MigrationJob.prototype.endTime = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * MigrationJob connectivity. + * @member {"reverseSshConnectivity"|"vpcPeeringConnectivity"|"staticIpConnectivity"|undefined} connectivity + * @memberof google.cloud.clouddms.v1.MigrationJob + * @instance + */ + Object.defineProperty(MigrationJob.prototype, "connectivity", { + get: $util.oneOfGetter($oneOfFields = ["reverseSshConnectivity", "vpcPeeringConnectivity", "staticIpConnectivity"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new MigrationJob instance using the specified properties. + * @function create + * @memberof google.cloud.clouddms.v1.MigrationJob + * @static + * @param {google.cloud.clouddms.v1.IMigrationJob=} [properties] Properties to set + * @returns {google.cloud.clouddms.v1.MigrationJob} MigrationJob instance + */ + MigrationJob.create = function create(properties) { + return new MigrationJob(properties); + }; + + /** + * Encodes the specified MigrationJob message. Does not implicitly {@link google.cloud.clouddms.v1.MigrationJob.verify|verify} messages. + * @function encode + * @memberof google.cloud.clouddms.v1.MigrationJob + * @static + * @param {google.cloud.clouddms.v1.IMigrationJob} message MigrationJob message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MigrationJob.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.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + 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 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.displayName); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.state); + if (message.phase != null && Object.hasOwnProperty.call(message, "phase")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.phase); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.type); + if (message.dumpPath != null && Object.hasOwnProperty.call(message, "dumpPath")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.dumpPath); + if (message.source != null && Object.hasOwnProperty.call(message, "source")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.source); + if (message.destination != null && Object.hasOwnProperty.call(message, "destination")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.destination); + if (message.duration != null && Object.hasOwnProperty.call(message, "duration")) + $root.google.protobuf.Duration.encode(message.duration, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.error != null && Object.hasOwnProperty.call(message, "error")) + $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.sourceDatabase != null && Object.hasOwnProperty.call(message, "sourceDatabase")) + $root.google.cloud.clouddms.v1.DatabaseType.encode(message.sourceDatabase, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + if (message.destinationDatabase != null && Object.hasOwnProperty.call(message, "destinationDatabase")) + $root.google.cloud.clouddms.v1.DatabaseType.encode(message.destinationDatabase, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 16, wireType 2 =*/130).fork()).ldelim(); + if (message.reverseSshConnectivity != null && Object.hasOwnProperty.call(message, "reverseSshConnectivity")) + $root.google.cloud.clouddms.v1.ReverseSshConnectivity.encode(message.reverseSshConnectivity, writer.uint32(/* id 101, wireType 2 =*/810).fork()).ldelim(); + if (message.vpcPeeringConnectivity != null && Object.hasOwnProperty.call(message, "vpcPeeringConnectivity")) + $root.google.cloud.clouddms.v1.VpcPeeringConnectivity.encode(message.vpcPeeringConnectivity, writer.uint32(/* id 102, wireType 2 =*/818).fork()).ldelim(); + if (message.staticIpConnectivity != null && Object.hasOwnProperty.call(message, "staticIpConnectivity")) + $root.google.cloud.clouddms.v1.StaticIpConnectivity.encode(message.staticIpConnectivity, writer.uint32(/* id 103, wireType 2 =*/826).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MigrationJob message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.MigrationJob.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.clouddms.v1.MigrationJob + * @static + * @param {google.cloud.clouddms.v1.IMigrationJob} message MigrationJob message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MigrationJob.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MigrationJob message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.clouddms.v1.MigrationJob + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.clouddms.v1.MigrationJob} MigrationJob + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MigrationJob.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.clouddms.v1.MigrationJob(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + 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 5: { + message.displayName = reader.string(); + break; + } + case 6: { + message.state = reader.int32(); + break; + } + case 7: { + message.phase = reader.int32(); + break; + } + case 8: { + message.type = reader.int32(); + break; + } + case 9: { + message.dumpPath = reader.string(); + break; + } + case 10: { + message.source = reader.string(); + break; + } + case 11: { + message.destination = reader.string(); + break; + } + case 101: { + message.reverseSshConnectivity = $root.google.cloud.clouddms.v1.ReverseSshConnectivity.decode(reader, reader.uint32()); + break; + } + case 102: { + message.vpcPeeringConnectivity = $root.google.cloud.clouddms.v1.VpcPeeringConnectivity.decode(reader, reader.uint32()); + break; + } + case 103: { + message.staticIpConnectivity = $root.google.cloud.clouddms.v1.StaticIpConnectivity.decode(reader, reader.uint32()); + break; + } + case 12: { + message.duration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 13: { + message.error = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + } + case 14: { + message.sourceDatabase = $root.google.cloud.clouddms.v1.DatabaseType.decode(reader, reader.uint32()); + break; + } + case 15: { + message.destinationDatabase = $root.google.cloud.clouddms.v1.DatabaseType.decode(reader, reader.uint32()); + break; + } + case 16: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MigrationJob message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.clouddms.v1.MigrationJob + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.clouddms.v1.MigrationJob} MigrationJob + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MigrationJob.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MigrationJob message. + * @function verify + * @memberof google.cloud.clouddms.v1.MigrationJob + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MigrationJob.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.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.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + break; + } + if (message.phase != null && message.hasOwnProperty("phase")) + switch (message.phase) { + default: + return "phase: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + 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.dumpPath != null && message.hasOwnProperty("dumpPath")) + if (!$util.isString(message.dumpPath)) + return "dumpPath: string expected"; + if (message.source != null && message.hasOwnProperty("source")) + if (!$util.isString(message.source)) + return "source: string expected"; + if (message.destination != null && message.hasOwnProperty("destination")) + if (!$util.isString(message.destination)) + return "destination: string expected"; + if (message.reverseSshConnectivity != null && message.hasOwnProperty("reverseSshConnectivity")) { + properties.connectivity = 1; + { + var error = $root.google.cloud.clouddms.v1.ReverseSshConnectivity.verify(message.reverseSshConnectivity); + if (error) + return "reverseSshConnectivity." + error; + } + } + if (message.vpcPeeringConnectivity != null && message.hasOwnProperty("vpcPeeringConnectivity")) { + if (properties.connectivity === 1) + return "connectivity: multiple values"; + properties.connectivity = 1; + { + var error = $root.google.cloud.clouddms.v1.VpcPeeringConnectivity.verify(message.vpcPeeringConnectivity); + if (error) + return "vpcPeeringConnectivity." + error; + } + } + if (message.staticIpConnectivity != null && message.hasOwnProperty("staticIpConnectivity")) { + if (properties.connectivity === 1) + return "connectivity: multiple values"; + properties.connectivity = 1; + { + var error = $root.google.cloud.clouddms.v1.StaticIpConnectivity.verify(message.staticIpConnectivity); + if (error) + return "staticIpConnectivity." + error; + } + } + if (message.duration != null && message.hasOwnProperty("duration")) { + var error = $root.google.protobuf.Duration.verify(message.duration); + if (error) + return "duration." + error; + } + if (message.error != null && message.hasOwnProperty("error")) { + var error = $root.google.rpc.Status.verify(message.error); + if (error) + return "error." + error; + } + if (message.sourceDatabase != null && message.hasOwnProperty("sourceDatabase")) { + var error = $root.google.cloud.clouddms.v1.DatabaseType.verify(message.sourceDatabase); + if (error) + return "sourceDatabase." + error; + } + if (message.destinationDatabase != null && message.hasOwnProperty("destinationDatabase")) { + var error = $root.google.cloud.clouddms.v1.DatabaseType.verify(message.destinationDatabase); + if (error) + return "destinationDatabase." + 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 MigrationJob message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.clouddms.v1.MigrationJob + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.clouddms.v1.MigrationJob} MigrationJob + */ + MigrationJob.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.clouddms.v1.MigrationJob) + return object; + var message = new $root.google.cloud.clouddms.v1.MigrationJob(); + if (object.name != null) + message.name = String(object.name); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.clouddms.v1.MigrationJob.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.clouddms.v1.MigrationJob.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.clouddms.v1.MigrationJob.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.displayName != null) + message.displayName = String(object.displayName); + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "MAINTENANCE": + case 1: + message.state = 1; + break; + case "DRAFT": + case 2: + message.state = 2; + break; + case "CREATING": + case 3: + message.state = 3; + break; + case "NOT_STARTED": + case 4: + message.state = 4; + break; + case "RUNNING": + case 5: + message.state = 5; + break; + case "FAILED": + case 6: + message.state = 6; + break; + case "COMPLETED": + case 7: + message.state = 7; + break; + case "DELETING": + case 8: + message.state = 8; + break; + case "STOPPING": + case 9: + message.state = 9; + break; + case "STOPPED": + case 10: + message.state = 10; + break; + case "DELETED": + case 11: + message.state = 11; + break; + case "UPDATING": + case 12: + message.state = 12; + break; + case "STARTING": + case 13: + message.state = 13; + break; + case "RESTARTING": + case 14: + message.state = 14; + break; + case "RESUMING": + case 15: + message.state = 15; + break; + } + switch (object.phase) { + default: + if (typeof object.phase === "number") { + message.phase = object.phase; + break; + } + break; + case "PHASE_UNSPECIFIED": + case 0: + message.phase = 0; + break; + case "FULL_DUMP": + case 1: + message.phase = 1; + break; + case "CDC": + case 2: + message.phase = 2; + break; + case "PROMOTE_IN_PROGRESS": + case 3: + message.phase = 3; + break; + case "WAITING_FOR_SOURCE_WRITES_TO_STOP": + case 4: + message.phase = 4; + break; + case "PREPARING_THE_DUMP": + case 5: + message.phase = 5; + break; + } + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "ONE_TIME": + case 1: + message.type = 1; + break; + case "CONTINUOUS": + case 2: + message.type = 2; + break; + } + if (object.dumpPath != null) + message.dumpPath = String(object.dumpPath); + if (object.source != null) + message.source = String(object.source); + if (object.destination != null) + message.destination = String(object.destination); + if (object.reverseSshConnectivity != null) { + if (typeof object.reverseSshConnectivity !== "object") + throw TypeError(".google.cloud.clouddms.v1.MigrationJob.reverseSshConnectivity: object expected"); + message.reverseSshConnectivity = $root.google.cloud.clouddms.v1.ReverseSshConnectivity.fromObject(object.reverseSshConnectivity); + } + if (object.vpcPeeringConnectivity != null) { + if (typeof object.vpcPeeringConnectivity !== "object") + throw TypeError(".google.cloud.clouddms.v1.MigrationJob.vpcPeeringConnectivity: object expected"); + message.vpcPeeringConnectivity = $root.google.cloud.clouddms.v1.VpcPeeringConnectivity.fromObject(object.vpcPeeringConnectivity); + } + if (object.staticIpConnectivity != null) { + if (typeof object.staticIpConnectivity !== "object") + throw TypeError(".google.cloud.clouddms.v1.MigrationJob.staticIpConnectivity: object expected"); + message.staticIpConnectivity = $root.google.cloud.clouddms.v1.StaticIpConnectivity.fromObject(object.staticIpConnectivity); + } + if (object.duration != null) { + if (typeof object.duration !== "object") + throw TypeError(".google.cloud.clouddms.v1.MigrationJob.duration: object expected"); + message.duration = $root.google.protobuf.Duration.fromObject(object.duration); + } + if (object.error != null) { + if (typeof object.error !== "object") + throw TypeError(".google.cloud.clouddms.v1.MigrationJob.error: object expected"); + message.error = $root.google.rpc.Status.fromObject(object.error); + } + if (object.sourceDatabase != null) { + if (typeof object.sourceDatabase !== "object") + throw TypeError(".google.cloud.clouddms.v1.MigrationJob.sourceDatabase: object expected"); + message.sourceDatabase = $root.google.cloud.clouddms.v1.DatabaseType.fromObject(object.sourceDatabase); + } + if (object.destinationDatabase != null) { + if (typeof object.destinationDatabase !== "object") + throw TypeError(".google.cloud.clouddms.v1.MigrationJob.destinationDatabase: object expected"); + message.destinationDatabase = $root.google.cloud.clouddms.v1.DatabaseType.fromObject(object.destinationDatabase); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.cloud.clouddms.v1.MigrationJob.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + return message; + }; + + /** + * Creates a plain object from a MigrationJob message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.clouddms.v1.MigrationJob + * @static + * @param {google.cloud.clouddms.v1.MigrationJob} message MigrationJob + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MigrationJob.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.createTime = null; + object.updateTime = null; + object.displayName = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.phase = options.enums === String ? "PHASE_UNSPECIFIED" : 0; + object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; + object.dumpPath = ""; + object.source = ""; + object.destination = ""; + object.duration = null; + object.error = null; + object.sourceDatabase = null; + object.destinationDatabase = null; + object.endTime = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + var keys2; + 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.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.clouddms.v1.MigrationJob.State[message.state] === undefined ? message.state : $root.google.cloud.clouddms.v1.MigrationJob.State[message.state] : message.state; + if (message.phase != null && message.hasOwnProperty("phase")) + object.phase = options.enums === String ? $root.google.cloud.clouddms.v1.MigrationJob.Phase[message.phase] === undefined ? message.phase : $root.google.cloud.clouddms.v1.MigrationJob.Phase[message.phase] : message.phase; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.clouddms.v1.MigrationJob.Type[message.type] === undefined ? message.type : $root.google.cloud.clouddms.v1.MigrationJob.Type[message.type] : message.type; + if (message.dumpPath != null && message.hasOwnProperty("dumpPath")) + object.dumpPath = message.dumpPath; + if (message.source != null && message.hasOwnProperty("source")) + object.source = message.source; + if (message.destination != null && message.hasOwnProperty("destination")) + object.destination = message.destination; + if (message.duration != null && message.hasOwnProperty("duration")) + object.duration = $root.google.protobuf.Duration.toObject(message.duration, options); + if (message.error != null && message.hasOwnProperty("error")) + object.error = $root.google.rpc.Status.toObject(message.error, options); + if (message.sourceDatabase != null && message.hasOwnProperty("sourceDatabase")) + object.sourceDatabase = $root.google.cloud.clouddms.v1.DatabaseType.toObject(message.sourceDatabase, options); + if (message.destinationDatabase != null && message.hasOwnProperty("destinationDatabase")) + object.destinationDatabase = $root.google.cloud.clouddms.v1.DatabaseType.toObject(message.destinationDatabase, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + if (message.reverseSshConnectivity != null && message.hasOwnProperty("reverseSshConnectivity")) { + object.reverseSshConnectivity = $root.google.cloud.clouddms.v1.ReverseSshConnectivity.toObject(message.reverseSshConnectivity, options); + if (options.oneofs) + object.connectivity = "reverseSshConnectivity"; + } + if (message.vpcPeeringConnectivity != null && message.hasOwnProperty("vpcPeeringConnectivity")) { + object.vpcPeeringConnectivity = $root.google.cloud.clouddms.v1.VpcPeeringConnectivity.toObject(message.vpcPeeringConnectivity, options); + if (options.oneofs) + object.connectivity = "vpcPeeringConnectivity"; + } + if (message.staticIpConnectivity != null && message.hasOwnProperty("staticIpConnectivity")) { + object.staticIpConnectivity = $root.google.cloud.clouddms.v1.StaticIpConnectivity.toObject(message.staticIpConnectivity, options); + if (options.oneofs) + object.connectivity = "staticIpConnectivity"; + } + return object; + }; + + /** + * Converts this MigrationJob to JSON. + * @function toJSON + * @memberof google.cloud.clouddms.v1.MigrationJob + * @instance + * @returns {Object.} JSON object + */ + MigrationJob.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MigrationJob + * @function getTypeUrl + * @memberof google.cloud.clouddms.v1.MigrationJob + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MigrationJob.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.clouddms.v1.MigrationJob"; + }; + + /** + * State enum. + * @name google.cloud.clouddms.v1.MigrationJob.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} MAINTENANCE=1 MAINTENANCE value + * @property {number} DRAFT=2 DRAFT value + * @property {number} CREATING=3 CREATING value + * @property {number} NOT_STARTED=4 NOT_STARTED value + * @property {number} RUNNING=5 RUNNING value + * @property {number} FAILED=6 FAILED value + * @property {number} COMPLETED=7 COMPLETED value + * @property {number} DELETING=8 DELETING value + * @property {number} STOPPING=9 STOPPING value + * @property {number} STOPPED=10 STOPPED value + * @property {number} DELETED=11 DELETED value + * @property {number} UPDATING=12 UPDATING value + * @property {number} STARTING=13 STARTING value + * @property {number} RESTARTING=14 RESTARTING value + * @property {number} RESUMING=15 RESUMING value + */ + MigrationJob.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "MAINTENANCE"] = 1; + values[valuesById[2] = "DRAFT"] = 2; + values[valuesById[3] = "CREATING"] = 3; + values[valuesById[4] = "NOT_STARTED"] = 4; + values[valuesById[5] = "RUNNING"] = 5; + values[valuesById[6] = "FAILED"] = 6; + values[valuesById[7] = "COMPLETED"] = 7; + values[valuesById[8] = "DELETING"] = 8; + values[valuesById[9] = "STOPPING"] = 9; + values[valuesById[10] = "STOPPED"] = 10; + values[valuesById[11] = "DELETED"] = 11; + values[valuesById[12] = "UPDATING"] = 12; + values[valuesById[13] = "STARTING"] = 13; + values[valuesById[14] = "RESTARTING"] = 14; + values[valuesById[15] = "RESUMING"] = 15; + return values; + })(); + + /** + * Phase enum. + * @name google.cloud.clouddms.v1.MigrationJob.Phase + * @enum {number} + * @property {number} PHASE_UNSPECIFIED=0 PHASE_UNSPECIFIED value + * @property {number} FULL_DUMP=1 FULL_DUMP value + * @property {number} CDC=2 CDC value + * @property {number} PROMOTE_IN_PROGRESS=3 PROMOTE_IN_PROGRESS value + * @property {number} WAITING_FOR_SOURCE_WRITES_TO_STOP=4 WAITING_FOR_SOURCE_WRITES_TO_STOP value + * @property {number} PREPARING_THE_DUMP=5 PREPARING_THE_DUMP value + */ + MigrationJob.Phase = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PHASE_UNSPECIFIED"] = 0; + values[valuesById[1] = "FULL_DUMP"] = 1; + values[valuesById[2] = "CDC"] = 2; + values[valuesById[3] = "PROMOTE_IN_PROGRESS"] = 3; + values[valuesById[4] = "WAITING_FOR_SOURCE_WRITES_TO_STOP"] = 4; + values[valuesById[5] = "PREPARING_THE_DUMP"] = 5; + return values; + })(); + + /** + * Type enum. + * @name google.cloud.clouddms.v1.MigrationJob.Type + * @enum {number} + * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value + * @property {number} ONE_TIME=1 ONE_TIME value + * @property {number} CONTINUOUS=2 CONTINUOUS value + */ + MigrationJob.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ONE_TIME"] = 1; + values[valuesById[2] = "CONTINUOUS"] = 2; + return values; + })(); + + return MigrationJob; + })(); + + v1.ConnectionProfile = (function() { + + /** + * Properties of a ConnectionProfile. + * @memberof google.cloud.clouddms.v1 + * @interface IConnectionProfile + * @property {string|null} [name] ConnectionProfile name + * @property {google.protobuf.ITimestamp|null} [createTime] ConnectionProfile createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] ConnectionProfile updateTime + * @property {Object.|null} [labels] ConnectionProfile labels + * @property {google.cloud.clouddms.v1.ConnectionProfile.State|null} [state] ConnectionProfile state + * @property {string|null} [displayName] ConnectionProfile displayName + * @property {google.cloud.clouddms.v1.IMySqlConnectionProfile|null} [mysql] ConnectionProfile mysql + * @property {google.cloud.clouddms.v1.IPostgreSqlConnectionProfile|null} [postgresql] ConnectionProfile postgresql + * @property {google.cloud.clouddms.v1.ICloudSqlConnectionProfile|null} [cloudsql] ConnectionProfile cloudsql + * @property {google.rpc.IStatus|null} [error] ConnectionProfile error + * @property {google.cloud.clouddms.v1.DatabaseProvider|null} [provider] ConnectionProfile provider + */ + + /** + * Constructs a new ConnectionProfile. + * @memberof google.cloud.clouddms.v1 + * @classdesc Represents a ConnectionProfile. + * @implements IConnectionProfile + * @constructor + * @param {google.cloud.clouddms.v1.IConnectionProfile=} [properties] Properties to set + */ + function ConnectionProfile(properties) { + this.labels = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ConnectionProfile name. + * @member {string} name + * @memberof google.cloud.clouddms.v1.ConnectionProfile + * @instance + */ + ConnectionProfile.prototype.name = ""; + + /** + * ConnectionProfile createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.clouddms.v1.ConnectionProfile + * @instance + */ + ConnectionProfile.prototype.createTime = null; + + /** + * ConnectionProfile updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.clouddms.v1.ConnectionProfile + * @instance + */ + ConnectionProfile.prototype.updateTime = null; + + /** + * ConnectionProfile labels. + * @member {Object.} labels + * @memberof google.cloud.clouddms.v1.ConnectionProfile + * @instance + */ + ConnectionProfile.prototype.labels = $util.emptyObject; + + /** + * ConnectionProfile state. + * @member {google.cloud.clouddms.v1.ConnectionProfile.State} state + * @memberof google.cloud.clouddms.v1.ConnectionProfile + * @instance + */ + ConnectionProfile.prototype.state = 0; + + /** + * ConnectionProfile displayName. + * @member {string} displayName + * @memberof google.cloud.clouddms.v1.ConnectionProfile + * @instance + */ + ConnectionProfile.prototype.displayName = ""; + + /** + * ConnectionProfile mysql. + * @member {google.cloud.clouddms.v1.IMySqlConnectionProfile|null|undefined} mysql + * @memberof google.cloud.clouddms.v1.ConnectionProfile + * @instance + */ + ConnectionProfile.prototype.mysql = null; + + /** + * ConnectionProfile postgresql. + * @member {google.cloud.clouddms.v1.IPostgreSqlConnectionProfile|null|undefined} postgresql + * @memberof google.cloud.clouddms.v1.ConnectionProfile + * @instance + */ + ConnectionProfile.prototype.postgresql = null; + + /** + * ConnectionProfile cloudsql. + * @member {google.cloud.clouddms.v1.ICloudSqlConnectionProfile|null|undefined} cloudsql + * @memberof google.cloud.clouddms.v1.ConnectionProfile + * @instance + */ + ConnectionProfile.prototype.cloudsql = null; + + /** + * ConnectionProfile error. + * @member {google.rpc.IStatus|null|undefined} error + * @memberof google.cloud.clouddms.v1.ConnectionProfile + * @instance + */ + ConnectionProfile.prototype.error = null; + + /** + * ConnectionProfile provider. + * @member {google.cloud.clouddms.v1.DatabaseProvider} provider + * @memberof google.cloud.clouddms.v1.ConnectionProfile + * @instance + */ + ConnectionProfile.prototype.provider = 0; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ConnectionProfile connectionProfile. + * @member {"mysql"|"postgresql"|"cloudsql"|undefined} connectionProfile + * @memberof google.cloud.clouddms.v1.ConnectionProfile + * @instance + */ + Object.defineProperty(ConnectionProfile.prototype, "connectionProfile", { + get: $util.oneOfGetter($oneOfFields = ["mysql", "postgresql", "cloudsql"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ConnectionProfile instance using the specified properties. + * @function create + * @memberof google.cloud.clouddms.v1.ConnectionProfile + * @static + * @param {google.cloud.clouddms.v1.IConnectionProfile=} [properties] Properties to set + * @returns {google.cloud.clouddms.v1.ConnectionProfile} ConnectionProfile instance + */ + ConnectionProfile.create = function create(properties) { + return new ConnectionProfile(properties); + }; + + /** + * Encodes the specified ConnectionProfile message. Does not implicitly {@link google.cloud.clouddms.v1.ConnectionProfile.verify|verify} messages. + * @function encode + * @memberof google.cloud.clouddms.v1.ConnectionProfile + * @static + * @param {google.cloud.clouddms.v1.IConnectionProfile} message ConnectionProfile message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConnectionProfile.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.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + 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 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.state); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.displayName); + if (message.error != null && Object.hasOwnProperty.call(message, "error")) + $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.provider != null && Object.hasOwnProperty.call(message, "provider")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.provider); + if (message.mysql != null && Object.hasOwnProperty.call(message, "mysql")) + $root.google.cloud.clouddms.v1.MySqlConnectionProfile.encode(message.mysql, writer.uint32(/* id 100, wireType 2 =*/802).fork()).ldelim(); + if (message.postgresql != null && Object.hasOwnProperty.call(message, "postgresql")) + $root.google.cloud.clouddms.v1.PostgreSqlConnectionProfile.encode(message.postgresql, writer.uint32(/* id 101, wireType 2 =*/810).fork()).ldelim(); + if (message.cloudsql != null && Object.hasOwnProperty.call(message, "cloudsql")) + $root.google.cloud.clouddms.v1.CloudSqlConnectionProfile.encode(message.cloudsql, writer.uint32(/* id 102, wireType 2 =*/818).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ConnectionProfile message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.ConnectionProfile.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.clouddms.v1.ConnectionProfile + * @static + * @param {google.cloud.clouddms.v1.IConnectionProfile} message ConnectionProfile message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConnectionProfile.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ConnectionProfile message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.clouddms.v1.ConnectionProfile + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.clouddms.v1.ConnectionProfile} ConnectionProfile + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConnectionProfile.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.clouddms.v1.ConnectionProfile(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + 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 5: { + message.state = reader.int32(); + break; + } + case 6: { + message.displayName = reader.string(); + break; + } + case 100: { + message.mysql = $root.google.cloud.clouddms.v1.MySqlConnectionProfile.decode(reader, reader.uint32()); + break; + } + case 101: { + message.postgresql = $root.google.cloud.clouddms.v1.PostgreSqlConnectionProfile.decode(reader, reader.uint32()); + break; + } + case 102: { + message.cloudsql = $root.google.cloud.clouddms.v1.CloudSqlConnectionProfile.decode(reader, reader.uint32()); + break; + } + case 7: { + message.error = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + } + case 8: { + message.provider = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ConnectionProfile message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.clouddms.v1.ConnectionProfile + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.clouddms.v1.ConnectionProfile} ConnectionProfile + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConnectionProfile.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ConnectionProfile message. + * @function verify + * @memberof google.cloud.clouddms.v1.ConnectionProfile + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ConnectionProfile.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.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.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: + case 6: + case 7: + break; + } + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.mysql != null && message.hasOwnProperty("mysql")) { + properties.connectionProfile = 1; + { + var error = $root.google.cloud.clouddms.v1.MySqlConnectionProfile.verify(message.mysql); + if (error) + return "mysql." + error; + } + } + if (message.postgresql != null && message.hasOwnProperty("postgresql")) { + if (properties.connectionProfile === 1) + return "connectionProfile: multiple values"; + properties.connectionProfile = 1; + { + var error = $root.google.cloud.clouddms.v1.PostgreSqlConnectionProfile.verify(message.postgresql); + if (error) + return "postgresql." + error; + } + } + if (message.cloudsql != null && message.hasOwnProperty("cloudsql")) { + if (properties.connectionProfile === 1) + return "connectionProfile: multiple values"; + properties.connectionProfile = 1; + { + var error = $root.google.cloud.clouddms.v1.CloudSqlConnectionProfile.verify(message.cloudsql); + if (error) + return "cloudsql." + error; + } + } + if (message.error != null && message.hasOwnProperty("error")) { + var error = $root.google.rpc.Status.verify(message.error); + if (error) + return "error." + error; + } + if (message.provider != null && message.hasOwnProperty("provider")) + switch (message.provider) { + default: + return "provider: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a ConnectionProfile message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.clouddms.v1.ConnectionProfile + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.clouddms.v1.ConnectionProfile} ConnectionProfile + */ + ConnectionProfile.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.clouddms.v1.ConnectionProfile) + return object; + var message = new $root.google.cloud.clouddms.v1.ConnectionProfile(); + if (object.name != null) + message.name = String(object.name); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.clouddms.v1.ConnectionProfile.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.clouddms.v1.ConnectionProfile.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.clouddms.v1.ConnectionProfile.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]]); + } + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "DRAFT": + case 1: + message.state = 1; + break; + case "CREATING": + case 2: + message.state = 2; + break; + case "READY": + case 3: + message.state = 3; + break; + case "UPDATING": + case 4: + message.state = 4; + break; + case "DELETING": + case 5: + message.state = 5; + break; + case "DELETED": + case 6: + message.state = 6; + break; + case "FAILED": + case 7: + message.state = 7; + break; + } + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.mysql != null) { + if (typeof object.mysql !== "object") + throw TypeError(".google.cloud.clouddms.v1.ConnectionProfile.mysql: object expected"); + message.mysql = $root.google.cloud.clouddms.v1.MySqlConnectionProfile.fromObject(object.mysql); + } + if (object.postgresql != null) { + if (typeof object.postgresql !== "object") + throw TypeError(".google.cloud.clouddms.v1.ConnectionProfile.postgresql: object expected"); + message.postgresql = $root.google.cloud.clouddms.v1.PostgreSqlConnectionProfile.fromObject(object.postgresql); + } + if (object.cloudsql != null) { + if (typeof object.cloudsql !== "object") + throw TypeError(".google.cloud.clouddms.v1.ConnectionProfile.cloudsql: object expected"); + message.cloudsql = $root.google.cloud.clouddms.v1.CloudSqlConnectionProfile.fromObject(object.cloudsql); + } + if (object.error != null) { + if (typeof object.error !== "object") + throw TypeError(".google.cloud.clouddms.v1.ConnectionProfile.error: object expected"); + message.error = $root.google.rpc.Status.fromObject(object.error); + } + switch (object.provider) { + default: + if (typeof object.provider === "number") { + message.provider = object.provider; + break; + } + break; + case "DATABASE_PROVIDER_UNSPECIFIED": + case 0: + message.provider = 0; + break; + case "CLOUDSQL": + case 1: + message.provider = 1; + break; + case "RDS": + case 2: + message.provider = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a ConnectionProfile message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.clouddms.v1.ConnectionProfile + * @static + * @param {google.cloud.clouddms.v1.ConnectionProfile} message ConnectionProfile + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ConnectionProfile.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.createTime = null; + object.updateTime = null; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.displayName = ""; + object.error = null; + object.provider = options.enums === String ? "DATABASE_PROVIDER_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + var keys2; + 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.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.clouddms.v1.ConnectionProfile.State[message.state] === undefined ? message.state : $root.google.cloud.clouddms.v1.ConnectionProfile.State[message.state] : message.state; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.error != null && message.hasOwnProperty("error")) + object.error = $root.google.rpc.Status.toObject(message.error, options); + if (message.provider != null && message.hasOwnProperty("provider")) + object.provider = options.enums === String ? $root.google.cloud.clouddms.v1.DatabaseProvider[message.provider] === undefined ? message.provider : $root.google.cloud.clouddms.v1.DatabaseProvider[message.provider] : message.provider; + if (message.mysql != null && message.hasOwnProperty("mysql")) { + object.mysql = $root.google.cloud.clouddms.v1.MySqlConnectionProfile.toObject(message.mysql, options); + if (options.oneofs) + object.connectionProfile = "mysql"; + } + if (message.postgresql != null && message.hasOwnProperty("postgresql")) { + object.postgresql = $root.google.cloud.clouddms.v1.PostgreSqlConnectionProfile.toObject(message.postgresql, options); + if (options.oneofs) + object.connectionProfile = "postgresql"; + } + if (message.cloudsql != null && message.hasOwnProperty("cloudsql")) { + object.cloudsql = $root.google.cloud.clouddms.v1.CloudSqlConnectionProfile.toObject(message.cloudsql, options); + if (options.oneofs) + object.connectionProfile = "cloudsql"; + } + return object; + }; + + /** + * Converts this ConnectionProfile to JSON. + * @function toJSON + * @memberof google.cloud.clouddms.v1.ConnectionProfile + * @instance + * @returns {Object.} JSON object + */ + ConnectionProfile.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ConnectionProfile + * @function getTypeUrl + * @memberof google.cloud.clouddms.v1.ConnectionProfile + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ConnectionProfile.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.clouddms.v1.ConnectionProfile"; + }; + + /** + * State enum. + * @name google.cloud.clouddms.v1.ConnectionProfile.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} DRAFT=1 DRAFT value + * @property {number} CREATING=2 CREATING value + * @property {number} READY=3 READY value + * @property {number} UPDATING=4 UPDATING value + * @property {number} DELETING=5 DELETING value + * @property {number} DELETED=6 DELETED value + * @property {number} FAILED=7 FAILED value + */ + ConnectionProfile.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "DRAFT"] = 1; + values[valuesById[2] = "CREATING"] = 2; + values[valuesById[3] = "READY"] = 3; + values[valuesById[4] = "UPDATING"] = 4; + values[valuesById[5] = "DELETING"] = 5; + values[valuesById[6] = "DELETED"] = 6; + values[valuesById[7] = "FAILED"] = 7; + return values; + })(); + + return ConnectionProfile; + })(); + + v1.MigrationJobVerificationError = (function() { + + /** + * Properties of a MigrationJobVerificationError. + * @memberof google.cloud.clouddms.v1 + * @interface IMigrationJobVerificationError + * @property {google.cloud.clouddms.v1.MigrationJobVerificationError.ErrorCode|null} [errorCode] MigrationJobVerificationError errorCode + * @property {string|null} [errorMessage] MigrationJobVerificationError errorMessage + * @property {string|null} [errorDetailMessage] MigrationJobVerificationError errorDetailMessage + */ + + /** + * Constructs a new MigrationJobVerificationError. + * @memberof google.cloud.clouddms.v1 + * @classdesc Represents a MigrationJobVerificationError. + * @implements IMigrationJobVerificationError + * @constructor + * @param {google.cloud.clouddms.v1.IMigrationJobVerificationError=} [properties] Properties to set + */ + function MigrationJobVerificationError(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MigrationJobVerificationError errorCode. + * @member {google.cloud.clouddms.v1.MigrationJobVerificationError.ErrorCode} errorCode + * @memberof google.cloud.clouddms.v1.MigrationJobVerificationError + * @instance + */ + MigrationJobVerificationError.prototype.errorCode = 0; + + /** + * MigrationJobVerificationError errorMessage. + * @member {string} errorMessage + * @memberof google.cloud.clouddms.v1.MigrationJobVerificationError + * @instance + */ + MigrationJobVerificationError.prototype.errorMessage = ""; + + /** + * MigrationJobVerificationError errorDetailMessage. + * @member {string} errorDetailMessage + * @memberof google.cloud.clouddms.v1.MigrationJobVerificationError + * @instance + */ + MigrationJobVerificationError.prototype.errorDetailMessage = ""; + + /** + * Creates a new MigrationJobVerificationError instance using the specified properties. + * @function create + * @memberof google.cloud.clouddms.v1.MigrationJobVerificationError + * @static + * @param {google.cloud.clouddms.v1.IMigrationJobVerificationError=} [properties] Properties to set + * @returns {google.cloud.clouddms.v1.MigrationJobVerificationError} MigrationJobVerificationError instance + */ + MigrationJobVerificationError.create = function create(properties) { + return new MigrationJobVerificationError(properties); + }; + + /** + * Encodes the specified MigrationJobVerificationError message. Does not implicitly {@link google.cloud.clouddms.v1.MigrationJobVerificationError.verify|verify} messages. + * @function encode + * @memberof google.cloud.clouddms.v1.MigrationJobVerificationError + * @static + * @param {google.cloud.clouddms.v1.IMigrationJobVerificationError} message MigrationJobVerificationError message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MigrationJobVerificationError.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.errorCode != null && Object.hasOwnProperty.call(message, "errorCode")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.errorCode); + if (message.errorMessage != null && Object.hasOwnProperty.call(message, "errorMessage")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.errorMessage); + if (message.errorDetailMessage != null && Object.hasOwnProperty.call(message, "errorDetailMessage")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.errorDetailMessage); + return writer; + }; + + /** + * Encodes the specified MigrationJobVerificationError message, length delimited. Does not implicitly {@link google.cloud.clouddms.v1.MigrationJobVerificationError.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.clouddms.v1.MigrationJobVerificationError + * @static + * @param {google.cloud.clouddms.v1.IMigrationJobVerificationError} message MigrationJobVerificationError message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MigrationJobVerificationError.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MigrationJobVerificationError message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.clouddms.v1.MigrationJobVerificationError + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.clouddms.v1.MigrationJobVerificationError} MigrationJobVerificationError + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MigrationJobVerificationError.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.clouddms.v1.MigrationJobVerificationError(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.errorCode = reader.int32(); + break; + } + case 2: { + message.errorMessage = reader.string(); + break; + } + case 3: { + message.errorDetailMessage = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MigrationJobVerificationError message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.clouddms.v1.MigrationJobVerificationError + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.clouddms.v1.MigrationJobVerificationError} MigrationJobVerificationError + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MigrationJobVerificationError.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MigrationJobVerificationError message. + * @function verify + * @memberof google.cloud.clouddms.v1.MigrationJobVerificationError + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MigrationJobVerificationError.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.errorCode != null && message.hasOwnProperty("errorCode")) + switch (message.errorCode) { + default: + return "errorCode: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + case 17: + case 18: + case 19: + case 21: + break; + } + if (message.errorMessage != null && message.hasOwnProperty("errorMessage")) + if (!$util.isString(message.errorMessage)) + return "errorMessage: string expected"; + if (message.errorDetailMessage != null && message.hasOwnProperty("errorDetailMessage")) + if (!$util.isString(message.errorDetailMessage)) + return "errorDetailMessage: string expected"; + return null; + }; + + /** + * Creates a MigrationJobVerificationError message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.clouddms.v1.MigrationJobVerificationError + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.clouddms.v1.MigrationJobVerificationError} MigrationJobVerificationError + */ + MigrationJobVerificationError.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.clouddms.v1.MigrationJobVerificationError) + return object; + var message = new $root.google.cloud.clouddms.v1.MigrationJobVerificationError(); + switch (object.errorCode) { + default: + if (typeof object.errorCode === "number") { + message.errorCode = object.errorCode; + break; + } + break; + case "ERROR_CODE_UNSPECIFIED": + case 0: + message.errorCode = 0; + break; + case "CONNECTION_FAILURE": + case 1: + message.errorCode = 1; + break; + case "AUTHENTICATION_FAILURE": + case 2: + message.errorCode = 2; + break; + case "INVALID_CONNECTION_PROFILE_CONFIG": + case 3: + message.errorCode = 3; + break; + case "VERSION_INCOMPATIBILITY": + case 4: + message.errorCode = 4; + break; + case "CONNECTION_PROFILE_TYPES_INCOMPATIBILITY": + case 5: + message.errorCode = 5; + break; + case "NO_PGLOGICAL_INSTALLED": + case 7: + message.errorCode = 7; + break; + case "PGLOGICAL_NODE_ALREADY_EXISTS": + case 8: + message.errorCode = 8; + break; + case "INVALID_WAL_LEVEL": + case 9: + message.errorCode = 9; + break; + case "INVALID_SHARED_PRELOAD_LIBRARY": + case 10: + message.errorCode = 10; + break; + case "INSUFFICIENT_MAX_REPLICATION_SLOTS": + case 11: + message.errorCode = 11; + break; + case "INSUFFICIENT_MAX_WAL_SENDERS": + case 12: + message.errorCode = 12; + break; + case "INSUFFICIENT_MAX_WORKER_PROCESSES": + case 13: + message.errorCode = 13; + break; + case "UNSUPPORTED_EXTENSIONS": + case 14: + message.errorCode = 14; + break; + case "UNSUPPORTED_MIGRATION_TYPE": + case 15: + message.errorCode = 15; + break; + case "INVALID_RDS_LOGICAL_REPLICATION": + case 16: + message.errorCode = 16; + break; + case "UNSUPPORTED_GTID_MODE": + case 17: + message.errorCode = 17; + break; + case "UNSUPPORTED_TABLE_DEFINITION": + case 18: + message.errorCode = 18; + break; + case "UNSUPPORTED_DEFINER": + case 19: + message.errorCode = 19; + break; + case "CANT_RESTART_RUNNING_MIGRATION": + case 21: + message.errorCode = 21; + break; + } + if (object.errorMessage != null) + message.errorMessage = String(object.errorMessage); + if (object.errorDetailMessage != null) + message.errorDetailMessage = String(object.errorDetailMessage); + return message; + }; + + /** + * Creates a plain object from a MigrationJobVerificationError message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.clouddms.v1.MigrationJobVerificationError + * @static + * @param {google.cloud.clouddms.v1.MigrationJobVerificationError} message MigrationJobVerificationError + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MigrationJobVerificationError.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.errorCode = options.enums === String ? "ERROR_CODE_UNSPECIFIED" : 0; + object.errorMessage = ""; + object.errorDetailMessage = ""; + } + if (message.errorCode != null && message.hasOwnProperty("errorCode")) + object.errorCode = options.enums === String ? $root.google.cloud.clouddms.v1.MigrationJobVerificationError.ErrorCode[message.errorCode] === undefined ? message.errorCode : $root.google.cloud.clouddms.v1.MigrationJobVerificationError.ErrorCode[message.errorCode] : message.errorCode; + if (message.errorMessage != null && message.hasOwnProperty("errorMessage")) + object.errorMessage = message.errorMessage; + if (message.errorDetailMessage != null && message.hasOwnProperty("errorDetailMessage")) + object.errorDetailMessage = message.errorDetailMessage; + return object; + }; + + /** + * Converts this MigrationJobVerificationError to JSON. + * @function toJSON + * @memberof google.cloud.clouddms.v1.MigrationJobVerificationError + * @instance + * @returns {Object.} JSON object + */ + MigrationJobVerificationError.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MigrationJobVerificationError + * @function getTypeUrl + * @memberof google.cloud.clouddms.v1.MigrationJobVerificationError + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MigrationJobVerificationError.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.clouddms.v1.MigrationJobVerificationError"; + }; + + /** + * ErrorCode enum. + * @name google.cloud.clouddms.v1.MigrationJobVerificationError.ErrorCode + * @enum {number} + * @property {number} ERROR_CODE_UNSPECIFIED=0 ERROR_CODE_UNSPECIFIED value + * @property {number} CONNECTION_FAILURE=1 CONNECTION_FAILURE value + * @property {number} AUTHENTICATION_FAILURE=2 AUTHENTICATION_FAILURE value + * @property {number} INVALID_CONNECTION_PROFILE_CONFIG=3 INVALID_CONNECTION_PROFILE_CONFIG value + * @property {number} VERSION_INCOMPATIBILITY=4 VERSION_INCOMPATIBILITY value + * @property {number} CONNECTION_PROFILE_TYPES_INCOMPATIBILITY=5 CONNECTION_PROFILE_TYPES_INCOMPATIBILITY value + * @property {number} NO_PGLOGICAL_INSTALLED=7 NO_PGLOGICAL_INSTALLED value + * @property {number} PGLOGICAL_NODE_ALREADY_EXISTS=8 PGLOGICAL_NODE_ALREADY_EXISTS value + * @property {number} INVALID_WAL_LEVEL=9 INVALID_WAL_LEVEL value + * @property {number} INVALID_SHARED_PRELOAD_LIBRARY=10 INVALID_SHARED_PRELOAD_LIBRARY value + * @property {number} INSUFFICIENT_MAX_REPLICATION_SLOTS=11 INSUFFICIENT_MAX_REPLICATION_SLOTS value + * @property {number} INSUFFICIENT_MAX_WAL_SENDERS=12 INSUFFICIENT_MAX_WAL_SENDERS value + * @property {number} INSUFFICIENT_MAX_WORKER_PROCESSES=13 INSUFFICIENT_MAX_WORKER_PROCESSES value + * @property {number} UNSUPPORTED_EXTENSIONS=14 UNSUPPORTED_EXTENSIONS value + * @property {number} UNSUPPORTED_MIGRATION_TYPE=15 UNSUPPORTED_MIGRATION_TYPE value + * @property {number} INVALID_RDS_LOGICAL_REPLICATION=16 INVALID_RDS_LOGICAL_REPLICATION value + * @property {number} UNSUPPORTED_GTID_MODE=17 UNSUPPORTED_GTID_MODE value + * @property {number} UNSUPPORTED_TABLE_DEFINITION=18 UNSUPPORTED_TABLE_DEFINITION value + * @property {number} UNSUPPORTED_DEFINER=19 UNSUPPORTED_DEFINER value + * @property {number} CANT_RESTART_RUNNING_MIGRATION=21 CANT_RESTART_RUNNING_MIGRATION value + */ + MigrationJobVerificationError.ErrorCode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ERROR_CODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "CONNECTION_FAILURE"] = 1; + values[valuesById[2] = "AUTHENTICATION_FAILURE"] = 2; + values[valuesById[3] = "INVALID_CONNECTION_PROFILE_CONFIG"] = 3; + values[valuesById[4] = "VERSION_INCOMPATIBILITY"] = 4; + values[valuesById[5] = "CONNECTION_PROFILE_TYPES_INCOMPATIBILITY"] = 5; + values[valuesById[7] = "NO_PGLOGICAL_INSTALLED"] = 7; + values[valuesById[8] = "PGLOGICAL_NODE_ALREADY_EXISTS"] = 8; + values[valuesById[9] = "INVALID_WAL_LEVEL"] = 9; + values[valuesById[10] = "INVALID_SHARED_PRELOAD_LIBRARY"] = 10; + values[valuesById[11] = "INSUFFICIENT_MAX_REPLICATION_SLOTS"] = 11; + values[valuesById[12] = "INSUFFICIENT_MAX_WAL_SENDERS"] = 12; + values[valuesById[13] = "INSUFFICIENT_MAX_WORKER_PROCESSES"] = 13; + values[valuesById[14] = "UNSUPPORTED_EXTENSIONS"] = 14; + values[valuesById[15] = "UNSUPPORTED_MIGRATION_TYPE"] = 15; + values[valuesById[16] = "INVALID_RDS_LOGICAL_REPLICATION"] = 16; + values[valuesById[17] = "UNSUPPORTED_GTID_MODE"] = 17; + values[valuesById[18] = "UNSUPPORTED_TABLE_DEFINITION"] = 18; + values[valuesById[19] = "UNSUPPORTED_DEFINER"] = 19; + values[valuesById[21] = "CANT_RESTART_RUNNING_MIGRATION"] = 21; + return values; + })(); + + return MigrationJobVerificationError; + })(); + + /** + * DatabaseEngine enum. + * @name google.cloud.clouddms.v1.DatabaseEngine + * @enum {number} + * @property {number} DATABASE_ENGINE_UNSPECIFIED=0 DATABASE_ENGINE_UNSPECIFIED value + * @property {number} MYSQL=1 MYSQL value + * @property {number} POSTGRESQL=2 POSTGRESQL value + */ + v1.DatabaseEngine = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DATABASE_ENGINE_UNSPECIFIED"] = 0; + values[valuesById[1] = "MYSQL"] = 1; + values[valuesById[2] = "POSTGRESQL"] = 2; + return values; + })(); + + /** + * DatabaseProvider enum. + * @name google.cloud.clouddms.v1.DatabaseProvider + * @enum {number} + * @property {number} DATABASE_PROVIDER_UNSPECIFIED=0 DATABASE_PROVIDER_UNSPECIFIED value + * @property {number} CLOUDSQL=1 CLOUDSQL value + * @property {number} RDS=2 RDS value + */ + v1.DatabaseProvider = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DATABASE_PROVIDER_UNSPECIFIED"] = 0; + values[valuesById[1] = "CLOUDSQL"] = 1; + values[valuesById[2] = "RDS"] = 2; + return values; + })(); + + return v1; + })(); + + return clouddms; + })(); + + return cloud; + })(); + + google.api = (function() { + + /** + * Namespace api. + * @memberof google + * @namespace + */ + var api = {}; + + api.Http = (function() { + + /** + * Properties of a Http. + * @memberof google.api + * @interface IHttp + * @property {Array.|null} [rules] Http rules + * @property {boolean|null} [fullyDecodeReservedExpansion] Http fullyDecodeReservedExpansion + */ + + /** + * Constructs a new Http. + * @memberof google.api + * @classdesc Represents a Http. + * @implements IHttp + * @constructor + * @param {google.api.IHttp=} [properties] Properties to set + */ + function Http(properties) { + this.rules = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Http rules. + * @member {Array.} rules + * @memberof google.api.Http + * @instance + */ + Http.prototype.rules = $util.emptyArray; + + /** + * Http fullyDecodeReservedExpansion. + * @member {boolean} fullyDecodeReservedExpansion + * @memberof google.api.Http + * @instance + */ + Http.prototype.fullyDecodeReservedExpansion = false; + + /** + * Creates a new Http instance using the specified properties. + * @function create + * @memberof google.api.Http + * @static + * @param {google.api.IHttp=} [properties] Properties to set + * @returns {google.api.Http} Http instance + */ + Http.create = function create(properties) { + return new Http(properties); + }; + + /** + * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @function encode + * @memberof google.api.Http + * @static + * @param {google.api.IHttp} message Http message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Http.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rules != null && message.rules.length) + for (var i = 0; i < message.rules.length; ++i) + $root.google.api.HttpRule.encode(message.rules[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.fullyDecodeReservedExpansion != null && Object.hasOwnProperty.call(message, "fullyDecodeReservedExpansion")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.fullyDecodeReservedExpansion); + return writer; + }; + + /** + * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.Http + * @static + * @param {google.api.IHttp} message Http message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Http.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Http message from the specified reader or buffer. + * @function decode + * @memberof google.api.Http + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.Http} Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Http.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Http(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.rules && message.rules.length)) + message.rules = []; + message.rules.push($root.google.api.HttpRule.decode(reader, reader.uint32())); + break; + } + case 2: { + message.fullyDecodeReservedExpansion = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Http message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.Http + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.Http} Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Http.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Http message. + * @function verify + * @memberof google.api.Http + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Http.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.rules != null && message.hasOwnProperty("rules")) { + if (!Array.isArray(message.rules)) + return "rules: array expected"; + for (var i = 0; i < message.rules.length; ++i) { + var error = $root.google.api.HttpRule.verify(message.rules[i]); + if (error) + return "rules." + error; + } + } + if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) + if (typeof message.fullyDecodeReservedExpansion !== "boolean") + return "fullyDecodeReservedExpansion: boolean expected"; + return null; + }; + + /** + * Creates a Http message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.Http + * @static + * @param {Object.} object Plain object + * @returns {google.api.Http} Http + */ + Http.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.Http) + return object; + var message = new $root.google.api.Http(); + if (object.rules) { + if (!Array.isArray(object.rules)) + throw TypeError(".google.api.Http.rules: array expected"); + message.rules = []; + for (var i = 0; i < object.rules.length; ++i) { + if (typeof object.rules[i] !== "object") + throw TypeError(".google.api.Http.rules: object expected"); + message.rules[i] = $root.google.api.HttpRule.fromObject(object.rules[i]); + } + } + if (object.fullyDecodeReservedExpansion != null) + message.fullyDecodeReservedExpansion = Boolean(object.fullyDecodeReservedExpansion); + return message; + }; + + /** + * Creates a plain object from a Http message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.Http + * @static + * @param {google.api.Http} message Http + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Http.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.rules = []; + if (options.defaults) + object.fullyDecodeReservedExpansion = false; + if (message.rules && message.rules.length) { + object.rules = []; + for (var j = 0; j < message.rules.length; ++j) + object.rules[j] = $root.google.api.HttpRule.toObject(message.rules[j], options); + } + if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) + object.fullyDecodeReservedExpansion = message.fullyDecodeReservedExpansion; + return object; + }; + + /** + * Converts this Http to JSON. + * @function toJSON + * @memberof google.api.Http + * @instance + * @returns {Object.} JSON object + */ + Http.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Http + * @function getTypeUrl + * @memberof google.api.Http + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Http.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.Http"; + }; + + return Http; + })(); + + api.HttpRule = (function() { + + /** + * Properties of a HttpRule. + * @memberof google.api + * @interface IHttpRule + * @property {string|null} [selector] HttpRule selector + * @property {string|null} [get] HttpRule get + * @property {string|null} [put] HttpRule put + * @property {string|null} [post] HttpRule post + * @property {string|null} ["delete"] HttpRule delete + * @property {string|null} [patch] HttpRule patch + * @property {google.api.ICustomHttpPattern|null} [custom] HttpRule custom + * @property {string|null} [body] HttpRule body + * @property {string|null} [responseBody] HttpRule responseBody + * @property {Array.|null} [additionalBindings] HttpRule additionalBindings + */ + + /** + * Constructs a new HttpRule. + * @memberof google.api + * @classdesc Represents a HttpRule. + * @implements IHttpRule + * @constructor + * @param {google.api.IHttpRule=} [properties] Properties to set + */ + function HttpRule(properties) { + this.additionalBindings = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HttpRule selector. + * @member {string} selector + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.selector = ""; + + /** + * HttpRule get. + * @member {string|null|undefined} get + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.get = null; + + /** + * HttpRule put. + * @member {string|null|undefined} put + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.put = null; + + /** + * HttpRule post. + * @member {string|null|undefined} post + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.post = null; + + /** + * HttpRule delete. + * @member {string|null|undefined} delete + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype["delete"] = null; + + /** + * HttpRule patch. + * @member {string|null|undefined} patch + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.patch = null; + + /** + * HttpRule custom. + * @member {google.api.ICustomHttpPattern|null|undefined} custom + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.custom = null; + + /** + * HttpRule body. + * @member {string} body + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.body = ""; + + /** + * HttpRule responseBody. + * @member {string} responseBody + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.responseBody = ""; + + /** + * HttpRule additionalBindings. + * @member {Array.} additionalBindings + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.additionalBindings = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * HttpRule pattern. + * @member {"get"|"put"|"post"|"delete"|"patch"|"custom"|undefined} pattern + * @memberof google.api.HttpRule + * @instance + */ + Object.defineProperty(HttpRule.prototype, "pattern", { + get: $util.oneOfGetter($oneOfFields = ["get", "put", "post", "delete", "patch", "custom"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new HttpRule instance using the specified properties. + * @function create + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule=} [properties] Properties to set + * @returns {google.api.HttpRule} HttpRule instance + */ + HttpRule.create = function create(properties) { + return new HttpRule(properties); + }; + + /** + * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @function encode + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpRule.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); + if (message.get != null && Object.hasOwnProperty.call(message, "get")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.get); + if (message.put != null && Object.hasOwnProperty.call(message, "put")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.put); + if (message.post != null && Object.hasOwnProperty.call(message, "post")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.post); + if (message["delete"] != null && Object.hasOwnProperty.call(message, "delete")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message["delete"]); + if (message.patch != null && Object.hasOwnProperty.call(message, "patch")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.patch); + if (message.body != null && Object.hasOwnProperty.call(message, "body")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.body); + if (message.custom != null && Object.hasOwnProperty.call(message, "custom")) + $root.google.api.CustomHttpPattern.encode(message.custom, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.additionalBindings != null && message.additionalBindings.length) + for (var i = 0; i < message.additionalBindings.length; ++i) + $root.google.api.HttpRule.encode(message.additionalBindings[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.responseBody != null && Object.hasOwnProperty.call(message, "responseBody")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.responseBody); + return writer; + }; + + /** + * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpRule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HttpRule message from the specified reader or buffer. + * @function decode + * @memberof google.api.HttpRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.HttpRule} HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpRule.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.HttpRule(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.selector = reader.string(); + break; + } + case 2: { + message.get = reader.string(); + break; + } + case 3: { + message.put = reader.string(); + break; + } + case 4: { + message.post = reader.string(); + break; + } + case 5: { + message["delete"] = reader.string(); + break; + } + case 6: { + message.patch = reader.string(); + break; + } + case 8: { + message.custom = $root.google.api.CustomHttpPattern.decode(reader, reader.uint32()); + break; + } + case 7: { + message.body = reader.string(); + break; + } + case 12: { + message.responseBody = reader.string(); + break; + } + case 11: { + if (!(message.additionalBindings && message.additionalBindings.length)) + message.additionalBindings = []; + message.additionalBindings.push($root.google.api.HttpRule.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HttpRule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.HttpRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.HttpRule} HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpRule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HttpRule message. + * @function verify + * @memberof google.api.HttpRule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HttpRule.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.selector != null && message.hasOwnProperty("selector")) + if (!$util.isString(message.selector)) + return "selector: string expected"; + if (message.get != null && message.hasOwnProperty("get")) { + properties.pattern = 1; + if (!$util.isString(message.get)) + return "get: string expected"; + } + if (message.put != null && message.hasOwnProperty("put")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.put)) + return "put: string expected"; + } + if (message.post != null && message.hasOwnProperty("post")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.post)) + return "post: string expected"; + } + if (message["delete"] != null && message.hasOwnProperty("delete")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message["delete"])) + return "delete: string expected"; + } + if (message.patch != null && message.hasOwnProperty("patch")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.patch)) + return "patch: string expected"; + } + if (message.custom != null && message.hasOwnProperty("custom")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + { + var error = $root.google.api.CustomHttpPattern.verify(message.custom); + if (error) + return "custom." + error; + } + } + if (message.body != null && message.hasOwnProperty("body")) + if (!$util.isString(message.body)) + return "body: string expected"; + if (message.responseBody != null && message.hasOwnProperty("responseBody")) + if (!$util.isString(message.responseBody)) + return "responseBody: string expected"; + if (message.additionalBindings != null && message.hasOwnProperty("additionalBindings")) { + if (!Array.isArray(message.additionalBindings)) + return "additionalBindings: array expected"; + for (var i = 0; i < message.additionalBindings.length; ++i) { + var error = $root.google.api.HttpRule.verify(message.additionalBindings[i]); + if (error) + return "additionalBindings." + error; + } + } + return null; + }; + + /** + * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.HttpRule + * @static + * @param {Object.} object Plain object + * @returns {google.api.HttpRule} HttpRule + */ + HttpRule.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.HttpRule) + return object; + var message = new $root.google.api.HttpRule(); + if (object.selector != null) + message.selector = String(object.selector); + if (object.get != null) + message.get = String(object.get); + if (object.put != null) + message.put = String(object.put); + if (object.post != null) + message.post = String(object.post); + if (object["delete"] != null) + message["delete"] = String(object["delete"]); + if (object.patch != null) + message.patch = String(object.patch); + if (object.custom != null) { + if (typeof object.custom !== "object") + throw TypeError(".google.api.HttpRule.custom: object expected"); + message.custom = $root.google.api.CustomHttpPattern.fromObject(object.custom); + } + if (object.body != null) + message.body = String(object.body); + if (object.responseBody != null) + message.responseBody = String(object.responseBody); + if (object.additionalBindings) { + if (!Array.isArray(object.additionalBindings)) + throw TypeError(".google.api.HttpRule.additionalBindings: array expected"); + message.additionalBindings = []; + for (var i = 0; i < object.additionalBindings.length; ++i) { + if (typeof object.additionalBindings[i] !== "object") + throw TypeError(".google.api.HttpRule.additionalBindings: object expected"); + message.additionalBindings[i] = $root.google.api.HttpRule.fromObject(object.additionalBindings[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a HttpRule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.HttpRule + * @static + * @param {google.api.HttpRule} message HttpRule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HttpRule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.additionalBindings = []; + if (options.defaults) { + object.selector = ""; + object.body = ""; + object.responseBody = ""; + } + if (message.selector != null && message.hasOwnProperty("selector")) + object.selector = message.selector; + if (message.get != null && message.hasOwnProperty("get")) { + object.get = message.get; + if (options.oneofs) + object.pattern = "get"; + } + if (message.put != null && message.hasOwnProperty("put")) { + object.put = message.put; + if (options.oneofs) + object.pattern = "put"; + } + if (message.post != null && message.hasOwnProperty("post")) { + object.post = message.post; + if (options.oneofs) + object.pattern = "post"; + } + if (message["delete"] != null && message.hasOwnProperty("delete")) { + object["delete"] = message["delete"]; + if (options.oneofs) + object.pattern = "delete"; + } + if (message.patch != null && message.hasOwnProperty("patch")) { + object.patch = message.patch; + if (options.oneofs) + object.pattern = "patch"; + } + if (message.body != null && message.hasOwnProperty("body")) + object.body = message.body; + if (message.custom != null && message.hasOwnProperty("custom")) { + object.custom = $root.google.api.CustomHttpPattern.toObject(message.custom, options); + if (options.oneofs) + object.pattern = "custom"; + } + if (message.additionalBindings && message.additionalBindings.length) { + object.additionalBindings = []; + for (var j = 0; j < message.additionalBindings.length; ++j) + object.additionalBindings[j] = $root.google.api.HttpRule.toObject(message.additionalBindings[j], options); + } + if (message.responseBody != null && message.hasOwnProperty("responseBody")) + object.responseBody = message.responseBody; + return object; + }; + + /** + * Converts this HttpRule to JSON. + * @function toJSON + * @memberof google.api.HttpRule + * @instance + * @returns {Object.} JSON object + */ + HttpRule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for HttpRule + * @function getTypeUrl + * @memberof google.api.HttpRule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + HttpRule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.HttpRule"; + }; + + return HttpRule; + })(); + + api.CustomHttpPattern = (function() { + + /** + * Properties of a CustomHttpPattern. + * @memberof google.api + * @interface ICustomHttpPattern + * @property {string|null} [kind] CustomHttpPattern kind + * @property {string|null} [path] CustomHttpPattern path + */ + + /** + * Constructs a new CustomHttpPattern. + * @memberof google.api + * @classdesc Represents a CustomHttpPattern. + * @implements ICustomHttpPattern + * @constructor + * @param {google.api.ICustomHttpPattern=} [properties] Properties to set + */ + function CustomHttpPattern(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CustomHttpPattern kind. + * @member {string} kind + * @memberof google.api.CustomHttpPattern + * @instance + */ + CustomHttpPattern.prototype.kind = ""; + + /** + * CustomHttpPattern path. + * @member {string} path + * @memberof google.api.CustomHttpPattern + * @instance + */ + CustomHttpPattern.prototype.path = ""; + + /** + * Creates a new CustomHttpPattern instance using the specified properties. + * @function create + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern=} [properties] Properties to set + * @returns {google.api.CustomHttpPattern} CustomHttpPattern instance + */ + CustomHttpPattern.create = function create(properties) { + return new CustomHttpPattern(properties); + }; + + /** + * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @function encode + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomHttpPattern.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.kind); + if (message.path != null && Object.hasOwnProperty.call(message, "path")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.path); + return writer; + }; + + /** + * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomHttpPattern.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer. + * @function decode + * @memberof google.api.CustomHttpPattern + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomHttpPattern.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CustomHttpPattern(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.kind = reader.string(); + break; + } + case 2: { + message.path = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.CustomHttpPattern + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomHttpPattern.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CustomHttpPattern message. + * @function verify + * @memberof google.api.CustomHttpPattern + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CustomHttpPattern.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.kind != null && message.hasOwnProperty("kind")) + if (!$util.isString(message.kind)) + return "kind: string expected"; + if (message.path != null && message.hasOwnProperty("path")) + if (!$util.isString(message.path)) + return "path: string expected"; + return null; + }; + + /** + * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.CustomHttpPattern + * @static + * @param {Object.} object Plain object + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + */ + CustomHttpPattern.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.CustomHttpPattern) + return object; + var message = new $root.google.api.CustomHttpPattern(); + if (object.kind != null) + message.kind = String(object.kind); + if (object.path != null) + message.path = String(object.path); + return message; + }; + + /** + * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.CustomHttpPattern} message CustomHttpPattern + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CustomHttpPattern.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.kind = ""; + object.path = ""; + } + if (message.kind != null && message.hasOwnProperty("kind")) + object.kind = message.kind; + if (message.path != null && message.hasOwnProperty("path")) + object.path = message.path; + return object; + }; + + /** + * Converts this CustomHttpPattern to JSON. + * @function toJSON + * @memberof google.api.CustomHttpPattern + * @instance + * @returns {Object.} JSON object + */ + CustomHttpPattern.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CustomHttpPattern + * @function getTypeUrl + * @memberof google.api.CustomHttpPattern + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomHttpPattern.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.CustomHttpPattern"; + }; + + return CustomHttpPattern; + })(); + + /** + * FieldBehavior enum. + * @name google.api.FieldBehavior + * @enum {number} + * @property {number} FIELD_BEHAVIOR_UNSPECIFIED=0 FIELD_BEHAVIOR_UNSPECIFIED value + * @property {number} OPTIONAL=1 OPTIONAL value + * @property {number} REQUIRED=2 REQUIRED value + * @property {number} OUTPUT_ONLY=3 OUTPUT_ONLY value + * @property {number} INPUT_ONLY=4 INPUT_ONLY value + * @property {number} IMMUTABLE=5 IMMUTABLE value + * @property {number} UNORDERED_LIST=6 UNORDERED_LIST value + * @property {number} NON_EMPTY_DEFAULT=7 NON_EMPTY_DEFAULT value + */ + api.FieldBehavior = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FIELD_BEHAVIOR_UNSPECIFIED"] = 0; + values[valuesById[1] = "OPTIONAL"] = 1; + values[valuesById[2] = "REQUIRED"] = 2; + values[valuesById[3] = "OUTPUT_ONLY"] = 3; + values[valuesById[4] = "INPUT_ONLY"] = 4; + values[valuesById[5] = "IMMUTABLE"] = 5; + values[valuesById[6] = "UNORDERED_LIST"] = 6; + values[valuesById[7] = "NON_EMPTY_DEFAULT"] = 7; + return values; + })(); + + api.ResourceDescriptor = (function() { + + /** + * Properties of a ResourceDescriptor. + * @memberof google.api + * @interface IResourceDescriptor + * @property {string|null} [type] ResourceDescriptor type + * @property {Array.|null} [pattern] ResourceDescriptor pattern + * @property {string|null} [nameField] ResourceDescriptor nameField + * @property {google.api.ResourceDescriptor.History|null} [history] ResourceDescriptor history + * @property {string|null} [plural] ResourceDescriptor plural + * @property {string|null} [singular] ResourceDescriptor singular + * @property {Array.|null} [style] ResourceDescriptor style + */ + + /** + * Constructs a new ResourceDescriptor. + * @memberof google.api + * @classdesc Represents a ResourceDescriptor. + * @implements IResourceDescriptor + * @constructor + * @param {google.api.IResourceDescriptor=} [properties] Properties to set + */ + function ResourceDescriptor(properties) { + this.pattern = []; + this.style = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResourceDescriptor type. + * @member {string} type + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.type = ""; + + /** + * ResourceDescriptor pattern. + * @member {Array.} pattern + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.pattern = $util.emptyArray; + + /** + * ResourceDescriptor nameField. + * @member {string} nameField + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.nameField = ""; + + /** + * ResourceDescriptor history. + * @member {google.api.ResourceDescriptor.History} history + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.history = 0; + + /** + * ResourceDescriptor plural. + * @member {string} plural + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.plural = ""; + + /** + * ResourceDescriptor singular. + * @member {string} singular + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.singular = ""; + + /** + * ResourceDescriptor style. + * @member {Array.} style + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.style = $util.emptyArray; + + /** + * Creates a new ResourceDescriptor instance using the specified properties. + * @function create + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor=} [properties] Properties to set + * @returns {google.api.ResourceDescriptor} ResourceDescriptor instance + */ + ResourceDescriptor.create = function create(properties) { + return new ResourceDescriptor(properties); + }; + + /** + * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @function encode + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceDescriptor.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.pattern != null && message.pattern.length) + for (var i = 0; i < message.pattern.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.pattern[i]); + if (message.nameField != null && Object.hasOwnProperty.call(message, "nameField")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.nameField); + if (message.history != null && Object.hasOwnProperty.call(message, "history")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.history); + if (message.plural != null && Object.hasOwnProperty.call(message, "plural")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.plural); + if (message.singular != null && Object.hasOwnProperty.call(message, "singular")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.singular); + if (message.style != null && message.style.length) { + writer.uint32(/* id 10, wireType 2 =*/82).fork(); + for (var i = 0; i < message.style.length; ++i) + writer.int32(message.style[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceDescriptor.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer. + * @function decode + * @memberof google.api.ResourceDescriptor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceDescriptor.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceDescriptor(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.type = reader.string(); + break; + } + case 2: { + if (!(message.pattern && message.pattern.length)) + message.pattern = []; + message.pattern.push(reader.string()); + break; + } + case 3: { + message.nameField = reader.string(); + break; + } + case 4: { + message.history = reader.int32(); + break; + } + case 5: { + message.plural = reader.string(); + break; + } + case 6: { + message.singular = reader.string(); + break; + } + case 10: { + if (!(message.style && message.style.length)) + message.style = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.style.push(reader.int32()); + } else + message.style.push(reader.int32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.ResourceDescriptor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceDescriptor.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourceDescriptor message. + * @function verify + * @memberof google.api.ResourceDescriptor + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceDescriptor.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.pattern != null && message.hasOwnProperty("pattern")) { + if (!Array.isArray(message.pattern)) + return "pattern: array expected"; + for (var i = 0; i < message.pattern.length; ++i) + if (!$util.isString(message.pattern[i])) + return "pattern: string[] expected"; + } + if (message.nameField != null && message.hasOwnProperty("nameField")) + if (!$util.isString(message.nameField)) + return "nameField: string expected"; + if (message.history != null && message.hasOwnProperty("history")) + switch (message.history) { + default: + return "history: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.plural != null && message.hasOwnProperty("plural")) + if (!$util.isString(message.plural)) + return "plural: string expected"; + if (message.singular != null && message.hasOwnProperty("singular")) + if (!$util.isString(message.singular)) + return "singular: string expected"; + if (message.style != null && message.hasOwnProperty("style")) { + if (!Array.isArray(message.style)) + return "style: array expected"; + for (var i = 0; i < message.style.length; ++i) + switch (message.style[i]) { + default: + return "style: enum value[] expected"; + case 0: + case 1: + break; + } + } + return null; + }; + + /** + * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.ResourceDescriptor + * @static + * @param {Object.} object Plain object + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + */ + ResourceDescriptor.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ResourceDescriptor) + return object; + var message = new $root.google.api.ResourceDescriptor(); + if (object.type != null) + message.type = String(object.type); + if (object.pattern) { + if (!Array.isArray(object.pattern)) + throw TypeError(".google.api.ResourceDescriptor.pattern: array expected"); + message.pattern = []; + for (var i = 0; i < object.pattern.length; ++i) + message.pattern[i] = String(object.pattern[i]); + } + if (object.nameField != null) + message.nameField = String(object.nameField); + switch (object.history) { + default: + if (typeof object.history === "number") { + message.history = object.history; + break; + } + break; + case "HISTORY_UNSPECIFIED": + case 0: + message.history = 0; + break; + case "ORIGINALLY_SINGLE_PATTERN": + case 1: + message.history = 1; + break; + case "FUTURE_MULTI_PATTERN": + case 2: + message.history = 2; + break; + } + if (object.plural != null) + message.plural = String(object.plural); + if (object.singular != null) + message.singular = String(object.singular); + if (object.style) { + if (!Array.isArray(object.style)) + throw TypeError(".google.api.ResourceDescriptor.style: array expected"); + message.style = []; + for (var i = 0; i < object.style.length; ++i) + switch (object.style[i]) { + default: + if (typeof object.style[i] === "number") { + message.style[i] = object.style[i]; + break; + } + case "STYLE_UNSPECIFIED": + case 0: + message.style[i] = 0; + break; + case "DECLARATIVE_FRIENDLY": + case 1: + message.style[i] = 1; + break; + } + } + return message; + }; + + /** + * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.ResourceDescriptor} message ResourceDescriptor + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceDescriptor.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.pattern = []; + object.style = []; + } + if (options.defaults) { + object.type = ""; + object.nameField = ""; + object.history = options.enums === String ? "HISTORY_UNSPECIFIED" : 0; + object.plural = ""; + object.singular = ""; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.pattern && message.pattern.length) { + object.pattern = []; + for (var j = 0; j < message.pattern.length; ++j) + object.pattern[j] = message.pattern[j]; + } + if (message.nameField != null && message.hasOwnProperty("nameField")) + object.nameField = message.nameField; + if (message.history != null && message.hasOwnProperty("history")) + object.history = options.enums === String ? $root.google.api.ResourceDescriptor.History[message.history] === undefined ? message.history : $root.google.api.ResourceDescriptor.History[message.history] : message.history; + if (message.plural != null && message.hasOwnProperty("plural")) + object.plural = message.plural; + if (message.singular != null && message.hasOwnProperty("singular")) + object.singular = message.singular; + if (message.style && message.style.length) { + object.style = []; + for (var j = 0; j < message.style.length; ++j) + object.style[j] = options.enums === String ? $root.google.api.ResourceDescriptor.Style[message.style[j]] === undefined ? message.style[j] : $root.google.api.ResourceDescriptor.Style[message.style[j]] : message.style[j]; + } + return object; + }; + + /** + * Converts this ResourceDescriptor to JSON. + * @function toJSON + * @memberof google.api.ResourceDescriptor + * @instance + * @returns {Object.} JSON object + */ + ResourceDescriptor.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ResourceDescriptor + * @function getTypeUrl + * @memberof google.api.ResourceDescriptor + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResourceDescriptor.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.ResourceDescriptor"; + }; + + /** + * History enum. + * @name google.api.ResourceDescriptor.History + * @enum {number} + * @property {number} HISTORY_UNSPECIFIED=0 HISTORY_UNSPECIFIED value + * @property {number} ORIGINALLY_SINGLE_PATTERN=1 ORIGINALLY_SINGLE_PATTERN value + * @property {number} FUTURE_MULTI_PATTERN=2 FUTURE_MULTI_PATTERN value + */ + ResourceDescriptor.History = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "HISTORY_UNSPECIFIED"] = 0; + values[valuesById[1] = "ORIGINALLY_SINGLE_PATTERN"] = 1; + values[valuesById[2] = "FUTURE_MULTI_PATTERN"] = 2; + return values; + })(); + + /** + * Style enum. + * @name google.api.ResourceDescriptor.Style + * @enum {number} + * @property {number} STYLE_UNSPECIFIED=0 STYLE_UNSPECIFIED value + * @property {number} DECLARATIVE_FRIENDLY=1 DECLARATIVE_FRIENDLY value + */ + ResourceDescriptor.Style = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STYLE_UNSPECIFIED"] = 0; + values[valuesById[1] = "DECLARATIVE_FRIENDLY"] = 1; + return values; + })(); + + return ResourceDescriptor; + })(); + + api.ResourceReference = (function() { + + /** + * Properties of a ResourceReference. + * @memberof google.api + * @interface IResourceReference + * @property {string|null} [type] ResourceReference type + * @property {string|null} [childType] ResourceReference childType + */ + + /** + * Constructs a new ResourceReference. + * @memberof google.api + * @classdesc Represents a ResourceReference. + * @implements IResourceReference + * @constructor + * @param {google.api.IResourceReference=} [properties] Properties to set + */ + function ResourceReference(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResourceReference type. + * @member {string} type + * @memberof google.api.ResourceReference + * @instance + */ + ResourceReference.prototype.type = ""; + + /** + * ResourceReference childType. + * @member {string} childType + * @memberof google.api.ResourceReference + * @instance + */ + ResourceReference.prototype.childType = ""; + + /** + * Creates a new ResourceReference instance using the specified properties. + * @function create + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference=} [properties] Properties to set + * @returns {google.api.ResourceReference} ResourceReference instance + */ + ResourceReference.create = function create(properties) { + return new ResourceReference(properties); + }; + + /** + * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @function encode + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceReference.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.childType != null && Object.hasOwnProperty.call(message, "childType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.childType); + return writer; + }; + + /** + * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceReference.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourceReference message from the specified reader or buffer. + * @function decode + * @memberof google.api.ResourceReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.ResourceReference} ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceReference.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceReference(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.type = reader.string(); + break; + } + case 2: { + message.childType = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourceReference message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.ResourceReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.ResourceReference} ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceReference.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourceReference message. + * @function verify + * @memberof google.api.ResourceReference + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceReference.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.childType != null && message.hasOwnProperty("childType")) + if (!$util.isString(message.childType)) + return "childType: string expected"; + return null; + }; + + /** + * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.ResourceReference + * @static + * @param {Object.} object Plain object + * @returns {google.api.ResourceReference} ResourceReference + */ + ResourceReference.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ResourceReference) + return object; + var message = new $root.google.api.ResourceReference(); + if (object.type != null) + message.type = String(object.type); + if (object.childType != null) + message.childType = String(object.childType); + return message; + }; + + /** + * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ResourceReference + * @static + * @param {google.api.ResourceReference} message ResourceReference + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceReference.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type = ""; + object.childType = ""; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.childType != null && message.hasOwnProperty("childType")) + object.childType = message.childType; + return object; + }; + + /** + * Converts this ResourceReference to JSON. + * @function toJSON + * @memberof google.api.ResourceReference + * @instance + * @returns {Object.} JSON object + */ + ResourceReference.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ResourceReference + * @function getTypeUrl + * @memberof google.api.ResourceReference + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResourceReference.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.ResourceReference"; + }; + + return ResourceReference; + })(); + + return api; + })(); + + google.protobuf = (function() { + + /** + * Namespace protobuf. + * @memberof google + * @namespace + */ + var protobuf = {}; + + protobuf.FileDescriptorSet = (function() { + + /** + * Properties of a FileDescriptorSet. + * @memberof google.protobuf + * @interface IFileDescriptorSet + * @property {Array.|null} [file] FileDescriptorSet file + */ + + /** + * Constructs a new FileDescriptorSet. + * @memberof google.protobuf + * @classdesc Represents a FileDescriptorSet. + * @implements IFileDescriptorSet + * @constructor + * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set + */ + function FileDescriptorSet(properties) { + this.file = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileDescriptorSet file. + * @member {Array.} file + * @memberof google.protobuf.FileDescriptorSet + * @instance + */ + FileDescriptorSet.prototype.file = $util.emptyArray; + + /** + * Creates a new FileDescriptorSet instance using the specified properties. + * @function create + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet instance + */ + FileDescriptorSet.create = function create(properties) { + return new FileDescriptorSet(properties); + }; + + /** + * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorSet.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.file != null && message.file.length) + for (var i = 0; i < message.file.length; ++i) + $root.google.protobuf.FileDescriptorProto.encode(message.file[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorSet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorSet.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorSet(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.file && message.file.length)) + message.file = []; + message.file.push($root.google.protobuf.FileDescriptorProto.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorSet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileDescriptorSet message. + * @function verify + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileDescriptorSet.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.file != null && message.hasOwnProperty("file")) { + if (!Array.isArray(message.file)) + return "file: array expected"; + for (var i = 0; i < message.file.length; ++i) { + var error = $root.google.protobuf.FileDescriptorProto.verify(message.file[i]); + if (error) + return "file." + error; + } + } + return null; + }; + + /** + * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + */ + FileDescriptorSet.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileDescriptorSet) + return object; + var message = new $root.google.protobuf.FileDescriptorSet(); + if (object.file) { + if (!Array.isArray(object.file)) + throw TypeError(".google.protobuf.FileDescriptorSet.file: array expected"); + message.file = []; + for (var i = 0; i < object.file.length; ++i) { + if (typeof object.file[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorSet.file: object expected"); + message.file[i] = $root.google.protobuf.FileDescriptorProto.fromObject(object.file[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.FileDescriptorSet} message FileDescriptorSet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileDescriptorSet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.file = []; + if (message.file && message.file.length) { + object.file = []; + for (var j = 0; j < message.file.length; ++j) + object.file[j] = $root.google.protobuf.FileDescriptorProto.toObject(message.file[j], options); + } + return object; + }; + + /** + * Converts this FileDescriptorSet to JSON. + * @function toJSON + * @memberof google.protobuf.FileDescriptorSet + * @instance + * @returns {Object.} JSON object + */ + FileDescriptorSet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FileDescriptorSet + * @function getTypeUrl + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileDescriptorSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileDescriptorSet"; + }; + + return FileDescriptorSet; + })(); + + protobuf.FileDescriptorProto = (function() { + + /** + * Properties of a FileDescriptorProto. + * @memberof google.protobuf + * @interface IFileDescriptorProto + * @property {string|null} [name] FileDescriptorProto name + * @property {string|null} ["package"] FileDescriptorProto package + * @property {Array.|null} [dependency] FileDescriptorProto dependency + * @property {Array.|null} [publicDependency] FileDescriptorProto publicDependency + * @property {Array.|null} [weakDependency] FileDescriptorProto weakDependency + * @property {Array.|null} [messageType] FileDescriptorProto messageType + * @property {Array.|null} [enumType] FileDescriptorProto enumType + * @property {Array.|null} [service] FileDescriptorProto service + * @property {Array.|null} [extension] FileDescriptorProto extension + * @property {google.protobuf.IFileOptions|null} [options] FileDescriptorProto options + * @property {google.protobuf.ISourceCodeInfo|null} [sourceCodeInfo] FileDescriptorProto sourceCodeInfo + * @property {string|null} [syntax] FileDescriptorProto syntax + * @property {string|null} [edition] FileDescriptorProto edition + */ + + /** + * Constructs a new FileDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a FileDescriptorProto. + * @implements IFileDescriptorProto + * @constructor + * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set + */ + function FileDescriptorProto(properties) { + this.dependency = []; + this.publicDependency = []; + this.weakDependency = []; + this.messageType = []; + this.enumType = []; + this.service = []; + this.extension = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.name = ""; + + /** + * FileDescriptorProto package. + * @member {string} package + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype["package"] = ""; + + /** + * FileDescriptorProto dependency. + * @member {Array.} dependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.dependency = $util.emptyArray; + + /** + * FileDescriptorProto publicDependency. + * @member {Array.} publicDependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.publicDependency = $util.emptyArray; + + /** + * FileDescriptorProto weakDependency. + * @member {Array.} weakDependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.weakDependency = $util.emptyArray; + + /** + * FileDescriptorProto messageType. + * @member {Array.} messageType + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.messageType = $util.emptyArray; + + /** + * FileDescriptorProto enumType. + * @member {Array.} enumType + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.enumType = $util.emptyArray; + + /** + * FileDescriptorProto service. + * @member {Array.} service + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.service = $util.emptyArray; + + /** + * FileDescriptorProto extension. + * @member {Array.} extension + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.extension = $util.emptyArray; + + /** + * FileDescriptorProto options. + * @member {google.protobuf.IFileOptions|null|undefined} options + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.options = null; + + /** + * FileDescriptorProto sourceCodeInfo. + * @member {google.protobuf.ISourceCodeInfo|null|undefined} sourceCodeInfo + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.sourceCodeInfo = null; + + /** + * FileDescriptorProto syntax. + * @member {string} syntax + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.syntax = ""; + + /** + * FileDescriptorProto edition. + * @member {string} edition + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.edition = ""; + + /** + * Creates a new FileDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto instance + */ + FileDescriptorProto.create = function create(properties) { + return new FileDescriptorProto(properties); + }; + + /** + * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message["package"] != null && Object.hasOwnProperty.call(message, "package")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message["package"]); + if (message.dependency != null && message.dependency.length) + for (var i = 0; i < message.dependency.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.dependency[i]); + if (message.messageType != null && message.messageType.length) + for (var i = 0; i < message.messageType.length; ++i) + $root.google.protobuf.DescriptorProto.encode(message.messageType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.enumType != null && message.enumType.length) + for (var i = 0; i < message.enumType.length; ++i) + $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.service != null && message.service.length) + for (var i = 0; i < message.service.length; ++i) + $root.google.protobuf.ServiceDescriptorProto.encode(message.service[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.extension != null && message.extension.length) + for (var i = 0; i < message.extension.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.FileOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.sourceCodeInfo != null && Object.hasOwnProperty.call(message, "sourceCodeInfo")) + $root.google.protobuf.SourceCodeInfo.encode(message.sourceCodeInfo, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.publicDependency != null && message.publicDependency.length) + for (var i = 0; i < message.publicDependency.length; ++i) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.publicDependency[i]); + if (message.weakDependency != null && message.weakDependency.length) + for (var i = 0; i < message.weakDependency.length; ++i) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.weakDependency[i]); + if (message.syntax != null && Object.hasOwnProperty.call(message, "syntax")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.syntax); + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) + writer.uint32(/* id 13, wireType 2 =*/106).string(message.edition); + return writer; + }; + + /** + * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message["package"] = reader.string(); + break; + } + case 3: { + if (!(message.dependency && message.dependency.length)) + message.dependency = []; + message.dependency.push(reader.string()); + break; + } + case 10: { + if (!(message.publicDependency && message.publicDependency.length)) + message.publicDependency = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.publicDependency.push(reader.int32()); + } else + message.publicDependency.push(reader.int32()); + break; + } + case 11: { + if (!(message.weakDependency && message.weakDependency.length)) + message.weakDependency = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.weakDependency.push(reader.int32()); + } else + message.weakDependency.push(reader.int32()); + break; + } + case 4: { + if (!(message.messageType && message.messageType.length)) + message.messageType = []; + message.messageType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.enumType && message.enumType.length)) + message.enumType = []; + message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.service && message.service.length)) + message.service = []; + message.service.push($root.google.protobuf.ServiceDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 7: { + if (!(message.extension && message.extension.length)) + message.extension = []; + message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 8: { + message.options = $root.google.protobuf.FileOptions.decode(reader, reader.uint32()); + break; + } + case 9: { + message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.decode(reader, reader.uint32()); + break; + } + case 12: { + message.syntax = reader.string(); + break; + } + case 13: { + message.edition = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileDescriptorProto message. + * @function verify + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message["package"] != null && message.hasOwnProperty("package")) + if (!$util.isString(message["package"])) + return "package: string expected"; + if (message.dependency != null && message.hasOwnProperty("dependency")) { + if (!Array.isArray(message.dependency)) + return "dependency: array expected"; + for (var i = 0; i < message.dependency.length; ++i) + if (!$util.isString(message.dependency[i])) + return "dependency: string[] expected"; + } + if (message.publicDependency != null && message.hasOwnProperty("publicDependency")) { + if (!Array.isArray(message.publicDependency)) + return "publicDependency: array expected"; + for (var i = 0; i < message.publicDependency.length; ++i) + if (!$util.isInteger(message.publicDependency[i])) + return "publicDependency: integer[] expected"; + } + if (message.weakDependency != null && message.hasOwnProperty("weakDependency")) { + if (!Array.isArray(message.weakDependency)) + return "weakDependency: array expected"; + for (var i = 0; i < message.weakDependency.length; ++i) + if (!$util.isInteger(message.weakDependency[i])) + return "weakDependency: integer[] expected"; + } + if (message.messageType != null && message.hasOwnProperty("messageType")) { + if (!Array.isArray(message.messageType)) + return "messageType: array expected"; + for (var i = 0; i < message.messageType.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.verify(message.messageType[i]); + if (error) + return "messageType." + error; + } + } + if (message.enumType != null && message.hasOwnProperty("enumType")) { + if (!Array.isArray(message.enumType)) + return "enumType: array expected"; + for (var i = 0; i < message.enumType.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); + if (error) + return "enumType." + error; + } + } + if (message.service != null && message.hasOwnProperty("service")) { + if (!Array.isArray(message.service)) + return "service: array expected"; + for (var i = 0; i < message.service.length; ++i) { + var error = $root.google.protobuf.ServiceDescriptorProto.verify(message.service[i]); + if (error) + return "service." + error; + } + } + if (message.extension != null && message.hasOwnProperty("extension")) { + if (!Array.isArray(message.extension)) + return "extension: array expected"; + for (var i = 0; i < message.extension.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); + if (error) + return "extension." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.FileOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) { + var error = $root.google.protobuf.SourceCodeInfo.verify(message.sourceCodeInfo); + if (error) + return "sourceCodeInfo." + error; + } + if (message.syntax != null && message.hasOwnProperty("syntax")) + if (!$util.isString(message.syntax)) + return "syntax: string expected"; + if (message.edition != null && message.hasOwnProperty("edition")) + if (!$util.isString(message.edition)) + return "edition: string expected"; + return null; + }; + + /** + * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + */ + FileDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileDescriptorProto) + return object; + var message = new $root.google.protobuf.FileDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object["package"] != null) + message["package"] = String(object["package"]); + if (object.dependency) { + if (!Array.isArray(object.dependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.dependency: array expected"); + message.dependency = []; + for (var i = 0; i < object.dependency.length; ++i) + message.dependency[i] = String(object.dependency[i]); + } + if (object.publicDependency) { + if (!Array.isArray(object.publicDependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.publicDependency: array expected"); + message.publicDependency = []; + for (var i = 0; i < object.publicDependency.length; ++i) + message.publicDependency[i] = object.publicDependency[i] | 0; + } + if (object.weakDependency) { + if (!Array.isArray(object.weakDependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.weakDependency: array expected"); + message.weakDependency = []; + for (var i = 0; i < object.weakDependency.length; ++i) + message.weakDependency[i] = object.weakDependency[i] | 0; + } + if (object.messageType) { + if (!Array.isArray(object.messageType)) + throw TypeError(".google.protobuf.FileDescriptorProto.messageType: array expected"); + message.messageType = []; + for (var i = 0; i < object.messageType.length; ++i) { + if (typeof object.messageType[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.messageType: object expected"); + message.messageType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.messageType[i]); + } + } + if (object.enumType) { + if (!Array.isArray(object.enumType)) + throw TypeError(".google.protobuf.FileDescriptorProto.enumType: array expected"); + message.enumType = []; + for (var i = 0; i < object.enumType.length; ++i) { + if (typeof object.enumType[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.enumType: object expected"); + message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); + } + } + if (object.service) { + if (!Array.isArray(object.service)) + throw TypeError(".google.protobuf.FileDescriptorProto.service: array expected"); + message.service = []; + for (var i = 0; i < object.service.length; ++i) { + if (typeof object.service[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.service: object expected"); + message.service[i] = $root.google.protobuf.ServiceDescriptorProto.fromObject(object.service[i]); + } + } + if (object.extension) { + if (!Array.isArray(object.extension)) + throw TypeError(".google.protobuf.FileDescriptorProto.extension: array expected"); + message.extension = []; + for (var i = 0; i < object.extension.length; ++i) { + if (typeof object.extension[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.extension: object expected"); + message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.FileOptions.fromObject(object.options); + } + if (object.sourceCodeInfo != null) { + if (typeof object.sourceCodeInfo !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.sourceCodeInfo: object expected"); + message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.fromObject(object.sourceCodeInfo); + } + if (object.syntax != null) + message.syntax = String(object.syntax); + if (object.edition != null) + message.edition = String(object.edition); + return message; + }; + + /** + * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.FileDescriptorProto} message FileDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.dependency = []; + object.messageType = []; + object.enumType = []; + object.service = []; + object.extension = []; + object.publicDependency = []; + object.weakDependency = []; + } + if (options.defaults) { + object.name = ""; + object["package"] = ""; + object.options = null; + object.sourceCodeInfo = null; + object.syntax = ""; + object.edition = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message["package"] != null && message.hasOwnProperty("package")) + object["package"] = message["package"]; + if (message.dependency && message.dependency.length) { + object.dependency = []; + for (var j = 0; j < message.dependency.length; ++j) + object.dependency[j] = message.dependency[j]; + } + if (message.messageType && message.messageType.length) { + object.messageType = []; + for (var j = 0; j < message.messageType.length; ++j) + object.messageType[j] = $root.google.protobuf.DescriptorProto.toObject(message.messageType[j], options); + } + if (message.enumType && message.enumType.length) { + object.enumType = []; + for (var j = 0; j < message.enumType.length; ++j) + object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); + } + if (message.service && message.service.length) { + object.service = []; + for (var j = 0; j < message.service.length; ++j) + object.service[j] = $root.google.protobuf.ServiceDescriptorProto.toObject(message.service[j], options); + } + if (message.extension && message.extension.length) { + object.extension = []; + for (var j = 0; j < message.extension.length; ++j) + object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.FileOptions.toObject(message.options, options); + if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) + object.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.toObject(message.sourceCodeInfo, options); + if (message.publicDependency && message.publicDependency.length) { + object.publicDependency = []; + for (var j = 0; j < message.publicDependency.length; ++j) + object.publicDependency[j] = message.publicDependency[j]; + } + if (message.weakDependency && message.weakDependency.length) { + object.weakDependency = []; + for (var j = 0; j < message.weakDependency.length; ++j) + object.weakDependency[j] = message.weakDependency[j]; + } + if (message.syntax != null && message.hasOwnProperty("syntax")) + object.syntax = message.syntax; + if (message.edition != null && message.hasOwnProperty("edition")) + object.edition = message.edition; + return object; + }; + + /** + * Converts this FileDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.FileDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + FileDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FileDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileDescriptorProto"; + }; + + return FileDescriptorProto; + })(); + + protobuf.DescriptorProto = (function() { + + /** + * Properties of a DescriptorProto. + * @memberof google.protobuf + * @interface IDescriptorProto + * @property {string|null} [name] DescriptorProto name + * @property {Array.|null} [field] DescriptorProto field + * @property {Array.|null} [extension] DescriptorProto extension + * @property {Array.|null} [nestedType] DescriptorProto nestedType + * @property {Array.|null} [enumType] DescriptorProto enumType + * @property {Array.|null} [extensionRange] DescriptorProto extensionRange + * @property {Array.|null} [oneofDecl] DescriptorProto oneofDecl + * @property {google.protobuf.IMessageOptions|null} [options] DescriptorProto options + * @property {Array.|null} [reservedRange] DescriptorProto reservedRange + * @property {Array.|null} [reservedName] DescriptorProto reservedName + */ + + /** + * Constructs a new DescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a DescriptorProto. + * @implements IDescriptorProto + * @constructor + * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set + */ + function DescriptorProto(properties) { + this.field = []; + this.extension = []; + this.nestedType = []; + this.enumType = []; + this.extensionRange = []; + this.oneofDecl = []; + this.reservedRange = []; + this.reservedName = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DescriptorProto name. + * @member {string} name + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.name = ""; + + /** + * DescriptorProto field. + * @member {Array.} field + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.field = $util.emptyArray; + + /** + * DescriptorProto extension. + * @member {Array.} extension + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.extension = $util.emptyArray; + + /** + * DescriptorProto nestedType. + * @member {Array.} nestedType + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.nestedType = $util.emptyArray; + + /** + * DescriptorProto enumType. + * @member {Array.} enumType + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.enumType = $util.emptyArray; + + /** + * DescriptorProto extensionRange. + * @member {Array.} extensionRange + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.extensionRange = $util.emptyArray; + + /** + * DescriptorProto oneofDecl. + * @member {Array.} oneofDecl + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.oneofDecl = $util.emptyArray; + + /** + * DescriptorProto options. + * @member {google.protobuf.IMessageOptions|null|undefined} options + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.options = null; + + /** + * DescriptorProto reservedRange. + * @member {Array.} reservedRange + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.reservedRange = $util.emptyArray; + + /** + * DescriptorProto reservedName. + * @member {Array.} reservedName + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.reservedName = $util.emptyArray; + + /** + * Creates a new DescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto} DescriptorProto instance + */ + DescriptorProto.create = function create(properties) { + return new DescriptorProto(properties); + }; + + /** + * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.field != null && message.field.length) + for (var i = 0; i < message.field.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.field[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.nestedType != null && message.nestedType.length) + for (var i = 0; i < message.nestedType.length; ++i) + $root.google.protobuf.DescriptorProto.encode(message.nestedType[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.enumType != null && message.enumType.length) + for (var i = 0; i < message.enumType.length; ++i) + $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.extensionRange != null && message.extensionRange.length) + for (var i = 0; i < message.extensionRange.length; ++i) + $root.google.protobuf.DescriptorProto.ExtensionRange.encode(message.extensionRange[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.extension != null && message.extension.length) + for (var i = 0; i < message.extension.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.MessageOptions.encode(message.options, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.oneofDecl != null && message.oneofDecl.length) + for (var i = 0; i < message.oneofDecl.length; ++i) + $root.google.protobuf.OneofDescriptorProto.encode(message.oneofDecl[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.reservedRange != null && message.reservedRange.length) + for (var i = 0; i < message.reservedRange.length; ++i) + $root.google.protobuf.DescriptorProto.ReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.reservedName != null && message.reservedName.length) + for (var i = 0; i < message.reservedName.length; ++i) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.reservedName[i]); + return writer; + }; + + /** + * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto} DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.field && message.field.length)) + message.field = []; + message.field.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.extension && message.extension.length)) + message.extension = []; + message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.nestedType && message.nestedType.length)) + message.nestedType = []; + message.nestedType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); + break; + } + case 4: { + if (!(message.enumType && message.enumType.length)) + message.enumType = []; + message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.extensionRange && message.extensionRange.length)) + message.extensionRange = []; + message.extensionRange.push($root.google.protobuf.DescriptorProto.ExtensionRange.decode(reader, reader.uint32())); + break; + } + case 8: { + if (!(message.oneofDecl && message.oneofDecl.length)) + message.oneofDecl = []; + message.oneofDecl.push($root.google.protobuf.OneofDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 7: { + message.options = $root.google.protobuf.MessageOptions.decode(reader, reader.uint32()); + break; + } + case 9: { + if (!(message.reservedRange && message.reservedRange.length)) + message.reservedRange = []; + message.reservedRange.push($root.google.protobuf.DescriptorProto.ReservedRange.decode(reader, reader.uint32())); + break; + } + case 10: { + if (!(message.reservedName && message.reservedName.length)) + message.reservedName = []; + message.reservedName.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto} DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DescriptorProto message. + * @function verify + * @memberof google.protobuf.DescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.field != null && message.hasOwnProperty("field")) { + if (!Array.isArray(message.field)) + return "field: array expected"; + for (var i = 0; i < message.field.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.field[i]); + if (error) + return "field." + error; + } + } + if (message.extension != null && message.hasOwnProperty("extension")) { + if (!Array.isArray(message.extension)) + return "extension: array expected"; + for (var i = 0; i < message.extension.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); + if (error) + return "extension." + error; + } + } + if (message.nestedType != null && message.hasOwnProperty("nestedType")) { + if (!Array.isArray(message.nestedType)) + return "nestedType: array expected"; + for (var i = 0; i < message.nestedType.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.verify(message.nestedType[i]); + if (error) + return "nestedType." + error; + } + } + if (message.enumType != null && message.hasOwnProperty("enumType")) { + if (!Array.isArray(message.enumType)) + return "enumType: array expected"; + for (var i = 0; i < message.enumType.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); + if (error) + return "enumType." + error; + } + } + if (message.extensionRange != null && message.hasOwnProperty("extensionRange")) { + if (!Array.isArray(message.extensionRange)) + return "extensionRange: array expected"; + for (var i = 0; i < message.extensionRange.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.ExtensionRange.verify(message.extensionRange[i]); + if (error) + return "extensionRange." + error; + } + } + if (message.oneofDecl != null && message.hasOwnProperty("oneofDecl")) { + if (!Array.isArray(message.oneofDecl)) + return "oneofDecl: array expected"; + for (var i = 0; i < message.oneofDecl.length; ++i) { + var error = $root.google.protobuf.OneofDescriptorProto.verify(message.oneofDecl[i]); + if (error) + return "oneofDecl." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.MessageOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { + if (!Array.isArray(message.reservedRange)) + return "reservedRange: array expected"; + for (var i = 0; i < message.reservedRange.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.ReservedRange.verify(message.reservedRange[i]); + if (error) + return "reservedRange." + error; + } + } + if (message.reservedName != null && message.hasOwnProperty("reservedName")) { + if (!Array.isArray(message.reservedName)) + return "reservedName: array expected"; + for (var i = 0; i < message.reservedName.length; ++i) + if (!$util.isString(message.reservedName[i])) + return "reservedName: string[] expected"; + } + return null; + }; + + /** + * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto} DescriptorProto + */ + DescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto) + return object; + var message = new $root.google.protobuf.DescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.field) { + if (!Array.isArray(object.field)) + throw TypeError(".google.protobuf.DescriptorProto.field: array expected"); + message.field = []; + for (var i = 0; i < object.field.length; ++i) { + if (typeof object.field[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.field: object expected"); + message.field[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.field[i]); + } + } + if (object.extension) { + if (!Array.isArray(object.extension)) + throw TypeError(".google.protobuf.DescriptorProto.extension: array expected"); + message.extension = []; + for (var i = 0; i < object.extension.length; ++i) { + if (typeof object.extension[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.extension: object expected"); + message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); + } + } + if (object.nestedType) { + if (!Array.isArray(object.nestedType)) + throw TypeError(".google.protobuf.DescriptorProto.nestedType: array expected"); + message.nestedType = []; + for (var i = 0; i < object.nestedType.length; ++i) { + if (typeof object.nestedType[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.nestedType: object expected"); + message.nestedType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.nestedType[i]); + } + } + if (object.enumType) { + if (!Array.isArray(object.enumType)) + throw TypeError(".google.protobuf.DescriptorProto.enumType: array expected"); + message.enumType = []; + for (var i = 0; i < object.enumType.length; ++i) { + if (typeof object.enumType[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.enumType: object expected"); + message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); + } + } + if (object.extensionRange) { + if (!Array.isArray(object.extensionRange)) + throw TypeError(".google.protobuf.DescriptorProto.extensionRange: array expected"); + message.extensionRange = []; + for (var i = 0; i < object.extensionRange.length; ++i) { + if (typeof object.extensionRange[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.extensionRange: object expected"); + message.extensionRange[i] = $root.google.protobuf.DescriptorProto.ExtensionRange.fromObject(object.extensionRange[i]); + } + } + if (object.oneofDecl) { + if (!Array.isArray(object.oneofDecl)) + throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: array expected"); + message.oneofDecl = []; + for (var i = 0; i < object.oneofDecl.length; ++i) { + if (typeof object.oneofDecl[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: object expected"); + message.oneofDecl[i] = $root.google.protobuf.OneofDescriptorProto.fromObject(object.oneofDecl[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.DescriptorProto.options: object expected"); + message.options = $root.google.protobuf.MessageOptions.fromObject(object.options); + } + if (object.reservedRange) { + if (!Array.isArray(object.reservedRange)) + throw TypeError(".google.protobuf.DescriptorProto.reservedRange: array expected"); + message.reservedRange = []; + for (var i = 0; i < object.reservedRange.length; ++i) { + if (typeof object.reservedRange[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.reservedRange: object expected"); + message.reservedRange[i] = $root.google.protobuf.DescriptorProto.ReservedRange.fromObject(object.reservedRange[i]); + } + } + if (object.reservedName) { + if (!Array.isArray(object.reservedName)) + throw TypeError(".google.protobuf.DescriptorProto.reservedName: array expected"); + message.reservedName = []; + for (var i = 0; i < object.reservedName.length; ++i) + message.reservedName[i] = String(object.reservedName[i]); + } + return message; + }; + + /** + * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.DescriptorProto} message DescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.field = []; + object.nestedType = []; + object.enumType = []; + object.extensionRange = []; + object.extension = []; + object.oneofDecl = []; + object.reservedRange = []; + object.reservedName = []; + } + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.field && message.field.length) { + object.field = []; + for (var j = 0; j < message.field.length; ++j) + object.field[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.field[j], options); + } + if (message.nestedType && message.nestedType.length) { + object.nestedType = []; + for (var j = 0; j < message.nestedType.length; ++j) + object.nestedType[j] = $root.google.protobuf.DescriptorProto.toObject(message.nestedType[j], options); + } + if (message.enumType && message.enumType.length) { + object.enumType = []; + for (var j = 0; j < message.enumType.length; ++j) + object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); + } + if (message.extensionRange && message.extensionRange.length) { + object.extensionRange = []; + for (var j = 0; j < message.extensionRange.length; ++j) + object.extensionRange[j] = $root.google.protobuf.DescriptorProto.ExtensionRange.toObject(message.extensionRange[j], options); + } + if (message.extension && message.extension.length) { + object.extension = []; + for (var j = 0; j < message.extension.length; ++j) + object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.MessageOptions.toObject(message.options, options); + if (message.oneofDecl && message.oneofDecl.length) { + object.oneofDecl = []; + for (var j = 0; j < message.oneofDecl.length; ++j) + object.oneofDecl[j] = $root.google.protobuf.OneofDescriptorProto.toObject(message.oneofDecl[j], options); + } + if (message.reservedRange && message.reservedRange.length) { + object.reservedRange = []; + for (var j = 0; j < message.reservedRange.length; ++j) + object.reservedRange[j] = $root.google.protobuf.DescriptorProto.ReservedRange.toObject(message.reservedRange[j], options); + } + if (message.reservedName && message.reservedName.length) { + object.reservedName = []; + for (var j = 0; j < message.reservedName.length; ++j) + object.reservedName[j] = message.reservedName[j]; + } + return object; + }; + + /** + * Converts this DescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto + * @instance + * @returns {Object.} JSON object + */ + DescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto"; + }; + + DescriptorProto.ExtensionRange = (function() { + + /** + * Properties of an ExtensionRange. + * @memberof google.protobuf.DescriptorProto + * @interface IExtensionRange + * @property {number|null} [start] ExtensionRange start + * @property {number|null} [end] ExtensionRange end + * @property {google.protobuf.IExtensionRangeOptions|null} [options] ExtensionRange options + */ + + /** + * Constructs a new ExtensionRange. + * @memberof google.protobuf.DescriptorProto + * @classdesc Represents an ExtensionRange. + * @implements IExtensionRange + * @constructor + * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set + */ + function ExtensionRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExtensionRange start. + * @member {number} start + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.start = 0; + + /** + * ExtensionRange end. + * @member {number} end + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.end = 0; + + /** + * ExtensionRange options. + * @member {google.protobuf.IExtensionRangeOptions|null|undefined} options + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.options = null; + + /** + * Creates a new ExtensionRange instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange instance + */ + ExtensionRange.create = function create(properties) { + return new ExtensionRange(properties); + }; + + /** + * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.ExtensionRangeOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRange.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.start = reader.int32(); + break; + } + case 2: { + message.end = reader.int32(); + break; + } + case 3: { + message.options = $root.google.protobuf.ExtensionRangeOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExtensionRange message. + * @function verify + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExtensionRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.ExtensionRangeOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + */ + ExtensionRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto.ExtensionRange) + return object; + var message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.DescriptorProto.ExtensionRange.options: object expected"); + message.options = $root.google.protobuf.ExtensionRangeOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.ExtensionRange} message ExtensionRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExtensionRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + object.options = null; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.ExtensionRangeOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this ExtensionRange to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + * @returns {Object.} JSON object + */ + ExtensionRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExtensionRange + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExtensionRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto.ExtensionRange"; + }; + + return ExtensionRange; + })(); + + DescriptorProto.ReservedRange = (function() { + + /** + * Properties of a ReservedRange. + * @memberof google.protobuf.DescriptorProto + * @interface IReservedRange + * @property {number|null} [start] ReservedRange start + * @property {number|null} [end] ReservedRange end + */ + + /** + * Constructs a new ReservedRange. + * @memberof google.protobuf.DescriptorProto + * @classdesc Represents a ReservedRange. + * @implements IReservedRange + * @constructor + * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set + */ + function ReservedRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReservedRange start. + * @member {number} start + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + */ + ReservedRange.prototype.start = 0; + + /** + * ReservedRange end. + * @member {number} end + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + */ + ReservedRange.prototype.end = 0; + + /** + * Creates a new ReservedRange instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange instance + */ + ReservedRange.create = function create(properties) { + return new ReservedRange(properties); + }; + + /** + * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReservedRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + return writer; + }; + + /** + * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReservedRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReservedRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReservedRange.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ReservedRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.start = reader.int32(); + break; + } + case 2: { + message.end = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReservedRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReservedRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReservedRange message. + * @function verify + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReservedRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + return null; + }; + + /** + * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + */ + ReservedRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto.ReservedRange) + return object; + var message = new $root.google.protobuf.DescriptorProto.ReservedRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + return message; + }; + + /** + * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.ReservedRange} message ReservedRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReservedRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + return object; + }; + + /** + * Converts this ReservedRange to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + * @returns {Object.} JSON object + */ + ReservedRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReservedRange + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReservedRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto.ReservedRange"; + }; + + return ReservedRange; + })(); + + return DescriptorProto; + })(); + + protobuf.ExtensionRangeOptions = (function() { + + /** + * Properties of an ExtensionRangeOptions. + * @memberof google.protobuf + * @interface IExtensionRangeOptions + * @property {Array.|null} [uninterpretedOption] ExtensionRangeOptions uninterpretedOption + */ + + /** + * Constructs a new ExtensionRangeOptions. + * @memberof google.protobuf + * @classdesc Represents an ExtensionRangeOptions. + * @implements IExtensionRangeOptions + * @constructor + * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set + */ + function ExtensionRangeOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExtensionRangeOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new ExtensionRangeOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions instance + */ + ExtensionRangeOptions.create = function create(properties) { + return new ExtensionRangeOptions(properties); + }; + + /** + * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRangeOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRangeOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRangeOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ExtensionRangeOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRangeOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExtensionRangeOptions message. + * @function verify + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExtensionRangeOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + */ + ExtensionRangeOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ExtensionRangeOptions) + return object; + var message = new $root.google.protobuf.ExtensionRangeOptions(); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.ExtensionRangeOptions} message ExtensionRangeOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExtensionRangeOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this ExtensionRangeOptions to JSON. + * @function toJSON + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + * @returns {Object.} JSON object + */ + ExtensionRangeOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExtensionRangeOptions + * @function getTypeUrl + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExtensionRangeOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ExtensionRangeOptions"; + }; + + return ExtensionRangeOptions; + })(); + + protobuf.FieldDescriptorProto = (function() { + + /** + * Properties of a FieldDescriptorProto. + * @memberof google.protobuf + * @interface IFieldDescriptorProto + * @property {string|null} [name] FieldDescriptorProto name + * @property {number|null} [number] FieldDescriptorProto number + * @property {google.protobuf.FieldDescriptorProto.Label|null} [label] FieldDescriptorProto label + * @property {google.protobuf.FieldDescriptorProto.Type|null} [type] FieldDescriptorProto type + * @property {string|null} [typeName] FieldDescriptorProto typeName + * @property {string|null} [extendee] FieldDescriptorProto extendee + * @property {string|null} [defaultValue] FieldDescriptorProto defaultValue + * @property {number|null} [oneofIndex] FieldDescriptorProto oneofIndex + * @property {string|null} [jsonName] FieldDescriptorProto jsonName + * @property {google.protobuf.IFieldOptions|null} [options] FieldDescriptorProto options + * @property {boolean|null} [proto3Optional] FieldDescriptorProto proto3Optional + */ + + /** + * Constructs a new FieldDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a FieldDescriptorProto. + * @implements IFieldDescriptorProto + * @constructor + * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set + */ + function FieldDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.name = ""; + + /** + * FieldDescriptorProto number. + * @member {number} number + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.number = 0; + + /** + * FieldDescriptorProto label. + * @member {google.protobuf.FieldDescriptorProto.Label} label + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.label = 1; + + /** + * FieldDescriptorProto type. + * @member {google.protobuf.FieldDescriptorProto.Type} type + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.type = 1; + + /** + * FieldDescriptorProto typeName. + * @member {string} typeName + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.typeName = ""; + + /** + * FieldDescriptorProto extendee. + * @member {string} extendee + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.extendee = ""; + + /** + * FieldDescriptorProto defaultValue. + * @member {string} defaultValue + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.defaultValue = ""; + + /** + * FieldDescriptorProto oneofIndex. + * @member {number} oneofIndex + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.oneofIndex = 0; + + /** + * FieldDescriptorProto jsonName. + * @member {string} jsonName + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.jsonName = ""; + + /** + * FieldDescriptorProto options. + * @member {google.protobuf.IFieldOptions|null|undefined} options + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.options = null; + + /** + * FieldDescriptorProto proto3Optional. + * @member {boolean} proto3Optional + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.proto3Optional = false; + + /** + * Creates a new FieldDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto instance + */ + FieldDescriptorProto.create = function create(properties) { + return new FieldDescriptorProto(properties); + }; + + /** + * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.extendee != null && Object.hasOwnProperty.call(message, "extendee")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.extendee); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.number); + if (message.label != null && Object.hasOwnProperty.call(message, "label")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.label); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.type); + if (message.typeName != null && Object.hasOwnProperty.call(message, "typeName")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.typeName); + if (message.defaultValue != null && Object.hasOwnProperty.call(message, "defaultValue")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.defaultValue); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.FieldOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.oneofIndex != null && Object.hasOwnProperty.call(message, "oneofIndex")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.oneofIndex); + if (message.jsonName != null && Object.hasOwnProperty.call(message, "jsonName")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.jsonName); + if (message.proto3Optional != null && Object.hasOwnProperty.call(message, "proto3Optional")) + writer.uint32(/* id 17, wireType 0 =*/136).bool(message.proto3Optional); + return writer; + }; + + /** + * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 3: { + message.number = reader.int32(); + break; + } + case 4: { + message.label = reader.int32(); + break; + } + case 5: { + message.type = reader.int32(); + break; + } + case 6: { + message.typeName = reader.string(); + break; + } + case 2: { + message.extendee = reader.string(); + break; + } + case 7: { + message.defaultValue = reader.string(); + break; + } + case 9: { + message.oneofIndex = reader.int32(); + break; + } + case 10: { + message.jsonName = reader.string(); + break; + } + case 8: { + message.options = $root.google.protobuf.FieldOptions.decode(reader, reader.uint32()); + break; + } + case 17: { + message.proto3Optional = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldDescriptorProto message. + * @function verify + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.label != null && message.hasOwnProperty("label")) + switch (message.label) { + default: + return "label: enum value expected"; + case 1: + case 2: + case 3: + break; + } + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + case 17: + case 18: + break; + } + if (message.typeName != null && message.hasOwnProperty("typeName")) + if (!$util.isString(message.typeName)) + return "typeName: string expected"; + if (message.extendee != null && message.hasOwnProperty("extendee")) + if (!$util.isString(message.extendee)) + return "extendee: string expected"; + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + if (!$util.isString(message.defaultValue)) + return "defaultValue: string expected"; + if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) + if (!$util.isInteger(message.oneofIndex)) + return "oneofIndex: integer expected"; + if (message.jsonName != null && message.hasOwnProperty("jsonName")) + if (!$util.isString(message.jsonName)) + return "jsonName: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.FieldOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) + if (typeof message.proto3Optional !== "boolean") + return "proto3Optional: boolean expected"; + return null; + }; + + /** + * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + */ + FieldDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldDescriptorProto) + return object; + var message = new $root.google.protobuf.FieldDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.number != null) + message.number = object.number | 0; + switch (object.label) { + default: + if (typeof object.label === "number") { + message.label = object.label; + break; + } + break; + case "LABEL_OPTIONAL": + case 1: + message.label = 1; + break; + case "LABEL_REQUIRED": + case 2: + message.label = 2; + break; + case "LABEL_REPEATED": + case 3: + message.label = 3; + break; + } + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "TYPE_DOUBLE": + case 1: + message.type = 1; + break; + case "TYPE_FLOAT": + case 2: + message.type = 2; + break; + case "TYPE_INT64": + case 3: + message.type = 3; + break; + case "TYPE_UINT64": + case 4: + message.type = 4; + break; + case "TYPE_INT32": + case 5: + message.type = 5; + break; + case "TYPE_FIXED64": + case 6: + message.type = 6; + break; + case "TYPE_FIXED32": + case 7: + message.type = 7; + break; + case "TYPE_BOOL": + case 8: + message.type = 8; + break; + case "TYPE_STRING": + case 9: + message.type = 9; + break; + case "TYPE_GROUP": + case 10: + message.type = 10; + break; + case "TYPE_MESSAGE": + case 11: + message.type = 11; + break; + case "TYPE_BYTES": + case 12: + message.type = 12; + break; + case "TYPE_UINT32": + case 13: + message.type = 13; + break; + case "TYPE_ENUM": + case 14: + message.type = 14; + break; + case "TYPE_SFIXED32": + case 15: + message.type = 15; + break; + case "TYPE_SFIXED64": + case 16: + message.type = 16; + break; + case "TYPE_SINT32": + case 17: + message.type = 17; + break; + case "TYPE_SINT64": + case 18: + message.type = 18; + break; + } + if (object.typeName != null) + message.typeName = String(object.typeName); + if (object.extendee != null) + message.extendee = String(object.extendee); + if (object.defaultValue != null) + message.defaultValue = String(object.defaultValue); + if (object.oneofIndex != null) + message.oneofIndex = object.oneofIndex | 0; + if (object.jsonName != null) + message.jsonName = String(object.jsonName); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.FieldDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.FieldOptions.fromObject(object.options); + } + if (object.proto3Optional != null) + message.proto3Optional = Boolean(object.proto3Optional); + return message; + }; + + /** + * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.FieldDescriptorProto} message FieldDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.extendee = ""; + object.number = 0; + object.label = options.enums === String ? "LABEL_OPTIONAL" : 1; + object.type = options.enums === String ? "TYPE_DOUBLE" : 1; + object.typeName = ""; + object.defaultValue = ""; + object.options = null; + object.oneofIndex = 0; + object.jsonName = ""; + object.proto3Optional = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.extendee != null && message.hasOwnProperty("extendee")) + object.extendee = message.extendee; + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.label != null && message.hasOwnProperty("label")) + object.label = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Label[message.label] === undefined ? message.label : $root.google.protobuf.FieldDescriptorProto.Label[message.label] : message.label; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Type[message.type] === undefined ? message.type : $root.google.protobuf.FieldDescriptorProto.Type[message.type] : message.type; + if (message.typeName != null && message.hasOwnProperty("typeName")) + object.typeName = message.typeName; + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + object.defaultValue = message.defaultValue; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.FieldOptions.toObject(message.options, options); + if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) + object.oneofIndex = message.oneofIndex; + if (message.jsonName != null && message.hasOwnProperty("jsonName")) + object.jsonName = message.jsonName; + if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) + object.proto3Optional = message.proto3Optional; + return object; + }; + + /** + * Converts this FieldDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.FieldDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + FieldDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldDescriptorProto"; + }; + + /** + * Type enum. + * @name google.protobuf.FieldDescriptorProto.Type + * @enum {number} + * @property {number} TYPE_DOUBLE=1 TYPE_DOUBLE value + * @property {number} TYPE_FLOAT=2 TYPE_FLOAT value + * @property {number} TYPE_INT64=3 TYPE_INT64 value + * @property {number} TYPE_UINT64=4 TYPE_UINT64 value + * @property {number} TYPE_INT32=5 TYPE_INT32 value + * @property {number} TYPE_FIXED64=6 TYPE_FIXED64 value + * @property {number} TYPE_FIXED32=7 TYPE_FIXED32 value + * @property {number} TYPE_BOOL=8 TYPE_BOOL value + * @property {number} TYPE_STRING=9 TYPE_STRING value + * @property {number} TYPE_GROUP=10 TYPE_GROUP value + * @property {number} TYPE_MESSAGE=11 TYPE_MESSAGE value + * @property {number} TYPE_BYTES=12 TYPE_BYTES value + * @property {number} TYPE_UINT32=13 TYPE_UINT32 value + * @property {number} TYPE_ENUM=14 TYPE_ENUM value + * @property {number} TYPE_SFIXED32=15 TYPE_SFIXED32 value + * @property {number} TYPE_SFIXED64=16 TYPE_SFIXED64 value + * @property {number} TYPE_SINT32=17 TYPE_SINT32 value + * @property {number} TYPE_SINT64=18 TYPE_SINT64 value + */ + FieldDescriptorProto.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "TYPE_DOUBLE"] = 1; + values[valuesById[2] = "TYPE_FLOAT"] = 2; + values[valuesById[3] = "TYPE_INT64"] = 3; + values[valuesById[4] = "TYPE_UINT64"] = 4; + values[valuesById[5] = "TYPE_INT32"] = 5; + values[valuesById[6] = "TYPE_FIXED64"] = 6; + values[valuesById[7] = "TYPE_FIXED32"] = 7; + values[valuesById[8] = "TYPE_BOOL"] = 8; + values[valuesById[9] = "TYPE_STRING"] = 9; + values[valuesById[10] = "TYPE_GROUP"] = 10; + values[valuesById[11] = "TYPE_MESSAGE"] = 11; + values[valuesById[12] = "TYPE_BYTES"] = 12; + values[valuesById[13] = "TYPE_UINT32"] = 13; + values[valuesById[14] = "TYPE_ENUM"] = 14; + values[valuesById[15] = "TYPE_SFIXED32"] = 15; + values[valuesById[16] = "TYPE_SFIXED64"] = 16; + values[valuesById[17] = "TYPE_SINT32"] = 17; + values[valuesById[18] = "TYPE_SINT64"] = 18; + return values; + })(); + + /** + * Label enum. + * @name google.protobuf.FieldDescriptorProto.Label + * @enum {number} + * @property {number} LABEL_OPTIONAL=1 LABEL_OPTIONAL value + * @property {number} LABEL_REQUIRED=2 LABEL_REQUIRED value + * @property {number} LABEL_REPEATED=3 LABEL_REPEATED value + */ + FieldDescriptorProto.Label = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "LABEL_OPTIONAL"] = 1; + values[valuesById[2] = "LABEL_REQUIRED"] = 2; + values[valuesById[3] = "LABEL_REPEATED"] = 3; + return values; + })(); + + return FieldDescriptorProto; + })(); + + protobuf.OneofDescriptorProto = (function() { + + /** + * Properties of an OneofDescriptorProto. + * @memberof google.protobuf + * @interface IOneofDescriptorProto + * @property {string|null} [name] OneofDescriptorProto name + * @property {google.protobuf.IOneofOptions|null} [options] OneofDescriptorProto options + */ + + /** + * Constructs a new OneofDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an OneofDescriptorProto. + * @implements IOneofDescriptorProto + * @constructor + * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set + */ + function OneofDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OneofDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.OneofDescriptorProto + * @instance + */ + OneofDescriptorProto.prototype.name = ""; + + /** + * OneofDescriptorProto options. + * @member {google.protobuf.IOneofOptions|null|undefined} options + * @memberof google.protobuf.OneofDescriptorProto + * @instance + */ + OneofDescriptorProto.prototype.options = null; + + /** + * Creates a new OneofDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto instance + */ + OneofDescriptorProto.create = function create(properties) { + return new OneofDescriptorProto(properties); + }; + + /** + * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.OneofOptions.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.options = $root.google.protobuf.OneofOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OneofDescriptorProto message. + * @function verify + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OneofDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.OneofOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + */ + OneofDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.OneofDescriptorProto) + return object; + var message = new $root.google.protobuf.OneofDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.OneofDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.OneofOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.OneofDescriptorProto} message OneofDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OneofDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.OneofOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this OneofDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.OneofDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + OneofDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OneofDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OneofDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.OneofDescriptorProto"; + }; + + return OneofDescriptorProto; + })(); + + protobuf.EnumDescriptorProto = (function() { + + /** + * Properties of an EnumDescriptorProto. + * @memberof google.protobuf + * @interface IEnumDescriptorProto + * @property {string|null} [name] EnumDescriptorProto name + * @property {Array.|null} [value] EnumDescriptorProto value + * @property {google.protobuf.IEnumOptions|null} [options] EnumDescriptorProto options + * @property {Array.|null} [reservedRange] EnumDescriptorProto reservedRange + * @property {Array.|null} [reservedName] EnumDescriptorProto reservedName + */ + + /** + * Constructs a new EnumDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an EnumDescriptorProto. + * @implements IEnumDescriptorProto + * @constructor + * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set + */ + function EnumDescriptorProto(properties) { + this.value = []; + this.reservedRange = []; + this.reservedName = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.name = ""; + + /** + * EnumDescriptorProto value. + * @member {Array.} value + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.value = $util.emptyArray; + + /** + * EnumDescriptorProto options. + * @member {google.protobuf.IEnumOptions|null|undefined} options + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.options = null; + + /** + * EnumDescriptorProto reservedRange. + * @member {Array.} reservedRange + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.reservedRange = $util.emptyArray; + + /** + * EnumDescriptorProto reservedName. + * @member {Array.} reservedName + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.reservedName = $util.emptyArray; + + /** + * Creates a new EnumDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto instance + */ + EnumDescriptorProto.create = function create(properties) { + return new EnumDescriptorProto(properties); + }; + + /** + * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.value != null && message.value.length) + for (var i = 0; i < message.value.length; ++i) + $root.google.protobuf.EnumValueDescriptorProto.encode(message.value[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.EnumOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.reservedRange != null && message.reservedRange.length) + for (var i = 0; i < message.reservedRange.length; ++i) + $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.reservedName != null && message.reservedName.length) + for (var i = 0; i < message.reservedName.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.reservedName[i]); + return writer; + }; + + /** + * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.value && message.value.length)) + message.value = []; + message.value.push($root.google.protobuf.EnumValueDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 3: { + message.options = $root.google.protobuf.EnumOptions.decode(reader, reader.uint32()); + break; + } + case 4: { + if (!(message.reservedRange && message.reservedRange.length)) + message.reservedRange = []; + message.reservedRange.push($root.google.protobuf.EnumDescriptorProto.EnumReservedRange.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.reservedName && message.reservedName.length)) + message.reservedName = []; + message.reservedName.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumDescriptorProto message. + * @function verify + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.value != null && message.hasOwnProperty("value")) { + if (!Array.isArray(message.value)) + return "value: array expected"; + for (var i = 0; i < message.value.length; ++i) { + var error = $root.google.protobuf.EnumValueDescriptorProto.verify(message.value[i]); + if (error) + return "value." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.EnumOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { + if (!Array.isArray(message.reservedRange)) + return "reservedRange: array expected"; + for (var i = 0; i < message.reservedRange.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.verify(message.reservedRange[i]); + if (error) + return "reservedRange." + error; + } + } + if (message.reservedName != null && message.hasOwnProperty("reservedName")) { + if (!Array.isArray(message.reservedName)) + return "reservedName: array expected"; + for (var i = 0; i < message.reservedName.length; ++i) + if (!$util.isString(message.reservedName[i])) + return "reservedName: string[] expected"; + } + return null; + }; + + /** + * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + */ + EnumDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumDescriptorProto) + return object; + var message = new $root.google.protobuf.EnumDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.value) { + if (!Array.isArray(object.value)) + throw TypeError(".google.protobuf.EnumDescriptorProto.value: array expected"); + message.value = []; + for (var i = 0; i < object.value.length; ++i) { + if (typeof object.value[i] !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.value: object expected"); + message.value[i] = $root.google.protobuf.EnumValueDescriptorProto.fromObject(object.value[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.EnumOptions.fromObject(object.options); + } + if (object.reservedRange) { + if (!Array.isArray(object.reservedRange)) + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: array expected"); + message.reservedRange = []; + for (var i = 0; i < object.reservedRange.length; ++i) { + if (typeof object.reservedRange[i] !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: object expected"); + message.reservedRange[i] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.fromObject(object.reservedRange[i]); + } + } + if (object.reservedName) { + if (!Array.isArray(object.reservedName)) + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedName: array expected"); + message.reservedName = []; + for (var i = 0; i < object.reservedName.length; ++i) + message.reservedName[i] = String(object.reservedName[i]); + } + return message; + }; + + /** + * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.EnumDescriptorProto} message EnumDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.value = []; + object.reservedRange = []; + object.reservedName = []; + } + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.value && message.value.length) { + object.value = []; + for (var j = 0; j < message.value.length; ++j) + object.value[j] = $root.google.protobuf.EnumValueDescriptorProto.toObject(message.value[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.EnumOptions.toObject(message.options, options); + if (message.reservedRange && message.reservedRange.length) { + object.reservedRange = []; + for (var j = 0; j < message.reservedRange.length; ++j) + object.reservedRange[j] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.toObject(message.reservedRange[j], options); + } + if (message.reservedName && message.reservedName.length) { + object.reservedName = []; + for (var j = 0; j < message.reservedName.length; ++j) + object.reservedName[j] = message.reservedName[j]; + } + return object; + }; + + /** + * Converts this EnumDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.EnumDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + EnumDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumDescriptorProto"; + }; + + EnumDescriptorProto.EnumReservedRange = (function() { + + /** + * Properties of an EnumReservedRange. + * @memberof google.protobuf.EnumDescriptorProto + * @interface IEnumReservedRange + * @property {number|null} [start] EnumReservedRange start + * @property {number|null} [end] EnumReservedRange end + */ + + /** + * Constructs a new EnumReservedRange. + * @memberof google.protobuf.EnumDescriptorProto + * @classdesc Represents an EnumReservedRange. + * @implements IEnumReservedRange + * @constructor + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set + */ + function EnumReservedRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumReservedRange start. + * @member {number} start + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + */ + EnumReservedRange.prototype.start = 0; + + /** + * EnumReservedRange end. + * @member {number} end + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + */ + EnumReservedRange.prototype.end = 0; + + /** + * Creates a new EnumReservedRange instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange instance + */ + EnumReservedRange.create = function create(properties) { + return new EnumReservedRange(properties); + }; + + /** + * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumReservedRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + return writer; + }; + + /** + * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumReservedRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumReservedRange.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.start = reader.int32(); + break; + } + case 2: { + message.end = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumReservedRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumReservedRange message. + * @function verify + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumReservedRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + return null; + }; + + /** + * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + */ + EnumReservedRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumDescriptorProto.EnumReservedRange) + return object; + var message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + return message; + }; + + /** + * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.EnumReservedRange} message EnumReservedRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumReservedRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + return object; + }; + + /** + * Converts this EnumReservedRange to JSON. + * @function toJSON + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + * @returns {Object.} JSON object + */ + EnumReservedRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumReservedRange + * @function getTypeUrl + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumReservedRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumDescriptorProto.EnumReservedRange"; + }; + + return EnumReservedRange; + })(); + + return EnumDescriptorProto; + })(); + + protobuf.EnumValueDescriptorProto = (function() { + + /** + * Properties of an EnumValueDescriptorProto. + * @memberof google.protobuf + * @interface IEnumValueDescriptorProto + * @property {string|null} [name] EnumValueDescriptorProto name + * @property {number|null} [number] EnumValueDescriptorProto number + * @property {google.protobuf.IEnumValueOptions|null} [options] EnumValueDescriptorProto options + */ + + /** + * Constructs a new EnumValueDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an EnumValueDescriptorProto. + * @implements IEnumValueDescriptorProto + * @constructor + * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set + */ + function EnumValueDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumValueDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.name = ""; + + /** + * EnumValueDescriptorProto number. + * @member {number} number + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.number = 0; + + /** + * EnumValueDescriptorProto options. + * @member {google.protobuf.IEnumValueOptions|null|undefined} options + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.options = null; + + /** + * Creates a new EnumValueDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto instance + */ + EnumValueDescriptorProto.create = function create(properties) { + return new EnumValueDescriptorProto(properties); + }; + + /** + * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.number); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.EnumValueOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.number = reader.int32(); + break; + } + case 3: { + message.options = $root.google.protobuf.EnumValueOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumValueDescriptorProto message. + * @function verify + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumValueDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.EnumValueOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + */ + EnumValueDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumValueDescriptorProto) + return object; + var message = new $root.google.protobuf.EnumValueDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.number != null) + message.number = object.number | 0; + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.EnumValueDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.EnumValueOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.EnumValueDescriptorProto} message EnumValueDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumValueDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.number = 0; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.EnumValueOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this EnumValueDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + EnumValueDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumValueDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumValueDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumValueDescriptorProto"; + }; + + return EnumValueDescriptorProto; + })(); + + protobuf.ServiceDescriptorProto = (function() { + + /** + * Properties of a ServiceDescriptorProto. + * @memberof google.protobuf + * @interface IServiceDescriptorProto + * @property {string|null} [name] ServiceDescriptorProto name + * @property {Array.|null} [method] ServiceDescriptorProto method + * @property {google.protobuf.IServiceOptions|null} [options] ServiceDescriptorProto options + */ + + /** + * Constructs a new ServiceDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a ServiceDescriptorProto. + * @implements IServiceDescriptorProto + * @constructor + * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set + */ + function ServiceDescriptorProto(properties) { + this.method = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ServiceDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.name = ""; + + /** + * ServiceDescriptorProto method. + * @member {Array.} method + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.method = $util.emptyArray; + + /** + * ServiceDescriptorProto options. + * @member {google.protobuf.IServiceOptions|null|undefined} options + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.options = null; + + /** + * Creates a new ServiceDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto instance + */ + ServiceDescriptorProto.create = function create(properties) { + return new ServiceDescriptorProto(properties); + }; + + /** + * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.method != null && message.method.length) + for (var i = 0; i < message.method.length; ++i) + $root.google.protobuf.MethodDescriptorProto.encode(message.method[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.ServiceOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.method && message.method.length)) + message.method = []; + message.method.push($root.google.protobuf.MethodDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 3: { + message.options = $root.google.protobuf.ServiceOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceDescriptorProto message. + * @function verify + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.method != null && message.hasOwnProperty("method")) { + if (!Array.isArray(message.method)) + return "method: array expected"; + for (var i = 0; i < message.method.length; ++i) { + var error = $root.google.protobuf.MethodDescriptorProto.verify(message.method[i]); + if (error) + return "method." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.ServiceOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + */ + ServiceDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ServiceDescriptorProto) + return object; + var message = new $root.google.protobuf.ServiceDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.method) { + if (!Array.isArray(object.method)) + throw TypeError(".google.protobuf.ServiceDescriptorProto.method: array expected"); + message.method = []; + for (var i = 0; i < object.method.length; ++i) { + if (typeof object.method[i] !== "object") + throw TypeError(".google.protobuf.ServiceDescriptorProto.method: object expected"); + message.method[i] = $root.google.protobuf.MethodDescriptorProto.fromObject(object.method[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.ServiceDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.ServiceOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.ServiceDescriptorProto} message ServiceDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.method = []; + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.method && message.method.length) { + object.method = []; + for (var j = 0; j < message.method.length; ++j) + object.method[j] = $root.google.protobuf.MethodDescriptorProto.toObject(message.method[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.ServiceOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this ServiceDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + ServiceDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ServiceDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ServiceDescriptorProto"; + }; + + return ServiceDescriptorProto; + })(); + + protobuf.MethodDescriptorProto = (function() { + + /** + * Properties of a MethodDescriptorProto. + * @memberof google.protobuf + * @interface IMethodDescriptorProto + * @property {string|null} [name] MethodDescriptorProto name + * @property {string|null} [inputType] MethodDescriptorProto inputType + * @property {string|null} [outputType] MethodDescriptorProto outputType + * @property {google.protobuf.IMethodOptions|null} [options] MethodDescriptorProto options + * @property {boolean|null} [clientStreaming] MethodDescriptorProto clientStreaming + * @property {boolean|null} [serverStreaming] MethodDescriptorProto serverStreaming + */ + + /** + * Constructs a new MethodDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a MethodDescriptorProto. + * @implements IMethodDescriptorProto + * @constructor + * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set + */ + function MethodDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MethodDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.name = ""; + + /** + * MethodDescriptorProto inputType. + * @member {string} inputType + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.inputType = ""; + + /** + * MethodDescriptorProto outputType. + * @member {string} outputType + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.outputType = ""; + + /** + * MethodDescriptorProto options. + * @member {google.protobuf.IMethodOptions|null|undefined} options + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.options = null; + + /** + * MethodDescriptorProto clientStreaming. + * @member {boolean} clientStreaming + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.clientStreaming = false; + + /** + * MethodDescriptorProto serverStreaming. + * @member {boolean} serverStreaming + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.serverStreaming = false; + + /** + * Creates a new MethodDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto instance + */ + MethodDescriptorProto.create = function create(properties) { + return new MethodDescriptorProto(properties); + }; + + /** + * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.inputType != null && Object.hasOwnProperty.call(message, "inputType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.inputType); + if (message.outputType != null && Object.hasOwnProperty.call(message, "outputType")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.outputType); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.MethodOptions.encode(message.options, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.clientStreaming != null && Object.hasOwnProperty.call(message, "clientStreaming")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.clientStreaming); + if (message.serverStreaming != null && Object.hasOwnProperty.call(message, "serverStreaming")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.serverStreaming); + return writer; + }; + + /** + * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.inputType = reader.string(); + break; + } + case 3: { + message.outputType = reader.string(); + break; + } + case 4: { + message.options = $root.google.protobuf.MethodOptions.decode(reader, reader.uint32()); + break; + } + case 5: { + message.clientStreaming = reader.bool(); + break; + } + case 6: { + message.serverStreaming = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodDescriptorProto message. + * @function verify + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.inputType != null && message.hasOwnProperty("inputType")) + if (!$util.isString(message.inputType)) + return "inputType: string expected"; + if (message.outputType != null && message.hasOwnProperty("outputType")) + if (!$util.isString(message.outputType)) + return "outputType: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.MethodOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) + if (typeof message.clientStreaming !== "boolean") + return "clientStreaming: boolean expected"; + if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) + if (typeof message.serverStreaming !== "boolean") + return "serverStreaming: boolean expected"; + return null; + }; + + /** + * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + */ + MethodDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MethodDescriptorProto) + return object; + var message = new $root.google.protobuf.MethodDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.inputType != null) + message.inputType = String(object.inputType); + if (object.outputType != null) + message.outputType = String(object.outputType); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.MethodDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.MethodOptions.fromObject(object.options); + } + if (object.clientStreaming != null) + message.clientStreaming = Boolean(object.clientStreaming); + if (object.serverStreaming != null) + message.serverStreaming = Boolean(object.serverStreaming); + return message; + }; + + /** + * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.MethodDescriptorProto} message MethodDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.inputType = ""; + object.outputType = ""; + object.options = null; + object.clientStreaming = false; + object.serverStreaming = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.inputType != null && message.hasOwnProperty("inputType")) + object.inputType = message.inputType; + if (message.outputType != null && message.hasOwnProperty("outputType")) + object.outputType = message.outputType; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.MethodOptions.toObject(message.options, options); + if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) + object.clientStreaming = message.clientStreaming; + if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) + object.serverStreaming = message.serverStreaming; + return object; + }; + + /** + * Converts this MethodDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.MethodDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + MethodDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MethodDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MethodDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MethodDescriptorProto"; + }; + + return MethodDescriptorProto; + })(); + + protobuf.FileOptions = (function() { + + /** + * Properties of a FileOptions. + * @memberof google.protobuf + * @interface IFileOptions + * @property {string|null} [javaPackage] FileOptions javaPackage + * @property {string|null} [javaOuterClassname] FileOptions javaOuterClassname + * @property {boolean|null} [javaMultipleFiles] FileOptions javaMultipleFiles + * @property {boolean|null} [javaGenerateEqualsAndHash] FileOptions javaGenerateEqualsAndHash + * @property {boolean|null} [javaStringCheckUtf8] FileOptions javaStringCheckUtf8 + * @property {google.protobuf.FileOptions.OptimizeMode|null} [optimizeFor] FileOptions optimizeFor + * @property {string|null} [goPackage] FileOptions goPackage + * @property {boolean|null} [ccGenericServices] FileOptions ccGenericServices + * @property {boolean|null} [javaGenericServices] FileOptions javaGenericServices + * @property {boolean|null} [pyGenericServices] FileOptions pyGenericServices + * @property {boolean|null} [phpGenericServices] FileOptions phpGenericServices + * @property {boolean|null} [deprecated] FileOptions deprecated + * @property {boolean|null} [ccEnableArenas] FileOptions ccEnableArenas + * @property {string|null} [objcClassPrefix] FileOptions objcClassPrefix + * @property {string|null} [csharpNamespace] FileOptions csharpNamespace + * @property {string|null} [swiftPrefix] FileOptions swiftPrefix + * @property {string|null} [phpClassPrefix] FileOptions phpClassPrefix + * @property {string|null} [phpNamespace] FileOptions phpNamespace + * @property {string|null} [phpMetadataNamespace] FileOptions phpMetadataNamespace + * @property {string|null} [rubyPackage] FileOptions rubyPackage + * @property {Array.|null} [uninterpretedOption] FileOptions uninterpretedOption + * @property {Array.|null} [".google.api.resourceDefinition"] FileOptions .google.api.resourceDefinition + */ + + /** + * Constructs a new FileOptions. + * @memberof google.protobuf + * @classdesc Represents a FileOptions. + * @implements IFileOptions + * @constructor + * @param {google.protobuf.IFileOptions=} [properties] Properties to set + */ + function FileOptions(properties) { + this.uninterpretedOption = []; + this[".google.api.resourceDefinition"] = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileOptions javaPackage. + * @member {string} javaPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaPackage = ""; + + /** + * FileOptions javaOuterClassname. + * @member {string} javaOuterClassname + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaOuterClassname = ""; + + /** + * FileOptions javaMultipleFiles. + * @member {boolean} javaMultipleFiles + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaMultipleFiles = false; + + /** + * FileOptions javaGenerateEqualsAndHash. + * @member {boolean} javaGenerateEqualsAndHash + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaGenerateEqualsAndHash = false; + + /** + * FileOptions javaStringCheckUtf8. + * @member {boolean} javaStringCheckUtf8 + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaStringCheckUtf8 = false; + + /** + * FileOptions optimizeFor. + * @member {google.protobuf.FileOptions.OptimizeMode} optimizeFor + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.optimizeFor = 1; + + /** + * FileOptions goPackage. + * @member {string} goPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.goPackage = ""; + + /** + * FileOptions ccGenericServices. + * @member {boolean} ccGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.ccGenericServices = false; + + /** + * FileOptions javaGenericServices. + * @member {boolean} javaGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaGenericServices = false; + + /** + * FileOptions pyGenericServices. + * @member {boolean} pyGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.pyGenericServices = false; + + /** + * FileOptions phpGenericServices. + * @member {boolean} phpGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpGenericServices = false; + + /** + * FileOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.deprecated = false; + + /** + * FileOptions ccEnableArenas. + * @member {boolean} ccEnableArenas + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.ccEnableArenas = true; + + /** + * FileOptions objcClassPrefix. + * @member {string} objcClassPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.objcClassPrefix = ""; + + /** + * FileOptions csharpNamespace. + * @member {string} csharpNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.csharpNamespace = ""; + + /** + * FileOptions swiftPrefix. + * @member {string} swiftPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.swiftPrefix = ""; + + /** + * FileOptions phpClassPrefix. + * @member {string} phpClassPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpClassPrefix = ""; + + /** + * FileOptions phpNamespace. + * @member {string} phpNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpNamespace = ""; + + /** + * FileOptions phpMetadataNamespace. + * @member {string} phpMetadataNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpMetadataNamespace = ""; + + /** + * FileOptions rubyPackage. + * @member {string} rubyPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.rubyPackage = ""; + + /** + * FileOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * FileOptions .google.api.resourceDefinition. + * @member {Array.} .google.api.resourceDefinition + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype[".google.api.resourceDefinition"] = $util.emptyArray; + + /** + * Creates a new FileOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions=} [properties] Properties to set + * @returns {google.protobuf.FileOptions} FileOptions instance + */ + FileOptions.create = function create(properties) { + return new FileOptions(properties); + }; + + /** + * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.javaPackage != null && Object.hasOwnProperty.call(message, "javaPackage")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.javaPackage); + if (message.javaOuterClassname != null && Object.hasOwnProperty.call(message, "javaOuterClassname")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.javaOuterClassname); + if (message.optimizeFor != null && Object.hasOwnProperty.call(message, "optimizeFor")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.optimizeFor); + if (message.javaMultipleFiles != null && Object.hasOwnProperty.call(message, "javaMultipleFiles")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.javaMultipleFiles); + if (message.goPackage != null && Object.hasOwnProperty.call(message, "goPackage")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.goPackage); + if (message.ccGenericServices != null && Object.hasOwnProperty.call(message, "ccGenericServices")) + writer.uint32(/* id 16, wireType 0 =*/128).bool(message.ccGenericServices); + if (message.javaGenericServices != null && Object.hasOwnProperty.call(message, "javaGenericServices")) + writer.uint32(/* id 17, wireType 0 =*/136).bool(message.javaGenericServices); + if (message.pyGenericServices != null && Object.hasOwnProperty.call(message, "pyGenericServices")) + writer.uint32(/* id 18, wireType 0 =*/144).bool(message.pyGenericServices); + if (message.javaGenerateEqualsAndHash != null && Object.hasOwnProperty.call(message, "javaGenerateEqualsAndHash")) + writer.uint32(/* id 20, wireType 0 =*/160).bool(message.javaGenerateEqualsAndHash); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 23, wireType 0 =*/184).bool(message.deprecated); + if (message.javaStringCheckUtf8 != null && Object.hasOwnProperty.call(message, "javaStringCheckUtf8")) + writer.uint32(/* id 27, wireType 0 =*/216).bool(message.javaStringCheckUtf8); + if (message.ccEnableArenas != null && Object.hasOwnProperty.call(message, "ccEnableArenas")) + writer.uint32(/* id 31, wireType 0 =*/248).bool(message.ccEnableArenas); + if (message.objcClassPrefix != null && Object.hasOwnProperty.call(message, "objcClassPrefix")) + writer.uint32(/* id 36, wireType 2 =*/290).string(message.objcClassPrefix); + if (message.csharpNamespace != null && Object.hasOwnProperty.call(message, "csharpNamespace")) + writer.uint32(/* id 37, wireType 2 =*/298).string(message.csharpNamespace); + if (message.swiftPrefix != null && Object.hasOwnProperty.call(message, "swiftPrefix")) + writer.uint32(/* id 39, wireType 2 =*/314).string(message.swiftPrefix); + if (message.phpClassPrefix != null && Object.hasOwnProperty.call(message, "phpClassPrefix")) + writer.uint32(/* id 40, wireType 2 =*/322).string(message.phpClassPrefix); + if (message.phpNamespace != null && Object.hasOwnProperty.call(message, "phpNamespace")) + writer.uint32(/* id 41, wireType 2 =*/330).string(message.phpNamespace); + if (message.phpGenericServices != null && Object.hasOwnProperty.call(message, "phpGenericServices")) + writer.uint32(/* id 42, wireType 0 =*/336).bool(message.phpGenericServices); + if (message.phpMetadataNamespace != null && Object.hasOwnProperty.call(message, "phpMetadataNamespace")) + writer.uint32(/* id 44, wireType 2 =*/354).string(message.phpMetadataNamespace); + if (message.rubyPackage != null && Object.hasOwnProperty.call(message, "rubyPackage")) + writer.uint32(/* id 45, wireType 2 =*/362).string(message.rubyPackage); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.resourceDefinition"] != null && message[".google.api.resourceDefinition"].length) + for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) + $root.google.api.ResourceDescriptor.encode(message[".google.api.resourceDefinition"][i], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileOptions} FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.javaPackage = reader.string(); + break; + } + case 8: { + message.javaOuterClassname = reader.string(); + break; + } + case 10: { + message.javaMultipleFiles = reader.bool(); + break; + } + case 20: { + message.javaGenerateEqualsAndHash = reader.bool(); + break; + } + case 27: { + message.javaStringCheckUtf8 = reader.bool(); + break; + } + case 9: { + message.optimizeFor = reader.int32(); + break; + } + case 11: { + message.goPackage = reader.string(); + break; + } + case 16: { + message.ccGenericServices = reader.bool(); + break; + } + case 17: { + message.javaGenericServices = reader.bool(); + break; + } + case 18: { + message.pyGenericServices = reader.bool(); + break; + } + case 42: { + message.phpGenericServices = reader.bool(); + break; + } + case 23: { + message.deprecated = reader.bool(); + break; + } + case 31: { + message.ccEnableArenas = reader.bool(); + break; + } + case 36: { + message.objcClassPrefix = reader.string(); + break; + } + case 37: { + message.csharpNamespace = reader.string(); + break; + } + case 39: { + message.swiftPrefix = reader.string(); + break; + } + case 40: { + message.phpClassPrefix = reader.string(); + break; + } + case 41: { + message.phpNamespace = reader.string(); + break; + } + case 44: { + message.phpMetadataNamespace = reader.string(); + break; + } + case 45: { + message.rubyPackage = reader.string(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1053: { + if (!(message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length)) + message[".google.api.resourceDefinition"] = []; + message[".google.api.resourceDefinition"].push($root.google.api.ResourceDescriptor.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileOptions} FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileOptions message. + * @function verify + * @memberof google.protobuf.FileOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) + if (!$util.isString(message.javaPackage)) + return "javaPackage: string expected"; + if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) + if (!$util.isString(message.javaOuterClassname)) + return "javaOuterClassname: string expected"; + if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) + if (typeof message.javaMultipleFiles !== "boolean") + return "javaMultipleFiles: boolean expected"; + if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) + if (typeof message.javaGenerateEqualsAndHash !== "boolean") + return "javaGenerateEqualsAndHash: boolean expected"; + if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) + if (typeof message.javaStringCheckUtf8 !== "boolean") + return "javaStringCheckUtf8: boolean expected"; + if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) + switch (message.optimizeFor) { + default: + return "optimizeFor: enum value expected"; + case 1: + case 2: + case 3: + break; + } + if (message.goPackage != null && message.hasOwnProperty("goPackage")) + if (!$util.isString(message.goPackage)) + return "goPackage: string expected"; + if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) + if (typeof message.ccGenericServices !== "boolean") + return "ccGenericServices: boolean expected"; + if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) + if (typeof message.javaGenericServices !== "boolean") + return "javaGenericServices: boolean expected"; + if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) + if (typeof message.pyGenericServices !== "boolean") + return "pyGenericServices: boolean expected"; + if (message.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) + if (typeof message.phpGenericServices !== "boolean") + return "phpGenericServices: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) + if (typeof message.ccEnableArenas !== "boolean") + return "ccEnableArenas: boolean expected"; + if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) + if (!$util.isString(message.objcClassPrefix)) + return "objcClassPrefix: string expected"; + if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) + if (!$util.isString(message.csharpNamespace)) + return "csharpNamespace: string expected"; + if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) + if (!$util.isString(message.swiftPrefix)) + return "swiftPrefix: string expected"; + if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) + if (!$util.isString(message.phpClassPrefix)) + return "phpClassPrefix: string expected"; + if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) + if (!$util.isString(message.phpNamespace)) + return "phpNamespace: string expected"; + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + if (!$util.isString(message.phpMetadataNamespace)) + return "phpMetadataNamespace: string expected"; + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + if (!$util.isString(message.rubyPackage)) + return "rubyPackage: string expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.resourceDefinition"] != null && message.hasOwnProperty(".google.api.resourceDefinition")) { + if (!Array.isArray(message[".google.api.resourceDefinition"])) + return ".google.api.resourceDefinition: array expected"; + for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) { + var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resourceDefinition"][i]); + if (error) + return ".google.api.resourceDefinition." + error; + } + } + return null; + }; + + /** + * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileOptions} FileOptions + */ + FileOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileOptions) + return object; + var message = new $root.google.protobuf.FileOptions(); + if (object.javaPackage != null) + message.javaPackage = String(object.javaPackage); + if (object.javaOuterClassname != null) + message.javaOuterClassname = String(object.javaOuterClassname); + if (object.javaMultipleFiles != null) + message.javaMultipleFiles = Boolean(object.javaMultipleFiles); + if (object.javaGenerateEqualsAndHash != null) + message.javaGenerateEqualsAndHash = Boolean(object.javaGenerateEqualsAndHash); + if (object.javaStringCheckUtf8 != null) + message.javaStringCheckUtf8 = Boolean(object.javaStringCheckUtf8); + switch (object.optimizeFor) { + default: + if (typeof object.optimizeFor === "number") { + message.optimizeFor = object.optimizeFor; + break; + } + break; + case "SPEED": + case 1: + message.optimizeFor = 1; + break; + case "CODE_SIZE": + case 2: + message.optimizeFor = 2; + break; + case "LITE_RUNTIME": + case 3: + message.optimizeFor = 3; + break; + } + if (object.goPackage != null) + message.goPackage = String(object.goPackage); + if (object.ccGenericServices != null) + message.ccGenericServices = Boolean(object.ccGenericServices); + if (object.javaGenericServices != null) + message.javaGenericServices = Boolean(object.javaGenericServices); + if (object.pyGenericServices != null) + message.pyGenericServices = Boolean(object.pyGenericServices); + if (object.phpGenericServices != null) + message.phpGenericServices = Boolean(object.phpGenericServices); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.ccEnableArenas != null) + message.ccEnableArenas = Boolean(object.ccEnableArenas); + if (object.objcClassPrefix != null) + message.objcClassPrefix = String(object.objcClassPrefix); + if (object.csharpNamespace != null) + message.csharpNamespace = String(object.csharpNamespace); + if (object.swiftPrefix != null) + message.swiftPrefix = String(object.swiftPrefix); + if (object.phpClassPrefix != null) + message.phpClassPrefix = String(object.phpClassPrefix); + if (object.phpNamespace != null) + message.phpNamespace = String(object.phpNamespace); + if (object.phpMetadataNamespace != null) + message.phpMetadataNamespace = String(object.phpMetadataNamespace); + if (object.rubyPackage != null) + message.rubyPackage = String(object.rubyPackage); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.resourceDefinition"]) { + if (!Array.isArray(object[".google.api.resourceDefinition"])) + throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: array expected"); + message[".google.api.resourceDefinition"] = []; + for (var i = 0; i < object[".google.api.resourceDefinition"].length; ++i) { + if (typeof object[".google.api.resourceDefinition"][i] !== "object") + throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: object expected"); + message[".google.api.resourceDefinition"][i] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resourceDefinition"][i]); + } + } + return message; + }; + + /** + * Creates a plain object from a FileOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.FileOptions} message FileOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.uninterpretedOption = []; + object[".google.api.resourceDefinition"] = []; + } + if (options.defaults) { + object.javaPackage = ""; + object.javaOuterClassname = ""; + object.optimizeFor = options.enums === String ? "SPEED" : 1; + object.javaMultipleFiles = false; + object.goPackage = ""; + object.ccGenericServices = false; + object.javaGenericServices = false; + object.pyGenericServices = false; + object.javaGenerateEqualsAndHash = false; + object.deprecated = false; + object.javaStringCheckUtf8 = false; + object.ccEnableArenas = true; + object.objcClassPrefix = ""; + object.csharpNamespace = ""; + object.swiftPrefix = ""; + object.phpClassPrefix = ""; + object.phpNamespace = ""; + object.phpGenericServices = false; + object.phpMetadataNamespace = ""; + object.rubyPackage = ""; + } + if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) + object.javaPackage = message.javaPackage; + if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) + object.javaOuterClassname = message.javaOuterClassname; + if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) + object.optimizeFor = options.enums === String ? $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] === undefined ? message.optimizeFor : $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] : message.optimizeFor; + if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) + object.javaMultipleFiles = message.javaMultipleFiles; + if (message.goPackage != null && message.hasOwnProperty("goPackage")) + object.goPackage = message.goPackage; + if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) + object.ccGenericServices = message.ccGenericServices; + if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) + object.javaGenericServices = message.javaGenericServices; + if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) + object.pyGenericServices = message.pyGenericServices; + if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) + object.javaGenerateEqualsAndHash = message.javaGenerateEqualsAndHash; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) + object.javaStringCheckUtf8 = message.javaStringCheckUtf8; + if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) + object.ccEnableArenas = message.ccEnableArenas; + if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) + object.objcClassPrefix = message.objcClassPrefix; + if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) + object.csharpNamespace = message.csharpNamespace; + if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) + object.swiftPrefix = message.swiftPrefix; + if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) + object.phpClassPrefix = message.phpClassPrefix; + if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) + object.phpNamespace = message.phpNamespace; + if (message.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) + object.phpGenericServices = message.phpGenericServices; + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + object.phpMetadataNamespace = message.phpMetadataNamespace; + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + object.rubyPackage = message.rubyPackage; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length) { + object[".google.api.resourceDefinition"] = []; + for (var j = 0; j < message[".google.api.resourceDefinition"].length; ++j) + object[".google.api.resourceDefinition"][j] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resourceDefinition"][j], options); + } + return object; + }; + + /** + * Converts this FileOptions to JSON. + * @function toJSON + * @memberof google.protobuf.FileOptions + * @instance + * @returns {Object.} JSON object + */ + FileOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FileOptions + * @function getTypeUrl + * @memberof google.protobuf.FileOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileOptions"; + }; + + /** + * OptimizeMode enum. + * @name google.protobuf.FileOptions.OptimizeMode + * @enum {number} + * @property {number} SPEED=1 SPEED value + * @property {number} CODE_SIZE=2 CODE_SIZE value + * @property {number} LITE_RUNTIME=3 LITE_RUNTIME value + */ + FileOptions.OptimizeMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "SPEED"] = 1; + values[valuesById[2] = "CODE_SIZE"] = 2; + values[valuesById[3] = "LITE_RUNTIME"] = 3; + return values; + })(); + + return FileOptions; + })(); + + protobuf.MessageOptions = (function() { + + /** + * Properties of a MessageOptions. + * @memberof google.protobuf + * @interface IMessageOptions + * @property {boolean|null} [messageSetWireFormat] MessageOptions messageSetWireFormat + * @property {boolean|null} [noStandardDescriptorAccessor] MessageOptions noStandardDescriptorAccessor + * @property {boolean|null} [deprecated] MessageOptions deprecated + * @property {boolean|null} [mapEntry] MessageOptions mapEntry + * @property {Array.|null} [uninterpretedOption] MessageOptions uninterpretedOption + * @property {google.api.IResourceDescriptor|null} [".google.api.resource"] MessageOptions .google.api.resource + */ + + /** + * Constructs a new MessageOptions. + * @memberof google.protobuf + * @classdesc Represents a MessageOptions. + * @implements IMessageOptions + * @constructor + * @param {google.protobuf.IMessageOptions=} [properties] Properties to set + */ + function MessageOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MessageOptions messageSetWireFormat. + * @member {boolean} messageSetWireFormat + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.messageSetWireFormat = false; + + /** + * MessageOptions noStandardDescriptorAccessor. + * @member {boolean} noStandardDescriptorAccessor + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.noStandardDescriptorAccessor = false; + + /** + * MessageOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.deprecated = false; + + /** + * MessageOptions mapEntry. + * @member {boolean} mapEntry + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.mapEntry = false; + + /** + * MessageOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * MessageOptions .google.api.resource. + * @member {google.api.IResourceDescriptor|null|undefined} .google.api.resource + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype[".google.api.resource"] = null; + + /** + * Creates a new MessageOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions=} [properties] Properties to set + * @returns {google.protobuf.MessageOptions} MessageOptions instance + */ + MessageOptions.create = function create(properties) { + return new MessageOptions(properties); + }; + + /** + * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.messageSetWireFormat != null && Object.hasOwnProperty.call(message, "messageSetWireFormat")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.messageSetWireFormat); + if (message.noStandardDescriptorAccessor != null && Object.hasOwnProperty.call(message, "noStandardDescriptorAccessor")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.noStandardDescriptorAccessor); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.mapEntry != null && Object.hasOwnProperty.call(message, "mapEntry")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.mapEntry); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.resource"] != null && Object.hasOwnProperty.call(message, ".google.api.resource")) + $root.google.api.ResourceDescriptor.encode(message[".google.api.resource"], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MessageOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MessageOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MessageOptions} MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MessageOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.messageSetWireFormat = reader.bool(); + break; + } + case 2: { + message.noStandardDescriptorAccessor = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 7: { + message.mapEntry = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1053: { + message[".google.api.resource"] = $root.google.api.ResourceDescriptor.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MessageOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MessageOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MessageOptions} MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MessageOptions message. + * @function verify + * @memberof google.protobuf.MessageOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MessageOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) + if (typeof message.messageSetWireFormat !== "boolean") + return "messageSetWireFormat: boolean expected"; + if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) + if (typeof message.noStandardDescriptorAccessor !== "boolean") + return "noStandardDescriptorAccessor: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) + if (typeof message.mapEntry !== "boolean") + return "mapEntry: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) { + var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resource"]); + if (error) + return ".google.api.resource." + error; + } + return null; + }; + + /** + * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MessageOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MessageOptions} MessageOptions + */ + MessageOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MessageOptions) + return object; + var message = new $root.google.protobuf.MessageOptions(); + if (object.messageSetWireFormat != null) + message.messageSetWireFormat = Boolean(object.messageSetWireFormat); + if (object.noStandardDescriptorAccessor != null) + message.noStandardDescriptorAccessor = Boolean(object.noStandardDescriptorAccessor); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.mapEntry != null) + message.mapEntry = Boolean(object.mapEntry); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.resource"] != null) { + if (typeof object[".google.api.resource"] !== "object") + throw TypeError(".google.protobuf.MessageOptions..google.api.resource: object expected"); + message[".google.api.resource"] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resource"]); + } + return message; + }; + + /** + * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.MessageOptions} message MessageOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MessageOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.messageSetWireFormat = false; + object.noStandardDescriptorAccessor = false; + object.deprecated = false; + object.mapEntry = false; + object[".google.api.resource"] = null; + } + if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) + object.messageSetWireFormat = message.messageSetWireFormat; + if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) + object.noStandardDescriptorAccessor = message.noStandardDescriptorAccessor; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) + object.mapEntry = message.mapEntry; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) + object[".google.api.resource"] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resource"], options); + return object; + }; + + /** + * Converts this MessageOptions to JSON. + * @function toJSON + * @memberof google.protobuf.MessageOptions + * @instance + * @returns {Object.} JSON object + */ + MessageOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MessageOptions + * @function getTypeUrl + * @memberof google.protobuf.MessageOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MessageOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MessageOptions"; + }; + + return MessageOptions; + })(); + + protobuf.FieldOptions = (function() { + + /** + * Properties of a FieldOptions. + * @memberof google.protobuf + * @interface IFieldOptions + * @property {google.protobuf.FieldOptions.CType|null} [ctype] FieldOptions ctype + * @property {boolean|null} [packed] FieldOptions packed + * @property {google.protobuf.FieldOptions.JSType|null} [jstype] FieldOptions jstype + * @property {boolean|null} [lazy] FieldOptions lazy + * @property {boolean|null} [unverifiedLazy] FieldOptions unverifiedLazy + * @property {boolean|null} [deprecated] FieldOptions deprecated + * @property {boolean|null} [weak] FieldOptions weak + * @property {Array.|null} [uninterpretedOption] FieldOptions uninterpretedOption + * @property {Array.|null} [".google.api.fieldBehavior"] FieldOptions .google.api.fieldBehavior + * @property {google.api.IResourceReference|null} [".google.api.resourceReference"] FieldOptions .google.api.resourceReference + */ + + /** + * Constructs a new FieldOptions. + * @memberof google.protobuf + * @classdesc Represents a FieldOptions. + * @implements IFieldOptions + * @constructor + * @param {google.protobuf.IFieldOptions=} [properties] Properties to set + */ + function FieldOptions(properties) { + this.uninterpretedOption = []; + this[".google.api.fieldBehavior"] = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldOptions ctype. + * @member {google.protobuf.FieldOptions.CType} ctype + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.ctype = 0; + + /** + * FieldOptions packed. + * @member {boolean} packed + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.packed = false; + + /** + * FieldOptions jstype. + * @member {google.protobuf.FieldOptions.JSType} jstype + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.jstype = 0; + + /** + * FieldOptions lazy. + * @member {boolean} lazy + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.lazy = false; + + /** + * FieldOptions unverifiedLazy. + * @member {boolean} unverifiedLazy + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.unverifiedLazy = false; + + /** + * FieldOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.deprecated = false; + + /** + * FieldOptions weak. + * @member {boolean} weak + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.weak = false; + + /** + * FieldOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * FieldOptions .google.api.fieldBehavior. + * @member {Array.} .google.api.fieldBehavior + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".google.api.fieldBehavior"] = $util.emptyArray; + + /** + * FieldOptions .google.api.resourceReference. + * @member {google.api.IResourceReference|null|undefined} .google.api.resourceReference + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".google.api.resourceReference"] = null; + + /** + * Creates a new FieldOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions=} [properties] Properties to set + * @returns {google.protobuf.FieldOptions} FieldOptions instance + */ + FieldOptions.create = function create(properties) { + return new FieldOptions(properties); + }; + + /** + * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ctype != null && Object.hasOwnProperty.call(message, "ctype")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.ctype); + if (message.packed != null && Object.hasOwnProperty.call(message, "packed")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.packed); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.lazy != null && Object.hasOwnProperty.call(message, "lazy")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.lazy); + if (message.jstype != null && Object.hasOwnProperty.call(message, "jstype")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jstype); + if (message.weak != null && Object.hasOwnProperty.call(message, "weak")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.weak); + if (message.unverifiedLazy != null && Object.hasOwnProperty.call(message, "unverifiedLazy")) + writer.uint32(/* id 15, wireType 0 =*/120).bool(message.unverifiedLazy); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.fieldBehavior"] != null && message[".google.api.fieldBehavior"].length) { + writer.uint32(/* id 1052, wireType 2 =*/8418).fork(); + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + writer.int32(message[".google.api.fieldBehavior"][i]); + writer.ldelim(); + } + if (message[".google.api.resourceReference"] != null && Object.hasOwnProperty.call(message, ".google.api.resourceReference")) + $root.google.api.ResourceReference.encode(message[".google.api.resourceReference"], writer.uint32(/* id 1055, wireType 2 =*/8442).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldOptions} FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.ctype = reader.int32(); + break; + } + case 2: { + message.packed = reader.bool(); + break; + } + case 6: { + message.jstype = reader.int32(); + break; + } + case 5: { + message.lazy = reader.bool(); + break; + } + case 15: { + message.unverifiedLazy = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 10: { + message.weak = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1052: { + if (!(message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length)) + message[".google.api.fieldBehavior"] = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message[".google.api.fieldBehavior"].push(reader.int32()); + } else + message[".google.api.fieldBehavior"].push(reader.int32()); + break; + } + case 1055: { + message[".google.api.resourceReference"] = $root.google.api.ResourceReference.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldOptions} FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldOptions message. + * @function verify + * @memberof google.protobuf.FieldOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.ctype != null && message.hasOwnProperty("ctype")) + switch (message.ctype) { + default: + return "ctype: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.packed != null && message.hasOwnProperty("packed")) + if (typeof message.packed !== "boolean") + return "packed: boolean expected"; + if (message.jstype != null && message.hasOwnProperty("jstype")) + switch (message.jstype) { + default: + return "jstype: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.lazy != null && message.hasOwnProperty("lazy")) + if (typeof message.lazy !== "boolean") + return "lazy: boolean expected"; + if (message.unverifiedLazy != null && message.hasOwnProperty("unverifiedLazy")) + if (typeof message.unverifiedLazy !== "boolean") + return "unverifiedLazy: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.weak != null && message.hasOwnProperty("weak")) + if (typeof message.weak !== "boolean") + return "weak: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.fieldBehavior"] != null && message.hasOwnProperty(".google.api.fieldBehavior")) { + if (!Array.isArray(message[".google.api.fieldBehavior"])) + return ".google.api.fieldBehavior: array expected"; + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + switch (message[".google.api.fieldBehavior"][i]) { + default: + return ".google.api.fieldBehavior: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + break; + } + } + if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) { + var error = $root.google.api.ResourceReference.verify(message[".google.api.resourceReference"]); + if (error) + return ".google.api.resourceReference." + error; + } + return null; + }; + + /** + * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldOptions} FieldOptions + */ + FieldOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldOptions) + return object; + var message = new $root.google.protobuf.FieldOptions(); + switch (object.ctype) { + default: + if (typeof object.ctype === "number") { + message.ctype = object.ctype; + break; + } + break; + case "STRING": + case 0: + message.ctype = 0; + break; + case "CORD": + case 1: + message.ctype = 1; + break; + case "STRING_PIECE": + case 2: + message.ctype = 2; + break; + } + if (object.packed != null) + message.packed = Boolean(object.packed); + switch (object.jstype) { + default: + if (typeof object.jstype === "number") { + message.jstype = object.jstype; + break; + } + break; + case "JS_NORMAL": + case 0: + message.jstype = 0; + break; + case "JS_STRING": + case 1: + message.jstype = 1; + break; + case "JS_NUMBER": + case 2: + message.jstype = 2; + break; + } + if (object.lazy != null) + message.lazy = Boolean(object.lazy); + if (object.unverifiedLazy != null) + message.unverifiedLazy = Boolean(object.unverifiedLazy); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.weak != null) + message.weak = Boolean(object.weak); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.fieldBehavior"]) { + if (!Array.isArray(object[".google.api.fieldBehavior"])) + throw TypeError(".google.protobuf.FieldOptions..google.api.fieldBehavior: array expected"); + message[".google.api.fieldBehavior"] = []; + for (var i = 0; i < object[".google.api.fieldBehavior"].length; ++i) + switch (object[".google.api.fieldBehavior"][i]) { + default: + if (typeof object[".google.api.fieldBehavior"][i] === "number") { + message[".google.api.fieldBehavior"][i] = object[".google.api.fieldBehavior"][i]; + break; + } + case "FIELD_BEHAVIOR_UNSPECIFIED": + case 0: + message[".google.api.fieldBehavior"][i] = 0; + break; + case "OPTIONAL": + case 1: + message[".google.api.fieldBehavior"][i] = 1; + break; + case "REQUIRED": + case 2: + message[".google.api.fieldBehavior"][i] = 2; + break; + case "OUTPUT_ONLY": + case 3: + message[".google.api.fieldBehavior"][i] = 3; + break; + case "INPUT_ONLY": + case 4: + message[".google.api.fieldBehavior"][i] = 4; + break; + case "IMMUTABLE": + case 5: + message[".google.api.fieldBehavior"][i] = 5; + break; + case "UNORDERED_LIST": + case 6: + message[".google.api.fieldBehavior"][i] = 6; + break; + case "NON_EMPTY_DEFAULT": + case 7: + message[".google.api.fieldBehavior"][i] = 7; + break; + } + } + if (object[".google.api.resourceReference"] != null) { + if (typeof object[".google.api.resourceReference"] !== "object") + throw TypeError(".google.protobuf.FieldOptions..google.api.resourceReference: object expected"); + message[".google.api.resourceReference"] = $root.google.api.ResourceReference.fromObject(object[".google.api.resourceReference"]); + } + return message; + }; + + /** + * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.FieldOptions} message FieldOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.uninterpretedOption = []; + object[".google.api.fieldBehavior"] = []; + } + if (options.defaults) { + object.ctype = options.enums === String ? "STRING" : 0; + object.packed = false; + object.deprecated = false; + object.lazy = false; + object.jstype = options.enums === String ? "JS_NORMAL" : 0; + object.weak = false; + object.unverifiedLazy = false; + object[".google.api.resourceReference"] = null; + } + if (message.ctype != null && message.hasOwnProperty("ctype")) + object.ctype = options.enums === String ? $root.google.protobuf.FieldOptions.CType[message.ctype] === undefined ? message.ctype : $root.google.protobuf.FieldOptions.CType[message.ctype] : message.ctype; + if (message.packed != null && message.hasOwnProperty("packed")) + object.packed = message.packed; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.lazy != null && message.hasOwnProperty("lazy")) + object.lazy = message.lazy; + if (message.jstype != null && message.hasOwnProperty("jstype")) + object.jstype = options.enums === String ? $root.google.protobuf.FieldOptions.JSType[message.jstype] === undefined ? message.jstype : $root.google.protobuf.FieldOptions.JSType[message.jstype] : message.jstype; + if (message.weak != null && message.hasOwnProperty("weak")) + object.weak = message.weak; + if (message.unverifiedLazy != null && message.hasOwnProperty("unverifiedLazy")) + object.unverifiedLazy = message.unverifiedLazy; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length) { + object[".google.api.fieldBehavior"] = []; + for (var j = 0; j < message[".google.api.fieldBehavior"].length; ++j) + object[".google.api.fieldBehavior"][j] = options.enums === String ? $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] === undefined ? message[".google.api.fieldBehavior"][j] : $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] : message[".google.api.fieldBehavior"][j]; + } + if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) + object[".google.api.resourceReference"] = $root.google.api.ResourceReference.toObject(message[".google.api.resourceReference"], options); + return object; + }; + + /** + * Converts this FieldOptions to JSON. + * @function toJSON + * @memberof google.protobuf.FieldOptions + * @instance + * @returns {Object.} JSON object + */ + FieldOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldOptions + * @function getTypeUrl + * @memberof google.protobuf.FieldOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldOptions"; + }; + + /** + * CType enum. + * @name google.protobuf.FieldOptions.CType + * @enum {number} + * @property {number} STRING=0 STRING value + * @property {number} CORD=1 CORD value + * @property {number} STRING_PIECE=2 STRING_PIECE value + */ + FieldOptions.CType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STRING"] = 0; + values[valuesById[1] = "CORD"] = 1; + values[valuesById[2] = "STRING_PIECE"] = 2; + return values; + })(); + + /** + * JSType enum. + * @name google.protobuf.FieldOptions.JSType + * @enum {number} + * @property {number} JS_NORMAL=0 JS_NORMAL value + * @property {number} JS_STRING=1 JS_STRING value + * @property {number} JS_NUMBER=2 JS_NUMBER value + */ + FieldOptions.JSType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "JS_NORMAL"] = 0; + values[valuesById[1] = "JS_STRING"] = 1; + values[valuesById[2] = "JS_NUMBER"] = 2; + return values; + })(); + + return FieldOptions; + })(); + + protobuf.OneofOptions = (function() { + + /** + * Properties of an OneofOptions. + * @memberof google.protobuf + * @interface IOneofOptions + * @property {Array.|null} [uninterpretedOption] OneofOptions uninterpretedOption + */ + + /** + * Constructs a new OneofOptions. + * @memberof google.protobuf + * @classdesc Represents an OneofOptions. + * @implements IOneofOptions + * @constructor + * @param {google.protobuf.IOneofOptions=} [properties] Properties to set + */ + function OneofOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OneofOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.OneofOptions + * @instance + */ + OneofOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new OneofOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions=} [properties] Properties to set + * @returns {google.protobuf.OneofOptions} OneofOptions instance + */ + OneofOptions.create = function create(properties) { + return new OneofOptions(properties); + }; + + /** + * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OneofOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.OneofOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.OneofOptions} OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OneofOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.OneofOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.OneofOptions} OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OneofOptions message. + * @function verify + * @memberof google.protobuf.OneofOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OneofOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.OneofOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.OneofOptions} OneofOptions + */ + OneofOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.OneofOptions) + return object; + var message = new $root.google.protobuf.OneofOptions(); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.OneofOptions} message OneofOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OneofOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this OneofOptions to JSON. + * @function toJSON + * @memberof google.protobuf.OneofOptions + * @instance + * @returns {Object.} JSON object + */ + OneofOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OneofOptions + * @function getTypeUrl + * @memberof google.protobuf.OneofOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OneofOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.OneofOptions"; + }; + + return OneofOptions; + })(); + + protobuf.EnumOptions = (function() { + + /** + * Properties of an EnumOptions. + * @memberof google.protobuf + * @interface IEnumOptions + * @property {boolean|null} [allowAlias] EnumOptions allowAlias + * @property {boolean|null} [deprecated] EnumOptions deprecated + * @property {Array.|null} [uninterpretedOption] EnumOptions uninterpretedOption + */ + + /** + * Constructs a new EnumOptions. + * @memberof google.protobuf + * @classdesc Represents an EnumOptions. + * @implements IEnumOptions + * @constructor + * @param {google.protobuf.IEnumOptions=} [properties] Properties to set + */ + function EnumOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumOptions allowAlias. + * @member {boolean} allowAlias + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.allowAlias = false; + + /** + * EnumOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.deprecated = false; + + /** + * EnumOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new EnumOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions=} [properties] Properties to set + * @returns {google.protobuf.EnumOptions} EnumOptions instance + */ + EnumOptions.create = function create(properties) { + return new EnumOptions(properties); + }; + + /** + * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.allowAlias != null && Object.hasOwnProperty.call(message, "allowAlias")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowAlias); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumOptions} EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.allowAlias = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumOptions} EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumOptions message. + * @function verify + * @memberof google.protobuf.EnumOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + if (typeof message.allowAlias !== "boolean") + return "allowAlias: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumOptions} EnumOptions + */ + EnumOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumOptions) + return object; + var message = new $root.google.protobuf.EnumOptions(); + if (object.allowAlias != null) + message.allowAlias = Boolean(object.allowAlias); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.EnumOptions} message EnumOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.allowAlias = false; + object.deprecated = false; + } + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + object.allowAlias = message.allowAlias; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this EnumOptions to JSON. + * @function toJSON + * @memberof google.protobuf.EnumOptions + * @instance + * @returns {Object.} JSON object + */ + EnumOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumOptions + * @function getTypeUrl + * @memberof google.protobuf.EnumOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumOptions"; + }; + + return EnumOptions; + })(); + + protobuf.EnumValueOptions = (function() { + + /** + * Properties of an EnumValueOptions. + * @memberof google.protobuf + * @interface IEnumValueOptions + * @property {boolean|null} [deprecated] EnumValueOptions deprecated + * @property {Array.|null} [uninterpretedOption] EnumValueOptions uninterpretedOption + */ + + /** + * Constructs a new EnumValueOptions. + * @memberof google.protobuf + * @classdesc Represents an EnumValueOptions. + * @implements IEnumValueOptions + * @constructor + * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set + */ + function EnumValueOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumValueOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.deprecated = false; + + /** + * EnumValueOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new EnumValueOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions instance + */ + EnumValueOptions.create = function create(properties) { + return new EnumValueOptions(properties); + }; + + /** + * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.deprecated); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.deprecated = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumValueOptions message. + * @function verify + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumValueOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + */ + EnumValueOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumValueOptions) + return object; + var message = new $root.google.protobuf.EnumValueOptions(); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.EnumValueOptions} message EnumValueOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumValueOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) + object.deprecated = false; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this EnumValueOptions to JSON. + * @function toJSON + * @memberof google.protobuf.EnumValueOptions + * @instance + * @returns {Object.} JSON object + */ + EnumValueOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumValueOptions + * @function getTypeUrl + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumValueOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumValueOptions"; + }; + + return EnumValueOptions; + })(); + + protobuf.ServiceOptions = (function() { + + /** + * Properties of a ServiceOptions. + * @memberof google.protobuf + * @interface IServiceOptions + * @property {boolean|null} [deprecated] ServiceOptions deprecated + * @property {Array.|null} [uninterpretedOption] ServiceOptions uninterpretedOption + * @property {string|null} [".google.api.defaultHost"] ServiceOptions .google.api.defaultHost + * @property {string|null} [".google.api.oauthScopes"] ServiceOptions .google.api.oauthScopes + */ + + /** + * Constructs a new ServiceOptions. + * @memberof google.protobuf + * @classdesc Represents a ServiceOptions. + * @implements IServiceOptions + * @constructor + * @param {google.protobuf.IServiceOptions=} [properties] Properties to set + */ + function ServiceOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ServiceOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.deprecated = false; + + /** + * ServiceOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * ServiceOptions .google.api.defaultHost. + * @member {string} .google.api.defaultHost + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.defaultHost"] = ""; + + /** + * ServiceOptions .google.api.oauthScopes. + * @member {string} .google.api.oauthScopes + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.oauthScopes"] = ""; + + /** + * Creates a new ServiceOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions=} [properties] Properties to set + * @returns {google.protobuf.ServiceOptions} ServiceOptions instance + */ + ServiceOptions.create = function create(properties) { + return new ServiceOptions(properties); + }; + + /** + * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.defaultHost"] != null && Object.hasOwnProperty.call(message, ".google.api.defaultHost")) + writer.uint32(/* id 1049, wireType 2 =*/8394).string(message[".google.api.defaultHost"]); + if (message[".google.api.oauthScopes"] != null && Object.hasOwnProperty.call(message, ".google.api.oauthScopes")) + writer.uint32(/* id 1050, wireType 2 =*/8402).string(message[".google.api.oauthScopes"]); + return writer; + }; + + /** + * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ServiceOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 33: { + message.deprecated = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1049: { + message[".google.api.defaultHost"] = reader.string(); + break; + } + case 1050: { + message[".google.api.oauthScopes"] = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceOptions message. + * @function verify + * @memberof google.protobuf.ServiceOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + if (!$util.isString(message[".google.api.defaultHost"])) + return ".google.api.defaultHost: string expected"; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + if (!$util.isString(message[".google.api.oauthScopes"])) + return ".google.api.oauthScopes: string expected"; + return null; + }; + + /** + * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ServiceOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ServiceOptions} ServiceOptions + */ + ServiceOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ServiceOptions) + return object; + var message = new $root.google.protobuf.ServiceOptions(); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.defaultHost"] != null) + message[".google.api.defaultHost"] = String(object[".google.api.defaultHost"]); + if (object[".google.api.oauthScopes"] != null) + message[".google.api.oauthScopes"] = String(object[".google.api.oauthScopes"]); + return message; + }; + + /** + * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.ServiceOptions} message ServiceOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.deprecated = false; + object[".google.api.defaultHost"] = ""; + object[".google.api.oauthScopes"] = ""; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + object[".google.api.defaultHost"] = message[".google.api.defaultHost"]; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + object[".google.api.oauthScopes"] = message[".google.api.oauthScopes"]; + return object; + }; + + /** + * Converts this ServiceOptions to JSON. + * @function toJSON + * @memberof google.protobuf.ServiceOptions + * @instance + * @returns {Object.} JSON object + */ + ServiceOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ServiceOptions + * @function getTypeUrl + * @memberof google.protobuf.ServiceOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ServiceOptions"; + }; + + return ServiceOptions; + })(); + + protobuf.MethodOptions = (function() { + + /** + * Properties of a MethodOptions. + * @memberof google.protobuf + * @interface IMethodOptions + * @property {boolean|null} [deprecated] MethodOptions deprecated + * @property {google.protobuf.MethodOptions.IdempotencyLevel|null} [idempotencyLevel] MethodOptions idempotencyLevel + * @property {Array.|null} [uninterpretedOption] MethodOptions uninterpretedOption + * @property {google.api.IHttpRule|null} [".google.api.http"] MethodOptions .google.api.http + * @property {Array.|null} [".google.api.methodSignature"] MethodOptions .google.api.methodSignature + * @property {google.longrunning.IOperationInfo|null} [".google.longrunning.operationInfo"] MethodOptions .google.longrunning.operationInfo + */ + + /** + * Constructs a new MethodOptions. + * @memberof google.protobuf + * @classdesc Represents a MethodOptions. + * @implements IMethodOptions + * @constructor + * @param {google.protobuf.IMethodOptions=} [properties] Properties to set + */ + function MethodOptions(properties) { + this.uninterpretedOption = []; + this[".google.api.methodSignature"] = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MethodOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.deprecated = false; + + /** + * MethodOptions idempotencyLevel. + * @member {google.protobuf.MethodOptions.IdempotencyLevel} idempotencyLevel + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.idempotencyLevel = 0; + + /** + * MethodOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * MethodOptions .google.api.http. + * @member {google.api.IHttpRule|null|undefined} .google.api.http + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.api.http"] = null; + + /** + * MethodOptions .google.api.methodSignature. + * @member {Array.} .google.api.methodSignature + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.api.methodSignature"] = $util.emptyArray; + + /** + * MethodOptions .google.longrunning.operationInfo. + * @member {google.longrunning.IOperationInfo|null|undefined} .google.longrunning.operationInfo + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.longrunning.operationInfo"] = null; + + /** + * Creates a new MethodOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions=} [properties] Properties to set + * @returns {google.protobuf.MethodOptions} MethodOptions instance + */ + MethodOptions.create = function create(properties) { + return new MethodOptions(properties); + }; + + /** + * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); + if (message.idempotencyLevel != null && Object.hasOwnProperty.call(message, "idempotencyLevel")) + writer.uint32(/* id 34, wireType 0 =*/272).int32(message.idempotencyLevel); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.longrunning.operationInfo"] != null && Object.hasOwnProperty.call(message, ".google.longrunning.operationInfo")) + $root.google.longrunning.OperationInfo.encode(message[".google.longrunning.operationInfo"], writer.uint32(/* id 1049, wireType 2 =*/8394).fork()).ldelim(); + if (message[".google.api.methodSignature"] != null && message[".google.api.methodSignature"].length) + for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) + writer.uint32(/* id 1051, wireType 2 =*/8410).string(message[".google.api.methodSignature"][i]); + if (message[".google.api.http"] != null && Object.hasOwnProperty.call(message, ".google.api.http")) + $root.google.api.HttpRule.encode(message[".google.api.http"], writer.uint32(/* id 72295728, wireType 2 =*/578365826).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MethodOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MethodOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MethodOptions} MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 33: { + message.deprecated = reader.bool(); + break; + } + case 34: { + message.idempotencyLevel = reader.int32(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 72295728: { + message[".google.api.http"] = $root.google.api.HttpRule.decode(reader, reader.uint32()); + break; + } + case 1051: { + if (!(message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length)) + message[".google.api.methodSignature"] = []; + message[".google.api.methodSignature"].push(reader.string()); + break; + } + case 1049: { + message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MethodOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MethodOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MethodOptions} MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodOptions message. + * @function verify + * @memberof google.protobuf.MethodOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) + switch (message.idempotencyLevel) { + default: + return "idempotencyLevel: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) { + var error = $root.google.api.HttpRule.verify(message[".google.api.http"]); + if (error) + return ".google.api.http." + error; + } + if (message[".google.api.methodSignature"] != null && message.hasOwnProperty(".google.api.methodSignature")) { + if (!Array.isArray(message[".google.api.methodSignature"])) + return ".google.api.methodSignature: array expected"; + for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) + if (!$util.isString(message[".google.api.methodSignature"][i])) + return ".google.api.methodSignature: string[] expected"; + } + if (message[".google.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo")) { + var error = $root.google.longrunning.OperationInfo.verify(message[".google.longrunning.operationInfo"]); + if (error) + return ".google.longrunning.operationInfo." + error; + } + return null; + }; + + /** + * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MethodOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MethodOptions} MethodOptions + */ + MethodOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MethodOptions) + return object; + var message = new $root.google.protobuf.MethodOptions(); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + switch (object.idempotencyLevel) { + default: + if (typeof object.idempotencyLevel === "number") { + message.idempotencyLevel = object.idempotencyLevel; + break; + } + break; + case "IDEMPOTENCY_UNKNOWN": + case 0: + message.idempotencyLevel = 0; + break; + case "NO_SIDE_EFFECTS": + case 1: + message.idempotencyLevel = 1; + break; + case "IDEMPOTENT": + case 2: + message.idempotencyLevel = 2; + break; + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.http"] != null) { + if (typeof object[".google.api.http"] !== "object") + throw TypeError(".google.protobuf.MethodOptions..google.api.http: object expected"); + message[".google.api.http"] = $root.google.api.HttpRule.fromObject(object[".google.api.http"]); + } + if (object[".google.api.methodSignature"]) { + if (!Array.isArray(object[".google.api.methodSignature"])) + throw TypeError(".google.protobuf.MethodOptions..google.api.methodSignature: array expected"); + message[".google.api.methodSignature"] = []; + for (var i = 0; i < object[".google.api.methodSignature"].length; ++i) + message[".google.api.methodSignature"][i] = String(object[".google.api.methodSignature"][i]); + } + if (object[".google.longrunning.operationInfo"] != null) { + if (typeof object[".google.longrunning.operationInfo"] !== "object") + throw TypeError(".google.protobuf.MethodOptions..google.longrunning.operationInfo: object expected"); + message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.fromObject(object[".google.longrunning.operationInfo"]); + } + return message; + }; + + /** + * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.MethodOptions} message MethodOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.uninterpretedOption = []; + object[".google.api.methodSignature"] = []; + } + if (options.defaults) { + object.deprecated = false; + object.idempotencyLevel = options.enums === String ? "IDEMPOTENCY_UNKNOWN" : 0; + object[".google.longrunning.operationInfo"] = null; + object[".google.api.http"] = null; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) + object.idempotencyLevel = options.enums === String ? $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] === undefined ? message.idempotencyLevel : $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] : message.idempotencyLevel; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo")) + object[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.toObject(message[".google.longrunning.operationInfo"], options); + if (message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length) { + object[".google.api.methodSignature"] = []; + for (var j = 0; j < message[".google.api.methodSignature"].length; ++j) + object[".google.api.methodSignature"][j] = message[".google.api.methodSignature"][j]; + } + if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) + object[".google.api.http"] = $root.google.api.HttpRule.toObject(message[".google.api.http"], options); + return object; + }; + + /** + * Converts this MethodOptions to JSON. + * @function toJSON + * @memberof google.protobuf.MethodOptions + * @instance + * @returns {Object.} JSON object + */ + MethodOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MethodOptions + * @function getTypeUrl + * @memberof google.protobuf.MethodOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MethodOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MethodOptions"; + }; + + /** + * IdempotencyLevel enum. + * @name google.protobuf.MethodOptions.IdempotencyLevel + * @enum {number} + * @property {number} IDEMPOTENCY_UNKNOWN=0 IDEMPOTENCY_UNKNOWN value + * @property {number} NO_SIDE_EFFECTS=1 NO_SIDE_EFFECTS value + * @property {number} IDEMPOTENT=2 IDEMPOTENT value + */ + MethodOptions.IdempotencyLevel = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "IDEMPOTENCY_UNKNOWN"] = 0; + values[valuesById[1] = "NO_SIDE_EFFECTS"] = 1; + values[valuesById[2] = "IDEMPOTENT"] = 2; + return values; + })(); + + return MethodOptions; + })(); + + protobuf.UninterpretedOption = (function() { + + /** + * Properties of an UninterpretedOption. + * @memberof google.protobuf + * @interface IUninterpretedOption + * @property {Array.|null} [name] UninterpretedOption name + * @property {string|null} [identifierValue] UninterpretedOption identifierValue + * @property {number|Long|null} [positiveIntValue] UninterpretedOption positiveIntValue + * @property {number|Long|null} [negativeIntValue] UninterpretedOption negativeIntValue + * @property {number|null} [doubleValue] UninterpretedOption doubleValue + * @property {Uint8Array|null} [stringValue] UninterpretedOption stringValue + * @property {string|null} [aggregateValue] UninterpretedOption aggregateValue + */ + + /** + * Constructs a new UninterpretedOption. + * @memberof google.protobuf + * @classdesc Represents an UninterpretedOption. + * @implements IUninterpretedOption + * @constructor + * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set + */ + function UninterpretedOption(properties) { + this.name = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UninterpretedOption name. + * @member {Array.} name + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.name = $util.emptyArray; + + /** + * UninterpretedOption identifierValue. + * @member {string} identifierValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.identifierValue = ""; + + /** + * UninterpretedOption positiveIntValue. + * @member {number|Long} positiveIntValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.positiveIntValue = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * UninterpretedOption negativeIntValue. + * @member {number|Long} negativeIntValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.negativeIntValue = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * UninterpretedOption doubleValue. + * @member {number} doubleValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.doubleValue = 0; + + /** + * UninterpretedOption stringValue. + * @member {Uint8Array} stringValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.stringValue = $util.newBuffer([]); + + /** + * UninterpretedOption aggregateValue. + * @member {string} aggregateValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.aggregateValue = ""; + + /** + * Creates a new UninterpretedOption instance using the specified properties. + * @function create + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption instance + */ + UninterpretedOption.create = function create(properties) { + return new UninterpretedOption(properties); + }; + + /** + * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UninterpretedOption.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.name.length) + for (var i = 0; i < message.name.length; ++i) + $root.google.protobuf.UninterpretedOption.NamePart.encode(message.name[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.identifierValue != null && Object.hasOwnProperty.call(message, "identifierValue")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.identifierValue); + if (message.positiveIntValue != null && Object.hasOwnProperty.call(message, "positiveIntValue")) + writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.positiveIntValue); + if (message.negativeIntValue != null && Object.hasOwnProperty.call(message, "negativeIntValue")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.negativeIntValue); + if (message.doubleValue != null && Object.hasOwnProperty.call(message, "doubleValue")) + writer.uint32(/* id 6, wireType 1 =*/49).double(message.doubleValue); + if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) + writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.stringValue); + if (message.aggregateValue != null && Object.hasOwnProperty.call(message, "aggregateValue")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.aggregateValue); + return writer; + }; + + /** + * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UninterpretedOption.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UninterpretedOption.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + if (!(message.name && message.name.length)) + message.name = []; + message.name.push($root.google.protobuf.UninterpretedOption.NamePart.decode(reader, reader.uint32())); + break; + } + case 3: { + message.identifierValue = reader.string(); + break; + } + case 4: { + message.positiveIntValue = reader.uint64(); + break; + } + case 5: { + message.negativeIntValue = reader.int64(); + break; + } + case 6: { + message.doubleValue = reader.double(); + break; + } + case 7: { + message.stringValue = reader.bytes(); + break; + } + case 8: { + message.aggregateValue = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UninterpretedOption.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UninterpretedOption message. + * @function verify + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UninterpretedOption.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) { + if (!Array.isArray(message.name)) + return "name: array expected"; + for (var i = 0; i < message.name.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.NamePart.verify(message.name[i]); + if (error) + return "name." + error; + } + } + if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) + if (!$util.isString(message.identifierValue)) + return "identifierValue: string expected"; + if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) + if (!$util.isInteger(message.positiveIntValue) && !(message.positiveIntValue && $util.isInteger(message.positiveIntValue.low) && $util.isInteger(message.positiveIntValue.high))) + return "positiveIntValue: integer|Long expected"; + if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) + if (!$util.isInteger(message.negativeIntValue) && !(message.negativeIntValue && $util.isInteger(message.negativeIntValue.low) && $util.isInteger(message.negativeIntValue.high))) + return "negativeIntValue: integer|Long expected"; + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) + if (typeof message.doubleValue !== "number") + return "doubleValue: number expected"; + if (message.stringValue != null && message.hasOwnProperty("stringValue")) + if (!(message.stringValue && typeof message.stringValue.length === "number" || $util.isString(message.stringValue))) + return "stringValue: buffer expected"; + if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) + if (!$util.isString(message.aggregateValue)) + return "aggregateValue: string expected"; + return null; + }; + + /** + * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + */ + UninterpretedOption.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UninterpretedOption) + return object; + var message = new $root.google.protobuf.UninterpretedOption(); + if (object.name) { + if (!Array.isArray(object.name)) + throw TypeError(".google.protobuf.UninterpretedOption.name: array expected"); + message.name = []; + for (var i = 0; i < object.name.length; ++i) { + if (typeof object.name[i] !== "object") + throw TypeError(".google.protobuf.UninterpretedOption.name: object expected"); + message.name[i] = $root.google.protobuf.UninterpretedOption.NamePart.fromObject(object.name[i]); + } + } + if (object.identifierValue != null) + message.identifierValue = String(object.identifierValue); + if (object.positiveIntValue != null) + if ($util.Long) + (message.positiveIntValue = $util.Long.fromValue(object.positiveIntValue)).unsigned = true; + else if (typeof object.positiveIntValue === "string") + message.positiveIntValue = parseInt(object.positiveIntValue, 10); + else if (typeof object.positiveIntValue === "number") + message.positiveIntValue = object.positiveIntValue; + else if (typeof object.positiveIntValue === "object") + message.positiveIntValue = new $util.LongBits(object.positiveIntValue.low >>> 0, object.positiveIntValue.high >>> 0).toNumber(true); + if (object.negativeIntValue != null) + if ($util.Long) + (message.negativeIntValue = $util.Long.fromValue(object.negativeIntValue)).unsigned = false; + else if (typeof object.negativeIntValue === "string") + message.negativeIntValue = parseInt(object.negativeIntValue, 10); + else if (typeof object.negativeIntValue === "number") + message.negativeIntValue = object.negativeIntValue; + else if (typeof object.negativeIntValue === "object") + message.negativeIntValue = new $util.LongBits(object.negativeIntValue.low >>> 0, object.negativeIntValue.high >>> 0).toNumber(); + if (object.doubleValue != null) + message.doubleValue = Number(object.doubleValue); + if (object.stringValue != null) + if (typeof object.stringValue === "string") + $util.base64.decode(object.stringValue, message.stringValue = $util.newBuffer($util.base64.length(object.stringValue)), 0); + else if (object.stringValue.length >= 0) + message.stringValue = object.stringValue; + if (object.aggregateValue != null) + message.aggregateValue = String(object.aggregateValue); + return message; + }; + + /** + * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.UninterpretedOption} message UninterpretedOption + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UninterpretedOption.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.name = []; + if (options.defaults) { + object.identifierValue = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.positiveIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.positiveIntValue = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.negativeIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.negativeIntValue = options.longs === String ? "0" : 0; + object.doubleValue = 0; + if (options.bytes === String) + object.stringValue = ""; + else { + object.stringValue = []; + if (options.bytes !== Array) + object.stringValue = $util.newBuffer(object.stringValue); + } + object.aggregateValue = ""; + } + if (message.name && message.name.length) { + object.name = []; + for (var j = 0; j < message.name.length; ++j) + object.name[j] = $root.google.protobuf.UninterpretedOption.NamePart.toObject(message.name[j], options); + } + if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) + object.identifierValue = message.identifierValue; + if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) + if (typeof message.positiveIntValue === "number") + object.positiveIntValue = options.longs === String ? String(message.positiveIntValue) : message.positiveIntValue; + else + object.positiveIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.positiveIntValue) : options.longs === Number ? new $util.LongBits(message.positiveIntValue.low >>> 0, message.positiveIntValue.high >>> 0).toNumber(true) : message.positiveIntValue; + if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) + if (typeof message.negativeIntValue === "number") + object.negativeIntValue = options.longs === String ? String(message.negativeIntValue) : message.negativeIntValue; + else + object.negativeIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.negativeIntValue) : options.longs === Number ? new $util.LongBits(message.negativeIntValue.low >>> 0, message.negativeIntValue.high >>> 0).toNumber() : message.negativeIntValue; + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) + object.doubleValue = options.json && !isFinite(message.doubleValue) ? String(message.doubleValue) : message.doubleValue; + if (message.stringValue != null && message.hasOwnProperty("stringValue")) + object.stringValue = options.bytes === String ? $util.base64.encode(message.stringValue, 0, message.stringValue.length) : options.bytes === Array ? Array.prototype.slice.call(message.stringValue) : message.stringValue; + if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) + object.aggregateValue = message.aggregateValue; + return object; + }; + + /** + * Converts this UninterpretedOption to JSON. + * @function toJSON + * @memberof google.protobuf.UninterpretedOption + * @instance + * @returns {Object.} JSON object + */ + UninterpretedOption.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UninterpretedOption + * @function getTypeUrl + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UninterpretedOption.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UninterpretedOption"; + }; + + UninterpretedOption.NamePart = (function() { + + /** + * Properties of a NamePart. + * @memberof google.protobuf.UninterpretedOption + * @interface INamePart + * @property {string} namePart NamePart namePart + * @property {boolean} isExtension NamePart isExtension + */ + + /** + * Constructs a new NamePart. + * @memberof google.protobuf.UninterpretedOption + * @classdesc Represents a NamePart. + * @implements INamePart + * @constructor + * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set + */ + function NamePart(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NamePart namePart. + * @member {string} namePart + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + */ + NamePart.prototype.namePart = ""; + + /** + * NamePart isExtension. + * @member {boolean} isExtension + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + */ + NamePart.prototype.isExtension = false; + + /** + * Creates a new NamePart instance using the specified properties. + * @function create + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart instance + */ + NamePart.create = function create(properties) { + return new NamePart(properties); + }; + + /** + * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NamePart.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + writer.uint32(/* id 1, wireType 2 =*/10).string(message.namePart); + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.isExtension); + return writer; + }; + + /** + * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NamePart.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NamePart message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NamePart.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption.NamePart(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.namePart = reader.string(); + break; + } + case 2: { + message.isExtension = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + if (!message.hasOwnProperty("namePart")) + throw $util.ProtocolError("missing required 'namePart'", { instance: message }); + if (!message.hasOwnProperty("isExtension")) + throw $util.ProtocolError("missing required 'isExtension'", { instance: message }); + return message; + }; + + /** + * Decodes a NamePart message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NamePart.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NamePart message. + * @function verify + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NamePart.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (!$util.isString(message.namePart)) + return "namePart: string expected"; + if (typeof message.isExtension !== "boolean") + return "isExtension: boolean expected"; + return null; + }; + + /** + * Creates a NamePart message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + */ + NamePart.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UninterpretedOption.NamePart) + return object; + var message = new $root.google.protobuf.UninterpretedOption.NamePart(); + if (object.namePart != null) + message.namePart = String(object.namePart); + if (object.isExtension != null) + message.isExtension = Boolean(object.isExtension); + return message; + }; + + /** + * Creates a plain object from a NamePart message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.NamePart} message NamePart + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NamePart.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.namePart = ""; + object.isExtension = false; + } + if (message.namePart != null && message.hasOwnProperty("namePart")) + object.namePart = message.namePart; + if (message.isExtension != null && message.hasOwnProperty("isExtension")) + object.isExtension = message.isExtension; + return object; + }; + + /** + * Converts this NamePart to JSON. + * @function toJSON + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + * @returns {Object.} JSON object + */ + NamePart.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NamePart + * @function getTypeUrl + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NamePart.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UninterpretedOption.NamePart"; + }; + + return NamePart; + })(); + + return UninterpretedOption; + })(); + + protobuf.SourceCodeInfo = (function() { + + /** + * Properties of a SourceCodeInfo. + * @memberof google.protobuf + * @interface ISourceCodeInfo + * @property {Array.|null} [location] SourceCodeInfo location + */ + + /** + * Constructs a new SourceCodeInfo. + * @memberof google.protobuf + * @classdesc Represents a SourceCodeInfo. + * @implements ISourceCodeInfo + * @constructor + * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set + */ + function SourceCodeInfo(properties) { + this.location = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SourceCodeInfo location. + * @member {Array.} location + * @memberof google.protobuf.SourceCodeInfo + * @instance + */ + SourceCodeInfo.prototype.location = $util.emptyArray; + + /** + * Creates a new SourceCodeInfo instance using the specified properties. + * @function create + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo instance + */ + SourceCodeInfo.create = function create(properties) { + return new SourceCodeInfo(properties); + }; + + /** + * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @function encode + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SourceCodeInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.location != null && message.location.length) + for (var i = 0; i < message.location.length; ++i) + $root.google.protobuf.SourceCodeInfo.Location.encode(message.location[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SourceCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SourceCodeInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.location && message.location.length)) + message.location = []; + message.location.push($root.google.protobuf.SourceCodeInfo.Location.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SourceCodeInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SourceCodeInfo message. + * @function verify + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SourceCodeInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.location != null && message.hasOwnProperty("location")) { + if (!Array.isArray(message.location)) + return "location: array expected"; + for (var i = 0; i < message.location.length; ++i) { + var error = $root.google.protobuf.SourceCodeInfo.Location.verify(message.location[i]); + if (error) + return "location." + error; + } + } + return null; + }; + + /** + * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + */ + SourceCodeInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.SourceCodeInfo) + return object; + var message = new $root.google.protobuf.SourceCodeInfo(); + if (object.location) { + if (!Array.isArray(object.location)) + throw TypeError(".google.protobuf.SourceCodeInfo.location: array expected"); + message.location = []; + for (var i = 0; i < object.location.length; ++i) { + if (typeof object.location[i] !== "object") + throw TypeError(".google.protobuf.SourceCodeInfo.location: object expected"); + message.location[i] = $root.google.protobuf.SourceCodeInfo.Location.fromObject(object.location[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.SourceCodeInfo} message SourceCodeInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SourceCodeInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.location = []; + if (message.location && message.location.length) { + object.location = []; + for (var j = 0; j < message.location.length; ++j) + object.location[j] = $root.google.protobuf.SourceCodeInfo.Location.toObject(message.location[j], options); + } + return object; + }; + + /** + * Converts this SourceCodeInfo to JSON. + * @function toJSON + * @memberof google.protobuf.SourceCodeInfo + * @instance + * @returns {Object.} JSON object + */ + SourceCodeInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SourceCodeInfo + * @function getTypeUrl + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SourceCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.SourceCodeInfo"; + }; + + SourceCodeInfo.Location = (function() { + + /** + * Properties of a Location. + * @memberof google.protobuf.SourceCodeInfo + * @interface ILocation + * @property {Array.|null} [path] Location path + * @property {Array.|null} [span] Location span + * @property {string|null} [leadingComments] Location leadingComments + * @property {string|null} [trailingComments] Location trailingComments + * @property {Array.|null} [leadingDetachedComments] Location leadingDetachedComments + */ + + /** + * Constructs a new Location. + * @memberof google.protobuf.SourceCodeInfo + * @classdesc Represents a Location. + * @implements ILocation + * @constructor + * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set + */ + function Location(properties) { + this.path = []; + this.span = []; + this.leadingDetachedComments = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Location path. + * @member {Array.} path + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.path = $util.emptyArray; + + /** + * Location span. + * @member {Array.} span + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.span = $util.emptyArray; + + /** + * Location leadingComments. + * @member {string} leadingComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.leadingComments = ""; + + /** + * Location trailingComments. + * @member {string} trailingComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.trailingComments = ""; + + /** + * Location leadingDetachedComments. + * @member {Array.} leadingDetachedComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.leadingDetachedComments = $util.emptyArray; + + /** + * Creates a new Location instance using the specified properties. + * @function create + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set + * @returns {google.protobuf.SourceCodeInfo.Location} Location instance + */ + Location.create = function create(properties) { + return new Location(properties); + }; + + /** + * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @function encode + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Location.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.path != null && message.path.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.path.length; ++i) + writer.int32(message.path[i]); + writer.ldelim(); + } + if (message.span != null && message.span.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.span.length; ++i) + writer.int32(message.span[i]); + writer.ldelim(); + } + if (message.leadingComments != null && Object.hasOwnProperty.call(message, "leadingComments")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.leadingComments); + if (message.trailingComments != null && Object.hasOwnProperty.call(message, "trailingComments")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.trailingComments); + if (message.leadingDetachedComments != null && message.leadingDetachedComments.length) + for (var i = 0; i < message.leadingDetachedComments.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.leadingDetachedComments[i]); + return writer; + }; + + /** + * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Location.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Location message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.SourceCodeInfo.Location} Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Location.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo.Location(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.path && message.path.length)) + message.path = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.path.push(reader.int32()); + } else + message.path.push(reader.int32()); + break; + } + case 2: { + if (!(message.span && message.span.length)) + message.span = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.span.push(reader.int32()); + } else + message.span.push(reader.int32()); + break; + } + case 3: { + message.leadingComments = reader.string(); + break; + } + case 4: { + message.trailingComments = reader.string(); + break; + } + case 6: { + if (!(message.leadingDetachedComments && message.leadingDetachedComments.length)) + message.leadingDetachedComments = []; + message.leadingDetachedComments.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Location message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.SourceCodeInfo.Location} Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Location.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Location message. + * @function verify + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Location.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.path != null && message.hasOwnProperty("path")) { + if (!Array.isArray(message.path)) + return "path: array expected"; + for (var i = 0; i < message.path.length; ++i) + if (!$util.isInteger(message.path[i])) + return "path: integer[] expected"; + } + if (message.span != null && message.hasOwnProperty("span")) { + if (!Array.isArray(message.span)) + return "span: array expected"; + for (var i = 0; i < message.span.length; ++i) + if (!$util.isInteger(message.span[i])) + return "span: integer[] expected"; + } + if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) + if (!$util.isString(message.leadingComments)) + return "leadingComments: string expected"; + if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) + if (!$util.isString(message.trailingComments)) + return "trailingComments: string expected"; + if (message.leadingDetachedComments != null && message.hasOwnProperty("leadingDetachedComments")) { + if (!Array.isArray(message.leadingDetachedComments)) + return "leadingDetachedComments: array expected"; + for (var i = 0; i < message.leadingDetachedComments.length; ++i) + if (!$util.isString(message.leadingDetachedComments[i])) + return "leadingDetachedComments: string[] expected"; + } + return null; + }; + + /** + * Creates a Location message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.SourceCodeInfo.Location} Location + */ + Location.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.SourceCodeInfo.Location) + return object; + var message = new $root.google.protobuf.SourceCodeInfo.Location(); + if (object.path) { + if (!Array.isArray(object.path)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.path: array expected"); + message.path = []; + for (var i = 0; i < object.path.length; ++i) + message.path[i] = object.path[i] | 0; + } + if (object.span) { + if (!Array.isArray(object.span)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.span: array expected"); + message.span = []; + for (var i = 0; i < object.span.length; ++i) + message.span[i] = object.span[i] | 0; + } + if (object.leadingComments != null) + message.leadingComments = String(object.leadingComments); + if (object.trailingComments != null) + message.trailingComments = String(object.trailingComments); + if (object.leadingDetachedComments) { + if (!Array.isArray(object.leadingDetachedComments)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.leadingDetachedComments: array expected"); + message.leadingDetachedComments = []; + for (var i = 0; i < object.leadingDetachedComments.length; ++i) + message.leadingDetachedComments[i] = String(object.leadingDetachedComments[i]); + } + return message; + }; + + /** + * Creates a plain object from a Location message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.Location} message Location + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Location.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.path = []; + object.span = []; + object.leadingDetachedComments = []; + } + if (options.defaults) { + object.leadingComments = ""; + object.trailingComments = ""; + } + if (message.path && message.path.length) { + object.path = []; + for (var j = 0; j < message.path.length; ++j) + object.path[j] = message.path[j]; + } + if (message.span && message.span.length) { + object.span = []; + for (var j = 0; j < message.span.length; ++j) + object.span[j] = message.span[j]; + } + if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) + object.leadingComments = message.leadingComments; + if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) + object.trailingComments = message.trailingComments; + if (message.leadingDetachedComments && message.leadingDetachedComments.length) { + object.leadingDetachedComments = []; + for (var j = 0; j < message.leadingDetachedComments.length; ++j) + object.leadingDetachedComments[j] = message.leadingDetachedComments[j]; + } + return object; + }; + + /** + * Converts this Location to JSON. + * @function toJSON + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + * @returns {Object.} JSON object + */ + Location.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Location + * @function getTypeUrl + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Location.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.SourceCodeInfo.Location"; + }; + + return Location; + })(); + + return SourceCodeInfo; + })(); + + protobuf.GeneratedCodeInfo = (function() { + + /** + * Properties of a GeneratedCodeInfo. + * @memberof google.protobuf + * @interface IGeneratedCodeInfo + * @property {Array.|null} [annotation] GeneratedCodeInfo annotation + */ + + /** + * Constructs a new GeneratedCodeInfo. + * @memberof google.protobuf + * @classdesc Represents a GeneratedCodeInfo. + * @implements IGeneratedCodeInfo + * @constructor + * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set + */ + function GeneratedCodeInfo(properties) { + this.annotation = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GeneratedCodeInfo annotation. + * @member {Array.} annotation + * @memberof google.protobuf.GeneratedCodeInfo + * @instance + */ + GeneratedCodeInfo.prototype.annotation = $util.emptyArray; + + /** + * Creates a new GeneratedCodeInfo instance using the specified properties. + * @function create + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo instance + */ + GeneratedCodeInfo.create = function create(properties) { + return new GeneratedCodeInfo(properties); + }; + + /** + * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @function encode + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GeneratedCodeInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.annotation != null && message.annotation.length) + for (var i = 0; i < message.annotation.length; ++i) + $root.google.protobuf.GeneratedCodeInfo.Annotation.encode(message.annotation[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GeneratedCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GeneratedCodeInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.annotation && message.annotation.length)) + message.annotation = []; + message.annotation.push($root.google.protobuf.GeneratedCodeInfo.Annotation.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GeneratedCodeInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GeneratedCodeInfo message. + * @function verify + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GeneratedCodeInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.annotation != null && message.hasOwnProperty("annotation")) { + if (!Array.isArray(message.annotation)) + return "annotation: array expected"; + for (var i = 0; i < message.annotation.length; ++i) { + var error = $root.google.protobuf.GeneratedCodeInfo.Annotation.verify(message.annotation[i]); + if (error) + return "annotation." + error; + } + } + return null; + }; + + /** + * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + */ + GeneratedCodeInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.GeneratedCodeInfo) + return object; + var message = new $root.google.protobuf.GeneratedCodeInfo(); + if (object.annotation) { + if (!Array.isArray(object.annotation)) + throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: array expected"); + message.annotation = []; + for (var i = 0; i < object.annotation.length; ++i) { + if (typeof object.annotation[i] !== "object") + throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: object expected"); + message.annotation[i] = $root.google.protobuf.GeneratedCodeInfo.Annotation.fromObject(object.annotation[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.GeneratedCodeInfo} message GeneratedCodeInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GeneratedCodeInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.annotation = []; + if (message.annotation && message.annotation.length) { + object.annotation = []; + for (var j = 0; j < message.annotation.length; ++j) + object.annotation[j] = $root.google.protobuf.GeneratedCodeInfo.Annotation.toObject(message.annotation[j], options); + } + return object; + }; + + /** + * Converts this GeneratedCodeInfo to JSON. + * @function toJSON + * @memberof google.protobuf.GeneratedCodeInfo + * @instance + * @returns {Object.} JSON object + */ + GeneratedCodeInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GeneratedCodeInfo + * @function getTypeUrl + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GeneratedCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo"; + }; + + GeneratedCodeInfo.Annotation = (function() { + + /** + * Properties of an Annotation. + * @memberof google.protobuf.GeneratedCodeInfo + * @interface IAnnotation + * @property {Array.|null} [path] Annotation path + * @property {string|null} [sourceFile] Annotation sourceFile + * @property {number|null} [begin] Annotation begin + * @property {number|null} [end] Annotation end + * @property {google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null} [semantic] Annotation semantic + */ + + /** + * Constructs a new Annotation. + * @memberof google.protobuf.GeneratedCodeInfo + * @classdesc Represents an Annotation. + * @implements IAnnotation + * @constructor + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set + */ + function Annotation(properties) { + this.path = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Annotation path. + * @member {Array.} path + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.path = $util.emptyArray; + + /** + * Annotation sourceFile. + * @member {string} sourceFile + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.sourceFile = ""; + + /** + * Annotation begin. + * @member {number} begin + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.begin = 0; + + /** + * Annotation end. + * @member {number} end + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.end = 0; + + /** + * Annotation semantic. + * @member {google.protobuf.GeneratedCodeInfo.Annotation.Semantic} semantic + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.semantic = 0; + + /** + * Creates a new Annotation instance using the specified properties. + * @function create + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation instance + */ + Annotation.create = function create(properties) { + return new Annotation(properties); + }; + + /** + * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @function encode + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Annotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.path != null && message.path.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.path.length; ++i) + writer.int32(message.path[i]); + writer.ldelim(); + } + if (message.sourceFile != null && Object.hasOwnProperty.call(message, "sourceFile")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceFile); + if (message.begin != null && Object.hasOwnProperty.call(message, "begin")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.begin); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.end); + if (message.semantic != null && Object.hasOwnProperty.call(message, "semantic")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.semantic); + return writer; + }; + + /** + * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Annotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Annotation message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Annotation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.path && message.path.length)) + message.path = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.path.push(reader.int32()); + } else + message.path.push(reader.int32()); + break; + } + case 2: { + message.sourceFile = reader.string(); + break; + } + case 3: { + message.begin = reader.int32(); + break; + } + case 4: { + message.end = reader.int32(); + break; + } + case 5: { + message.semantic = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Annotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Annotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Annotation message. + * @function verify + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Annotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.path != null && message.hasOwnProperty("path")) { + if (!Array.isArray(message.path)) + return "path: array expected"; + for (var i = 0; i < message.path.length; ++i) + if (!$util.isInteger(message.path[i])) + return "path: integer[] expected"; + } + if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) + if (!$util.isString(message.sourceFile)) + return "sourceFile: string expected"; + if (message.begin != null && message.hasOwnProperty("begin")) + if (!$util.isInteger(message.begin)) + return "begin: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + if (message.semantic != null && message.hasOwnProperty("semantic")) + switch (message.semantic) { + default: + return "semantic: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates an Annotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + */ + Annotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.GeneratedCodeInfo.Annotation) + return object; + var message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); + if (object.path) { + if (!Array.isArray(object.path)) + throw TypeError(".google.protobuf.GeneratedCodeInfo.Annotation.path: array expected"); + message.path = []; + for (var i = 0; i < object.path.length; ++i) + message.path[i] = object.path[i] | 0; + } + if (object.sourceFile != null) + message.sourceFile = String(object.sourceFile); + if (object.begin != null) + message.begin = object.begin | 0; + if (object.end != null) + message.end = object.end | 0; + switch (object.semantic) { + default: + if (typeof object.semantic === "number") { + message.semantic = object.semantic; + break; + } + break; + case "NONE": + case 0: + message.semantic = 0; + break; + case "SET": + case 1: + message.semantic = 1; + break; + case "ALIAS": + case 2: + message.semantic = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from an Annotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.Annotation} message Annotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Annotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.path = []; + if (options.defaults) { + object.sourceFile = ""; + object.begin = 0; + object.end = 0; + object.semantic = options.enums === String ? "NONE" : 0; + } + if (message.path && message.path.length) { + object.path = []; + for (var j = 0; j < message.path.length; ++j) + object.path[j] = message.path[j]; + } + if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) + object.sourceFile = message.sourceFile; + if (message.begin != null && message.hasOwnProperty("begin")) + object.begin = message.begin; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + if (message.semantic != null && message.hasOwnProperty("semantic")) + object.semantic = options.enums === String ? $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] === undefined ? message.semantic : $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] : message.semantic; + return object; + }; + + /** + * Converts this Annotation to JSON. + * @function toJSON + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + * @returns {Object.} JSON object + */ + Annotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Annotation + * @function getTypeUrl + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Annotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo.Annotation"; + }; + + /** + * Semantic enum. + * @name google.protobuf.GeneratedCodeInfo.Annotation.Semantic + * @enum {number} + * @property {number} NONE=0 NONE value + * @property {number} SET=1 SET value + * @property {number} ALIAS=2 ALIAS value + */ + Annotation.Semantic = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NONE"] = 0; + values[valuesById[1] = "SET"] = 1; + values[valuesById[2] = "ALIAS"] = 2; + return values; + })(); + + return Annotation; + })(); + + return GeneratedCodeInfo; + })(); + + protobuf.Duration = (function() { + + /** + * Properties of a Duration. + * @memberof google.protobuf + * @interface IDuration + * @property {number|Long|null} [seconds] Duration seconds + * @property {number|null} [nanos] Duration nanos + */ + + /** + * Constructs a new Duration. + * @memberof google.protobuf + * @classdesc Represents a Duration. + * @implements IDuration + * @constructor + * @param {google.protobuf.IDuration=} [properties] Properties to set + */ + function Duration(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Duration seconds. + * @member {number|Long} seconds + * @memberof google.protobuf.Duration + * @instance + */ + Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Duration nanos. + * @member {number} nanos + * @memberof google.protobuf.Duration + * @instance + */ + Duration.prototype.nanos = 0; + + /** + * Creates a new Duration instance using the specified properties. + * @function create + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration=} [properties] Properties to set + * @returns {google.protobuf.Duration} Duration instance + */ + Duration.create = function create(properties) { + return new Duration(properties); + }; + + /** + * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration} message Duration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); + return writer; + }; + + /** + * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration} message Duration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Duration(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.seconds = reader.int64(); + break; + } + case 2: { + message.nanos = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Duration message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Duration message. + * @function verify + * @memberof google.protobuf.Duration + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Duration.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) + return "seconds: integer|Long expected"; + if (message.nanos != null && message.hasOwnProperty("nanos")) + if (!$util.isInteger(message.nanos)) + return "nanos: integer expected"; + return null; + }; + + /** + * Creates a Duration message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Duration + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Duration} Duration + */ + Duration.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Duration) + return object; + var message = new $root.google.protobuf.Duration(); + if (object.seconds != null) + if ($util.Long) + (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; + else if (typeof object.seconds === "string") + message.seconds = parseInt(object.seconds, 10); + else if (typeof object.seconds === "number") + message.seconds = object.seconds; + else if (typeof object.seconds === "object") + message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); + if (object.nanos != null) + message.nanos = object.nanos | 0; + return message; + }; + + /** + * Creates a plain object from a Duration message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.Duration} message Duration + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Duration.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.seconds = options.longs === String ? "0" : 0; + object.nanos = 0; + } + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (typeof message.seconds === "number") + object.seconds = options.longs === String ? String(message.seconds) : message.seconds; + else + object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; + if (message.nanos != null && message.hasOwnProperty("nanos")) + object.nanos = message.nanos; + return object; + }; + + /** + * Converts this Duration to JSON. + * @function toJSON + * @memberof google.protobuf.Duration + * @instance + * @returns {Object.} JSON object + */ + Duration.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Duration + * @function getTypeUrl + * @memberof google.protobuf.Duration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Duration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Duration"; + }; + + return Duration; + })(); + + protobuf.Timestamp = (function() { + + /** + * Properties of a Timestamp. + * @memberof google.protobuf + * @interface ITimestamp + * @property {number|Long|null} [seconds] Timestamp seconds + * @property {number|null} [nanos] Timestamp nanos + */ + + /** + * Constructs a new Timestamp. + * @memberof google.protobuf + * @classdesc Represents a Timestamp. + * @implements ITimestamp + * @constructor + * @param {google.protobuf.ITimestamp=} [properties] Properties to set + */ + function Timestamp(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Timestamp seconds. + * @member {number|Long} seconds + * @memberof google.protobuf.Timestamp + * @instance + */ + Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Timestamp nanos. + * @member {number} nanos + * @memberof google.protobuf.Timestamp + * @instance + */ + Timestamp.prototype.nanos = 0; + + /** + * Creates a new Timestamp instance using the specified properties. + * @function create + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp=} [properties] Properties to set + * @returns {google.protobuf.Timestamp} Timestamp instance + */ + Timestamp.create = function create(properties) { + return new Timestamp(properties); + }; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); + return writer; + }; + + /** + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Timestamp(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.seconds = reader.int64(); + break; + } + case 2: { + message.nanos = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Timestamp message. + * @function verify + * @memberof google.protobuf.Timestamp + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Timestamp.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) + return "seconds: integer|Long expected"; + if (message.nanos != null && message.hasOwnProperty("nanos")) + if (!$util.isInteger(message.nanos)) + return "nanos: integer expected"; + return null; + }; + + /** + * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Timestamp + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Timestamp} Timestamp + */ + Timestamp.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Timestamp) + return object; + var message = new $root.google.protobuf.Timestamp(); + if (object.seconds != null) + if ($util.Long) + (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; + else if (typeof object.seconds === "string") + message.seconds = parseInt(object.seconds, 10); + else if (typeof object.seconds === "number") + message.seconds = object.seconds; + else if (typeof object.seconds === "object") + message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); + if (object.nanos != null) + message.nanos = object.nanos | 0; + return message; + }; + + /** + * Creates a plain object from a Timestamp message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.Timestamp} message Timestamp + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Timestamp.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.seconds = options.longs === String ? "0" : 0; + object.nanos = 0; + } + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (typeof message.seconds === "number") + object.seconds = options.longs === String ? String(message.seconds) : message.seconds; + else + object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; + if (message.nanos != null && message.hasOwnProperty("nanos")) + object.nanos = message.nanos; + return object; + }; + + /** + * Converts this Timestamp to JSON. + * @function toJSON + * @memberof google.protobuf.Timestamp + * @instance + * @returns {Object.} JSON object + */ + Timestamp.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Timestamp + * @function getTypeUrl + * @memberof google.protobuf.Timestamp + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Timestamp.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Timestamp"; + }; + + return Timestamp; + })(); + + protobuf.DoubleValue = (function() { + + /** + * Properties of a DoubleValue. + * @memberof google.protobuf + * @interface IDoubleValue + * @property {number|null} [value] DoubleValue value + */ + + /** + * Constructs a new DoubleValue. + * @memberof google.protobuf + * @classdesc Represents a DoubleValue. + * @implements IDoubleValue + * @constructor + * @param {google.protobuf.IDoubleValue=} [properties] Properties to set + */ + function DoubleValue(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DoubleValue value. + * @member {number} value + * @memberof google.protobuf.DoubleValue + * @instance + */ + DoubleValue.prototype.value = 0; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @function create + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue=} [properties] Properties to set + * @returns {google.protobuf.DoubleValue} DoubleValue instance + */ + DoubleValue.create = function create(properties) { + return new DoubleValue(properties); + }; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue} message DoubleValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DoubleValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 1 =*/9).double(message.value); + return writer; + }; + + /** + * Encodes the specified DoubleValue message, length delimited. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue} message DoubleValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DoubleValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DoubleValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DoubleValue} DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DoubleValue.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DoubleValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.value = reader.double(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DoubleValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DoubleValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DoubleValue} DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DoubleValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DoubleValue message. + * @function verify + * @memberof google.protobuf.DoubleValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DoubleValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value !== "number") + return "value: number expected"; + return null; + }; + + /** + * Creates a DoubleValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DoubleValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DoubleValue} DoubleValue + */ + DoubleValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DoubleValue) + return object; + var message = new $root.google.protobuf.DoubleValue(); + if (object.value != null) + message.value = Number(object.value); + return message; + }; + + /** + * Creates a plain object from a DoubleValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.DoubleValue} message DoubleValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DoubleValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = 0; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.json && !isFinite(message.value) ? String(message.value) : message.value; + return object; + }; + + /** + * Converts this DoubleValue to JSON. + * @function toJSON + * @memberof google.protobuf.DoubleValue + * @instance + * @returns {Object.} JSON object + */ + DoubleValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DoubleValue + * @function getTypeUrl + * @memberof google.protobuf.DoubleValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DoubleValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DoubleValue"; + }; + + return DoubleValue; + })(); + + protobuf.FloatValue = (function() { + + /** + * Properties of a FloatValue. + * @memberof google.protobuf + * @interface IFloatValue + * @property {number|null} [value] FloatValue value + */ + + /** + * Constructs a new FloatValue. + * @memberof google.protobuf + * @classdesc Represents a FloatValue. + * @implements IFloatValue + * @constructor + * @param {google.protobuf.IFloatValue=} [properties] Properties to set + */ + function FloatValue(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FloatValue value. + * @member {number} value + * @memberof google.protobuf.FloatValue + * @instance + */ + FloatValue.prototype.value = 0; + + /** + * Creates a new FloatValue instance using the specified properties. + * @function create + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue=} [properties] Properties to set + * @returns {google.protobuf.FloatValue} FloatValue instance + */ + FloatValue.create = function create(properties) { + return new FloatValue(properties); + }; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue} message FloatValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FloatValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.value); + return writer; + }; + + /** + * Encodes the specified FloatValue message, length delimited. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue} message FloatValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FloatValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FloatValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FloatValue} FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FloatValue.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FloatValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.value = reader.float(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FloatValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FloatValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FloatValue} FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FloatValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FloatValue message. + * @function verify + * @memberof google.protobuf.FloatValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FloatValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value !== "number") + return "value: number expected"; + return null; + }; + + /** + * Creates a FloatValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FloatValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FloatValue} FloatValue + */ + FloatValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FloatValue) + return object; + var message = new $root.google.protobuf.FloatValue(); + if (object.value != null) + message.value = Number(object.value); + return message; + }; + + /** + * Creates a plain object from a FloatValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.FloatValue} message FloatValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FloatValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = 0; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.json && !isFinite(message.value) ? String(message.value) : message.value; + return object; + }; + + /** + * Converts this FloatValue to JSON. + * @function toJSON + * @memberof google.protobuf.FloatValue + * @instance + * @returns {Object.} JSON object + */ + FloatValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FloatValue + * @function getTypeUrl + * @memberof google.protobuf.FloatValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FloatValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FloatValue"; + }; + + return FloatValue; + })(); + + protobuf.Int64Value = (function() { + + /** + * Properties of an Int64Value. + * @memberof google.protobuf + * @interface IInt64Value + * @property {number|Long|null} [value] Int64Value value + */ + + /** + * Constructs a new Int64Value. + * @memberof google.protobuf + * @classdesc Represents an Int64Value. + * @implements IInt64Value + * @constructor + * @param {google.protobuf.IInt64Value=} [properties] Properties to set + */ + function Int64Value(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Int64Value value. + * @member {number|Long} value + * @memberof google.protobuf.Int64Value + * @instance + */ + Int64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Int64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value=} [properties] Properties to set + * @returns {google.protobuf.Int64Value} Int64Value instance + */ + Int64Value.create = function create(properties) { + return new Int64Value(properties); + }; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value} message Int64Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int64Value.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.value); + return writer; + }; + + /** + * Encodes the specified Int64Value message, length delimited. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value} message Int64Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int64Value.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int64Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Int64Value} Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int64Value.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Int64Value(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.value = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Int64Value message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Int64Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Int64Value} Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int64Value.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Int64Value message. + * @function verify + * @memberof google.protobuf.Int64Value + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Int64Value.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isInteger(message.value) && !(message.value && $util.isInteger(message.value.low) && $util.isInteger(message.value.high))) + return "value: integer|Long expected"; + return null; + }; + + /** + * Creates an Int64Value message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Int64Value + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Int64Value} Int64Value + */ + Int64Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Int64Value) + return object; + var message = new $root.google.protobuf.Int64Value(); + if (object.value != null) + if ($util.Long) + (message.value = $util.Long.fromValue(object.value)).unsigned = false; + else if (typeof object.value === "string") + message.value = parseInt(object.value, 10); + else if (typeof object.value === "number") + message.value = object.value; + else if (typeof object.value === "object") + message.value = new $util.LongBits(object.value.low >>> 0, object.value.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from an Int64Value message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.Int64Value} message Int64Value + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Int64Value.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.value = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.value = options.longs === String ? "0" : 0; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value === "number") + object.value = options.longs === String ? String(message.value) : message.value; + else + object.value = options.longs === String ? $util.Long.prototype.toString.call(message.value) : options.longs === Number ? new $util.LongBits(message.value.low >>> 0, message.value.high >>> 0).toNumber() : message.value; + return object; + }; + + /** + * Converts this Int64Value to JSON. + * @function toJSON + * @memberof google.protobuf.Int64Value + * @instance + * @returns {Object.} JSON object + */ + Int64Value.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Int64Value + * @function getTypeUrl + * @memberof google.protobuf.Int64Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Int64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Int64Value"; + }; + + return Int64Value; + })(); + + protobuf.UInt64Value = (function() { + + /** + * Properties of a UInt64Value. + * @memberof google.protobuf + * @interface IUInt64Value + * @property {number|Long|null} [value] UInt64Value value + */ + + /** + * Constructs a new UInt64Value. + * @memberof google.protobuf + * @classdesc Represents a UInt64Value. + * @implements IUInt64Value + * @constructor + * @param {google.protobuf.IUInt64Value=} [properties] Properties to set + */ + function UInt64Value(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UInt64Value value. + * @member {number|Long} value + * @memberof google.protobuf.UInt64Value + * @instance + */ + UInt64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new UInt64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value=} [properties] Properties to set + * @returns {google.protobuf.UInt64Value} UInt64Value instance + */ + UInt64Value.create = function create(properties) { + return new UInt64Value(properties); + }; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value} message UInt64Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt64Value.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.value); + return writer; + }; + + /** + * Encodes the specified UInt64Value message, length delimited. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value} message UInt64Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt64Value.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt64Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UInt64Value} UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt64Value.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UInt64Value(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.value = reader.uint64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a UInt64Value message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UInt64Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UInt64Value} UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt64Value.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a UInt64Value message. + * @function verify + * @memberof google.protobuf.UInt64Value + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UInt64Value.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isInteger(message.value) && !(message.value && $util.isInteger(message.value.low) && $util.isInteger(message.value.high))) + return "value: integer|Long expected"; + return null; + }; + + /** + * Creates a UInt64Value message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UInt64Value + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UInt64Value} UInt64Value + */ + UInt64Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UInt64Value) + return object; + var message = new $root.google.protobuf.UInt64Value(); + if (object.value != null) + if ($util.Long) + (message.value = $util.Long.fromValue(object.value)).unsigned = true; + else if (typeof object.value === "string") + message.value = parseInt(object.value, 10); + else if (typeof object.value === "number") + message.value = object.value; + else if (typeof object.value === "object") + message.value = new $util.LongBits(object.value.low >>> 0, object.value.high >>> 0).toNumber(true); + return message; + }; + + /** + * Creates a plain object from a UInt64Value message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.UInt64Value} message UInt64Value + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UInt64Value.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.value = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.value = options.longs === String ? "0" : 0; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value === "number") + object.value = options.longs === String ? String(message.value) : message.value; + else + object.value = options.longs === String ? $util.Long.prototype.toString.call(message.value) : options.longs === Number ? new $util.LongBits(message.value.low >>> 0, message.value.high >>> 0).toNumber(true) : message.value; + return object; + }; + + /** + * Converts this UInt64Value to JSON. + * @function toJSON + * @memberof google.protobuf.UInt64Value + * @instance + * @returns {Object.} JSON object + */ + UInt64Value.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UInt64Value + * @function getTypeUrl + * @memberof google.protobuf.UInt64Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UInt64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UInt64Value"; + }; + + return UInt64Value; + })(); + + protobuf.Int32Value = (function() { + + /** + * Properties of an Int32Value. + * @memberof google.protobuf + * @interface IInt32Value + * @property {number|null} [value] Int32Value value + */ + + /** + * Constructs a new Int32Value. + * @memberof google.protobuf + * @classdesc Represents an Int32Value. + * @implements IInt32Value + * @constructor + * @param {google.protobuf.IInt32Value=} [properties] Properties to set + */ + function Int32Value(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Int32Value value. + * @member {number} value + * @memberof google.protobuf.Int32Value + * @instance + */ + Int32Value.prototype.value = 0; + + /** + * Creates a new Int32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value=} [properties] Properties to set + * @returns {google.protobuf.Int32Value} Int32Value instance + */ + Int32Value.create = function create(properties) { + return new Int32Value(properties); + }; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value} message Int32Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int32Value.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.value); + return writer; + }; + + /** + * Encodes the specified Int32Value message, length delimited. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value} message Int32Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int32Value.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int32Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Int32Value} Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int32Value.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Int32Value(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.value = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Int32Value message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Int32Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Int32Value} Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int32Value.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Int32Value message. + * @function verify + * @memberof google.protobuf.Int32Value + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Int32Value.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isInteger(message.value)) + return "value: integer expected"; + return null; + }; + + /** + * Creates an Int32Value message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Int32Value + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Int32Value} Int32Value + */ + Int32Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Int32Value) + return object; + var message = new $root.google.protobuf.Int32Value(); + if (object.value != null) + message.value = object.value | 0; + return message; + }; + + /** + * Creates a plain object from an Int32Value message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.Int32Value} message Int32Value + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Int32Value.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = 0; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + return object; + }; + + /** + * Converts this Int32Value to JSON. + * @function toJSON + * @memberof google.protobuf.Int32Value + * @instance + * @returns {Object.} JSON object + */ + Int32Value.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Int32Value + * @function getTypeUrl + * @memberof google.protobuf.Int32Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Int32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Int32Value"; + }; + + return Int32Value; + })(); + + protobuf.UInt32Value = (function() { + + /** + * Properties of a UInt32Value. + * @memberof google.protobuf + * @interface IUInt32Value + * @property {number|null} [value] UInt32Value value + */ + + /** + * Constructs a new UInt32Value. + * @memberof google.protobuf + * @classdesc Represents a UInt32Value. + * @implements IUInt32Value + * @constructor + * @param {google.protobuf.IUInt32Value=} [properties] Properties to set + */ + function UInt32Value(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UInt32Value value. + * @member {number} value + * @memberof google.protobuf.UInt32Value + * @instance + */ + UInt32Value.prototype.value = 0; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value=} [properties] Properties to set + * @returns {google.protobuf.UInt32Value} UInt32Value instance + */ + UInt32Value.create = function create(properties) { + return new UInt32Value(properties); + }; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value} message UInt32Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt32Value.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.value); + return writer; + }; + + /** + * Encodes the specified UInt32Value message, length delimited. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value} message UInt32Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt32Value.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt32Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UInt32Value} UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt32Value.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UInt32Value(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.value = reader.uint32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a UInt32Value message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UInt32Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UInt32Value} UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt32Value.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a UInt32Value message. + * @function verify + * @memberof google.protobuf.UInt32Value + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UInt32Value.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isInteger(message.value)) + return "value: integer expected"; + return null; + }; + + /** + * Creates a UInt32Value message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UInt32Value + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UInt32Value} UInt32Value + */ + UInt32Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UInt32Value) + return object; + var message = new $root.google.protobuf.UInt32Value(); + if (object.value != null) + message.value = object.value >>> 0; + return message; + }; + + /** + * Creates a plain object from a UInt32Value message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.UInt32Value} message UInt32Value + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UInt32Value.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = 0; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + return object; + }; + + /** + * Converts this UInt32Value to JSON. + * @function toJSON + * @memberof google.protobuf.UInt32Value + * @instance + * @returns {Object.} JSON object + */ + UInt32Value.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UInt32Value + * @function getTypeUrl + * @memberof google.protobuf.UInt32Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UInt32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UInt32Value"; + }; + + return UInt32Value; + })(); + + protobuf.BoolValue = (function() { + + /** + * Properties of a BoolValue. + * @memberof google.protobuf + * @interface IBoolValue + * @property {boolean|null} [value] BoolValue value + */ + + /** + * Constructs a new BoolValue. + * @memberof google.protobuf + * @classdesc Represents a BoolValue. + * @implements IBoolValue + * @constructor + * @param {google.protobuf.IBoolValue=} [properties] Properties to set + */ + function BoolValue(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BoolValue value. + * @member {boolean} value + * @memberof google.protobuf.BoolValue + * @instance + */ + BoolValue.prototype.value = false; + + /** + * Creates a new BoolValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue=} [properties] Properties to set + * @returns {google.protobuf.BoolValue} BoolValue instance + */ + BoolValue.create = function create(properties) { + return new BoolValue(properties); + }; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue} message BoolValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoolValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.value); + return writer; + }; + + /** + * Encodes the specified BoolValue message, length delimited. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue} message BoolValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoolValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BoolValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.BoolValue} BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoolValue.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.BoolValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.value = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BoolValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.BoolValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.BoolValue} BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoolValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BoolValue message. + * @function verify + * @memberof google.protobuf.BoolValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BoolValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value !== "boolean") + return "value: boolean expected"; + return null; + }; + + /** + * Creates a BoolValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.BoolValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.BoolValue} BoolValue + */ + BoolValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.BoolValue) + return object; + var message = new $root.google.protobuf.BoolValue(); + if (object.value != null) + message.value = Boolean(object.value); + return message; + }; + + /** + * Creates a plain object from a BoolValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.BoolValue} message BoolValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BoolValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = false; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + return object; + }; + + /** + * Converts this BoolValue to JSON. + * @function toJSON + * @memberof google.protobuf.BoolValue + * @instance + * @returns {Object.} JSON object + */ + BoolValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BoolValue + * @function getTypeUrl + * @memberof google.protobuf.BoolValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BoolValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.BoolValue"; + }; + + return BoolValue; + })(); + + protobuf.StringValue = (function() { + + /** + * Properties of a StringValue. + * @memberof google.protobuf + * @interface IStringValue + * @property {string|null} [value] StringValue value + */ + + /** + * Constructs a new StringValue. + * @memberof google.protobuf + * @classdesc Represents a StringValue. + * @implements IStringValue + * @constructor + * @param {google.protobuf.IStringValue=} [properties] Properties to set + */ + function StringValue(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StringValue value. + * @member {string} value + * @memberof google.protobuf.StringValue + * @instance + */ + StringValue.prototype.value = ""; + + /** + * Creates a new StringValue instance using the specified properties. + * @function create + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue=} [properties] Properties to set + * @returns {google.protobuf.StringValue} StringValue instance + */ + StringValue.create = function create(properties) { + return new StringValue(properties); + }; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue} message StringValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StringValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.value); + return writer; + }; + + /** + * Encodes the specified StringValue message, length delimited. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue} message StringValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StringValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.StringValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.StringValue} StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StringValue.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.StringValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.value = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StringValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.StringValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.StringValue} StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StringValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StringValue message. + * @function verify + * @memberof google.protobuf.StringValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StringValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isString(message.value)) + return "value: string expected"; + return null; + }; + + /** + * Creates a StringValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.StringValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.StringValue} StringValue + */ + StringValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.StringValue) + return object; + var message = new $root.google.protobuf.StringValue(); + if (object.value != null) + message.value = String(object.value); + return message; + }; + + /** + * Creates a plain object from a StringValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.StringValue} message StringValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StringValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = ""; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + return object; + }; + + /** + * Converts this StringValue to JSON. + * @function toJSON + * @memberof google.protobuf.StringValue + * @instance + * @returns {Object.} JSON object + */ + StringValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StringValue + * @function getTypeUrl + * @memberof google.protobuf.StringValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StringValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.StringValue"; + }; + + return StringValue; + })(); + + protobuf.BytesValue = (function() { + + /** + * Properties of a BytesValue. + * @memberof google.protobuf + * @interface IBytesValue + * @property {Uint8Array|null} [value] BytesValue value + */ + + /** + * Constructs a new BytesValue. + * @memberof google.protobuf + * @classdesc Represents a BytesValue. + * @implements IBytesValue + * @constructor + * @param {google.protobuf.IBytesValue=} [properties] Properties to set + */ + function BytesValue(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BytesValue value. + * @member {Uint8Array} value + * @memberof google.protobuf.BytesValue + * @instance + */ + BytesValue.prototype.value = $util.newBuffer([]); + + /** + * Creates a new BytesValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue=} [properties] Properties to set + * @returns {google.protobuf.BytesValue} BytesValue instance + */ + BytesValue.create = function create(properties) { + return new BytesValue(properties); + }; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue} message BytesValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BytesValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.value); + return writer; + }; + + /** + * Encodes the specified BytesValue message, length delimited. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue} message BytesValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BytesValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BytesValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.BytesValue} BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BytesValue.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.BytesValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.value = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BytesValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.BytesValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.BytesValue} BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BytesValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BytesValue message. + * @function verify + * @memberof google.protobuf.BytesValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BytesValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) + return "value: buffer expected"; + return null; + }; + + /** + * Creates a BytesValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.BytesValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.BytesValue} BytesValue + */ + BytesValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.BytesValue) + return object; + var message = new $root.google.protobuf.BytesValue(); + if (object.value != null) + if (typeof object.value === "string") + $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); + else if (object.value.length >= 0) + message.value = object.value; + return message; + }; + + /** + * Creates a plain object from a BytesValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.BytesValue} message BytesValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BytesValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + if (options.bytes === String) + object.value = ""; + else { + object.value = []; + if (options.bytes !== Array) + object.value = $util.newBuffer(object.value); + } + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; + return object; + }; + + /** + * Converts this BytesValue to JSON. + * @function toJSON + * @memberof google.protobuf.BytesValue + * @instance + * @returns {Object.} JSON object + */ + BytesValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BytesValue + * @function getTypeUrl + * @memberof google.protobuf.BytesValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BytesValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.BytesValue"; + }; + + return BytesValue; + })(); + + 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.Empty = (function() { + + /** + * Properties of an Empty. + * @memberof google.protobuf + * @interface IEmpty + */ + + /** + * Constructs a new Empty. + * @memberof google.protobuf + * @classdesc Represents an Empty. + * @implements IEmpty + * @constructor + * @param {google.protobuf.IEmpty=} [properties] Properties to set + */ + function Empty(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new Empty instance using the specified properties. + * @function create + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty=} [properties] Properties to set + * @returns {google.protobuf.Empty} Empty instance + */ + Empty.create = function create(properties) { + return new Empty(properties); + }; + + /** + * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty} message Empty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Empty.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty} message Empty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Empty.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Empty message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Empty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Empty} Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Empty.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Empty(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Empty message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Empty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Empty} Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Empty.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Empty message. + * @function verify + * @memberof google.protobuf.Empty + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Empty.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates an Empty message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Empty + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Empty} Empty + */ + Empty.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Empty) + return object; + return new $root.google.protobuf.Empty(); + }; + + /** + * Creates a plain object from an Empty message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.Empty} message Empty + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Empty.toObject = function toObject() { + return {}; + }; + + /** + * Converts this Empty to JSON. + * @function toJSON + * @memberof google.protobuf.Empty + * @instance + * @returns {Object.} JSON object + */ + Empty.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Empty + * @function getTypeUrl + * @memberof google.protobuf.Empty + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Empty.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Empty"; + }; + + return Empty; + })(); + + protobuf.FieldMask = (function() { + + /** + * Properties of a FieldMask. + * @memberof google.protobuf + * @interface IFieldMask + * @property {Array.|null} [paths] FieldMask paths + */ + + /** + * Constructs a new FieldMask. + * @memberof google.protobuf + * @classdesc Represents a FieldMask. + * @implements IFieldMask + * @constructor + * @param {google.protobuf.IFieldMask=} [properties] Properties to set + */ + function FieldMask(properties) { + this.paths = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldMask paths. + * @member {Array.} paths + * @memberof google.protobuf.FieldMask + * @instance + */ + FieldMask.prototype.paths = $util.emptyArray; + + /** + * Creates a new FieldMask instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask=} [properties] Properties to set + * @returns {google.protobuf.FieldMask} FieldMask instance + */ + FieldMask.create = function create(properties) { + return new FieldMask(properties); + }; + + /** + * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldMask.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.paths != null && message.paths.length) + for (var i = 0; i < message.paths.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.paths[i]); + return writer; + }; + + /** + * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldMask.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldMask message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldMask + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldMask} FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldMask.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldMask(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.paths && message.paths.length)) + message.paths = []; + message.paths.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldMask message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldMask + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldMask} FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldMask.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldMask message. + * @function verify + * @memberof google.protobuf.FieldMask + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldMask.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.paths != null && message.hasOwnProperty("paths")) { + if (!Array.isArray(message.paths)) + return "paths: array expected"; + for (var i = 0; i < message.paths.length; ++i) + if (!$util.isString(message.paths[i])) + return "paths: string[] expected"; + } + return null; + }; + + /** + * Creates a FieldMask message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldMask + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldMask} FieldMask + */ + FieldMask.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldMask) + return object; + var message = new $root.google.protobuf.FieldMask(); + if (object.paths) { + if (!Array.isArray(object.paths)) + throw TypeError(".google.protobuf.FieldMask.paths: array expected"); + message.paths = []; + for (var i = 0; i < object.paths.length; ++i) + message.paths[i] = String(object.paths[i]); + } + return message; + }; + + /** + * Creates a plain object from a FieldMask message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.FieldMask} message FieldMask + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldMask.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.paths = []; + if (message.paths && message.paths.length) { + object.paths = []; + for (var j = 0; j < message.paths.length; ++j) + object.paths[j] = message.paths[j]; + } + return object; + }; + + /** + * Converts this FieldMask to JSON. + * @function toJSON + * @memberof google.protobuf.FieldMask + * @instance + * @returns {Object.} JSON object + */ + FieldMask.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldMask + * @function getTypeUrl + * @memberof google.protobuf.FieldMask + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldMask.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldMask"; + }; + + return FieldMask; + })(); + + return protobuf; + })(); + + google.rpc = (function() { + + /** + * Namespace rpc. + * @memberof google + * @namespace + */ + var rpc = {}; + + rpc.Status = (function() { + + /** + * Properties of a Status. + * @memberof google.rpc + * @interface IStatus + * @property {number|null} [code] Status code + * @property {string|null} [message] Status message + * @property {Array.|null} [details] Status details + */ + + /** + * Constructs a new Status. + * @memberof google.rpc + * @classdesc Represents a Status. + * @implements IStatus + * @constructor + * @param {google.rpc.IStatus=} [properties] Properties to set + */ + function Status(properties) { + this.details = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Status code. + * @member {number} code + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.code = 0; + + /** + * Status message. + * @member {string} message + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.message = ""; + + /** + * Status details. + * @member {Array.} details + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.details = $util.emptyArray; + + /** + * Creates a new Status instance using the specified properties. + * @function create + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus=} [properties] Properties to set + * @returns {google.rpc.Status} Status instance + */ + Status.create = function create(properties) { + return new Status(properties); + }; + + /** + * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @function encode + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus} message Status message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Status.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.code != null && Object.hasOwnProperty.call(message, "code")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.code); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.message); + if (message.details != null && message.details.length) + for (var i = 0; i < message.details.length; ++i) + $root.google.protobuf.Any.encode(message.details[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @function encodeDelimited + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus} message Status message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Status.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Status message from the specified reader or buffer. + * @function decode + * @memberof google.rpc.Status + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.rpc.Status} Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Status.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.rpc.Status(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.code = reader.int32(); + break; + } + case 2: { + message.message = reader.string(); + break; + } + case 3: { + if (!(message.details && message.details.length)) + message.details = []; + message.details.push($root.google.protobuf.Any.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Status message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.rpc.Status + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.rpc.Status} Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Status.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Status message. + * @function verify + * @memberof google.rpc.Status + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Status.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.code != null && message.hasOwnProperty("code")) + if (!$util.isInteger(message.code)) + return "code: integer expected"; + if (message.message != null && message.hasOwnProperty("message")) + if (!$util.isString(message.message)) + return "message: string expected"; + if (message.details != null && message.hasOwnProperty("details")) { + if (!Array.isArray(message.details)) + return "details: array expected"; + for (var i = 0; i < message.details.length; ++i) { + var error = $root.google.protobuf.Any.verify(message.details[i]); + if (error) + return "details." + error; + } + } + return null; + }; + + /** + * Creates a Status message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.rpc.Status + * @static + * @param {Object.} object Plain object + * @returns {google.rpc.Status} Status + */ + Status.fromObject = function fromObject(object) { + if (object instanceof $root.google.rpc.Status) + return object; + var message = new $root.google.rpc.Status(); + if (object.code != null) + message.code = object.code | 0; + if (object.message != null) + message.message = String(object.message); + if (object.details) { + if (!Array.isArray(object.details)) + throw TypeError(".google.rpc.Status.details: array expected"); + message.details = []; + for (var i = 0; i < object.details.length; ++i) { + if (typeof object.details[i] !== "object") + throw TypeError(".google.rpc.Status.details: object expected"); + message.details[i] = $root.google.protobuf.Any.fromObject(object.details[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Status message. Also converts values to other types if specified. + * @function toObject + * @memberof google.rpc.Status + * @static + * @param {google.rpc.Status} message Status + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Status.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.details = []; + if (options.defaults) { + object.code = 0; + object.message = ""; + } + if (message.code != null && message.hasOwnProperty("code")) + object.code = message.code; + if (message.message != null && message.hasOwnProperty("message")) + object.message = message.message; + if (message.details && message.details.length) { + object.details = []; + for (var j = 0; j < message.details.length; ++j) + object.details[j] = $root.google.protobuf.Any.toObject(message.details[j], options); + } + return object; + }; + + /** + * Converts this Status to JSON. + * @function toJSON + * @memberof google.rpc.Status + * @instance + * @returns {Object.} JSON object + */ + Status.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Status + * @function getTypeUrl + * @memberof google.rpc.Status + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Status.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.rpc.Status"; + }; + + return Status; + })(); + + return rpc; + })(); + + google.longrunning = (function() { + + /** + * Namespace longrunning. + * @memberof google + * @namespace + */ + var longrunning = {}; + + longrunning.Operations = (function() { + + /** + * Constructs a new Operations service. + * @memberof google.longrunning + * @classdesc Represents an Operations + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Operations(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Operations.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Operations; + + /** + * Creates new Operations service using the specified rpc implementation. + * @function create + * @memberof google.longrunning.Operations + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {Operations} RPC service. Useful where requests and/or responses are streamed. + */ + Operations.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.longrunning.Operations|listOperations}. + * @memberof google.longrunning.Operations + * @typedef ListOperationsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.ListOperationsResponse} [response] ListOperationsResponse + */ + + /** + * Calls ListOperations. + * @function listOperations + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IListOperationsRequest} request ListOperationsRequest message or plain object + * @param {google.longrunning.Operations.ListOperationsCallback} callback Node-style callback called with the error, if any, and ListOperationsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.listOperations = function listOperations(request, callback) { + return this.rpcCall(listOperations, $root.google.longrunning.ListOperationsRequest, $root.google.longrunning.ListOperationsResponse, request, callback); + }, "name", { value: "ListOperations" }); + + /** + * Calls ListOperations. + * @function listOperations + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IListOperationsRequest} request ListOperationsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|getOperation}. + * @memberof google.longrunning.Operations + * @typedef GetOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls GetOperation. + * @function getOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IGetOperationRequest} request GetOperationRequest message or plain object + * @param {google.longrunning.Operations.GetOperationCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.getOperation = function getOperation(request, callback) { + return this.rpcCall(getOperation, $root.google.longrunning.GetOperationRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "GetOperation" }); + + /** + * Calls GetOperation. + * @function getOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IGetOperationRequest} request GetOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|deleteOperation}. + * @memberof google.longrunning.Operations + * @typedef DeleteOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteOperation. + * @function deleteOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IDeleteOperationRequest} request DeleteOperationRequest message or plain object + * @param {google.longrunning.Operations.DeleteOperationCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.deleteOperation = function deleteOperation(request, callback) { + return this.rpcCall(deleteOperation, $root.google.longrunning.DeleteOperationRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteOperation" }); + + /** + * Calls DeleteOperation. + * @function deleteOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IDeleteOperationRequest} request DeleteOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|cancelOperation}. + * @memberof google.longrunning.Operations + * @typedef CancelOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls CancelOperation. + * @function cancelOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.ICancelOperationRequest} request CancelOperationRequest message or plain object + * @param {google.longrunning.Operations.CancelOperationCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.cancelOperation = function cancelOperation(request, callback) { + return this.rpcCall(cancelOperation, $root.google.longrunning.CancelOperationRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "CancelOperation" }); + + /** + * Calls CancelOperation. + * @function cancelOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.ICancelOperationRequest} request CancelOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|waitOperation}. + * @memberof google.longrunning.Operations + * @typedef WaitOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls WaitOperation. + * @function waitOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IWaitOperationRequest} request WaitOperationRequest message or plain object + * @param {google.longrunning.Operations.WaitOperationCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.waitOperation = function waitOperation(request, callback) { + return this.rpcCall(waitOperation, $root.google.longrunning.WaitOperationRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "WaitOperation" }); + + /** + * Calls WaitOperation. + * @function waitOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IWaitOperationRequest} request WaitOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Operations; + })(); + + longrunning.Operation = (function() { + + /** + * Properties of an Operation. + * @memberof google.longrunning + * @interface IOperation + * @property {string|null} [name] Operation name + * @property {google.protobuf.IAny|null} [metadata] Operation metadata + * @property {boolean|null} [done] Operation done + * @property {google.rpc.IStatus|null} [error] Operation error + * @property {google.protobuf.IAny|null} [response] Operation response + */ + + /** + * Constructs a new Operation. + * @memberof google.longrunning + * @classdesc Represents an Operation. + * @implements IOperation + * @constructor + * @param {google.longrunning.IOperation=} [properties] Properties to set + */ + function Operation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Operation name. + * @member {string} name + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.name = ""; + + /** + * Operation metadata. + * @member {google.protobuf.IAny|null|undefined} metadata + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.metadata = null; + + /** + * Operation done. + * @member {boolean} done + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.done = false; + + /** + * Operation error. + * @member {google.rpc.IStatus|null|undefined} error + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.error = null; + + /** + * Operation response. + * @member {google.protobuf.IAny|null|undefined} response + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.response = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Operation result. + * @member {"error"|"response"|undefined} result + * @memberof google.longrunning.Operation + * @instance + */ + Object.defineProperty(Operation.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["error", "response"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Operation instance using the specified properties. + * @function create + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.IOperation=} [properties] Properties to set + * @returns {google.longrunning.Operation} Operation instance + */ + Operation.create = function create(properties) { + return new Operation(properties); + }; + + /** + * Encodes the specified Operation message. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @function encode + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.IOperation} message Operation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Operation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.google.protobuf.Any.encode(message.metadata, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.done != null && Object.hasOwnProperty.call(message, "done")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.done); + if (message.error != null && Object.hasOwnProperty.call(message, "error")) + $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.response != null && Object.hasOwnProperty.call(message, "response")) + $root.google.protobuf.Any.encode(message.response, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Operation message, length delimited. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.IOperation} message Operation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Operation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Operation message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.Operation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.Operation} Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Operation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.Operation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.metadata = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + } + case 3: { + message.done = reader.bool(); + break; + } + case 4: { + message.error = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + } + case 5: { + message.response = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Operation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.Operation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.Operation} Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Operation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Operation message. + * @function verify + * @memberof google.longrunning.Operation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Operation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.google.protobuf.Any.verify(message.metadata); + if (error) + return "metadata." + error; + } + if (message.done != null && message.hasOwnProperty("done")) + if (typeof message.done !== "boolean") + return "done: boolean expected"; + if (message.error != null && message.hasOwnProperty("error")) { + properties.result = 1; + { + var error = $root.google.rpc.Status.verify(message.error); + if (error) + return "error." + error; + } + } + if (message.response != null && message.hasOwnProperty("response")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.google.protobuf.Any.verify(message.response); + if (error) + return "response." + error; + } + } + return null; + }; + + /** + * Creates an Operation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.Operation + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.Operation} Operation + */ + Operation.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.Operation) + return object; + var message = new $root.google.longrunning.Operation(); + if (object.name != null) + message.name = String(object.name); + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".google.longrunning.Operation.metadata: object expected"); + message.metadata = $root.google.protobuf.Any.fromObject(object.metadata); + } + if (object.done != null) + message.done = Boolean(object.done); + if (object.error != null) { + if (typeof object.error !== "object") + throw TypeError(".google.longrunning.Operation.error: object expected"); + message.error = $root.google.rpc.Status.fromObject(object.error); + } + if (object.response != null) { + if (typeof object.response !== "object") + throw TypeError(".google.longrunning.Operation.response: object expected"); + message.response = $root.google.protobuf.Any.fromObject(object.response); + } + return message; + }; + + /** + * Creates a plain object from an Operation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.Operation} message Operation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Operation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.metadata = null; + object.done = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.google.protobuf.Any.toObject(message.metadata, options); + if (message.done != null && message.hasOwnProperty("done")) + object.done = message.done; + if (message.error != null && message.hasOwnProperty("error")) { + object.error = $root.google.rpc.Status.toObject(message.error, options); + if (options.oneofs) + object.result = "error"; + } + if (message.response != null && message.hasOwnProperty("response")) { + object.response = $root.google.protobuf.Any.toObject(message.response, options); + if (options.oneofs) + object.result = "response"; + } + return object; + }; + + /** + * Converts this Operation to JSON. + * @function toJSON + * @memberof google.longrunning.Operation + * @instance + * @returns {Object.} JSON object + */ + Operation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Operation + * @function getTypeUrl + * @memberof google.longrunning.Operation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Operation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.Operation"; + }; + + return Operation; + })(); + + longrunning.GetOperationRequest = (function() { + + /** + * Properties of a GetOperationRequest. + * @memberof google.longrunning + * @interface IGetOperationRequest + * @property {string|null} [name] GetOperationRequest name + */ + + /** + * Constructs a new GetOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a GetOperationRequest. + * @implements IGetOperationRequest + * @constructor + * @param {google.longrunning.IGetOperationRequest=} [properties] Properties to set + */ + function GetOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetOperationRequest name. + * @member {string} name + * @memberof google.longrunning.GetOperationRequest + * @instance + */ + GetOperationRequest.prototype.name = ""; + + /** + * Creates a new GetOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.IGetOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest instance + */ + GetOperationRequest.create = function create(properties) { + return new GetOperationRequest(properties); + }; + + /** + * Encodes the specified GetOperationRequest message. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.IGetOperationRequest} message GetOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.IGetOperationRequest} message GetOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetOperationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.GetOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetOperationRequest message. + * @function verify + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetOperationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest + */ + GetOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.GetOperationRequest) + return object; + var message = new $root.google.longrunning.GetOperationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.GetOperationRequest} message GetOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.GetOperationRequest + * @instance + * @returns {Object.} JSON object + */ + GetOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.GetOperationRequest"; + }; + + return GetOperationRequest; + })(); + + longrunning.ListOperationsRequest = (function() { + + /** + * Properties of a ListOperationsRequest. + * @memberof google.longrunning + * @interface IListOperationsRequest + * @property {string|null} [name] ListOperationsRequest name + * @property {string|null} [filter] ListOperationsRequest filter + * @property {number|null} [pageSize] ListOperationsRequest pageSize + * @property {string|null} [pageToken] ListOperationsRequest pageToken + */ + + /** + * Constructs a new ListOperationsRequest. + * @memberof google.longrunning + * @classdesc Represents a ListOperationsRequest. + * @implements IListOperationsRequest + * @constructor + * @param {google.longrunning.IListOperationsRequest=} [properties] Properties to set + */ + function ListOperationsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListOperationsRequest name. + * @member {string} name + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.name = ""; + + /** + * ListOperationsRequest filter. + * @member {string} filter + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.filter = ""; + + /** + * ListOperationsRequest pageSize. + * @member {number} pageSize + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.pageSize = 0; + + /** + * ListOperationsRequest pageToken. + * @member {string} pageToken + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListOperationsRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.IListOperationsRequest=} [properties] Properties to set + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest instance + */ + ListOperationsRequest.create = function create(properties) { + return new ListOperationsRequest(properties); + }; + + /** + * Encodes the specified ListOperationsRequest message. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.IListOperationsRequest} message ListOperationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.filter); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.name); + return writer; + }; + + /** + * Encodes the specified ListOperationsRequest message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.IListOperationsRequest} message ListOperationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.ListOperationsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 4: { + message.name = reader.string(); + break; + } + case 1: { + message.filter = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListOperationsRequest message. + * @function verify + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListOperationsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListOperationsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest + */ + ListOperationsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.ListOperationsRequest) + return object; + var message = new $root.google.longrunning.ListOperationsRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.filter != null) + message.filter = String(object.filter); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListOperationsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.ListOperationsRequest} message ListOperationsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListOperationsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.filter = ""; + object.pageSize = 0; + object.pageToken = ""; + object.name = ""; + } + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this ListOperationsRequest to JSON. + * @function toJSON + * @memberof google.longrunning.ListOperationsRequest + * @instance + * @returns {Object.} JSON object + */ + ListOperationsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListOperationsRequest + * @function getTypeUrl + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListOperationsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.ListOperationsRequest"; + }; + + return ListOperationsRequest; + })(); + + longrunning.ListOperationsResponse = (function() { + + /** + * Properties of a ListOperationsResponse. + * @memberof google.longrunning + * @interface IListOperationsResponse + * @property {Array.|null} [operations] ListOperationsResponse operations + * @property {string|null} [nextPageToken] ListOperationsResponse nextPageToken + */ + + /** + * Constructs a new ListOperationsResponse. + * @memberof google.longrunning + * @classdesc Represents a ListOperationsResponse. + * @implements IListOperationsResponse + * @constructor + * @param {google.longrunning.IListOperationsResponse=} [properties] Properties to set + */ + function ListOperationsResponse(properties) { + this.operations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListOperationsResponse operations. + * @member {Array.} operations + * @memberof google.longrunning.ListOperationsResponse + * @instance + */ + ListOperationsResponse.prototype.operations = $util.emptyArray; + + /** + * ListOperationsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.longrunning.ListOperationsResponse + * @instance + */ + ListOperationsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListOperationsResponse instance using the specified properties. + * @function create + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.IListOperationsResponse=} [properties] Properties to set + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse instance + */ + ListOperationsResponse.create = function create(properties) { + return new ListOperationsResponse(properties); + }; + + /** + * Encodes the specified ListOperationsResponse message. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @function encode + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.IListOperationsResponse} message ListOperationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.operations != null && message.operations.length) + for (var i = 0; i < message.operations.length; ++i) + $root.google.longrunning.Operation.encode(message.operations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListOperationsResponse message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.IListOperationsResponse} message ListOperationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.ListOperationsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.operations && message.operations.length)) + message.operations = []; + message.operations.push($root.google.longrunning.Operation.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListOperationsResponse message. + * @function verify + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListOperationsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.operations != null && message.hasOwnProperty("operations")) { + if (!Array.isArray(message.operations)) + return "operations: array expected"; + for (var i = 0; i < message.operations.length; ++i) { + var error = $root.google.longrunning.Operation.verify(message.operations[i]); + if (error) + return "operations." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListOperationsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse + */ + ListOperationsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.ListOperationsResponse) + return object; + var message = new $root.google.longrunning.ListOperationsResponse(); + if (object.operations) { + if (!Array.isArray(object.operations)) + throw TypeError(".google.longrunning.ListOperationsResponse.operations: array expected"); + message.operations = []; + for (var i = 0; i < object.operations.length; ++i) { + if (typeof object.operations[i] !== "object") + throw TypeError(".google.longrunning.ListOperationsResponse.operations: object expected"); + message.operations[i] = $root.google.longrunning.Operation.fromObject(object.operations[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListOperationsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.ListOperationsResponse} message ListOperationsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListOperationsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.operations = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.operations && message.operations.length) { + object.operations = []; + for (var j = 0; j < message.operations.length; ++j) + object.operations[j] = $root.google.longrunning.Operation.toObject(message.operations[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListOperationsResponse to JSON. + * @function toJSON + * @memberof google.longrunning.ListOperationsResponse + * @instance + * @returns {Object.} JSON object + */ + ListOperationsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListOperationsResponse + * @function getTypeUrl + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListOperationsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.ListOperationsResponse"; + }; + + return ListOperationsResponse; + })(); + + longrunning.CancelOperationRequest = (function() { + + /** + * Properties of a CancelOperationRequest. + * @memberof google.longrunning + * @interface ICancelOperationRequest + * @property {string|null} [name] CancelOperationRequest name + */ + + /** + * Constructs a new CancelOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a CancelOperationRequest. + * @implements ICancelOperationRequest + * @constructor + * @param {google.longrunning.ICancelOperationRequest=} [properties] Properties to set + */ + function CancelOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CancelOperationRequest name. + * @member {string} name + * @memberof google.longrunning.CancelOperationRequest + * @instance + */ + CancelOperationRequest.prototype.name = ""; + + /** + * Creates a new CancelOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.ICancelOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest instance + */ + CancelOperationRequest.create = function create(properties) { + return new CancelOperationRequest(properties); + }; + + /** + * Encodes the specified CancelOperationRequest message. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.ICancelOperationRequest} message CancelOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CancelOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified CancelOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.ICancelOperationRequest} message CancelOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CancelOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CancelOperationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.CancelOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CancelOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CancelOperationRequest message. + * @function verify + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CancelOperationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a CancelOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest + */ + CancelOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.CancelOperationRequest) + return object; + var message = new $root.google.longrunning.CancelOperationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a CancelOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.CancelOperationRequest} message CancelOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CancelOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this CancelOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.CancelOperationRequest + * @instance + * @returns {Object.} JSON object + */ + CancelOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CancelOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CancelOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.CancelOperationRequest"; + }; + + return CancelOperationRequest; + })(); + + longrunning.DeleteOperationRequest = (function() { + + /** + * Properties of a DeleteOperationRequest. + * @memberof google.longrunning + * @interface IDeleteOperationRequest + * @property {string|null} [name] DeleteOperationRequest name + */ + + /** + * Constructs a new DeleteOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a DeleteOperationRequest. + * @implements IDeleteOperationRequest + * @constructor + * @param {google.longrunning.IDeleteOperationRequest=} [properties] Properties to set + */ + function DeleteOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteOperationRequest name. + * @member {string} name + * @memberof google.longrunning.DeleteOperationRequest + * @instance + */ + DeleteOperationRequest.prototype.name = ""; + + /** + * Creates a new DeleteOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.IDeleteOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest instance + */ + DeleteOperationRequest.create = function create(properties) { + return new DeleteOperationRequest(properties); + }; + + /** + * Encodes the specified DeleteOperationRequest message. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.IDeleteOperationRequest} message DeleteOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified DeleteOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.IDeleteOperationRequest} message DeleteOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteOperationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.DeleteOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteOperationRequest message. + * @function verify + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteOperationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a DeleteOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest + */ + DeleteOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.DeleteOperationRequest) + return object; + var message = new $root.google.longrunning.DeleteOperationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.DeleteOperationRequest} message DeleteOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this DeleteOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.DeleteOperationRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.DeleteOperationRequest"; + }; + + return DeleteOperationRequest; + })(); + + longrunning.WaitOperationRequest = (function() { + + /** + * Properties of a WaitOperationRequest. + * @memberof google.longrunning + * @interface IWaitOperationRequest + * @property {string|null} [name] WaitOperationRequest name + * @property {google.protobuf.IDuration|null} [timeout] WaitOperationRequest timeout + */ + + /** + * Constructs a new WaitOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a WaitOperationRequest. + * @implements IWaitOperationRequest + * @constructor + * @param {google.longrunning.IWaitOperationRequest=} [properties] Properties to set + */ + function WaitOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * WaitOperationRequest name. + * @member {string} name + * @memberof google.longrunning.WaitOperationRequest + * @instance + */ + WaitOperationRequest.prototype.name = ""; + + /** + * WaitOperationRequest timeout. + * @member {google.protobuf.IDuration|null|undefined} timeout + * @memberof google.longrunning.WaitOperationRequest + * @instance + */ + WaitOperationRequest.prototype.timeout = null; + + /** + * Creates a new WaitOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.IWaitOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest instance + */ + WaitOperationRequest.create = function create(properties) { + return new WaitOperationRequest(properties); + }; + + /** + * Encodes the specified WaitOperationRequest message. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.IWaitOperationRequest} message WaitOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WaitOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.timeout != null && Object.hasOwnProperty.call(message, "timeout")) + $root.google.protobuf.Duration.encode(message.timeout, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified WaitOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.IWaitOperationRequest} message WaitOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WaitOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WaitOperationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.WaitOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.timeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WaitOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WaitOperationRequest message. + * @function verify + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WaitOperationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.timeout != null && message.hasOwnProperty("timeout")) { + var error = $root.google.protobuf.Duration.verify(message.timeout); + if (error) + return "timeout." + error; + } + return null; + }; + + /** + * Creates a WaitOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest + */ + WaitOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.WaitOperationRequest) + return object; + var message = new $root.google.longrunning.WaitOperationRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.timeout != null) { + if (typeof object.timeout !== "object") + throw TypeError(".google.longrunning.WaitOperationRequest.timeout: object expected"); + message.timeout = $root.google.protobuf.Duration.fromObject(object.timeout); + } + return message; + }; + + /** + * Creates a plain object from a WaitOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.WaitOperationRequest} message WaitOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WaitOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.timeout = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.timeout != null && message.hasOwnProperty("timeout")) + object.timeout = $root.google.protobuf.Duration.toObject(message.timeout, options); + return object; + }; + + /** + * Converts this WaitOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.WaitOperationRequest + * @instance + * @returns {Object.} JSON object + */ + WaitOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for WaitOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WaitOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.WaitOperationRequest"; + }; + + return WaitOperationRequest; + })(); + + longrunning.OperationInfo = (function() { + + /** + * Properties of an OperationInfo. + * @memberof google.longrunning + * @interface IOperationInfo + * @property {string|null} [responseType] OperationInfo responseType + * @property {string|null} [metadataType] OperationInfo metadataType + */ + + /** + * Constructs a new OperationInfo. + * @memberof google.longrunning + * @classdesc Represents an OperationInfo. + * @implements IOperationInfo + * @constructor + * @param {google.longrunning.IOperationInfo=} [properties] Properties to set + */ + function OperationInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OperationInfo responseType. + * @member {string} responseType + * @memberof google.longrunning.OperationInfo + * @instance + */ + OperationInfo.prototype.responseType = ""; + + /** + * OperationInfo metadataType. + * @member {string} metadataType + * @memberof google.longrunning.OperationInfo + * @instance + */ + OperationInfo.prototype.metadataType = ""; + + /** + * Creates a new OperationInfo instance using the specified properties. + * @function create + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.IOperationInfo=} [properties] Properties to set + * @returns {google.longrunning.OperationInfo} OperationInfo instance + */ + OperationInfo.create = function create(properties) { + return new OperationInfo(properties); + }; + + /** + * Encodes the specified OperationInfo message. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @function encode + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.IOperationInfo} message OperationInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.responseType != null && Object.hasOwnProperty.call(message, "responseType")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.responseType); + if (message.metadataType != null && Object.hasOwnProperty.call(message, "metadataType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.metadataType); + return writer; + }; + + /** + * Encodes the specified OperationInfo message, length delimited. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.IOperationInfo} message OperationInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OperationInfo message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.OperationInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.OperationInfo} OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.OperationInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.responseType = reader.string(); + break; + } + case 2: { + message.metadataType = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OperationInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.OperationInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.OperationInfo} OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OperationInfo message. + * @function verify + * @memberof google.longrunning.OperationInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OperationInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.responseType != null && message.hasOwnProperty("responseType")) + if (!$util.isString(message.responseType)) + return "responseType: string expected"; + if (message.metadataType != null && message.hasOwnProperty("metadataType")) + if (!$util.isString(message.metadataType)) + return "metadataType: string expected"; + return null; + }; + + /** + * Creates an OperationInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.OperationInfo + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.OperationInfo} OperationInfo + */ + OperationInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.OperationInfo) + return object; + var message = new $root.google.longrunning.OperationInfo(); + if (object.responseType != null) + message.responseType = String(object.responseType); + if (object.metadataType != null) + message.metadataType = String(object.metadataType); + return message; + }; + + /** + * Creates a plain object from an OperationInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.OperationInfo} message OperationInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OperationInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.responseType = ""; + object.metadataType = ""; + } + if (message.responseType != null && message.hasOwnProperty("responseType")) + object.responseType = message.responseType; + if (message.metadataType != null && message.hasOwnProperty("metadataType")) + object.metadataType = message.metadataType; + return object; + }; + + /** + * Converts this OperationInfo to JSON. + * @function toJSON + * @memberof google.longrunning.OperationInfo + * @instance + * @returns {Object.} JSON object + */ + OperationInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OperationInfo + * @function getTypeUrl + * @memberof google.longrunning.OperationInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OperationInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.OperationInfo"; + }; + + return OperationInfo; + })(); + + return longrunning; + })(); + + return google; + })(); + + return $root; +}); diff --git a/packages/google-cloud-clouddms/protos/protos.json b/packages/google-cloud-clouddms/protos/protos.json new file mode 100644 index 00000000000..f7c59de057c --- /dev/null +++ b/packages/google-cloud-clouddms/protos/protos.json @@ -0,0 +1,3075 @@ +{ + "nested": { + "google": { + "nested": { + "cloud": { + "nested": { + "clouddms": { + "nested": { + "v1": { + "options": { + "csharp_namespace": "Google.Cloud.CloudDms.V1", + "go_package": "google.golang.org/genproto/googleapis/cloud/clouddms/v1;clouddms", + "java_multiple_files": true, + "java_outer_classname": "ClouddmsResourcesProto", + "java_package": "com.google.cloud.clouddms.v1", + "php_namespace": "Google\\Cloud\\CloudDms\\V1", + "ruby_package": "Google::Cloud::CloudDMS::V1" + }, + "nested": { + "DataMigrationService": { + "options": { + "(google.api.default_host)": "datamigration.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "ListMigrationJobs": { + "requestType": "ListMigrationJobsRequest", + "responseType": "ListMigrationJobsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/migrationJobs", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}/migrationJobs" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetMigrationJob": { + "requestType": "GetMigrationJobRequest", + "responseType": "MigrationJob", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/migrationJobs/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/migrationJobs/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateMigrationJob": { + "requestType": "CreateMigrationJobRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/migrationJobs", + "(google.api.http).body": "migration_job", + "(google.api.method_signature)": "parent,migration_job,migration_job_id", + "(google.longrunning.operation_info).response_type": "MigrationJob", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*}/migrationJobs", + "body": "migration_job" + } + }, + { + "(google.api.method_signature)": "parent,migration_job,migration_job_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "MigrationJob", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "UpdateMigrationJob": { + "requestType": "UpdateMigrationJobRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v1/{migration_job.name=projects/*/locations/*/migrationJobs/*}", + "(google.api.http).body": "migration_job", + "(google.api.method_signature)": "migration_job,update_mask", + "(google.longrunning.operation_info).response_type": "MigrationJob", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{migration_job.name=projects/*/locations/*/migrationJobs/*}", + "body": "migration_job" + } + }, + { + "(google.api.method_signature)": "migration_job,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "MigrationJob", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "DeleteMigrationJob": { + "requestType": "DeleteMigrationJobRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/migrationJobs/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/migrationJobs/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "StartMigrationJob": { + "requestType": "StartMigrationJobRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{name=projects/*/locations/*/migrationJobs/*}:start", + "(google.api.http).body": "*", + "(google.longrunning.operation_info).response_type": "MigrationJob", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=projects/*/locations/*/migrationJobs/*}:start", + "body": "*" + } + }, + { + "(google.longrunning.operation_info)": { + "response_type": "MigrationJob", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "StopMigrationJob": { + "requestType": "StopMigrationJobRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{name=projects/*/locations/*/migrationJobs/*}:stop", + "(google.api.http).body": "*", + "(google.longrunning.operation_info).response_type": "MigrationJob", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=projects/*/locations/*/migrationJobs/*}:stop", + "body": "*" + } + }, + { + "(google.longrunning.operation_info)": { + "response_type": "MigrationJob", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "ResumeMigrationJob": { + "requestType": "ResumeMigrationJobRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{name=projects/*/locations/*/migrationJobs/*}:resume", + "(google.api.http).body": "*", + "(google.longrunning.operation_info).response_type": "MigrationJob", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=projects/*/locations/*/migrationJobs/*}:resume", + "body": "*" + } + }, + { + "(google.longrunning.operation_info)": { + "response_type": "MigrationJob", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "PromoteMigrationJob": { + "requestType": "PromoteMigrationJobRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{name=projects/*/locations/*/migrationJobs/*}:promote", + "(google.api.http).body": "*", + "(google.longrunning.operation_info).response_type": "MigrationJob", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=projects/*/locations/*/migrationJobs/*}:promote", + "body": "*" + } + }, + { + "(google.longrunning.operation_info)": { + "response_type": "MigrationJob", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "VerifyMigrationJob": { + "requestType": "VerifyMigrationJobRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{name=projects/*/locations/*/migrationJobs/*}:verify", + "(google.api.http).body": "*", + "(google.longrunning.operation_info).response_type": "MigrationJob", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=projects/*/locations/*/migrationJobs/*}:verify", + "body": "*" + } + }, + { + "(google.longrunning.operation_info)": { + "response_type": "MigrationJob", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "RestartMigrationJob": { + "requestType": "RestartMigrationJobRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{name=projects/*/locations/*/migrationJobs/*}:restart", + "(google.api.http).body": "*", + "(google.longrunning.operation_info).response_type": "MigrationJob", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=projects/*/locations/*/migrationJobs/*}:restart", + "body": "*" + } + }, + { + "(google.longrunning.operation_info)": { + "response_type": "MigrationJob", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "GenerateSshScript": { + "requestType": "GenerateSshScriptRequest", + "responseType": "SshScript", + "options": { + "(google.api.http).post": "/v1/{migration_job=projects/*/locations/*/migrationJobs/*}:generateSshScript", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{migration_job=projects/*/locations/*/migrationJobs/*}:generateSshScript", + "body": "*" + } + } + ] + }, + "ListConnectionProfiles": { + "requestType": "ListConnectionProfilesRequest", + "responseType": "ListConnectionProfilesResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/connectionProfiles", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}/connectionProfiles" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetConnectionProfile": { + "requestType": "GetConnectionProfileRequest", + "responseType": "ConnectionProfile", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/connectionProfiles/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/connectionProfiles/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateConnectionProfile": { + "requestType": "CreateConnectionProfileRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/connectionProfiles", + "(google.api.http).body": "connection_profile", + "(google.api.method_signature)": "parent,connection_profile,connection_profile_id", + "(google.longrunning.operation_info).response_type": "ConnectionProfile", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*}/connectionProfiles", + "body": "connection_profile" + } + }, + { + "(google.api.method_signature)": "parent,connection_profile,connection_profile_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "ConnectionProfile", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "UpdateConnectionProfile": { + "requestType": "UpdateConnectionProfileRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v1/{connection_profile.name=projects/*/locations/*/connectionProfiles/*}", + "(google.api.http).body": "connection_profile", + "(google.api.method_signature)": "connection_profile,update_mask", + "(google.longrunning.operation_info).response_type": "ConnectionProfile", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{connection_profile.name=projects/*/locations/*/connectionProfiles/*}", + "body": "connection_profile" + } + }, + { + "(google.api.method_signature)": "connection_profile,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "ConnectionProfile", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "DeleteConnectionProfile": { + "requestType": "DeleteConnectionProfileRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/connectionProfiles/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/connectionProfiles/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "OperationMetadata" + } + } + ] + } + } + }, + "ListMigrationJobsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "datamigration.googleapis.com/MigrationJob" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "filter": { + "type": "string", + "id": 4 + }, + "orderBy": { + "type": "string", + "id": 5 + } + } + }, + "ListMigrationJobsResponse": { + "fields": { + "migrationJobs": { + "rule": "repeated", + "type": "MigrationJob", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "GetMigrationJobRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "datamigration.googleapis.com/MigrationJob" + } + } + } + }, + "CreateMigrationJobRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "datamigration.googleapis.com/MigrationJob" + } + }, + "migrationJobId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "migrationJob": { + "type": "MigrationJob", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 4 + } + } + }, + "UpdateMigrationJobRequest": { + "fields": { + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "migrationJob": { + "type": "MigrationJob", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 3 + } + } + }, + "DeleteMigrationJobRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "datamigration.googleapis.com/MigrationJob" + } + }, + "requestId": { + "type": "string", + "id": 2 + }, + "force": { + "type": "bool", + "id": 3 + } + } + }, + "StartMigrationJobRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "datamigration.googleapis.com/MigrationJob" + } + } + } + }, + "StopMigrationJobRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "datamigration.googleapis.com/MigrationJob" + } + } + } + }, + "ResumeMigrationJobRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "datamigration.googleapis.com/MigrationJob" + } + } + } + }, + "PromoteMigrationJobRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "datamigration.googleapis.com/MigrationJob" + } + } + } + }, + "VerifyMigrationJobRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "datamigration.googleapis.com/MigrationJob" + } + } + } + }, + "RestartMigrationJobRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "datamigration.googleapis.com/MigrationJob" + } + } + } + }, + "GenerateSshScriptRequest": { + "oneofs": { + "vmConfig": { + "oneof": [ + "vmCreationConfig", + "vmSelectionConfig" + ] + } + }, + "fields": { + "migrationJob": { + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "datamigration.googleapis.com/MigrationJob" + } + }, + "vm": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "vmCreationConfig": { + "type": "VmCreationConfig", + "id": 100 + }, + "vmSelectionConfig": { + "type": "VmSelectionConfig", + "id": 101 + }, + "vmPort": { + "type": "int32", + "id": 3 + } + } + }, + "VmCreationConfig": { + "fields": { + "vmMachineType": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "vmZone": { + "type": "string", + "id": 2 + }, + "subnet": { + "type": "string", + "id": 3 + } + } + }, + "VmSelectionConfig": { + "fields": { + "vmZone": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "SshScript": { + "fields": { + "script": { + "type": "string", + "id": 1 + } + } + }, + "ListConnectionProfilesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "datamigration.googleapis.com/ConnectionProfile" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "filter": { + "type": "string", + "id": 4 + }, + "orderBy": { + "type": "string", + "id": 5 + } + } + }, + "ListConnectionProfilesResponse": { + "fields": { + "connectionProfiles": { + "rule": "repeated", + "type": "ConnectionProfile", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "GetConnectionProfileRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "datamigration.googleapis.com/ConnectionProfile" + } + } + } + }, + "CreateConnectionProfileRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "datamigration.googleapis.com/ConnectionProfile" + } + }, + "connectionProfileId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "connectionProfile": { + "type": "ConnectionProfile", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 4 + } + } + }, + "UpdateConnectionProfileRequest": { + "fields": { + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "connectionProfile": { + "type": "ConnectionProfile", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 3 + } + } + }, + "DeleteConnectionProfileRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "datamigration.googleapis.com/ConnectionProfile" + } + }, + "requestId": { + "type": "string", + "id": 2 + }, + "force": { + "type": "bool", + "id": 3 + } + } + }, + "OperationMetadata": { + "fields": { + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "target": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "verb": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "statusMessage": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "requestedCancellation": { + "type": "bool", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "apiVersion": { + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "SslConfig": { + "fields": { + "type": { + "type": "SslType", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "clientKey": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "INPUT_ONLY" + } + }, + "clientCertificate": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "INPUT_ONLY" + } + }, + "caCertificate": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + }, + "nested": { + "SslType": { + "values": { + "SSL_TYPE_UNSPECIFIED": 0, + "SERVER_ONLY": 1, + "SERVER_CLIENT": 2 + } + } + } + }, + "MySqlConnectionProfile": { + "fields": { + "host": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "port": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "username": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "password": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "passwordSet": { + "type": "bool", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "ssl": { + "type": "SslConfig", + "id": 6 + }, + "cloudSqlId": { + "type": "string", + "id": 7 + } + } + }, + "PostgreSqlConnectionProfile": { + "fields": { + "host": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "port": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "username": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "password": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "passwordSet": { + "type": "bool", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "ssl": { + "type": "SslConfig", + "id": 6 + }, + "cloudSqlId": { + "type": "string", + "id": 7 + } + } + }, + "CloudSqlConnectionProfile": { + "fields": { + "cloudSqlId": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "settings": { + "type": "CloudSqlSettings", + "id": 2, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "privateIp": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "publicIp": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "SqlAclEntry": { + "oneofs": { + "expiration": { + "oneof": [ + "expireTime", + "ttl" + ] + } + }, + "fields": { + "value": { + "type": "string", + "id": 1 + }, + "expireTime": { + "type": "google.protobuf.Timestamp", + "id": 10 + }, + "ttl": { + "type": "google.protobuf.Duration", + "id": 11, + "options": { + "(google.api.field_behavior)": "INPUT_ONLY" + } + }, + "label": { + "type": "string", + "id": 3 + } + } + }, + "SqlIpConfig": { + "fields": { + "enableIpv4": { + "type": "google.protobuf.BoolValue", + "id": 1 + }, + "privateNetwork": { + "type": "string", + "id": 2 + }, + "requireSsl": { + "type": "google.protobuf.BoolValue", + "id": 3 + }, + "authorizedNetworks": { + "rule": "repeated", + "type": "SqlAclEntry", + "id": 4 + } + } + }, + "CloudSqlSettings": { + "fields": { + "databaseVersion": { + "type": "SqlDatabaseVersion", + "id": 1 + }, + "userLabels": { + "keyType": "string", + "type": "string", + "id": 2 + }, + "tier": { + "type": "string", + "id": 3 + }, + "storageAutoResizeLimit": { + "type": "google.protobuf.Int64Value", + "id": 4 + }, + "activationPolicy": { + "type": "SqlActivationPolicy", + "id": 5 + }, + "ipConfig": { + "type": "SqlIpConfig", + "id": 6 + }, + "autoStorageIncrease": { + "type": "google.protobuf.BoolValue", + "id": 7 + }, + "databaseFlags": { + "keyType": "string", + "type": "string", + "id": 8 + }, + "dataDiskType": { + "type": "SqlDataDiskType", + "id": 9 + }, + "dataDiskSizeGb": { + "type": "google.protobuf.Int64Value", + "id": 10 + }, + "zone": { + "type": "string", + "id": 11 + }, + "sourceId": { + "type": "string", + "id": 12 + }, + "rootPassword": { + "type": "string", + "id": 13, + "options": { + "(google.api.field_behavior)": "INPUT_ONLY" + } + }, + "rootPasswordSet": { + "type": "bool", + "id": 14, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "collation": { + "type": "string", + "id": 15 + } + }, + "nested": { + "SqlActivationPolicy": { + "values": { + "SQL_ACTIVATION_POLICY_UNSPECIFIED": 0, + "ALWAYS": 1, + "NEVER": 2 + } + }, + "SqlDataDiskType": { + "values": { + "SQL_DATA_DISK_TYPE_UNSPECIFIED": 0, + "PD_SSD": 1, + "PD_HDD": 2 + } + }, + "SqlDatabaseVersion": { + "values": { + "SQL_DATABASE_VERSION_UNSPECIFIED": 0, + "MYSQL_5_6": 1, + "MYSQL_5_7": 2, + "POSTGRES_9_6": 3, + "POSTGRES_11": 4, + "POSTGRES_10": 5, + "MYSQL_8_0": 6, + "POSTGRES_12": 7, + "POSTGRES_13": 8 + } + } + } + }, + "StaticIpConnectivity": { + "fields": {} + }, + "ReverseSshConnectivity": { + "fields": { + "vmIp": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "vmPort": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "vm": { + "type": "string", + "id": 3 + }, + "vpc": { + "type": "string", + "id": 4 + } + } + }, + "VpcPeeringConnectivity": { + "fields": { + "vpc": { + "type": "string", + "id": 1 + } + } + }, + "DatabaseType": { + "fields": { + "provider": { + "type": "DatabaseProvider", + "id": 1 + }, + "engine": { + "type": "DatabaseEngine", + "id": 2 + } + } + }, + "MigrationJob": { + "options": { + "(google.api.resource).type": "datamigration.googleapis.com/MigrationJob", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/migrationJobs/{migration_job}" + }, + "oneofs": { + "connectivity": { + "oneof": [ + "reverseSshConnectivity", + "vpcPeeringConnectivity", + "staticIpConnectivity" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 4 + }, + "displayName": { + "type": "string", + "id": 5 + }, + "state": { + "type": "State", + "id": 6 + }, + "phase": { + "type": "Phase", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "type": { + "type": "Type", + "id": 8, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "dumpPath": { + "type": "string", + "id": 9 + }, + "source": { + "type": "string", + "id": 10, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "destination": { + "type": "string", + "id": 11, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "reverseSshConnectivity": { + "type": "ReverseSshConnectivity", + "id": 101 + }, + "vpcPeeringConnectivity": { + "type": "VpcPeeringConnectivity", + "id": 102 + }, + "staticIpConnectivity": { + "type": "StaticIpConnectivity", + "id": 103 + }, + "duration": { + "type": "google.protobuf.Duration", + "id": 12, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "error": { + "type": "google.rpc.Status", + "id": 13, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "sourceDatabase": { + "type": "DatabaseType", + "id": 14 + }, + "destinationDatabase": { + "type": "DatabaseType", + "id": 15 + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 16, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "MAINTENANCE": 1, + "DRAFT": 2, + "CREATING": 3, + "NOT_STARTED": 4, + "RUNNING": 5, + "FAILED": 6, + "COMPLETED": 7, + "DELETING": 8, + "STOPPING": 9, + "STOPPED": 10, + "DELETED": 11, + "UPDATING": 12, + "STARTING": 13, + "RESTARTING": 14, + "RESUMING": 15 + } + }, + "Phase": { + "values": { + "PHASE_UNSPECIFIED": 0, + "FULL_DUMP": 1, + "CDC": 2, + "PROMOTE_IN_PROGRESS": 3, + "WAITING_FOR_SOURCE_WRITES_TO_STOP": 4, + "PREPARING_THE_DUMP": 5 + } + }, + "Type": { + "values": { + "TYPE_UNSPECIFIED": 0, + "ONE_TIME": 1, + "CONTINUOUS": 2 + } + } + } + }, + "ConnectionProfile": { + "options": { + "(google.api.resource).type": "datamigration.googleapis.com/ConnectionProfile", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/connectionProfiles/{connection_profile}" + }, + "oneofs": { + "connectionProfile": { + "oneof": [ + "mysql", + "postgresql", + "cloudsql" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 4 + }, + "state": { + "type": "State", + "id": 5 + }, + "displayName": { + "type": "string", + "id": 6 + }, + "mysql": { + "type": "MySqlConnectionProfile", + "id": 100 + }, + "postgresql": { + "type": "PostgreSqlConnectionProfile", + "id": 101 + }, + "cloudsql": { + "type": "CloudSqlConnectionProfile", + "id": 102 + }, + "error": { + "type": "google.rpc.Status", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "provider": { + "type": "DatabaseProvider", + "id": 8 + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "DRAFT": 1, + "CREATING": 2, + "READY": 3, + "UPDATING": 4, + "DELETING": 5, + "DELETED": 6, + "FAILED": 7 + } + } + } + }, + "MigrationJobVerificationError": { + "fields": { + "errorCode": { + "type": "ErrorCode", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "errorMessage": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "errorDetailMessage": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "ErrorCode": { + "values": { + "ERROR_CODE_UNSPECIFIED": 0, + "CONNECTION_FAILURE": 1, + "AUTHENTICATION_FAILURE": 2, + "INVALID_CONNECTION_PROFILE_CONFIG": 3, + "VERSION_INCOMPATIBILITY": 4, + "CONNECTION_PROFILE_TYPES_INCOMPATIBILITY": 5, + "NO_PGLOGICAL_INSTALLED": 7, + "PGLOGICAL_NODE_ALREADY_EXISTS": 8, + "INVALID_WAL_LEVEL": 9, + "INVALID_SHARED_PRELOAD_LIBRARY": 10, + "INSUFFICIENT_MAX_REPLICATION_SLOTS": 11, + "INSUFFICIENT_MAX_WAL_SENDERS": 12, + "INSUFFICIENT_MAX_WORKER_PROCESSES": 13, + "UNSUPPORTED_EXTENSIONS": 14, + "UNSUPPORTED_MIGRATION_TYPE": 15, + "INVALID_RDS_LOGICAL_REPLICATION": 16, + "UNSUPPORTED_GTID_MODE": 17, + "UNSUPPORTED_TABLE_DEFINITION": 18, + "UNSUPPORTED_DEFINER": 19, + "CANT_RESTART_RUNNING_MIGRATION": 21 + } + } + } + }, + "DatabaseEngine": { + "values": { + "DATABASE_ENGINE_UNSPECIFIED": 0, + "MYSQL": 1, + "POSTGRESQL": 2 + } + }, + "DatabaseProvider": { + "values": { + "DATABASE_PROVIDER_UNSPECIFIED": 0, + "CLOUDSQL": 1, + "RDS": 2 + } + } + } + } + } + } + } + }, + "api": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/api/annotations;annotations", + "java_multiple_files": true, + "java_outer_classname": "ResourceProto", + "java_package": "com.google.api", + "objc_class_prefix": "GAPI", + "cc_enable_arenas": true + }, + "nested": { + "http": { + "type": "HttpRule", + "id": 72295728, + "extend": "google.protobuf.MethodOptions" + }, + "Http": { + "fields": { + "rules": { + "rule": "repeated", + "type": "HttpRule", + "id": 1 + }, + "fullyDecodeReservedExpansion": { + "type": "bool", + "id": 2 + } + } + }, + "HttpRule": { + "oneofs": { + "pattern": { + "oneof": [ + "get", + "put", + "post", + "delete", + "patch", + "custom" + ] + } + }, + "fields": { + "selector": { + "type": "string", + "id": 1 + }, + "get": { + "type": "string", + "id": 2 + }, + "put": { + "type": "string", + "id": 3 + }, + "post": { + "type": "string", + "id": 4 + }, + "delete": { + "type": "string", + "id": 5 + }, + "patch": { + "type": "string", + "id": 6 + }, + "custom": { + "type": "CustomHttpPattern", + "id": 8 + }, + "body": { + "type": "string", + "id": 7 + }, + "responseBody": { + "type": "string", + "id": 12 + }, + "additionalBindings": { + "rule": "repeated", + "type": "HttpRule", + "id": 11 + } + } + }, + "CustomHttpPattern": { + "fields": { + "kind": { + "type": "string", + "id": 1 + }, + "path": { + "type": "string", + "id": 2 + } + } + }, + "methodSignature": { + "rule": "repeated", + "type": "string", + "id": 1051, + "extend": "google.protobuf.MethodOptions" + }, + "defaultHost": { + "type": "string", + "id": 1049, + "extend": "google.protobuf.ServiceOptions" + }, + "oauthScopes": { + "type": "string", + "id": 1050, + "extend": "google.protobuf.ServiceOptions" + }, + "fieldBehavior": { + "rule": "repeated", + "type": "google.api.FieldBehavior", + "id": 1052, + "extend": "google.protobuf.FieldOptions" + }, + "FieldBehavior": { + "values": { + "FIELD_BEHAVIOR_UNSPECIFIED": 0, + "OPTIONAL": 1, + "REQUIRED": 2, + "OUTPUT_ONLY": 3, + "INPUT_ONLY": 4, + "IMMUTABLE": 5, + "UNORDERED_LIST": 6, + "NON_EMPTY_DEFAULT": 7 + } + }, + "resourceReference": { + "type": "google.api.ResourceReference", + "id": 1055, + "extend": "google.protobuf.FieldOptions" + }, + "resourceDefinition": { + "rule": "repeated", + "type": "google.api.ResourceDescriptor", + "id": 1053, + "extend": "google.protobuf.FileOptions" + }, + "resource": { + "type": "google.api.ResourceDescriptor", + "id": 1053, + "extend": "google.protobuf.MessageOptions" + }, + "ResourceDescriptor": { + "fields": { + "type": { + "type": "string", + "id": 1 + }, + "pattern": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "nameField": { + "type": "string", + "id": 3 + }, + "history": { + "type": "History", + "id": 4 + }, + "plural": { + "type": "string", + "id": 5 + }, + "singular": { + "type": "string", + "id": 6 + }, + "style": { + "rule": "repeated", + "type": "Style", + "id": 10 + } + }, + "nested": { + "History": { + "values": { + "HISTORY_UNSPECIFIED": 0, + "ORIGINALLY_SINGLE_PATTERN": 1, + "FUTURE_MULTI_PATTERN": 2 + } + }, + "Style": { + "values": { + "STYLE_UNSPECIFIED": 0, + "DECLARATIVE_FRIENDLY": 1 + } + } + } + }, + "ResourceReference": { + "fields": { + "type": { + "type": "string", + "id": 1 + }, + "childType": { + "type": "string", + "id": 2 + } + } + } + } + }, + "protobuf": { + "options": { + "go_package": "google.golang.org/protobuf/types/descriptorpb", + "java_package": "com.google.protobuf", + "java_outer_classname": "DescriptorProtos", + "csharp_namespace": "Google.Protobuf.Reflection", + "objc_class_prefix": "GPB", + "cc_enable_arenas": true, + "optimize_for": "SPEED" + }, + "nested": { + "FileDescriptorSet": { + "fields": { + "file": { + "rule": "repeated", + "type": "FileDescriptorProto", + "id": 1 + } + } + }, + "FileDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "package": { + "type": "string", + "id": 2 + }, + "dependency": { + "rule": "repeated", + "type": "string", + "id": 3 + }, + "publicDependency": { + "rule": "repeated", + "type": "int32", + "id": 10, + "options": { + "packed": false + } + }, + "weakDependency": { + "rule": "repeated", + "type": "int32", + "id": 11, + "options": { + "packed": false + } + }, + "messageType": { + "rule": "repeated", + "type": "DescriptorProto", + "id": 4 + }, + "enumType": { + "rule": "repeated", + "type": "EnumDescriptorProto", + "id": 5 + }, + "service": { + "rule": "repeated", + "type": "ServiceDescriptorProto", + "id": 6 + }, + "extension": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 7 + }, + "options": { + "type": "FileOptions", + "id": 8 + }, + "sourceCodeInfo": { + "type": "SourceCodeInfo", + "id": 9 + }, + "syntax": { + "type": "string", + "id": 12 + }, + "edition": { + "type": "string", + "id": 13 + } + } + }, + "DescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "field": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 2 + }, + "extension": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 6 + }, + "nestedType": { + "rule": "repeated", + "type": "DescriptorProto", + "id": 3 + }, + "enumType": { + "rule": "repeated", + "type": "EnumDescriptorProto", + "id": 4 + }, + "extensionRange": { + "rule": "repeated", + "type": "ExtensionRange", + "id": 5 + }, + "oneofDecl": { + "rule": "repeated", + "type": "OneofDescriptorProto", + "id": 8 + }, + "options": { + "type": "MessageOptions", + "id": 7 + }, + "reservedRange": { + "rule": "repeated", + "type": "ReservedRange", + "id": 9 + }, + "reservedName": { + "rule": "repeated", + "type": "string", + "id": 10 + } + }, + "nested": { + "ExtensionRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + }, + "options": { + "type": "ExtensionRangeOptions", + "id": 3 + } + } + }, + "ReservedRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + } + } + } + } + }, + "ExtensionRangeOptions": { + "fields": { + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "FieldDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "number": { + "type": "int32", + "id": 3 + }, + "label": { + "type": "Label", + "id": 4 + }, + "type": { + "type": "Type", + "id": 5 + }, + "typeName": { + "type": "string", + "id": 6 + }, + "extendee": { + "type": "string", + "id": 2 + }, + "defaultValue": { + "type": "string", + "id": 7 + }, + "oneofIndex": { + "type": "int32", + "id": 9 + }, + "jsonName": { + "type": "string", + "id": 10 + }, + "options": { + "type": "FieldOptions", + "id": 8 + }, + "proto3Optional": { + "type": "bool", + "id": 17 + } + }, + "nested": { + "Type": { + "values": { + "TYPE_DOUBLE": 1, + "TYPE_FLOAT": 2, + "TYPE_INT64": 3, + "TYPE_UINT64": 4, + "TYPE_INT32": 5, + "TYPE_FIXED64": 6, + "TYPE_FIXED32": 7, + "TYPE_BOOL": 8, + "TYPE_STRING": 9, + "TYPE_GROUP": 10, + "TYPE_MESSAGE": 11, + "TYPE_BYTES": 12, + "TYPE_UINT32": 13, + "TYPE_ENUM": 14, + "TYPE_SFIXED32": 15, + "TYPE_SFIXED64": 16, + "TYPE_SINT32": 17, + "TYPE_SINT64": 18 + } + }, + "Label": { + "values": { + "LABEL_OPTIONAL": 1, + "LABEL_REQUIRED": 2, + "LABEL_REPEATED": 3 + } + } + } + }, + "OneofDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "options": { + "type": "OneofOptions", + "id": 2 + } + } + }, + "EnumDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "value": { + "rule": "repeated", + "type": "EnumValueDescriptorProto", + "id": 2 + }, + "options": { + "type": "EnumOptions", + "id": 3 + }, + "reservedRange": { + "rule": "repeated", + "type": "EnumReservedRange", + "id": 4 + }, + "reservedName": { + "rule": "repeated", + "type": "string", + "id": 5 + } + }, + "nested": { + "EnumReservedRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + } + } + } + } + }, + "EnumValueDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "number": { + "type": "int32", + "id": 2 + }, + "options": { + "type": "EnumValueOptions", + "id": 3 + } + } + }, + "ServiceDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "method": { + "rule": "repeated", + "type": "MethodDescriptorProto", + "id": 2 + }, + "options": { + "type": "ServiceOptions", + "id": 3 + } + } + }, + "MethodDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "inputType": { + "type": "string", + "id": 2 + }, + "outputType": { + "type": "string", + "id": 3 + }, + "options": { + "type": "MethodOptions", + "id": 4 + }, + "clientStreaming": { + "type": "bool", + "id": 5, + "options": { + "default": false + } + }, + "serverStreaming": { + "type": "bool", + "id": 6, + "options": { + "default": false + } + } + } + }, + "FileOptions": { + "fields": { + "javaPackage": { + "type": "string", + "id": 1 + }, + "javaOuterClassname": { + "type": "string", + "id": 8 + }, + "javaMultipleFiles": { + "type": "bool", + "id": 10, + "options": { + "default": false + } + }, + "javaGenerateEqualsAndHash": { + "type": "bool", + "id": 20, + "options": { + "deprecated": true + } + }, + "javaStringCheckUtf8": { + "type": "bool", + "id": 27, + "options": { + "default": false + } + }, + "optimizeFor": { + "type": "OptimizeMode", + "id": 9, + "options": { + "default": "SPEED" + } + }, + "goPackage": { + "type": "string", + "id": 11 + }, + "ccGenericServices": { + "type": "bool", + "id": 16, + "options": { + "default": false + } + }, + "javaGenericServices": { + "type": "bool", + "id": 17, + "options": { + "default": false + } + }, + "pyGenericServices": { + "type": "bool", + "id": 18, + "options": { + "default": false + } + }, + "phpGenericServices": { + "type": "bool", + "id": 42, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 23, + "options": { + "default": false + } + }, + "ccEnableArenas": { + "type": "bool", + "id": 31, + "options": { + "default": true + } + }, + "objcClassPrefix": { + "type": "string", + "id": 36 + }, + "csharpNamespace": { + "type": "string", + "id": 37 + }, + "swiftPrefix": { + "type": "string", + "id": 39 + }, + "phpClassPrefix": { + "type": "string", + "id": 40 + }, + "phpNamespace": { + "type": "string", + "id": 41 + }, + "phpMetadataNamespace": { + "type": "string", + "id": 44 + }, + "rubyPackage": { + "type": "string", + "id": 45 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 38, + 38 + ] + ], + "nested": { + "OptimizeMode": { + "values": { + "SPEED": 1, + "CODE_SIZE": 2, + "LITE_RUNTIME": 3 + } + } + } + }, + "MessageOptions": { + "fields": { + "messageSetWireFormat": { + "type": "bool", + "id": 1, + "options": { + "default": false + } + }, + "noStandardDescriptorAccessor": { + "type": "bool", + "id": 2, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "mapEntry": { + "type": "bool", + "id": 7 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 4, + 4 + ], + [ + 5, + 5 + ], + [ + 6, + 6 + ], + [ + 8, + 8 + ], + [ + 9, + 9 + ] + ] + }, + "FieldOptions": { + "fields": { + "ctype": { + "type": "CType", + "id": 1, + "options": { + "default": "STRING" + } + }, + "packed": { + "type": "bool", + "id": 2 + }, + "jstype": { + "type": "JSType", + "id": 6, + "options": { + "default": "JS_NORMAL" + } + }, + "lazy": { + "type": "bool", + "id": 5, + "options": { + "default": false + } + }, + "unverifiedLazy": { + "type": "bool", + "id": 15, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "weak": { + "type": "bool", + "id": 10, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 4, + 4 + ] + ], + "nested": { + "CType": { + "values": { + "STRING": 0, + "CORD": 1, + "STRING_PIECE": 2 + } + }, + "JSType": { + "values": { + "JS_NORMAL": 0, + "JS_STRING": 1, + "JS_NUMBER": 2 + } + } + } + }, + "OneofOptions": { + "fields": { + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "EnumOptions": { + "fields": { + "allowAlias": { + "type": "bool", + "id": 2 + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 5, + 5 + ] + ] + }, + "EnumValueOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 1, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "ServiceOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 33, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "MethodOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 33, + "options": { + "default": false + } + }, + "idempotencyLevel": { + "type": "IdempotencyLevel", + "id": 34, + "options": { + "default": "IDEMPOTENCY_UNKNOWN" + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "nested": { + "IdempotencyLevel": { + "values": { + "IDEMPOTENCY_UNKNOWN": 0, + "NO_SIDE_EFFECTS": 1, + "IDEMPOTENT": 2 + } + } + } + }, + "UninterpretedOption": { + "fields": { + "name": { + "rule": "repeated", + "type": "NamePart", + "id": 2 + }, + "identifierValue": { + "type": "string", + "id": 3 + }, + "positiveIntValue": { + "type": "uint64", + "id": 4 + }, + "negativeIntValue": { + "type": "int64", + "id": 5 + }, + "doubleValue": { + "type": "double", + "id": 6 + }, + "stringValue": { + "type": "bytes", + "id": 7 + }, + "aggregateValue": { + "type": "string", + "id": 8 + } + }, + "nested": { + "NamePart": { + "fields": { + "namePart": { + "rule": "required", + "type": "string", + "id": 1 + }, + "isExtension": { + "rule": "required", + "type": "bool", + "id": 2 + } + } + } + } + }, + "SourceCodeInfo": { + "fields": { + "location": { + "rule": "repeated", + "type": "Location", + "id": 1 + } + }, + "nested": { + "Location": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1 + }, + "span": { + "rule": "repeated", + "type": "int32", + "id": 2 + }, + "leadingComments": { + "type": "string", + "id": 3 + }, + "trailingComments": { + "type": "string", + "id": 4 + }, + "leadingDetachedComments": { + "rule": "repeated", + "type": "string", + "id": 6 + } + } + } + } + }, + "GeneratedCodeInfo": { + "fields": { + "annotation": { + "rule": "repeated", + "type": "Annotation", + "id": 1 + } + }, + "nested": { + "Annotation": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1 + }, + "sourceFile": { + "type": "string", + "id": 2 + }, + "begin": { + "type": "int32", + "id": 3 + }, + "end": { + "type": "int32", + "id": 4 + }, + "semantic": { + "type": "Semantic", + "id": 5 + } + }, + "nested": { + "Semantic": { + "values": { + "NONE": 0, + "SET": 1, + "ALIAS": 2 + } + } + } + } + } + }, + "Duration": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + }, + "Timestamp": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + }, + "DoubleValue": { + "fields": { + "value": { + "type": "double", + "id": 1 + } + } + }, + "FloatValue": { + "fields": { + "value": { + "type": "float", + "id": 1 + } + } + }, + "Int64Value": { + "fields": { + "value": { + "type": "int64", + "id": 1 + } + } + }, + "UInt64Value": { + "fields": { + "value": { + "type": "uint64", + "id": 1 + } + } + }, + "Int32Value": { + "fields": { + "value": { + "type": "int32", + "id": 1 + } + } + }, + "UInt32Value": { + "fields": { + "value": { + "type": "uint32", + "id": 1 + } + } + }, + "BoolValue": { + "fields": { + "value": { + "type": "bool", + "id": 1 + } + } + }, + "StringValue": { + "fields": { + "value": { + "type": "string", + "id": 1 + } + } + }, + "BytesValue": { + "fields": { + "value": { + "type": "bytes", + "id": 1 + } + } + }, + "Any": { + "fields": { + "type_url": { + "type": "string", + "id": 1 + }, + "value": { + "type": "bytes", + "id": 2 + } + } + }, + "Empty": { + "fields": {} + }, + "FieldMask": { + "fields": { + "paths": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + } + } + }, + "rpc": { + "options": { + "cc_enable_arenas": true, + "go_package": "google.golang.org/genproto/googleapis/rpc/status;status", + "java_multiple_files": true, + "java_outer_classname": "StatusProto", + "java_package": "com.google.rpc", + "objc_class_prefix": "RPC" + }, + "nested": { + "Status": { + "fields": { + "code": { + "type": "int32", + "id": 1 + }, + "message": { + "type": "string", + "id": 2 + }, + "details": { + "rule": "repeated", + "type": "google.protobuf.Any", + "id": 3 + } + } + } + } + }, + "longrunning": { + "options": { + "cc_enable_arenas": true, + "csharp_namespace": "Google.LongRunning", + "go_package": "google.golang.org/genproto/googleapis/longrunning;longrunning", + "java_multiple_files": true, + "java_outer_classname": "OperationsProto", + "java_package": "com.google.longrunning", + "php_namespace": "Google\\LongRunning" + }, + "nested": { + "operationInfo": { + "type": "google.longrunning.OperationInfo", + "id": 1049, + "extend": "google.protobuf.MethodOptions" + }, + "Operations": { + "options": { + "(google.api.default_host)": "longrunning.googleapis.com" + }, + "methods": { + "ListOperations": { + "requestType": "ListOperationsRequest", + "responseType": "ListOperationsResponse", + "options": { + "(google.api.http).get": "/v1/{name=operations}", + "(google.api.method_signature)": "name,filter" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=operations}" + } + }, + { + "(google.api.method_signature)": "name,filter" + } + ] + }, + "GetOperation": { + "requestType": "GetOperationRequest", + "responseType": "Operation", + "options": { + "(google.api.http).get": "/v1/{name=operations/**}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=operations/**}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "DeleteOperation": { + "requestType": "DeleteOperationRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=operations/**}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=operations/**}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CancelOperation": { + "requestType": "CancelOperationRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).post": "/v1/{name=operations/**}:cancel", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=operations/**}:cancel", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "WaitOperation": { + "requestType": "WaitOperationRequest", + "responseType": "Operation" + } + } + }, + "Operation": { + "oneofs": { + "result": { + "oneof": [ + "error", + "response" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "metadata": { + "type": "google.protobuf.Any", + "id": 2 + }, + "done": { + "type": "bool", + "id": 3 + }, + "error": { + "type": "google.rpc.Status", + "id": 4 + }, + "response": { + "type": "google.protobuf.Any", + "id": 5 + } + } + }, + "GetOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "ListOperationsRequest": { + "fields": { + "name": { + "type": "string", + "id": 4 + }, + "filter": { + "type": "string", + "id": 1 + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListOperationsResponse": { + "fields": { + "operations": { + "rule": "repeated", + "type": "Operation", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "CancelOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "DeleteOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "WaitOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "timeout": { + "type": "google.protobuf.Duration", + "id": 2 + } + } + }, + "OperationInfo": { + "fields": { + "responseType": { + "type": "string", + "id": 1 + }, + "metadataType": { + "type": "string", + "id": 2 + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/packages/google-cloud-clouddms/samples/README.md b/packages/google-cloud-clouddms/samples/README.md new file mode 100644 index 00000000000..3b56625fba6 --- /dev/null +++ b/packages/google-cloud-clouddms/samples/README.md @@ -0,0 +1,374 @@ +[//]: # "This README.md file is auto-generated, all changes to this file will be lost." +[//]: # "To regenerate it, use `python -m synthtool`." +Google Cloud Platform logo + +# [Cloud Database Migration Service: Node.js Samples](https://github.com/googleapis/google-cloud-node) + +[![Open in Cloud Shell][shell_img]][shell_link] + + + +## Table of Contents + +* [Before you begin](#before-you-begin) +* [Samples](#samples) + * [Data_migration_service.create_connection_profile](#data_migration_service.create_connection_profile) + * [Data_migration_service.create_migration_job](#data_migration_service.create_migration_job) + * [Data_migration_service.delete_connection_profile](#data_migration_service.delete_connection_profile) + * [Data_migration_service.delete_migration_job](#data_migration_service.delete_migration_job) + * [Data_migration_service.generate_ssh_script](#data_migration_service.generate_ssh_script) + * [Data_migration_service.get_connection_profile](#data_migration_service.get_connection_profile) + * [Data_migration_service.get_migration_job](#data_migration_service.get_migration_job) + * [Data_migration_service.list_connection_profiles](#data_migration_service.list_connection_profiles) + * [Data_migration_service.list_migration_jobs](#data_migration_service.list_migration_jobs) + * [Data_migration_service.promote_migration_job](#data_migration_service.promote_migration_job) + * [Data_migration_service.restart_migration_job](#data_migration_service.restart_migration_job) + * [Data_migration_service.resume_migration_job](#data_migration_service.resume_migration_job) + * [Data_migration_service.start_migration_job](#data_migration_service.start_migration_job) + * [Data_migration_service.stop_migration_job](#data_migration_service.stop_migration_job) + * [Data_migration_service.update_connection_profile](#data_migration_service.update_connection_profile) + * [Data_migration_service.update_migration_job](#data_migration_service.update_migration_job) + * [Data_migration_service.verify_migration_job](#data_migration_service.verify_migration_job) + * [Quickstart](#quickstart) + * [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/google-cloud-node#using-the-client-library). + +`cd samples` + +`npm install` + +`cd ..` + +## Samples + + + +### Data_migration_service.create_connection_profile + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.create_connection_profile.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.create_connection_profile.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.create_connection_profile.js` + + +----- + + + + +### Data_migration_service.create_migration_job + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.create_migration_job.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.create_migration_job.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.create_migration_job.js` + + +----- + + + + +### Data_migration_service.delete_connection_profile + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.delete_connection_profile.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.delete_connection_profile.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.delete_connection_profile.js` + + +----- + + + + +### Data_migration_service.delete_migration_job + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.delete_migration_job.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.delete_migration_job.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.delete_migration_job.js` + + +----- + + + + +### Data_migration_service.generate_ssh_script + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.generate_ssh_script.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.generate_ssh_script.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.generate_ssh_script.js` + + +----- + + + + +### Data_migration_service.get_connection_profile + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.get_connection_profile.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.get_connection_profile.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.get_connection_profile.js` + + +----- + + + + +### Data_migration_service.get_migration_job + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.get_migration_job.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.get_migration_job.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.get_migration_job.js` + + +----- + + + + +### Data_migration_service.list_connection_profiles + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.list_connection_profiles.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.list_connection_profiles.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.list_connection_profiles.js` + + +----- + + + + +### Data_migration_service.list_migration_jobs + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.list_migration_jobs.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.list_migration_jobs.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.list_migration_jobs.js` + + +----- + + + + +### Data_migration_service.promote_migration_job + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.promote_migration_job.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.promote_migration_job.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.promote_migration_job.js` + + +----- + + + + +### Data_migration_service.restart_migration_job + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.restart_migration_job.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.restart_migration_job.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.restart_migration_job.js` + + +----- + + + + +### Data_migration_service.resume_migration_job + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.resume_migration_job.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.resume_migration_job.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.resume_migration_job.js` + + +----- + + + + +### Data_migration_service.start_migration_job + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.start_migration_job.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.start_migration_job.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.start_migration_job.js` + + +----- + + + + +### Data_migration_service.stop_migration_job + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.stop_migration_job.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.stop_migration_job.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.stop_migration_job.js` + + +----- + + + + +### Data_migration_service.update_connection_profile + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.update_connection_profile.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.update_connection_profile.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.update_connection_profile.js` + + +----- + + + + +### Data_migration_service.update_migration_job + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.update_migration_job.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.update_migration_job.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.update_migration_job.js` + + +----- + + + + +### Data_migration_service.verify_migration_job + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.verify_migration_job.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.verify_migration_job.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.verify_migration_job.js` + + +----- + + + + +### Quickstart + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-clouddms/samples/quickstart.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-clouddms/samples/quickstart.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-clouddms/samples/quickstart.js` + + +----- + + + + +### Quickstart + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-clouddms/samples/test/quickstart.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-clouddms/samples/test/quickstart.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-clouddms/samples/test/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/google-cloud-node&page=editor&open_in_editor=samples/README.md +[product-docs]: https://cloud.google.com/database-migration/ diff --git a/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.create_connection_profile.js b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.create_connection_profile.js new file mode 100644 index 00000000000..9e2cfd1e2e7 --- /dev/null +++ b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.create_connection_profile.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(parent, connectionProfileId, connectionProfile) { + // [START datamigration_v1_generated_DataMigrationService_CreateConnectionProfile_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent, which owns this collection of connection profiles. + */ + // const parent = 'abc123' + /** + * Required. The connection profile identifier. + */ + // const connectionProfileId = 'abc123' + /** + * Required. The create request body including the connection profile data + */ + // const connectionProfile = {} + /** + * A unique id used to identify the request. If the server receives two + * requests with the same id, then the second request will be ignored. + * It is recommended to always set this value to a UUID. + * The id must contain only letters (a-z, A-Z), numbers (0-9), underscores + * (_), and hyphens (-). The maximum length is 40 characters. + */ + // const requestId = 'abc123' + + // Imports the Clouddms library + const {DataMigrationServiceClient} = require('@google-cloud/dms').v1; + + // Instantiates a client + const clouddmsClient = new DataMigrationServiceClient(); + + async function callCreateConnectionProfile() { + // Construct request + const request = { + parent, + connectionProfileId, + connectionProfile, + }; + + // Run request + const [operation] = await clouddmsClient.createConnectionProfile(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateConnectionProfile(); + // [END datamigration_v1_generated_DataMigrationService_CreateConnectionProfile_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.create_migration_job.js b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.create_migration_job.js new file mode 100644 index 00000000000..b75b2bd7497 --- /dev/null +++ b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.create_migration_job.js @@ -0,0 +1,82 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, migrationJobId, migrationJob) { + // [START datamigration_v1_generated_DataMigrationService_CreateMigrationJob_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent, which owns this collection of migration jobs. + */ + // const parent = 'abc123' + /** + * Required. The ID of the instance to create. + */ + // const migrationJobId = 'abc123' + /** + * Required. Represents a migration + * job (https://cloud.google.com/database-migration/docs/reference/rest/v1/projects.locations.migrationJobs) + * object. + */ + // const migrationJob = {} + /** + * A unique id used to identify the request. If the server receives two + * requests with the same id, then the second request will be ignored. + * It is recommended to always set this value to a UUID. + * The id must contain only letters (a-z, A-Z), numbers (0-9), underscores + * (_), and hyphens (-). The maximum length is 40 characters. + */ + // const requestId = 'abc123' + + // Imports the Clouddms library + const {DataMigrationServiceClient} = require('@google-cloud/dms').v1; + + // Instantiates a client + const clouddmsClient = new DataMigrationServiceClient(); + + async function callCreateMigrationJob() { + // Construct request + const request = { + parent, + migrationJobId, + migrationJob, + }; + + // Run request + const [operation] = await clouddmsClient.createMigrationJob(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateMigrationJob(); + // [END datamigration_v1_generated_DataMigrationService_CreateMigrationJob_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.delete_connection_profile.js b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.delete_connection_profile.js new file mode 100644 index 00000000000..b71d7914a8c --- /dev/null +++ b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.delete_connection_profile.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(name) { + // [START datamigration_v1_generated_DataMigrationService_DeleteConnectionProfile_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the connection profile resource to delete. + */ + // const name = 'abc123' + /** + * A unique id used to identify the request. If the server receives two + * requests with the same id, then the second request will be ignored. + * It is recommended to always set this value to a UUID. + * The id must contain only letters (a-z, A-Z), numbers (0-9), underscores + * (_), and hyphens (-). The maximum length is 40 characters. + */ + // const requestId = 'abc123' + /** + * In case of force delete, the CloudSQL replica database is also deleted + * (only for CloudSQL connection profile). + */ + // const force = true + + // Imports the Clouddms library + const {DataMigrationServiceClient} = require('@google-cloud/dms').v1; + + // Instantiates a client + const clouddmsClient = new DataMigrationServiceClient(); + + async function callDeleteConnectionProfile() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await clouddmsClient.deleteConnectionProfile(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteConnectionProfile(); + // [END datamigration_v1_generated_DataMigrationService_DeleteConnectionProfile_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.delete_migration_job.js b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.delete_migration_job.js new file mode 100644 index 00000000000..0791cd8d507 --- /dev/null +++ b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.delete_migration_job.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(name) { + // [START datamigration_v1_generated_DataMigrationService_DeleteMigrationJob_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the migration job resource to delete. + */ + // const name = 'abc123' + /** + * A unique id used to identify the request. If the server receives two + * requests with the same id, then the second request will be ignored. + * It is recommended to always set this value to a UUID. + * The id must contain only letters (a-z, A-Z), numbers (0-9), underscores + * (_), and hyphens (-). The maximum length is 40 characters. + */ + // const requestId = 'abc123' + /** + * The destination CloudSQL connection profile is always deleted with the + * migration job. In case of force delete, the destination CloudSQL replica + * database is also deleted. + */ + // const force = true + + // Imports the Clouddms library + const {DataMigrationServiceClient} = require('@google-cloud/dms').v1; + + // Instantiates a client + const clouddmsClient = new DataMigrationServiceClient(); + + async function callDeleteMigrationJob() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await clouddmsClient.deleteMigrationJob(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteMigrationJob(); + // [END datamigration_v1_generated_DataMigrationService_DeleteMigrationJob_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.generate_ssh_script.js b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.generate_ssh_script.js new file mode 100644 index 00000000000..91924b63640 --- /dev/null +++ b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.generate_ssh_script.js @@ -0,0 +1,77 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(vm) { + // [START datamigration_v1_generated_DataMigrationService_GenerateSshScript_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. + */ + /** + * Name of the migration job resource to generate the SSH script. + */ + // const migrationJob = 'abc123' + /** + * Required. Bastion VM Instance name to use or to create. + */ + // const vm = 'abc123' + /** + * The VM creation configuration + */ + // const vmCreationConfig = {} + /** + * The VM selection configuration + */ + // const vmSelectionConfig = {} + /** + * The port that will be open on the bastion host + */ + // const vmPort = 1234 + + // Imports the Clouddms library + const {DataMigrationServiceClient} = require('@google-cloud/dms').v1; + + // Instantiates a client + const clouddmsClient = new DataMigrationServiceClient(); + + async function callGenerateSshScript() { + // Construct request + const request = { + vm, + }; + + // Run request + const response = await clouddmsClient.generateSshScript(request); + console.log(response); + } + + callGenerateSshScript(); + // [END datamigration_v1_generated_DataMigrationService_GenerateSshScript_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.get_connection_profile.js b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.get_connection_profile.js new file mode 100644 index 00000000000..cfaba64369f --- /dev/null +++ b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.get_connection_profile.js @@ -0,0 +1,61 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START datamigration_v1_generated_DataMigrationService_GetConnectionProfile_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the connection profile resource to get. + */ + // const name = 'abc123' + + // Imports the Clouddms library + const {DataMigrationServiceClient} = require('@google-cloud/dms').v1; + + // Instantiates a client + const clouddmsClient = new DataMigrationServiceClient(); + + async function callGetConnectionProfile() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await clouddmsClient.getConnectionProfile(request); + console.log(response); + } + + callGetConnectionProfile(); + // [END datamigration_v1_generated_DataMigrationService_GetConnectionProfile_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.get_migration_job.js b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.get_migration_job.js new file mode 100644 index 00000000000..35104781c8b --- /dev/null +++ b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.get_migration_job.js @@ -0,0 +1,61 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START datamigration_v1_generated_DataMigrationService_GetMigrationJob_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the migration job resource to get. + */ + // const name = 'abc123' + + // Imports the Clouddms library + const {DataMigrationServiceClient} = require('@google-cloud/dms').v1; + + // Instantiates a client + const clouddmsClient = new DataMigrationServiceClient(); + + async function callGetMigrationJob() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await clouddmsClient.getMigrationJob(request); + console.log(response); + } + + callGetMigrationJob(); + // [END datamigration_v1_generated_DataMigrationService_GetMigrationJob_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.list_connection_profiles.js b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.list_connection_profiles.js new file mode 100644 index 00000000000..f53c4047e64 --- /dev/null +++ b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.list_connection_profiles.js @@ -0,0 +1,93 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START datamigration_v1_generated_DataMigrationService_ListConnectionProfiles_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent, which owns this collection of connection profiles. + */ + // const parent = 'abc123' + /** + * The maximum number of connection profiles to return. The service may return + * fewer than this value. If unspecified, at most 50 connection profiles will + * be returned. The maximum value is 1000; values above 1000 will be coerced + * to 1000. + */ + // const pageSize = 1234 + /** + * A page token, received from a previous `ListConnectionProfiles` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListConnectionProfiles` + * must match the call that provided the page token. + */ + // const pageToken = 'abc123' + /** + * A filter expression that filters connection profiles listed in the + * response. The expression must specify the field name, a comparison + * operator, and the value that you want to use for filtering. The value must + * be a string, a number, or a boolean. The comparison operator must be either + * =, !=, >, or <. For example, list connection profiles created this year by + * specifying **createTime %gt; 2020-01-01T00:00:00.000000000Z**. You can + * also filter nested fields. For example, you could specify **mySql.username + * = %lt;my_username%gt;** to list all connection profiles configured to + * connect with a specific username. + */ + // const filter = 'abc123' + /** + * the order by fields for the result. + */ + // const orderBy = 'abc123' + + // Imports the Clouddms library + const {DataMigrationServiceClient} = require('@google-cloud/dms').v1; + + // Instantiates a client + const clouddmsClient = new DataMigrationServiceClient(); + + async function callListConnectionProfiles() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await clouddmsClient.listConnectionProfilesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListConnectionProfiles(); + // [END datamigration_v1_generated_DataMigrationService_ListConnectionProfiles_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.list_migration_jobs.js b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.list_migration_jobs.js new file mode 100644 index 00000000000..1640ac11627 --- /dev/null +++ b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.list_migration_jobs.js @@ -0,0 +1,95 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START datamigration_v1_generated_DataMigrationService_ListMigrationJobs_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent, which owns this collection of migrationJobs. + */ + // const parent = 'abc123' + /** + * The maximum number of migration jobs to return. The service may return + * fewer than this value. If unspecified, at most 50 migration jobs will be + * returned. The maximum value is 1000; values above 1000 will be coerced to + * 1000. + */ + // const pageSize = 1234 + /** + * The nextPageToken value received in the previous call to + * migrationJobs.list, used in the subsequent request to retrieve the next + * page of results. On first call this should be left blank. When paginating, + * all other parameters provided to migrationJobs.list must match the call + * that provided the page token. + */ + // const pageToken = 'abc123' + /** + * A filter expression that filters migration jobs listed in the response. + * The expression must specify the field name, a comparison operator, and the + * value that you want to use for filtering. The value must be a string, + * a number, or a boolean. The comparison operator must be + * either =, !=, >, or <. For example, list migration jobs created this year + * by specifying **createTime %gt; 2020-01-01T00:00:00.000000000Z.** + * You can also filter nested fields. For example, you could specify + * **reverseSshConnectivity.vmIp = "1.2.3.4"** to select all migration + * jobs connecting through the specific SSH tunnel bastion. + */ + // const filter = 'abc123' + /** + * Sort the results based on the migration job name. + * Valid values are: "name", "name asc", and "name desc". + */ + // const orderBy = 'abc123' + + // Imports the Clouddms library + const {DataMigrationServiceClient} = require('@google-cloud/dms').v1; + + // Instantiates a client + const clouddmsClient = new DataMigrationServiceClient(); + + async function callListMigrationJobs() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await clouddmsClient.listMigrationJobsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListMigrationJobs(); + // [END datamigration_v1_generated_DataMigrationService_ListMigrationJobs_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.promote_migration_job.js b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.promote_migration_job.js new file mode 100644 index 00000000000..397d3c546e8 --- /dev/null +++ b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.promote_migration_job.js @@ -0,0 +1,61 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main() { + // [START datamigration_v1_generated_DataMigrationService_PromoteMigrationJob_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. + */ + /** + * Name of the migration job resource to promote. + */ + // const name = 'abc123' + + // Imports the Clouddms library + const {DataMigrationServiceClient} = require('@google-cloud/dms').v1; + + // Instantiates a client + const clouddmsClient = new DataMigrationServiceClient(); + + async function callPromoteMigrationJob() { + // Construct request + const request = { + }; + + // Run request + const [operation] = await clouddmsClient.promoteMigrationJob(request); + const [response] = await operation.promise(); + console.log(response); + } + + callPromoteMigrationJob(); + // [END datamigration_v1_generated_DataMigrationService_PromoteMigrationJob_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.restart_migration_job.js b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.restart_migration_job.js new file mode 100644 index 00000000000..91fff0bc03d --- /dev/null +++ b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.restart_migration_job.js @@ -0,0 +1,61 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main() { + // [START datamigration_v1_generated_DataMigrationService_RestartMigrationJob_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. + */ + /** + * Name of the migration job resource to restart. + */ + // const name = 'abc123' + + // Imports the Clouddms library + const {DataMigrationServiceClient} = require('@google-cloud/dms').v1; + + // Instantiates a client + const clouddmsClient = new DataMigrationServiceClient(); + + async function callRestartMigrationJob() { + // Construct request + const request = { + }; + + // Run request + const [operation] = await clouddmsClient.restartMigrationJob(request); + const [response] = await operation.promise(); + console.log(response); + } + + callRestartMigrationJob(); + // [END datamigration_v1_generated_DataMigrationService_RestartMigrationJob_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.resume_migration_job.js b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.resume_migration_job.js new file mode 100644 index 00000000000..92f5f96bc52 --- /dev/null +++ b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.resume_migration_job.js @@ -0,0 +1,61 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main() { + // [START datamigration_v1_generated_DataMigrationService_ResumeMigrationJob_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. + */ + /** + * Name of the migration job resource to resume. + */ + // const name = 'abc123' + + // Imports the Clouddms library + const {DataMigrationServiceClient} = require('@google-cloud/dms').v1; + + // Instantiates a client + const clouddmsClient = new DataMigrationServiceClient(); + + async function callResumeMigrationJob() { + // Construct request + const request = { + }; + + // Run request + const [operation] = await clouddmsClient.resumeMigrationJob(request); + const [response] = await operation.promise(); + console.log(response); + } + + callResumeMigrationJob(); + // [END datamigration_v1_generated_DataMigrationService_ResumeMigrationJob_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.start_migration_job.js b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.start_migration_job.js new file mode 100644 index 00000000000..63e513bdd76 --- /dev/null +++ b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.start_migration_job.js @@ -0,0 +1,61 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main() { + // [START datamigration_v1_generated_DataMigrationService_StartMigrationJob_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. + */ + /** + * Name of the migration job resource to start. + */ + // const name = 'abc123' + + // Imports the Clouddms library + const {DataMigrationServiceClient} = require('@google-cloud/dms').v1; + + // Instantiates a client + const clouddmsClient = new DataMigrationServiceClient(); + + async function callStartMigrationJob() { + // Construct request + const request = { + }; + + // Run request + const [operation] = await clouddmsClient.startMigrationJob(request); + const [response] = await operation.promise(); + console.log(response); + } + + callStartMigrationJob(); + // [END datamigration_v1_generated_DataMigrationService_StartMigrationJob_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.stop_migration_job.js b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.stop_migration_job.js new file mode 100644 index 00000000000..2bcc8c1ff78 --- /dev/null +++ b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.stop_migration_job.js @@ -0,0 +1,61 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main() { + // [START datamigration_v1_generated_DataMigrationService_StopMigrationJob_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. + */ + /** + * Name of the migration job resource to stop. + */ + // const name = 'abc123' + + // Imports the Clouddms library + const {DataMigrationServiceClient} = require('@google-cloud/dms').v1; + + // Instantiates a client + const clouddmsClient = new DataMigrationServiceClient(); + + async function callStopMigrationJob() { + // Construct request + const request = { + }; + + // Run request + const [operation] = await clouddmsClient.stopMigrationJob(request); + const [response] = await operation.promise(); + console.log(response); + } + + callStopMigrationJob(); + // [END datamigration_v1_generated_DataMigrationService_StopMigrationJob_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.update_connection_profile.js b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.update_connection_profile.js new file mode 100644 index 00000000000..37cc1c38cf5 --- /dev/null +++ b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.update_connection_profile.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(updateMask, connectionProfile) { + // [START datamigration_v1_generated_DataMigrationService_UpdateConnectionProfile_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. Field mask is used to specify the fields to be overwritten in the + * connection profile resource by the update. + */ + // const updateMask = {} + /** + * Required. The connection profile parameters to update. + */ + // const connectionProfile = {} + /** + * A unique id used to identify the request. If the server receives two + * requests with the same id, then the second request will be ignored. + * It is recommended to always set this value to a UUID. + * The id must contain only letters (a-z, A-Z), numbers (0-9), underscores + * (_), and hyphens (-). The maximum length is 40 characters. + */ + // const requestId = 'abc123' + + // Imports the Clouddms library + const {DataMigrationServiceClient} = require('@google-cloud/dms').v1; + + // Instantiates a client + const clouddmsClient = new DataMigrationServiceClient(); + + async function callUpdateConnectionProfile() { + // Construct request + const request = { + updateMask, + connectionProfile, + }; + + // Run request + const [operation] = await clouddmsClient.updateConnectionProfile(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateConnectionProfile(); + // [END datamigration_v1_generated_DataMigrationService_UpdateConnectionProfile_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.update_migration_job.js b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.update_migration_job.js new file mode 100644 index 00000000000..a85b12e6a5d --- /dev/null +++ b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.update_migration_job.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(updateMask, migrationJob) { + // [START datamigration_v1_generated_DataMigrationService_UpdateMigrationJob_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. Field mask is used to specify the fields to be overwritten in the + * migration job resource by the update. + */ + // const updateMask = {} + /** + * Required. The migration job parameters to update. + */ + // const migrationJob = {} + /** + * A unique id used to identify the request. If the server receives two + * requests with the same id, then the second request will be ignored. + * It is recommended to always set this value to a UUID. + * The id must contain only letters (a-z, A-Z), numbers (0-9), underscores + * (_), and hyphens (-). The maximum length is 40 characters. + */ + // const requestId = 'abc123' + + // Imports the Clouddms library + const {DataMigrationServiceClient} = require('@google-cloud/dms').v1; + + // Instantiates a client + const clouddmsClient = new DataMigrationServiceClient(); + + async function callUpdateMigrationJob() { + // Construct request + const request = { + updateMask, + migrationJob, + }; + + // Run request + const [operation] = await clouddmsClient.updateMigrationJob(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateMigrationJob(); + // [END datamigration_v1_generated_DataMigrationService_UpdateMigrationJob_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.verify_migration_job.js b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.verify_migration_job.js new file mode 100644 index 00000000000..baa93dc4786 --- /dev/null +++ b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.verify_migration_job.js @@ -0,0 +1,61 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main() { + // [START datamigration_v1_generated_DataMigrationService_VerifyMigrationJob_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. + */ + /** + * Name of the migration job resource to verify. + */ + // const name = 'abc123' + + // Imports the Clouddms library + const {DataMigrationServiceClient} = require('@google-cloud/dms').v1; + + // Instantiates a client + const clouddmsClient = new DataMigrationServiceClient(); + + async function callVerifyMigrationJob() { + // Construct request + const request = { + }; + + // Run request + const [operation] = await clouddmsClient.verifyMigrationJob(request); + const [response] = await operation.promise(); + console.log(response); + } + + callVerifyMigrationJob(); + // [END datamigration_v1_generated_DataMigrationService_VerifyMigrationJob_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-clouddms/samples/generated/v1/snippet_metadata.google.cloud.clouddms.v1.json b/packages/google-cloud-clouddms/samples/generated/v1/snippet_metadata.google.cloud.clouddms.v1.json new file mode 100644 index 00000000000..b0caa5da4a3 --- /dev/null +++ b/packages/google-cloud-clouddms/samples/generated/v1/snippet_metadata.google.cloud.clouddms.v1.json @@ -0,0 +1,799 @@ +{ + "clientLibrary": { + "name": "nodejs-clouddms", + "version": "2.1.2", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.clouddms.v1", + "version": "v1" + } + ] + }, + "snippets": [ + { + "regionTag": "datamigration_v1_generated_DataMigrationService_ListMigrationJobs_async", + "title": "DataMigrationService listMigrationJobs Sample", + "origin": "API_DEFINITION", + "description": " Lists migration jobs in a given project and location.", + "canonical": true, + "file": "data_migration_service.list_migration_jobs.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 87, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListMigrationJobs", + "fullName": "google.cloud.clouddms.v1.DataMigrationService.ListMigrationJobs", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.clouddms.v1.ListMigrationJobsResponse", + "client": { + "shortName": "DataMigrationServiceClient", + "fullName": "google.cloud.clouddms.v1.DataMigrationServiceClient" + }, + "method": { + "shortName": "ListMigrationJobs", + "fullName": "google.cloud.clouddms.v1.DataMigrationService.ListMigrationJobs", + "service": { + "shortName": "DataMigrationService", + "fullName": "google.cloud.clouddms.v1.DataMigrationService" + } + } + } + }, + { + "regionTag": "datamigration_v1_generated_DataMigrationService_GetMigrationJob_async", + "title": "DataMigrationService getMigrationJob Sample", + "origin": "API_DEFINITION", + "description": " Gets details of a single migration job.", + "canonical": true, + "file": "data_migration_service.get_migration_job.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetMigrationJob", + "fullName": "google.cloud.clouddms.v1.DataMigrationService.GetMigrationJob", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.clouddms.v1.MigrationJob", + "client": { + "shortName": "DataMigrationServiceClient", + "fullName": "google.cloud.clouddms.v1.DataMigrationServiceClient" + }, + "method": { + "shortName": "GetMigrationJob", + "fullName": "google.cloud.clouddms.v1.DataMigrationService.GetMigrationJob", + "service": { + "shortName": "DataMigrationService", + "fullName": "google.cloud.clouddms.v1.DataMigrationService" + } + } + } + }, + { + "regionTag": "datamigration_v1_generated_DataMigrationService_CreateMigrationJob_async", + "title": "DataMigrationService createMigrationJob Sample", + "origin": "API_DEFINITION", + "description": " Creates a new migration job in a given project and location.", + "canonical": true, + "file": "data_migration_service.create_migration_job.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 74, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateMigrationJob", + "fullName": "google.cloud.clouddms.v1.DataMigrationService.CreateMigrationJob", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "migration_job_id", + "type": "TYPE_STRING" + }, + { + "name": "migration_job", + "type": ".google.cloud.clouddms.v1.MigrationJob" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "DataMigrationServiceClient", + "fullName": "google.cloud.clouddms.v1.DataMigrationServiceClient" + }, + "method": { + "shortName": "CreateMigrationJob", + "fullName": "google.cloud.clouddms.v1.DataMigrationService.CreateMigrationJob", + "service": { + "shortName": "DataMigrationService", + "fullName": "google.cloud.clouddms.v1.DataMigrationService" + } + } + } + }, + { + "regionTag": "datamigration_v1_generated_DataMigrationService_UpdateMigrationJob_async", + "title": "DataMigrationService updateMigrationJob Sample", + "origin": "API_DEFINITION", + "description": " Updates the parameters of a single migration job.", + "canonical": true, + "file": "data_migration_service.update_migration_job.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateMigrationJob", + "fullName": "google.cloud.clouddms.v1.DataMigrationService.UpdateMigrationJob", + "async": true, + "parameters": [ + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "migration_job", + "type": ".google.cloud.clouddms.v1.MigrationJob" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "DataMigrationServiceClient", + "fullName": "google.cloud.clouddms.v1.DataMigrationServiceClient" + }, + "method": { + "shortName": "UpdateMigrationJob", + "fullName": "google.cloud.clouddms.v1.DataMigrationService.UpdateMigrationJob", + "service": { + "shortName": "DataMigrationService", + "fullName": "google.cloud.clouddms.v1.DataMigrationService" + } + } + } + }, + { + "regionTag": "datamigration_v1_generated_DataMigrationService_DeleteMigrationJob_async", + "title": "DataMigrationService deleteMigrationJob Sample", + "origin": "API_DEFINITION", + "description": " Deletes a single migration job.", + "canonical": true, + "file": "data_migration_service.delete_migration_job.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteMigrationJob", + "fullName": "google.cloud.clouddms.v1.DataMigrationService.DeleteMigrationJob", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + }, + { + "name": "force", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "DataMigrationServiceClient", + "fullName": "google.cloud.clouddms.v1.DataMigrationServiceClient" + }, + "method": { + "shortName": "DeleteMigrationJob", + "fullName": "google.cloud.clouddms.v1.DataMigrationService.DeleteMigrationJob", + "service": { + "shortName": "DataMigrationService", + "fullName": "google.cloud.clouddms.v1.DataMigrationService" + } + } + } + }, + { + "regionTag": "datamigration_v1_generated_DataMigrationService_StartMigrationJob_async", + "title": "DataMigrationService startMigrationJob Sample", + "origin": "API_DEFINITION", + "description": " Start an already created migration job.", + "canonical": true, + "file": "data_migration_service.start_migration_job.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "StartMigrationJob", + "fullName": "google.cloud.clouddms.v1.DataMigrationService.StartMigrationJob", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "DataMigrationServiceClient", + "fullName": "google.cloud.clouddms.v1.DataMigrationServiceClient" + }, + "method": { + "shortName": "StartMigrationJob", + "fullName": "google.cloud.clouddms.v1.DataMigrationService.StartMigrationJob", + "service": { + "shortName": "DataMigrationService", + "fullName": "google.cloud.clouddms.v1.DataMigrationService" + } + } + } + }, + { + "regionTag": "datamigration_v1_generated_DataMigrationService_StopMigrationJob_async", + "title": "DataMigrationService stopMigrationJob Sample", + "origin": "API_DEFINITION", + "description": " Stops a running migration job.", + "canonical": true, + "file": "data_migration_service.stop_migration_job.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "StopMigrationJob", + "fullName": "google.cloud.clouddms.v1.DataMigrationService.StopMigrationJob", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "DataMigrationServiceClient", + "fullName": "google.cloud.clouddms.v1.DataMigrationServiceClient" + }, + "method": { + "shortName": "StopMigrationJob", + "fullName": "google.cloud.clouddms.v1.DataMigrationService.StopMigrationJob", + "service": { + "shortName": "DataMigrationService", + "fullName": "google.cloud.clouddms.v1.DataMigrationService" + } + } + } + }, + { + "regionTag": "datamigration_v1_generated_DataMigrationService_ResumeMigrationJob_async", + "title": "DataMigrationService resumeMigrationJob Sample", + "origin": "API_DEFINITION", + "description": " Resume a migration job that is currently stopped and is resumable (was stopped during CDC phase).", + "canonical": true, + "file": "data_migration_service.resume_migration_job.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ResumeMigrationJob", + "fullName": "google.cloud.clouddms.v1.DataMigrationService.ResumeMigrationJob", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "DataMigrationServiceClient", + "fullName": "google.cloud.clouddms.v1.DataMigrationServiceClient" + }, + "method": { + "shortName": "ResumeMigrationJob", + "fullName": "google.cloud.clouddms.v1.DataMigrationService.ResumeMigrationJob", + "service": { + "shortName": "DataMigrationService", + "fullName": "google.cloud.clouddms.v1.DataMigrationService" + } + } + } + }, + { + "regionTag": "datamigration_v1_generated_DataMigrationService_PromoteMigrationJob_async", + "title": "DataMigrationService promoteMigrationJob Sample", + "origin": "API_DEFINITION", + "description": " Promote a migration job, stopping replication to the destination and promoting the destination to be a standalone database.", + "canonical": true, + "file": "data_migration_service.promote_migration_job.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "PromoteMigrationJob", + "fullName": "google.cloud.clouddms.v1.DataMigrationService.PromoteMigrationJob", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "DataMigrationServiceClient", + "fullName": "google.cloud.clouddms.v1.DataMigrationServiceClient" + }, + "method": { + "shortName": "PromoteMigrationJob", + "fullName": "google.cloud.clouddms.v1.DataMigrationService.PromoteMigrationJob", + "service": { + "shortName": "DataMigrationService", + "fullName": "google.cloud.clouddms.v1.DataMigrationService" + } + } + } + }, + { + "regionTag": "datamigration_v1_generated_DataMigrationService_VerifyMigrationJob_async", + "title": "DataMigrationService verifyMigrationJob Sample", + "origin": "API_DEFINITION", + "description": " Verify a migration job, making sure the destination can reach the source and that all configuration and prerequisites are met.", + "canonical": true, + "file": "data_migration_service.verify_migration_job.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "VerifyMigrationJob", + "fullName": "google.cloud.clouddms.v1.DataMigrationService.VerifyMigrationJob", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "DataMigrationServiceClient", + "fullName": "google.cloud.clouddms.v1.DataMigrationServiceClient" + }, + "method": { + "shortName": "VerifyMigrationJob", + "fullName": "google.cloud.clouddms.v1.DataMigrationService.VerifyMigrationJob", + "service": { + "shortName": "DataMigrationService", + "fullName": "google.cloud.clouddms.v1.DataMigrationService" + } + } + } + }, + { + "regionTag": "datamigration_v1_generated_DataMigrationService_RestartMigrationJob_async", + "title": "DataMigrationService restartMigrationJob Sample", + "origin": "API_DEFINITION", + "description": " Restart a stopped or failed migration job, resetting the destination instance to its original state and starting the migration process from scratch.", + "canonical": true, + "file": "data_migration_service.restart_migration_job.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "RestartMigrationJob", + "fullName": "google.cloud.clouddms.v1.DataMigrationService.RestartMigrationJob", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "DataMigrationServiceClient", + "fullName": "google.cloud.clouddms.v1.DataMigrationServiceClient" + }, + "method": { + "shortName": "RestartMigrationJob", + "fullName": "google.cloud.clouddms.v1.DataMigrationService.RestartMigrationJob", + "service": { + "shortName": "DataMigrationService", + "fullName": "google.cloud.clouddms.v1.DataMigrationService" + } + } + } + }, + { + "regionTag": "datamigration_v1_generated_DataMigrationService_GenerateSshScript_async", + "title": "DataMigrationService generateSshScript Sample", + "origin": "API_DEFINITION", + "description": " Generate a SSH configuration script to configure the reverse SSH connectivity.", + "canonical": true, + "file": "data_migration_service.generate_ssh_script.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 69, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GenerateSshScript", + "fullName": "google.cloud.clouddms.v1.DataMigrationService.GenerateSshScript", + "async": true, + "parameters": [ + { + "name": "migration_job", + "type": "TYPE_STRING" + }, + { + "name": "vm", + "type": "TYPE_STRING" + }, + { + "name": "vm_creation_config", + "type": ".google.cloud.clouddms.v1.VmCreationConfig" + }, + { + "name": "vm_selection_config", + "type": ".google.cloud.clouddms.v1.VmSelectionConfig" + }, + { + "name": "vm_port", + "type": "TYPE_INT32" + } + ], + "resultType": ".google.cloud.clouddms.v1.SshScript", + "client": { + "shortName": "DataMigrationServiceClient", + "fullName": "google.cloud.clouddms.v1.DataMigrationServiceClient" + }, + "method": { + "shortName": "GenerateSshScript", + "fullName": "google.cloud.clouddms.v1.DataMigrationService.GenerateSshScript", + "service": { + "shortName": "DataMigrationService", + "fullName": "google.cloud.clouddms.v1.DataMigrationService" + } + } + } + }, + { + "regionTag": "datamigration_v1_generated_DataMigrationService_ListConnectionProfiles_async", + "title": "DataMigrationService listConnectionProfiles Sample", + "origin": "API_DEFINITION", + "description": " Retrieve a list of all connection profiles in a given project and location.", + "canonical": true, + "file": "data_migration_service.list_connection_profiles.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 85, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListConnectionProfiles", + "fullName": "google.cloud.clouddms.v1.DataMigrationService.ListConnectionProfiles", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.clouddms.v1.ListConnectionProfilesResponse", + "client": { + "shortName": "DataMigrationServiceClient", + "fullName": "google.cloud.clouddms.v1.DataMigrationServiceClient" + }, + "method": { + "shortName": "ListConnectionProfiles", + "fullName": "google.cloud.clouddms.v1.DataMigrationService.ListConnectionProfiles", + "service": { + "shortName": "DataMigrationService", + "fullName": "google.cloud.clouddms.v1.DataMigrationService" + } + } + } + }, + { + "regionTag": "datamigration_v1_generated_DataMigrationService_GetConnectionProfile_async", + "title": "DataMigrationService getConnectionProfile Sample", + "origin": "API_DEFINITION", + "description": " Gets details of a single connection profile.", + "canonical": true, + "file": "data_migration_service.get_connection_profile.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetConnectionProfile", + "fullName": "google.cloud.clouddms.v1.DataMigrationService.GetConnectionProfile", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.clouddms.v1.ConnectionProfile", + "client": { + "shortName": "DataMigrationServiceClient", + "fullName": "google.cloud.clouddms.v1.DataMigrationServiceClient" + }, + "method": { + "shortName": "GetConnectionProfile", + "fullName": "google.cloud.clouddms.v1.DataMigrationService.GetConnectionProfile", + "service": { + "shortName": "DataMigrationService", + "fullName": "google.cloud.clouddms.v1.DataMigrationService" + } + } + } + }, + { + "regionTag": "datamigration_v1_generated_DataMigrationService_CreateConnectionProfile_async", + "title": "DataMigrationService createConnectionProfile Sample", + "origin": "API_DEFINITION", + "description": " Creates a new connection profile in a given project and location.", + "canonical": true, + "file": "data_migration_service.create_connection_profile.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 72, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateConnectionProfile", + "fullName": "google.cloud.clouddms.v1.DataMigrationService.CreateConnectionProfile", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "connection_profile_id", + "type": "TYPE_STRING" + }, + { + "name": "connection_profile", + "type": ".google.cloud.clouddms.v1.ConnectionProfile" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "DataMigrationServiceClient", + "fullName": "google.cloud.clouddms.v1.DataMigrationServiceClient" + }, + "method": { + "shortName": "CreateConnectionProfile", + "fullName": "google.cloud.clouddms.v1.DataMigrationService.CreateConnectionProfile", + "service": { + "shortName": "DataMigrationService", + "fullName": "google.cloud.clouddms.v1.DataMigrationService" + } + } + } + }, + { + "regionTag": "datamigration_v1_generated_DataMigrationService_UpdateConnectionProfile_async", + "title": "DataMigrationService updateConnectionProfile Sample", + "origin": "API_DEFINITION", + "description": " Update the configuration of a single connection profile.", + "canonical": true, + "file": "data_migration_service.update_connection_profile.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateConnectionProfile", + "fullName": "google.cloud.clouddms.v1.DataMigrationService.UpdateConnectionProfile", + "async": true, + "parameters": [ + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "connection_profile", + "type": ".google.cloud.clouddms.v1.ConnectionProfile" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "DataMigrationServiceClient", + "fullName": "google.cloud.clouddms.v1.DataMigrationServiceClient" + }, + "method": { + "shortName": "UpdateConnectionProfile", + "fullName": "google.cloud.clouddms.v1.DataMigrationService.UpdateConnectionProfile", + "service": { + "shortName": "DataMigrationService", + "fullName": "google.cloud.clouddms.v1.DataMigrationService" + } + } + } + }, + { + "regionTag": "datamigration_v1_generated_DataMigrationService_DeleteConnectionProfile_async", + "title": "DataMigrationService deleteConnectionProfile Sample", + "origin": "API_DEFINITION", + "description": " Deletes a single Database Migration Service connection profile. A connection profile can only be deleted if it is not in use by any active migration jobs.", + "canonical": true, + "file": "data_migration_service.delete_connection_profile.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 67, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteConnectionProfile", + "fullName": "google.cloud.clouddms.v1.DataMigrationService.DeleteConnectionProfile", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + }, + { + "name": "force", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "DataMigrationServiceClient", + "fullName": "google.cloud.clouddms.v1.DataMigrationServiceClient" + }, + "method": { + "shortName": "DeleteConnectionProfile", + "fullName": "google.cloud.clouddms.v1.DataMigrationService.DeleteConnectionProfile", + "service": { + "shortName": "DataMigrationService", + "fullName": "google.cloud.clouddms.v1.DataMigrationService" + } + } + } + } + ] +} \ No newline at end of file diff --git a/packages/google-cloud-clouddms/samples/package.json b/packages/google-cloud-clouddms/samples/package.json new file mode 100644 index 00000000000..ee48cd806ab --- /dev/null +++ b/packages/google-cloud-clouddms/samples/package.json @@ -0,0 +1,23 @@ +{ + "name": "nodejs-dms", + "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/dms": "^2.1.2" + }, + "devDependencies": { + "c8": "^7.1.0", + "chai": "^4.2.0", + "mocha": "^8.0.0" + } +} \ No newline at end of file diff --git a/packages/google-cloud-clouddms/samples/quickstart.js b/packages/google-cloud-clouddms/samples/quickstart.js new file mode 100644 index 00000000000..588588731a5 --- /dev/null +++ b/packages/google-cloud-clouddms/samples/quickstart.js @@ -0,0 +1,44 @@ +// 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. +// +'use strict'; + +async function main(projectId = 'my-project', location = 'us-central1') { + // [START dms_quickstart] + // Imports the Google Cloud client library + const {DataMigrationServiceClient} = require('@google-cloud/dms'); + + // const parent = 'projects/my-project', // Project to list service usage for. + + // Creates a client + const client = new DataMigrationServiceClient(); + async function listMigrationJobs() { + for await (const migration of client.listMigrationJobsAsync({ + parent: `projects/${projectId}/locations/${location}`, + })) { + console.info(`${migration.name} ${migration.state}`); + } + } + listMigrationJobs(); + // [END dms_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-cloud-clouddms/samples/test/quickstart.js b/packages/google-cloud-clouddms/samples/test/quickstart.js new file mode 100644 index 00000000000..106279c8663 --- /dev/null +++ b/packages/google-cloud-clouddms/samples/test/quickstart.js @@ -0,0 +1,45 @@ +// +// 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 {DataMigrationServiceClient} = require('@google-cloud/dms'); +const {assert} = require('chai'); + +const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'}); + +const cwd = path.join(__dirname, '..'); + +const client = new DataMigrationServiceClient(); + +describe('Quickstart', () => { + let projectId; + before(async () => { + // eslint-disable-next-line no-unused-vars + projectId = await client.getProjectId(); + }); + + it('should run quickstart', async () => { + const stdout = execSync(`node ./quickstart.js ${projectId} us-central1`, { + cwd, + }); + assert.match(stdout, /DRAFT/); + }); +}); diff --git a/packages/google-cloud-clouddms/src/index.ts b/packages/google-cloud-clouddms/src/index.ts new file mode 100644 index 00000000000..5813535053d --- /dev/null +++ b/packages/google-cloud-clouddms/src/index.ts @@ -0,0 +1,27 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by synthtool. ** +// ** https://github.com/googleapis/synthtool ** +// ** All changes to this file may be overwritten. ** + +import * as v1 from './v1'; + +const DataMigrationServiceClient = v1.DataMigrationServiceClient; +type DataMigrationServiceClient = v1.DataMigrationServiceClient; + +export {v1, DataMigrationServiceClient}; +export default {v1, DataMigrationServiceClient}; +import * as protos from '../protos/protos'; +export {protos}; diff --git a/packages/google-cloud-clouddms/src/v1/data_migration_service_client.ts b/packages/google-cloud-clouddms/src/v1/data_migration_service_client.ts new file mode 100644 index 00000000000..0deb738c1ce --- /dev/null +++ b/packages/google-cloud-clouddms/src/v1/data_migration_service_client.ts @@ -0,0 +1,3304 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import type * as gax from 'google-gax'; +import type { + Callback, + CallOptions, + Descriptors, + ClientOptions, + GrpcClientOptions, + LROperation, + PaginationCallback, + GaxCall, +} from 'google-gax'; +import {Transform} from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1/data_migration_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './data_migration_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Database Migration service + * @class + * @memberof v1 + */ +export class DataMigrationServiceClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; + operationsClient: gax.OperationsClient; + dataMigrationServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of DataMigrationServiceClient. + * + * @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 DataMigrationServiceClient({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 DataMigrationServiceClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = + opts?.fallback ?? + (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === staticMembers.servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else if (opts.fallback === 'rest') { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + connectionProfilePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/connectionProfiles/{connection_profile}' + ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}' + ), + migrationJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/migrationJobs/{migration_job}' + ), + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}' + ), + }; + + // 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 = { + listMigrationJobs: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'migrationJobs' + ), + listConnectionProfiles: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'connectionProfiles' + ), + }; + + const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); + // This API contains "long-running operations", which return a + // an Operation object that allows for tracking of the operation, + // rather than holding a request open. + const lroOptions: GrpcClientOptions = { + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined, + }; + if (opts.fallback === 'rest') { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [ + { + selector: 'google.cloud.location.Locations.GetLocation', + get: '/v1/{name=projects/*/locations/*}', + }, + { + selector: 'google.cloud.location.Locations.ListLocations', + get: '/v1/{name=projects/*}/locations', + }, + { + selector: 'google.iam.v1.IAMPolicy.GetIamPolicy', + get: '/v1/{resource=projects/*/locations/*/connectionProfiles/*}:getIamPolicy', + additional_bindings: [ + { + get: '/v1/{resource=projects/*/locations/*/migrationJobs/*}:getIamPolicy', + }, + ], + }, + { + selector: 'google.iam.v1.IAMPolicy.SetIamPolicy', + post: '/v1/{resource=projects/*/locations/*/connectionProfiles/*}:setIamPolicy', + body: '*', + additional_bindings: [ + { + post: '/v1/{resource=projects/*/locations/*/migrationJobs/*}:setIamPolicy', + body: '*', + }, + ], + }, + { + selector: 'google.iam.v1.IAMPolicy.TestIamPermissions', + post: '/v1/{resource=projects/*/locations/*/migrationJobs/*}:testIamPermissions', + body: '*', + additional_bindings: [ + { + post: '/v1/{resource=projects/*/locations/*/connectionProfiles/*}:testIamPermissions', + body: '*', + }, + ], + }, + { + selector: 'google.longrunning.Operations.CancelOperation', + post: '/v1/{name=projects/*/locations/*/operations/*}:cancel', + body: '*', + }, + { + selector: 'google.longrunning.Operations.DeleteOperation', + delete: '/v1/{name=projects/*/locations/*/operations/*}', + }, + { + selector: 'google.longrunning.Operations.GetOperation', + get: '/v1/{name=projects/*/locations/*/operations/*}', + }, + { + selector: 'google.longrunning.Operations.ListOperations', + get: '/v1/{name=projects/*/locations/*}/operations', + }, + ]; + } + this.operationsClient = this._gaxModule + .lro(lroOptions) + .operationsClient(opts); + const createMigrationJobResponse = protoFilesRoot.lookup( + '.google.cloud.clouddms.v1.MigrationJob' + ) as gax.protobuf.Type; + const createMigrationJobMetadata = protoFilesRoot.lookup( + '.google.cloud.clouddms.v1.OperationMetadata' + ) as gax.protobuf.Type; + const updateMigrationJobResponse = protoFilesRoot.lookup( + '.google.cloud.clouddms.v1.MigrationJob' + ) as gax.protobuf.Type; + const updateMigrationJobMetadata = protoFilesRoot.lookup( + '.google.cloud.clouddms.v1.OperationMetadata' + ) as gax.protobuf.Type; + const deleteMigrationJobResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty' + ) as gax.protobuf.Type; + const deleteMigrationJobMetadata = protoFilesRoot.lookup( + '.google.cloud.clouddms.v1.OperationMetadata' + ) as gax.protobuf.Type; + const startMigrationJobResponse = protoFilesRoot.lookup( + '.google.cloud.clouddms.v1.MigrationJob' + ) as gax.protobuf.Type; + const startMigrationJobMetadata = protoFilesRoot.lookup( + '.google.cloud.clouddms.v1.OperationMetadata' + ) as gax.protobuf.Type; + const stopMigrationJobResponse = protoFilesRoot.lookup( + '.google.cloud.clouddms.v1.MigrationJob' + ) as gax.protobuf.Type; + const stopMigrationJobMetadata = protoFilesRoot.lookup( + '.google.cloud.clouddms.v1.OperationMetadata' + ) as gax.protobuf.Type; + const resumeMigrationJobResponse = protoFilesRoot.lookup( + '.google.cloud.clouddms.v1.MigrationJob' + ) as gax.protobuf.Type; + const resumeMigrationJobMetadata = protoFilesRoot.lookup( + '.google.cloud.clouddms.v1.OperationMetadata' + ) as gax.protobuf.Type; + const promoteMigrationJobResponse = protoFilesRoot.lookup( + '.google.cloud.clouddms.v1.MigrationJob' + ) as gax.protobuf.Type; + const promoteMigrationJobMetadata = protoFilesRoot.lookup( + '.google.cloud.clouddms.v1.OperationMetadata' + ) as gax.protobuf.Type; + const verifyMigrationJobResponse = protoFilesRoot.lookup( + '.google.cloud.clouddms.v1.MigrationJob' + ) as gax.protobuf.Type; + const verifyMigrationJobMetadata = protoFilesRoot.lookup( + '.google.cloud.clouddms.v1.OperationMetadata' + ) as gax.protobuf.Type; + const restartMigrationJobResponse = protoFilesRoot.lookup( + '.google.cloud.clouddms.v1.MigrationJob' + ) as gax.protobuf.Type; + const restartMigrationJobMetadata = protoFilesRoot.lookup( + '.google.cloud.clouddms.v1.OperationMetadata' + ) as gax.protobuf.Type; + const createConnectionProfileResponse = protoFilesRoot.lookup( + '.google.cloud.clouddms.v1.ConnectionProfile' + ) as gax.protobuf.Type; + const createConnectionProfileMetadata = protoFilesRoot.lookup( + '.google.cloud.clouddms.v1.OperationMetadata' + ) as gax.protobuf.Type; + const updateConnectionProfileResponse = protoFilesRoot.lookup( + '.google.cloud.clouddms.v1.ConnectionProfile' + ) as gax.protobuf.Type; + const updateConnectionProfileMetadata = protoFilesRoot.lookup( + '.google.cloud.clouddms.v1.OperationMetadata' + ) as gax.protobuf.Type; + const deleteConnectionProfileResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty' + ) as gax.protobuf.Type; + const deleteConnectionProfileMetadata = protoFilesRoot.lookup( + '.google.cloud.clouddms.v1.OperationMetadata' + ) as gax.protobuf.Type; + + this.descriptors.longrunning = { + createMigrationJob: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createMigrationJobResponse.decode.bind(createMigrationJobResponse), + createMigrationJobMetadata.decode.bind(createMigrationJobMetadata) + ), + updateMigrationJob: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateMigrationJobResponse.decode.bind(updateMigrationJobResponse), + updateMigrationJobMetadata.decode.bind(updateMigrationJobMetadata) + ), + deleteMigrationJob: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteMigrationJobResponse.decode.bind(deleteMigrationJobResponse), + deleteMigrationJobMetadata.decode.bind(deleteMigrationJobMetadata) + ), + startMigrationJob: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + startMigrationJobResponse.decode.bind(startMigrationJobResponse), + startMigrationJobMetadata.decode.bind(startMigrationJobMetadata) + ), + stopMigrationJob: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + stopMigrationJobResponse.decode.bind(stopMigrationJobResponse), + stopMigrationJobMetadata.decode.bind(stopMigrationJobMetadata) + ), + resumeMigrationJob: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + resumeMigrationJobResponse.decode.bind(resumeMigrationJobResponse), + resumeMigrationJobMetadata.decode.bind(resumeMigrationJobMetadata) + ), + promoteMigrationJob: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + promoteMigrationJobResponse.decode.bind(promoteMigrationJobResponse), + promoteMigrationJobMetadata.decode.bind(promoteMigrationJobMetadata) + ), + verifyMigrationJob: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + verifyMigrationJobResponse.decode.bind(verifyMigrationJobResponse), + verifyMigrationJobMetadata.decode.bind(verifyMigrationJobMetadata) + ), + restartMigrationJob: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + restartMigrationJobResponse.decode.bind(restartMigrationJobResponse), + restartMigrationJobMetadata.decode.bind(restartMigrationJobMetadata) + ), + createConnectionProfile: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createConnectionProfileResponse.decode.bind( + createConnectionProfileResponse + ), + createConnectionProfileMetadata.decode.bind( + createConnectionProfileMetadata + ) + ), + updateConnectionProfile: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateConnectionProfileResponse.decode.bind( + updateConnectionProfileResponse + ), + updateConnectionProfileMetadata.decode.bind( + updateConnectionProfileMetadata + ) + ), + deleteConnectionProfile: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteConnectionProfileResponse.decode.bind( + deleteConnectionProfileResponse + ), + deleteConnectionProfileMetadata.decode.bind( + deleteConnectionProfileMetadata + ) + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.clouddms.v1.DataMigrationService', + 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.dataMigrationServiceStub) { + return this.dataMigrationServiceStub; + } + + // Put together the "service stub" for + // google.cloud.clouddms.v1.DataMigrationService. + this.dataMigrationServiceStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.clouddms.v1.DataMigrationService' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.clouddms.v1.DataMigrationService, + 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 dataMigrationServiceStubMethods = [ + 'listMigrationJobs', + 'getMigrationJob', + 'createMigrationJob', + 'updateMigrationJob', + 'deleteMigrationJob', + 'startMigrationJob', + 'stopMigrationJob', + 'resumeMigrationJob', + 'promoteMigrationJob', + 'verifyMigrationJob', + 'restartMigrationJob', + 'generateSshScript', + 'listConnectionProfiles', + 'getConnectionProfile', + 'createConnectionProfile', + 'updateConnectionProfile', + 'deleteConnectionProfile', + ]; + for (const methodName of dataMigrationServiceStubMethods) { + const callPromise = this.dataMigrationServiceStub.then( + stub => + (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error | null | undefined) => () => { + throw err; + } + ); + + const descriptor = + this.descriptors.page[methodName] || + this.descriptors.longrunning[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.dataMigrationServiceStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'datamigration.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 'datamigration.googleapis.com'; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return ['https://www.googleapis.com/auth/cloud-platform']; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId( + callback?: Callback + ): Promise | void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- + /** + * Gets details of a single migration job. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the migration job resource to get. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [MigrationJob]{@link google.cloud.clouddms.v1.MigrationJob}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/data_migration_service.get_migration_job.js + * region_tag:datamigration_v1_generated_DataMigrationService_GetMigrationJob_async + */ + getMigrationJob( + request?: protos.google.cloud.clouddms.v1.IGetMigrationJobRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.clouddms.v1.IMigrationJob, + protos.google.cloud.clouddms.v1.IGetMigrationJobRequest | undefined, + {} | undefined + ] + >; + getMigrationJob( + request: protos.google.cloud.clouddms.v1.IGetMigrationJobRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.clouddms.v1.IMigrationJob, + | protos.google.cloud.clouddms.v1.IGetMigrationJobRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getMigrationJob( + request: protos.google.cloud.clouddms.v1.IGetMigrationJobRequest, + callback: Callback< + protos.google.cloud.clouddms.v1.IMigrationJob, + | protos.google.cloud.clouddms.v1.IGetMigrationJobRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getMigrationJob( + request?: protos.google.cloud.clouddms.v1.IGetMigrationJobRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.clouddms.v1.IMigrationJob, + | protos.google.cloud.clouddms.v1.IGetMigrationJobRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.clouddms.v1.IMigrationJob, + | protos.google.cloud.clouddms.v1.IGetMigrationJobRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.clouddms.v1.IMigrationJob, + protos.google.cloud.clouddms.v1.IGetMigrationJobRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.getMigrationJob(request, options, callback); + } + /** + * Generate a SSH configuration script to configure the reverse SSH + * connectivity. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.migrationJob + * Name of the migration job resource to generate the SSH script. + * @param {string} request.vm + * Required. Bastion VM Instance name to use or to create. + * @param {google.cloud.clouddms.v1.VmCreationConfig} request.vmCreationConfig + * The VM creation configuration + * @param {google.cloud.clouddms.v1.VmSelectionConfig} request.vmSelectionConfig + * The VM selection configuration + * @param {number} request.vmPort + * The port that will be open on the bastion host + * @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 [SshScript]{@link google.cloud.clouddms.v1.SshScript}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/data_migration_service.generate_ssh_script.js + * region_tag:datamigration_v1_generated_DataMigrationService_GenerateSshScript_async + */ + generateSshScript( + request?: protos.google.cloud.clouddms.v1.IGenerateSshScriptRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.clouddms.v1.ISshScript, + protos.google.cloud.clouddms.v1.IGenerateSshScriptRequest | undefined, + {} | undefined + ] + >; + generateSshScript( + request: protos.google.cloud.clouddms.v1.IGenerateSshScriptRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.clouddms.v1.ISshScript, + | protos.google.cloud.clouddms.v1.IGenerateSshScriptRequest + | null + | undefined, + {} | null | undefined + > + ): void; + generateSshScript( + request: protos.google.cloud.clouddms.v1.IGenerateSshScriptRequest, + callback: Callback< + protos.google.cloud.clouddms.v1.ISshScript, + | protos.google.cloud.clouddms.v1.IGenerateSshScriptRequest + | null + | undefined, + {} | null | undefined + > + ): void; + generateSshScript( + request?: protos.google.cloud.clouddms.v1.IGenerateSshScriptRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.clouddms.v1.ISshScript, + | protos.google.cloud.clouddms.v1.IGenerateSshScriptRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.clouddms.v1.ISshScript, + | protos.google.cloud.clouddms.v1.IGenerateSshScriptRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.clouddms.v1.ISshScript, + protos.google.cloud.clouddms.v1.IGenerateSshScriptRequest | 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({ + migration_job: request.migrationJob ?? '', + }); + this.initialize(); + return this.innerApiCalls.generateSshScript(request, options, callback); + } + /** + * Gets details of a single connection profile. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the connection profile resource to get. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [ConnectionProfile]{@link google.cloud.clouddms.v1.ConnectionProfile}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/data_migration_service.get_connection_profile.js + * region_tag:datamigration_v1_generated_DataMigrationService_GetConnectionProfile_async + */ + getConnectionProfile( + request?: protos.google.cloud.clouddms.v1.IGetConnectionProfileRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.clouddms.v1.IConnectionProfile, + protos.google.cloud.clouddms.v1.IGetConnectionProfileRequest | undefined, + {} | undefined + ] + >; + getConnectionProfile( + request: protos.google.cloud.clouddms.v1.IGetConnectionProfileRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.clouddms.v1.IConnectionProfile, + | protos.google.cloud.clouddms.v1.IGetConnectionProfileRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getConnectionProfile( + request: protos.google.cloud.clouddms.v1.IGetConnectionProfileRequest, + callback: Callback< + protos.google.cloud.clouddms.v1.IConnectionProfile, + | protos.google.cloud.clouddms.v1.IGetConnectionProfileRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getConnectionProfile( + request?: protos.google.cloud.clouddms.v1.IGetConnectionProfileRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.clouddms.v1.IConnectionProfile, + | protos.google.cloud.clouddms.v1.IGetConnectionProfileRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.clouddms.v1.IConnectionProfile, + | protos.google.cloud.clouddms.v1.IGetConnectionProfileRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.clouddms.v1.IConnectionProfile, + protos.google.cloud.clouddms.v1.IGetConnectionProfileRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.getConnectionProfile(request, options, callback); + } + + /** + * Creates a new migration job in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of migration jobs. + * @param {string} request.migrationJobId + * Required. The ID of the instance to create. + * @param {google.cloud.clouddms.v1.MigrationJob} request.migrationJob + * Required. Represents a [migration + * job](https://cloud.google.com/database-migration/docs/reference/rest/v1/projects.locations.migrationJobs) + * object. + * @param {string} request.requestId + * A unique id used to identify the request. If the server receives two + * requests with the same id, then the second request will be ignored. + * + * It is recommended to always set this value to a UUID. + * + * The id must contain only letters (a-z, A-Z), numbers (0-9), underscores + * (_), and hyphens (-). The maximum length is 40 characters. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/data_migration_service.create_migration_job.js + * region_tag:datamigration_v1_generated_DataMigrationService_CreateMigrationJob_async + */ + createMigrationJob( + request?: protos.google.cloud.clouddms.v1.ICreateMigrationJobRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.clouddms.v1.IMigrationJob, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + createMigrationJob( + request: protos.google.cloud.clouddms.v1.ICreateMigrationJobRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.clouddms.v1.IMigrationJob, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createMigrationJob( + request: protos.google.cloud.clouddms.v1.ICreateMigrationJobRequest, + callback: Callback< + LROperation< + protos.google.cloud.clouddms.v1.IMigrationJob, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createMigrationJob( + request?: protos.google.cloud.clouddms.v1.ICreateMigrationJobRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.clouddms.v1.IMigrationJob, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.clouddms.v1.IMigrationJob, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.clouddms.v1.IMigrationJob, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.createMigrationJob(request, options, callback); + } + /** + * Check the status of the long running operation returned by `createMigrationJob()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/data_migration_service.create_migration_job.js + * region_tag:datamigration_v1_generated_DataMigrationService_CreateMigrationJob_async + */ + async checkCreateMigrationJobProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.clouddms.v1.MigrationJob, + protos.google.cloud.clouddms.v1.OperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.createMigrationJob, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.clouddms.v1.MigrationJob, + protos.google.cloud.clouddms.v1.OperationMetadata + >; + } + /** + * Updates the parameters of a single migration job. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. Field mask is used to specify the fields to be overwritten in the + * migration job resource by the update. + * @param {google.cloud.clouddms.v1.MigrationJob} request.migrationJob + * Required. The migration job parameters to update. + * @param {string} request.requestId + * A unique id used to identify the request. If the server receives two + * requests with the same id, then the second request will be ignored. + * + * It is recommended to always set this value to a UUID. + * + * The id must contain only letters (a-z, A-Z), numbers (0-9), underscores + * (_), and hyphens (-). The maximum length is 40 characters. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/data_migration_service.update_migration_job.js + * region_tag:datamigration_v1_generated_DataMigrationService_UpdateMigrationJob_async + */ + updateMigrationJob( + request?: protos.google.cloud.clouddms.v1.IUpdateMigrationJobRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.clouddms.v1.IMigrationJob, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + updateMigrationJob( + request: protos.google.cloud.clouddms.v1.IUpdateMigrationJobRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.clouddms.v1.IMigrationJob, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateMigrationJob( + request: protos.google.cloud.clouddms.v1.IUpdateMigrationJobRequest, + callback: Callback< + LROperation< + protos.google.cloud.clouddms.v1.IMigrationJob, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateMigrationJob( + request?: protos.google.cloud.clouddms.v1.IUpdateMigrationJobRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.clouddms.v1.IMigrationJob, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.clouddms.v1.IMigrationJob, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.clouddms.v1.IMigrationJob, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + 'migration_job.name': request.migrationJob!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateMigrationJob(request, options, callback); + } + /** + * Check the status of the long running operation returned by `updateMigrationJob()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/data_migration_service.update_migration_job.js + * region_tag:datamigration_v1_generated_DataMigrationService_UpdateMigrationJob_async + */ + async checkUpdateMigrationJobProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.clouddms.v1.MigrationJob, + protos.google.cloud.clouddms.v1.OperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.updateMigrationJob, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.clouddms.v1.MigrationJob, + protos.google.cloud.clouddms.v1.OperationMetadata + >; + } + /** + * Deletes a single migration job. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the migration job resource to delete. + * @param {string} request.requestId + * A unique id used to identify the request. If the server receives two + * requests with the same id, then the second request will be ignored. + * + * It is recommended to always set this value to a UUID. + * + * The id must contain only letters (a-z, A-Z), numbers (0-9), underscores + * (_), and hyphens (-). The maximum length is 40 characters. + * @param {boolean} request.force + * The destination CloudSQL connection profile is always deleted with the + * migration job. In case of force delete, the destination CloudSQL replica + * database is also deleted. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/data_migration_service.delete_migration_job.js + * region_tag:datamigration_v1_generated_DataMigrationService_DeleteMigrationJob_async + */ + deleteMigrationJob( + request?: protos.google.cloud.clouddms.v1.IDeleteMigrationJobRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + deleteMigrationJob( + request: protos.google.cloud.clouddms.v1.IDeleteMigrationJobRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteMigrationJob( + request: protos.google.cloud.clouddms.v1.IDeleteMigrationJobRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteMigrationJob( + request?: protos.google.cloud.clouddms.v1.IDeleteMigrationJobRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.deleteMigrationJob(request, options, callback); + } + /** + * Check the status of the long running operation returned by `deleteMigrationJob()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/data_migration_service.delete_migration_job.js + * region_tag:datamigration_v1_generated_DataMigrationService_DeleteMigrationJob_async + */ + async checkDeleteMigrationJobProgress( + name: string + ): Promise< + LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.clouddms.v1.OperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.deleteMigrationJob, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.clouddms.v1.OperationMetadata + >; + } + /** + * Start an already created migration job. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Name of the migration job resource to start. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/data_migration_service.start_migration_job.js + * region_tag:datamigration_v1_generated_DataMigrationService_StartMigrationJob_async + */ + startMigrationJob( + request?: protos.google.cloud.clouddms.v1.IStartMigrationJobRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.clouddms.v1.IMigrationJob, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + startMigrationJob( + request: protos.google.cloud.clouddms.v1.IStartMigrationJobRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.clouddms.v1.IMigrationJob, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + startMigrationJob( + request: protos.google.cloud.clouddms.v1.IStartMigrationJobRequest, + callback: Callback< + LROperation< + protos.google.cloud.clouddms.v1.IMigrationJob, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + startMigrationJob( + request?: protos.google.cloud.clouddms.v1.IStartMigrationJobRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.clouddms.v1.IMigrationJob, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.clouddms.v1.IMigrationJob, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.clouddms.v1.IMigrationJob, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.startMigrationJob(request, options, callback); + } + /** + * Check the status of the long running operation returned by `startMigrationJob()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/data_migration_service.start_migration_job.js + * region_tag:datamigration_v1_generated_DataMigrationService_StartMigrationJob_async + */ + async checkStartMigrationJobProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.clouddms.v1.MigrationJob, + protos.google.cloud.clouddms.v1.OperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.startMigrationJob, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.clouddms.v1.MigrationJob, + protos.google.cloud.clouddms.v1.OperationMetadata + >; + } + /** + * Stops a running migration job. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Name of the migration job resource to stop. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/data_migration_service.stop_migration_job.js + * region_tag:datamigration_v1_generated_DataMigrationService_StopMigrationJob_async + */ + stopMigrationJob( + request?: protos.google.cloud.clouddms.v1.IStopMigrationJobRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.clouddms.v1.IMigrationJob, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + stopMigrationJob( + request: protos.google.cloud.clouddms.v1.IStopMigrationJobRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.clouddms.v1.IMigrationJob, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + stopMigrationJob( + request: protos.google.cloud.clouddms.v1.IStopMigrationJobRequest, + callback: Callback< + LROperation< + protos.google.cloud.clouddms.v1.IMigrationJob, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + stopMigrationJob( + request?: protos.google.cloud.clouddms.v1.IStopMigrationJobRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.clouddms.v1.IMigrationJob, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.clouddms.v1.IMigrationJob, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.clouddms.v1.IMigrationJob, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.stopMigrationJob(request, options, callback); + } + /** + * Check the status of the long running operation returned by `stopMigrationJob()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/data_migration_service.stop_migration_job.js + * region_tag:datamigration_v1_generated_DataMigrationService_StopMigrationJob_async + */ + async checkStopMigrationJobProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.clouddms.v1.MigrationJob, + protos.google.cloud.clouddms.v1.OperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.stopMigrationJob, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.clouddms.v1.MigrationJob, + protos.google.cloud.clouddms.v1.OperationMetadata + >; + } + /** + * Resume a migration job that is currently stopped and is resumable (was + * stopped during CDC phase). + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Name of the migration job resource to resume. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/data_migration_service.resume_migration_job.js + * region_tag:datamigration_v1_generated_DataMigrationService_ResumeMigrationJob_async + */ + resumeMigrationJob( + request?: protos.google.cloud.clouddms.v1.IResumeMigrationJobRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.clouddms.v1.IMigrationJob, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + resumeMigrationJob( + request: protos.google.cloud.clouddms.v1.IResumeMigrationJobRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.clouddms.v1.IMigrationJob, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + resumeMigrationJob( + request: protos.google.cloud.clouddms.v1.IResumeMigrationJobRequest, + callback: Callback< + LROperation< + protos.google.cloud.clouddms.v1.IMigrationJob, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + resumeMigrationJob( + request?: protos.google.cloud.clouddms.v1.IResumeMigrationJobRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.clouddms.v1.IMigrationJob, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.clouddms.v1.IMigrationJob, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.clouddms.v1.IMigrationJob, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.resumeMigrationJob(request, options, callback); + } + /** + * Check the status of the long running operation returned by `resumeMigrationJob()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/data_migration_service.resume_migration_job.js + * region_tag:datamigration_v1_generated_DataMigrationService_ResumeMigrationJob_async + */ + async checkResumeMigrationJobProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.clouddms.v1.MigrationJob, + protos.google.cloud.clouddms.v1.OperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.resumeMigrationJob, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.clouddms.v1.MigrationJob, + protos.google.cloud.clouddms.v1.OperationMetadata + >; + } + /** + * Promote a migration job, stopping replication to the destination and + * promoting the destination to be a standalone database. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Name of the migration job resource to promote. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/data_migration_service.promote_migration_job.js + * region_tag:datamigration_v1_generated_DataMigrationService_PromoteMigrationJob_async + */ + promoteMigrationJob( + request?: protos.google.cloud.clouddms.v1.IPromoteMigrationJobRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.clouddms.v1.IMigrationJob, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + promoteMigrationJob( + request: protos.google.cloud.clouddms.v1.IPromoteMigrationJobRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.clouddms.v1.IMigrationJob, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + promoteMigrationJob( + request: protos.google.cloud.clouddms.v1.IPromoteMigrationJobRequest, + callback: Callback< + LROperation< + protos.google.cloud.clouddms.v1.IMigrationJob, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + promoteMigrationJob( + request?: protos.google.cloud.clouddms.v1.IPromoteMigrationJobRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.clouddms.v1.IMigrationJob, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.clouddms.v1.IMigrationJob, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.clouddms.v1.IMigrationJob, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.promoteMigrationJob(request, options, callback); + } + /** + * Check the status of the long running operation returned by `promoteMigrationJob()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/data_migration_service.promote_migration_job.js + * region_tag:datamigration_v1_generated_DataMigrationService_PromoteMigrationJob_async + */ + async checkPromoteMigrationJobProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.clouddms.v1.MigrationJob, + protos.google.cloud.clouddms.v1.OperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.promoteMigrationJob, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.clouddms.v1.MigrationJob, + protos.google.cloud.clouddms.v1.OperationMetadata + >; + } + /** + * Verify a migration job, making sure the destination can reach the source + * and that all configuration and prerequisites are met. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Name of the migration job resource to verify. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/data_migration_service.verify_migration_job.js + * region_tag:datamigration_v1_generated_DataMigrationService_VerifyMigrationJob_async + */ + verifyMigrationJob( + request?: protos.google.cloud.clouddms.v1.IVerifyMigrationJobRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.clouddms.v1.IMigrationJob, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + verifyMigrationJob( + request: protos.google.cloud.clouddms.v1.IVerifyMigrationJobRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.clouddms.v1.IMigrationJob, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + verifyMigrationJob( + request: protos.google.cloud.clouddms.v1.IVerifyMigrationJobRequest, + callback: Callback< + LROperation< + protos.google.cloud.clouddms.v1.IMigrationJob, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + verifyMigrationJob( + request?: protos.google.cloud.clouddms.v1.IVerifyMigrationJobRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.clouddms.v1.IMigrationJob, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.clouddms.v1.IMigrationJob, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.clouddms.v1.IMigrationJob, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.verifyMigrationJob(request, options, callback); + } + /** + * Check the status of the long running operation returned by `verifyMigrationJob()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/data_migration_service.verify_migration_job.js + * region_tag:datamigration_v1_generated_DataMigrationService_VerifyMigrationJob_async + */ + async checkVerifyMigrationJobProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.clouddms.v1.MigrationJob, + protos.google.cloud.clouddms.v1.OperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.verifyMigrationJob, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.clouddms.v1.MigrationJob, + protos.google.cloud.clouddms.v1.OperationMetadata + >; + } + /** + * Restart a stopped or failed migration job, resetting the destination + * instance to its original state and starting the migration process from + * scratch. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Name of the migration job resource to restart. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/data_migration_service.restart_migration_job.js + * region_tag:datamigration_v1_generated_DataMigrationService_RestartMigrationJob_async + */ + restartMigrationJob( + request?: protos.google.cloud.clouddms.v1.IRestartMigrationJobRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.clouddms.v1.IMigrationJob, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + restartMigrationJob( + request: protos.google.cloud.clouddms.v1.IRestartMigrationJobRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.clouddms.v1.IMigrationJob, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + restartMigrationJob( + request: protos.google.cloud.clouddms.v1.IRestartMigrationJobRequest, + callback: Callback< + LROperation< + protos.google.cloud.clouddms.v1.IMigrationJob, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + restartMigrationJob( + request?: protos.google.cloud.clouddms.v1.IRestartMigrationJobRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.clouddms.v1.IMigrationJob, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.clouddms.v1.IMigrationJob, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.clouddms.v1.IMigrationJob, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.restartMigrationJob(request, options, callback); + } + /** + * Check the status of the long running operation returned by `restartMigrationJob()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/data_migration_service.restart_migration_job.js + * region_tag:datamigration_v1_generated_DataMigrationService_RestartMigrationJob_async + */ + async checkRestartMigrationJobProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.clouddms.v1.MigrationJob, + protos.google.cloud.clouddms.v1.OperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.restartMigrationJob, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.clouddms.v1.MigrationJob, + protos.google.cloud.clouddms.v1.OperationMetadata + >; + } + /** + * Creates a new connection profile in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of connection profiles. + * @param {string} request.connectionProfileId + * Required. The connection profile identifier. + * @param {google.cloud.clouddms.v1.ConnectionProfile} request.connectionProfile + * Required. The create request body including the connection profile data + * @param {string} request.requestId + * A unique id used to identify the request. If the server receives two + * requests with the same id, then the second request will be ignored. + * + * It is recommended to always set this value to a UUID. + * + * The id must contain only letters (a-z, A-Z), numbers (0-9), underscores + * (_), and hyphens (-). The maximum length is 40 characters. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/data_migration_service.create_connection_profile.js + * region_tag:datamigration_v1_generated_DataMigrationService_CreateConnectionProfile_async + */ + createConnectionProfile( + request?: protos.google.cloud.clouddms.v1.ICreateConnectionProfileRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.clouddms.v1.IConnectionProfile, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + createConnectionProfile( + request: protos.google.cloud.clouddms.v1.ICreateConnectionProfileRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.clouddms.v1.IConnectionProfile, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createConnectionProfile( + request: protos.google.cloud.clouddms.v1.ICreateConnectionProfileRequest, + callback: Callback< + LROperation< + protos.google.cloud.clouddms.v1.IConnectionProfile, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createConnectionProfile( + request?: protos.google.cloud.clouddms.v1.ICreateConnectionProfileRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.clouddms.v1.IConnectionProfile, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.clouddms.v1.IConnectionProfile, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.clouddms.v1.IConnectionProfile, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.createConnectionProfile( + request, + options, + callback + ); + } + /** + * Check the status of the long running operation returned by `createConnectionProfile()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/data_migration_service.create_connection_profile.js + * region_tag:datamigration_v1_generated_DataMigrationService_CreateConnectionProfile_async + */ + async checkCreateConnectionProfileProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.clouddms.v1.ConnectionProfile, + protos.google.cloud.clouddms.v1.OperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.createConnectionProfile, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.clouddms.v1.ConnectionProfile, + protos.google.cloud.clouddms.v1.OperationMetadata + >; + } + /** + * Update the configuration of a single connection profile. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. Field mask is used to specify the fields to be overwritten in the + * connection profile resource by the update. + * @param {google.cloud.clouddms.v1.ConnectionProfile} request.connectionProfile + * Required. The connection profile parameters to update. + * @param {string} request.requestId + * A unique id used to identify the request. If the server receives two + * requests with the same id, then the second request will be ignored. + * + * It is recommended to always set this value to a UUID. + * + * The id must contain only letters (a-z, A-Z), numbers (0-9), underscores + * (_), and hyphens (-). The maximum length is 40 characters. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/data_migration_service.update_connection_profile.js + * region_tag:datamigration_v1_generated_DataMigrationService_UpdateConnectionProfile_async + */ + updateConnectionProfile( + request?: protos.google.cloud.clouddms.v1.IUpdateConnectionProfileRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.clouddms.v1.IConnectionProfile, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + updateConnectionProfile( + request: protos.google.cloud.clouddms.v1.IUpdateConnectionProfileRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.clouddms.v1.IConnectionProfile, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateConnectionProfile( + request: protos.google.cloud.clouddms.v1.IUpdateConnectionProfileRequest, + callback: Callback< + LROperation< + protos.google.cloud.clouddms.v1.IConnectionProfile, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateConnectionProfile( + request?: protos.google.cloud.clouddms.v1.IUpdateConnectionProfileRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.clouddms.v1.IConnectionProfile, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.clouddms.v1.IConnectionProfile, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.clouddms.v1.IConnectionProfile, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + 'connection_profile.name': request.connectionProfile!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateConnectionProfile( + request, + options, + callback + ); + } + /** + * Check the status of the long running operation returned by `updateConnectionProfile()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/data_migration_service.update_connection_profile.js + * region_tag:datamigration_v1_generated_DataMigrationService_UpdateConnectionProfile_async + */ + async checkUpdateConnectionProfileProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.clouddms.v1.ConnectionProfile, + protos.google.cloud.clouddms.v1.OperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.updateConnectionProfile, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.clouddms.v1.ConnectionProfile, + protos.google.cloud.clouddms.v1.OperationMetadata + >; + } + /** + * Deletes a single Database Migration Service connection profile. + * A connection profile can only be deleted if it is not in use by any + * active migration jobs. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the connection profile resource to delete. + * @param {string} request.requestId + * A unique id used to identify the request. If the server receives two + * requests with the same id, then the second request will be ignored. + * + * It is recommended to always set this value to a UUID. + * + * The id must contain only letters (a-z, A-Z), numbers (0-9), underscores + * (_), and hyphens (-). The maximum length is 40 characters. + * @param {boolean} request.force + * In case of force delete, the CloudSQL replica database is also deleted + * (only for CloudSQL connection profile). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/data_migration_service.delete_connection_profile.js + * region_tag:datamigration_v1_generated_DataMigrationService_DeleteConnectionProfile_async + */ + deleteConnectionProfile( + request?: protos.google.cloud.clouddms.v1.IDeleteConnectionProfileRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + deleteConnectionProfile( + request: protos.google.cloud.clouddms.v1.IDeleteConnectionProfileRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteConnectionProfile( + request: protos.google.cloud.clouddms.v1.IDeleteConnectionProfileRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteConnectionProfile( + request?: protos.google.cloud.clouddms.v1.IDeleteConnectionProfileRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.deleteConnectionProfile( + request, + options, + callback + ); + } + /** + * Check the status of the long running operation returned by `deleteConnectionProfile()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/data_migration_service.delete_connection_profile.js + * region_tag:datamigration_v1_generated_DataMigrationService_DeleteConnectionProfile_async + */ + async checkDeleteConnectionProfileProgress( + name: string + ): Promise< + LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.clouddms.v1.OperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.deleteConnectionProfile, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.clouddms.v1.OperationMetadata + >; + } + /** + * Lists migration jobs in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of migrationJobs. + * @param {number} request.pageSize + * The maximum number of migration jobs to return. The service may return + * fewer than this value. If unspecified, at most 50 migration jobs will be + * returned. The maximum value is 1000; values above 1000 will be coerced to + * 1000. + * @param {string} request.pageToken + * The nextPageToken value received in the previous call to + * migrationJobs.list, used in the subsequent request to retrieve the next + * page of results. On first call this should be left blank. When paginating, + * all other parameters provided to migrationJobs.list must match the call + * that provided the page token. + * @param {string} request.filter + * A filter expression that filters migration jobs listed in the response. + * The expression must specify the field name, a comparison operator, and the + * value that you want to use for filtering. The value must be a string, + * a number, or a boolean. The comparison operator must be + * either =, !=, >, or <. For example, list migration jobs created this year + * by specifying **createTime %gt; 2020-01-01T00:00:00.000000000Z.** + * You can also filter nested fields. For example, you could specify + * **reverseSshConnectivity.vmIp = "1.2.3.4"** to select all migration + * jobs connecting through the specific SSH tunnel bastion. + * @param {string} request.orderBy + * Sort the results based on the migration job name. + * Valid values are: "name", "name asc", and "name desc". + * @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 [MigrationJob]{@link google.cloud.clouddms.v1.MigrationJob}. + * 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 `listMigrationJobsAsync()` + * 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. + */ + listMigrationJobs( + request?: protos.google.cloud.clouddms.v1.IListMigrationJobsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.clouddms.v1.IMigrationJob[], + protos.google.cloud.clouddms.v1.IListMigrationJobsRequest | null, + protos.google.cloud.clouddms.v1.IListMigrationJobsResponse + ] + >; + listMigrationJobs( + request: protos.google.cloud.clouddms.v1.IListMigrationJobsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.clouddms.v1.IListMigrationJobsRequest, + | protos.google.cloud.clouddms.v1.IListMigrationJobsResponse + | null + | undefined, + protos.google.cloud.clouddms.v1.IMigrationJob + > + ): void; + listMigrationJobs( + request: protos.google.cloud.clouddms.v1.IListMigrationJobsRequest, + callback: PaginationCallback< + protos.google.cloud.clouddms.v1.IListMigrationJobsRequest, + | protos.google.cloud.clouddms.v1.IListMigrationJobsResponse + | null + | undefined, + protos.google.cloud.clouddms.v1.IMigrationJob + > + ): void; + listMigrationJobs( + request?: protos.google.cloud.clouddms.v1.IListMigrationJobsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.clouddms.v1.IListMigrationJobsRequest, + | protos.google.cloud.clouddms.v1.IListMigrationJobsResponse + | null + | undefined, + protos.google.cloud.clouddms.v1.IMigrationJob + >, + callback?: PaginationCallback< + protos.google.cloud.clouddms.v1.IListMigrationJobsRequest, + | protos.google.cloud.clouddms.v1.IListMigrationJobsResponse + | null + | undefined, + protos.google.cloud.clouddms.v1.IMigrationJob + > + ): Promise< + [ + protos.google.cloud.clouddms.v1.IMigrationJob[], + protos.google.cloud.clouddms.v1.IListMigrationJobsRequest | null, + protos.google.cloud.clouddms.v1.IListMigrationJobsResponse + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.listMigrationJobs(request, options, callback); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of migrationJobs. + * @param {number} request.pageSize + * The maximum number of migration jobs to return. The service may return + * fewer than this value. If unspecified, at most 50 migration jobs will be + * returned. The maximum value is 1000; values above 1000 will be coerced to + * 1000. + * @param {string} request.pageToken + * The nextPageToken value received in the previous call to + * migrationJobs.list, used in the subsequent request to retrieve the next + * page of results. On first call this should be left blank. When paginating, + * all other parameters provided to migrationJobs.list must match the call + * that provided the page token. + * @param {string} request.filter + * A filter expression that filters migration jobs listed in the response. + * The expression must specify the field name, a comparison operator, and the + * value that you want to use for filtering. The value must be a string, + * a number, or a boolean. The comparison operator must be + * either =, !=, >, or <. For example, list migration jobs created this year + * by specifying **createTime %gt; 2020-01-01T00:00:00.000000000Z.** + * You can also filter nested fields. For example, you could specify + * **reverseSshConnectivity.vmIp = "1.2.3.4"** to select all migration + * jobs connecting through the specific SSH tunnel bastion. + * @param {string} request.orderBy + * Sort the results based on the migration job name. + * Valid values are: "name", "name asc", and "name desc". + * @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 [MigrationJob]{@link google.cloud.clouddms.v1.MigrationJob} 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 `listMigrationJobsAsync()` + * 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. + */ + listMigrationJobsStream( + request?: protos.google.cloud.clouddms.v1.IListMigrationJobsRequest, + options?: CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listMigrationJobs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listMigrationJobs.createStream( + this.innerApiCalls.listMigrationJobs as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listMigrationJobs`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of migrationJobs. + * @param {number} request.pageSize + * The maximum number of migration jobs to return. The service may return + * fewer than this value. If unspecified, at most 50 migration jobs will be + * returned. The maximum value is 1000; values above 1000 will be coerced to + * 1000. + * @param {string} request.pageToken + * The nextPageToken value received in the previous call to + * migrationJobs.list, used in the subsequent request to retrieve the next + * page of results. On first call this should be left blank. When paginating, + * all other parameters provided to migrationJobs.list must match the call + * that provided the page token. + * @param {string} request.filter + * A filter expression that filters migration jobs listed in the response. + * The expression must specify the field name, a comparison operator, and the + * value that you want to use for filtering. The value must be a string, + * a number, or a boolean. The comparison operator must be + * either =, !=, >, or <. For example, list migration jobs created this year + * by specifying **createTime %gt; 2020-01-01T00:00:00.000000000Z.** + * You can also filter nested fields. For example, you could specify + * **reverseSshConnectivity.vmIp = "1.2.3.4"** to select all migration + * jobs connecting through the specific SSH tunnel bastion. + * @param {string} request.orderBy + * Sort the results based on the migration job name. + * Valid values are: "name", "name asc", and "name desc". + * @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 + * [MigrationJob]{@link google.cloud.clouddms.v1.MigrationJob}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1/data_migration_service.list_migration_jobs.js + * region_tag:datamigration_v1_generated_DataMigrationService_ListMigrationJobs_async + */ + listMigrationJobsAsync( + request?: protos.google.cloud.clouddms.v1.IListMigrationJobsRequest, + options?: CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listMigrationJobs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listMigrationJobs.asyncIterate( + this.innerApiCalls['listMigrationJobs'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Retrieve a list of all connection profiles in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of connection profiles. + * @param {number} request.pageSize + * The maximum number of connection profiles to return. The service may return + * fewer than this value. If unspecified, at most 50 connection profiles will + * be returned. The maximum value is 1000; values above 1000 will be coerced + * to 1000. + * @param {string} request.pageToken + * A page token, received from a previous `ListConnectionProfiles` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListConnectionProfiles` + * must match the call that provided the page token. + * @param {string} request.filter + * A filter expression that filters connection profiles listed in the + * response. The expression must specify the field name, a comparison + * operator, and the value that you want to use for filtering. The value must + * be a string, a number, or a boolean. The comparison operator must be either + * =, !=, >, or <. For example, list connection profiles created this year by + * specifying **createTime %gt; 2020-01-01T00:00:00.000000000Z**. You can + * also filter nested fields. For example, you could specify **mySql.username + * = %lt;my_username%gt;** to list all connection profiles configured to + * connect with a specific username. + * @param {string} request.orderBy + * the order by fields for the result. + * @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 [ConnectionProfile]{@link google.cloud.clouddms.v1.ConnectionProfile}. + * 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 `listConnectionProfilesAsync()` + * 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. + */ + listConnectionProfiles( + request?: protos.google.cloud.clouddms.v1.IListConnectionProfilesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.clouddms.v1.IConnectionProfile[], + protos.google.cloud.clouddms.v1.IListConnectionProfilesRequest | null, + protos.google.cloud.clouddms.v1.IListConnectionProfilesResponse + ] + >; + listConnectionProfiles( + request: protos.google.cloud.clouddms.v1.IListConnectionProfilesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.clouddms.v1.IListConnectionProfilesRequest, + | protos.google.cloud.clouddms.v1.IListConnectionProfilesResponse + | null + | undefined, + protos.google.cloud.clouddms.v1.IConnectionProfile + > + ): void; + listConnectionProfiles( + request: protos.google.cloud.clouddms.v1.IListConnectionProfilesRequest, + callback: PaginationCallback< + protos.google.cloud.clouddms.v1.IListConnectionProfilesRequest, + | protos.google.cloud.clouddms.v1.IListConnectionProfilesResponse + | null + | undefined, + protos.google.cloud.clouddms.v1.IConnectionProfile + > + ): void; + listConnectionProfiles( + request?: protos.google.cloud.clouddms.v1.IListConnectionProfilesRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.clouddms.v1.IListConnectionProfilesRequest, + | protos.google.cloud.clouddms.v1.IListConnectionProfilesResponse + | null + | undefined, + protos.google.cloud.clouddms.v1.IConnectionProfile + >, + callback?: PaginationCallback< + protos.google.cloud.clouddms.v1.IListConnectionProfilesRequest, + | protos.google.cloud.clouddms.v1.IListConnectionProfilesResponse + | null + | undefined, + protos.google.cloud.clouddms.v1.IConnectionProfile + > + ): Promise< + [ + protos.google.cloud.clouddms.v1.IConnectionProfile[], + protos.google.cloud.clouddms.v1.IListConnectionProfilesRequest | null, + protos.google.cloud.clouddms.v1.IListConnectionProfilesResponse + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.listConnectionProfiles( + request, + options, + callback + ); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of connection profiles. + * @param {number} request.pageSize + * The maximum number of connection profiles to return. The service may return + * fewer than this value. If unspecified, at most 50 connection profiles will + * be returned. The maximum value is 1000; values above 1000 will be coerced + * to 1000. + * @param {string} request.pageToken + * A page token, received from a previous `ListConnectionProfiles` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListConnectionProfiles` + * must match the call that provided the page token. + * @param {string} request.filter + * A filter expression that filters connection profiles listed in the + * response. The expression must specify the field name, a comparison + * operator, and the value that you want to use for filtering. The value must + * be a string, a number, or a boolean. The comparison operator must be either + * =, !=, >, or <. For example, list connection profiles created this year by + * specifying **createTime %gt; 2020-01-01T00:00:00.000000000Z**. You can + * also filter nested fields. For example, you could specify **mySql.username + * = %lt;my_username%gt;** to list all connection profiles configured to + * connect with a specific username. + * @param {string} request.orderBy + * the order by fields for the result. + * @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 [ConnectionProfile]{@link google.cloud.clouddms.v1.ConnectionProfile} 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 `listConnectionProfilesAsync()` + * 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. + */ + listConnectionProfilesStream( + request?: protos.google.cloud.clouddms.v1.IListConnectionProfilesRequest, + options?: CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listConnectionProfiles']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listConnectionProfiles.createStream( + this.innerApiCalls.listConnectionProfiles as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listConnectionProfiles`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of connection profiles. + * @param {number} request.pageSize + * The maximum number of connection profiles to return. The service may return + * fewer than this value. If unspecified, at most 50 connection profiles will + * be returned. The maximum value is 1000; values above 1000 will be coerced + * to 1000. + * @param {string} request.pageToken + * A page token, received from a previous `ListConnectionProfiles` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListConnectionProfiles` + * must match the call that provided the page token. + * @param {string} request.filter + * A filter expression that filters connection profiles listed in the + * response. The expression must specify the field name, a comparison + * operator, and the value that you want to use for filtering. The value must + * be a string, a number, or a boolean. The comparison operator must be either + * =, !=, >, or <. For example, list connection profiles created this year by + * specifying **createTime %gt; 2020-01-01T00:00:00.000000000Z**. You can + * also filter nested fields. For example, you could specify **mySql.username + * = %lt;my_username%gt;** to list all connection profiles configured to + * connect with a specific username. + * @param {string} request.orderBy + * the order by fields for the result. + * @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 + * [ConnectionProfile]{@link google.cloud.clouddms.v1.ConnectionProfile}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1/data_migration_service.list_connection_profiles.js + * region_tag:datamigration_v1_generated_DataMigrationService_ListConnectionProfiles_async + */ + listConnectionProfilesAsync( + request?: protos.google.cloud.clouddms.v1.IListConnectionProfilesRequest, + options?: CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listConnectionProfiles']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listConnectionProfiles.asyncIterate( + this.innerApiCalls['listConnectionProfiles'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified connectionProfile resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} connection_profile + * @returns {string} Resource name string. + */ + connectionProfilePath( + project: string, + location: string, + connectionProfile: string + ) { + return this.pathTemplates.connectionProfilePathTemplate.render({ + project: project, + location: location, + connection_profile: connectionProfile, + }); + } + + /** + * Parse the project from ConnectionProfile resource. + * + * @param {string} connectionProfileName + * A fully-qualified path representing ConnectionProfile resource. + * @returns {string} A string representing the project. + */ + matchProjectFromConnectionProfileName(connectionProfileName: string) { + return this.pathTemplates.connectionProfilePathTemplate.match( + connectionProfileName + ).project; + } + + /** + * Parse the location from ConnectionProfile resource. + * + * @param {string} connectionProfileName + * A fully-qualified path representing ConnectionProfile resource. + * @returns {string} A string representing the location. + */ + matchLocationFromConnectionProfileName(connectionProfileName: string) { + return this.pathTemplates.connectionProfilePathTemplate.match( + connectionProfileName + ).location; + } + + /** + * Parse the connection_profile from ConnectionProfile resource. + * + * @param {string} connectionProfileName + * A fully-qualified path representing ConnectionProfile resource. + * @returns {string} A string representing the connection_profile. + */ + matchConnectionProfileFromConnectionProfileName( + connectionProfileName: string + ) { + return this.pathTemplates.connectionProfilePathTemplate.match( + connectionProfileName + ).connection_profile; + } + + /** + * Return a fully-qualified location resource name string. + * + * @param {string} project + * @param {string} location + * @returns {string} Resource name string. + */ + locationPath(project: string, location: string) { + return this.pathTemplates.locationPathTemplate.render({ + project: project, + location: location, + }); + } + + /** + * Parse the project from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the project. + */ + matchProjectFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).project; + } + + /** + * Parse the location from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the location. + */ + matchLocationFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).location; + } + + /** + * Return a fully-qualified migrationJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} migration_job + * @returns {string} Resource name string. + */ + migrationJobPath(project: string, location: string, migrationJob: string) { + return this.pathTemplates.migrationJobPathTemplate.render({ + project: project, + location: location, + migration_job: migrationJob, + }); + } + + /** + * Parse the project from MigrationJob resource. + * + * @param {string} migrationJobName + * A fully-qualified path representing MigrationJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromMigrationJobName(migrationJobName: string) { + return this.pathTemplates.migrationJobPathTemplate.match(migrationJobName) + .project; + } + + /** + * Parse the location from MigrationJob resource. + * + * @param {string} migrationJobName + * A fully-qualified path representing MigrationJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromMigrationJobName(migrationJobName: string) { + return this.pathTemplates.migrationJobPathTemplate.match(migrationJobName) + .location; + } + + /** + * Parse the migration_job from MigrationJob resource. + * + * @param {string} migrationJobName + * A fully-qualified path representing MigrationJob resource. + * @returns {string} A string representing the migration_job. + */ + matchMigrationJobFromMigrationJobName(migrationJobName: string) { + return this.pathTemplates.migrationJobPathTemplate.match(migrationJobName) + .migration_job; + } + + /** + * Return a fully-qualified project resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + projectPath(project: string) { + return this.pathTemplates.projectPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from Project resource. + * + * @param {string} projectName + * A fully-qualified path representing Project resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectName(projectName: string) { + return this.pathTemplates.projectPathTemplate.match(projectName).project; + } + + /** + * 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.dataMigrationServiceStub && !this._terminated) { + return this.dataMigrationServiceStub.then(stub => { + this._terminated = true; + stub.close(); + this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-clouddms/src/v1/data_migration_service_client_config.json b/packages/google-cloud-clouddms/src/v1/data_migration_service_client_config.json new file mode 100644 index 00000000000..33c9e3a8686 --- /dev/null +++ b/packages/google-cloud-clouddms/src/v1/data_migration_service_client_config.json @@ -0,0 +1,111 @@ +{ + "interfaces": { + "google.cloud.clouddms.v1.DataMigrationService": { + "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": { + "ListMigrationJobs": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetMigrationJob": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateMigrationJob": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateMigrationJob": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteMigrationJob": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "StartMigrationJob": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "StopMigrationJob": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ResumeMigrationJob": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "PromoteMigrationJob": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "VerifyMigrationJob": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "RestartMigrationJob": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GenerateSshScript": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListConnectionProfiles": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetConnectionProfile": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateConnectionProfile": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateConnectionProfile": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteConnectionProfile": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-cloud-clouddms/src/v1/data_migration_service_proto_list.json b/packages/google-cloud-clouddms/src/v1/data_migration_service_proto_list.json new file mode 100644 index 00000000000..888fb46fae1 --- /dev/null +++ b/packages/google-cloud-clouddms/src/v1/data_migration_service_proto_list.json @@ -0,0 +1,4 @@ +[ + "../../protos/google/cloud/clouddms/v1/clouddms.proto", + "../../protos/google/cloud/clouddms/v1/clouddms_resources.proto" +] diff --git a/packages/google-cloud-clouddms/src/v1/gapic_metadata.json b/packages/google-cloud-clouddms/src/v1/gapic_metadata.json new file mode 100644 index 00000000000..a50466d0076 --- /dev/null +++ b/packages/google-cloud-clouddms/src/v1/gapic_metadata.json @@ -0,0 +1,201 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.cloud.clouddms.v1", + "libraryPackage": "@google-cloud/dms", + "services": { + "DataMigrationService": { + "clients": { + "grpc": { + "libraryClient": "DataMigrationServiceClient", + "rpcs": { + "GetMigrationJob": { + "methods": [ + "getMigrationJob" + ] + }, + "GenerateSshScript": { + "methods": [ + "generateSshScript" + ] + }, + "GetConnectionProfile": { + "methods": [ + "getConnectionProfile" + ] + }, + "CreateMigrationJob": { + "methods": [ + "createMigrationJob" + ] + }, + "UpdateMigrationJob": { + "methods": [ + "updateMigrationJob" + ] + }, + "DeleteMigrationJob": { + "methods": [ + "deleteMigrationJob" + ] + }, + "StartMigrationJob": { + "methods": [ + "startMigrationJob" + ] + }, + "StopMigrationJob": { + "methods": [ + "stopMigrationJob" + ] + }, + "ResumeMigrationJob": { + "methods": [ + "resumeMigrationJob" + ] + }, + "PromoteMigrationJob": { + "methods": [ + "promoteMigrationJob" + ] + }, + "VerifyMigrationJob": { + "methods": [ + "verifyMigrationJob" + ] + }, + "RestartMigrationJob": { + "methods": [ + "restartMigrationJob" + ] + }, + "CreateConnectionProfile": { + "methods": [ + "createConnectionProfile" + ] + }, + "UpdateConnectionProfile": { + "methods": [ + "updateConnectionProfile" + ] + }, + "DeleteConnectionProfile": { + "methods": [ + "deleteConnectionProfile" + ] + }, + "ListMigrationJobs": { + "methods": [ + "listMigrationJobs", + "listMigrationJobsStream", + "listMigrationJobsAsync" + ] + }, + "ListConnectionProfiles": { + "methods": [ + "listConnectionProfiles", + "listConnectionProfilesStream", + "listConnectionProfilesAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "DataMigrationServiceClient", + "rpcs": { + "GetMigrationJob": { + "methods": [ + "getMigrationJob" + ] + }, + "GenerateSshScript": { + "methods": [ + "generateSshScript" + ] + }, + "GetConnectionProfile": { + "methods": [ + "getConnectionProfile" + ] + }, + "CreateMigrationJob": { + "methods": [ + "createMigrationJob" + ] + }, + "UpdateMigrationJob": { + "methods": [ + "updateMigrationJob" + ] + }, + "DeleteMigrationJob": { + "methods": [ + "deleteMigrationJob" + ] + }, + "StartMigrationJob": { + "methods": [ + "startMigrationJob" + ] + }, + "StopMigrationJob": { + "methods": [ + "stopMigrationJob" + ] + }, + "ResumeMigrationJob": { + "methods": [ + "resumeMigrationJob" + ] + }, + "PromoteMigrationJob": { + "methods": [ + "promoteMigrationJob" + ] + }, + "VerifyMigrationJob": { + "methods": [ + "verifyMigrationJob" + ] + }, + "RestartMigrationJob": { + "methods": [ + "restartMigrationJob" + ] + }, + "CreateConnectionProfile": { + "methods": [ + "createConnectionProfile" + ] + }, + "UpdateConnectionProfile": { + "methods": [ + "updateConnectionProfile" + ] + }, + "DeleteConnectionProfile": { + "methods": [ + "deleteConnectionProfile" + ] + }, + "ListMigrationJobs": { + "methods": [ + "listMigrationJobs", + "listMigrationJobsStream", + "listMigrationJobsAsync" + ] + }, + "ListConnectionProfiles": { + "methods": [ + "listConnectionProfiles", + "listConnectionProfilesStream", + "listConnectionProfilesAsync" + ] + } + } + } + } + } + } +} diff --git a/packages/google-cloud-clouddms/src/v1/index.ts b/packages/google-cloud-clouddms/src/v1/index.ts new file mode 100644 index 00000000000..e2c865c22ac --- /dev/null +++ b/packages/google-cloud-clouddms/src/v1/index.ts @@ -0,0 +1,19 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +export {DataMigrationServiceClient} from './data_migration_service_client'; diff --git a/packages/google-cloud-clouddms/system-test/fixtures/sample/src/index.js b/packages/google-cloud-clouddms/system-test/fixtures/sample/src/index.js new file mode 100644 index 00000000000..bfe7cae2014 --- /dev/null +++ b/packages/google-cloud-clouddms/system-test/fixtures/sample/src/index.js @@ -0,0 +1,26 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* eslint-disable node/no-missing-require, no-unused-vars */ +const clouddms = require('@google-cloud/dms'); + +function main() { + const dataMigrationServiceClient = new clouddms.DataMigrationServiceClient(); +} + +main(); diff --git a/packages/google-cloud-clouddms/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-clouddms/system-test/fixtures/sample/src/index.ts new file mode 100644 index 00000000000..b84ed564e7c --- /dev/null +++ b/packages/google-cloud-clouddms/system-test/fixtures/sample/src/index.ts @@ -0,0 +1,34 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import {DataMigrationServiceClient} from '@google-cloud/dms'; + +// check that the client class type name can be used +function doStuffWithDataMigrationServiceClient( + client: DataMigrationServiceClient +) { + client.close(); +} + +function main() { + // check that the client instance can be created + const dataMigrationServiceClient = new DataMigrationServiceClient(); + doStuffWithDataMigrationServiceClient(dataMigrationServiceClient); +} + +main(); diff --git a/packages/google-cloud-clouddms/system-test/install.ts b/packages/google-cloud-clouddms/system-test/install.ts new file mode 100644 index 00000000000..6dd1eaadafa --- /dev/null +++ b/packages/google-cloud-clouddms/system-test/install.ts @@ -0,0 +1,51 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import {packNTest} from 'pack-n-play'; +import {readFileSync} from 'fs'; +import {describe, it} from 'mocha'; + +describe('📦 pack-n-play test', () => { + it('TypeScript code', async function () { + this.timeout(300000); + const options = { + packageDir: process.cwd(), + sample: { + description: 'TypeScript user can use the type definitions', + ts: readFileSync( + './system-test/fixtures/sample/src/index.ts' + ).toString(), + }, + }; + await packNTest(options); + }); + + it('JavaScript code', async function () { + this.timeout(300000); + const options = { + packageDir: process.cwd(), + sample: { + description: 'JavaScript user can use the library', + ts: readFileSync( + './system-test/fixtures/sample/src/index.js' + ).toString(), + }, + }; + await packNTest(options); + }); +}); diff --git a/packages/google-cloud-clouddms/test/gapic_data_migration_service_v1.ts b/packages/google-cloud-clouddms/test/gapic_data_migration_service_v1.ts new file mode 100644 index 00000000000..ce9b193625e --- /dev/null +++ b/packages/google-cloud-clouddms/test/gapic_data_migration_service_v1.ts @@ -0,0 +1,4018 @@ +// 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 datamigrationserviceModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf, LROperation, operationsProtos} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON( + require('../protos/protos.json') +).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = ( + instance.constructor as typeof protobuf.Message + ).toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject( + filledObject + ) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error + ? sinon.stub().rejects(error) + : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback( + response?: ResponseType, + error?: Error +) { + return error + ? sinon.stub().callsArgWith(2, error) + : sinon.stub().callsArgWith(2, null, response); +} + +function stubLongRunningCall( + response?: ResponseType, + callError?: Error, + lroError?: Error +) { + const innerStub = lroError + ? sinon.stub().rejects(lroError) + : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError + ? sinon.stub().rejects(callError) + : sinon.stub().resolves([mockOperation]); +} + +function stubLongRunningCallWithCallback( + response?: ResponseType, + callError?: Error, + lroError?: Error +) { + const innerStub = lroError + ? sinon.stub().rejects(lroError) + : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError + ? sinon.stub().callsArgWith(2, callError) + : sinon.stub().callsArgWith(2, null, mockOperation); +} + +function stubPageStreamingCall( + responses?: ResponseType[], + error?: Error +) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error + ? sinon.stub().callsArgWith(2, error) + : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { + mockStream.write({}); + }); + } + setImmediate(() => { + mockStream.end(); + }); + } else { + setImmediate(() => { + mockStream.write({}); + }); + setImmediate(() => { + mockStream.end(); + }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall( + responses?: ResponseType[], + error?: Error +) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + }, + }; + }, + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v1.DataMigrationServiceClient', () => { + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = + datamigrationserviceModule.v1.DataMigrationServiceClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + datamigrationserviceModule.v1.DataMigrationServiceClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = + datamigrationserviceModule.v1.DataMigrationServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.dataMigrationServiceStub, undefined); + await client.initialize(); + assert(client.dataMigrationServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.dataMigrationServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.dataMigrationServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + 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 datamigrationserviceModule.v1.DataMigrationServiceClient({ + 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('getMigrationJob', () => { + it('invokes getMigrationJob without error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.GetMigrationJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.GetMigrationJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.clouddms.v1.MigrationJob() + ); + client.innerApiCalls.getMigrationJob = stubSimpleCall(expectedResponse); + const [response] = await client.getMigrationJob(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getMigrationJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getMigrationJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getMigrationJob without error using callback', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.GetMigrationJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.GetMigrationJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.clouddms.v1.MigrationJob() + ); + client.innerApiCalls.getMigrationJob = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getMigrationJob( + request, + ( + err?: Error | null, + result?: protos.google.cloud.clouddms.v1.IMigrationJob | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getMigrationJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getMigrationJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getMigrationJob with error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.GetMigrationJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.GetMigrationJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getMigrationJob = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getMigrationJob(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getMigrationJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getMigrationJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getMigrationJob with closed client', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.GetMigrationJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.GetMigrationJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getMigrationJob(request), expectedError); + }); + }); + + describe('generateSshScript', () => { + it('invokes generateSshScript without error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.GenerateSshScriptRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.GenerateSshScriptRequest', + ['migrationJob'] + ); + request.migrationJob = defaultValue1; + const expectedHeaderRequestParams = `migration_job=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.clouddms.v1.SshScript() + ); + client.innerApiCalls.generateSshScript = stubSimpleCall(expectedResponse); + const [response] = await client.generateSshScript(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.generateSshScript as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.generateSshScript as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes generateSshScript without error using callback', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.GenerateSshScriptRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.GenerateSshScriptRequest', + ['migrationJob'] + ); + request.migrationJob = defaultValue1; + const expectedHeaderRequestParams = `migration_job=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.clouddms.v1.SshScript() + ); + client.innerApiCalls.generateSshScript = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.generateSshScript( + request, + ( + err?: Error | null, + result?: protos.google.cloud.clouddms.v1.ISshScript | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.generateSshScript as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.generateSshScript as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes generateSshScript with error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.GenerateSshScriptRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.GenerateSshScriptRequest', + ['migrationJob'] + ); + request.migrationJob = defaultValue1; + const expectedHeaderRequestParams = `migration_job=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.generateSshScript = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.generateSshScript(request), expectedError); + const actualRequest = ( + client.innerApiCalls.generateSshScript as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.generateSshScript as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes generateSshScript with closed client', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.GenerateSshScriptRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.GenerateSshScriptRequest', + ['migrationJob'] + ); + request.migrationJob = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.generateSshScript(request), expectedError); + }); + }); + + describe('getConnectionProfile', () => { + it('invokes getConnectionProfile without error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.GetConnectionProfileRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.GetConnectionProfileRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.clouddms.v1.ConnectionProfile() + ); + client.innerApiCalls.getConnectionProfile = + stubSimpleCall(expectedResponse); + const [response] = await client.getConnectionProfile(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getConnectionProfile as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getConnectionProfile as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getConnectionProfile without error using callback', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.GetConnectionProfileRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.GetConnectionProfileRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.clouddms.v1.ConnectionProfile() + ); + client.innerApiCalls.getConnectionProfile = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getConnectionProfile( + request, + ( + err?: Error | null, + result?: protos.google.cloud.clouddms.v1.IConnectionProfile | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getConnectionProfile as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getConnectionProfile as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getConnectionProfile with error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.GetConnectionProfileRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.GetConnectionProfileRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getConnectionProfile = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getConnectionProfile(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getConnectionProfile as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getConnectionProfile as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getConnectionProfile with closed client', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.GetConnectionProfileRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.GetConnectionProfileRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getConnectionProfile(request), expectedError); + }); + }); + + describe('createMigrationJob', () => { + it('invokes createMigrationJob without error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.CreateMigrationJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.CreateMigrationJobRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createMigrationJob = + stubLongRunningCall(expectedResponse); + const [operation] = await client.createMigrationJob(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createMigrationJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createMigrationJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createMigrationJob without error using callback', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.CreateMigrationJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.CreateMigrationJobRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createMigrationJob = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createMigrationJob( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.clouddms.v1.IMigrationJob, + protos.google.cloud.clouddms.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.clouddms.v1.IMigrationJob, + protos.google.cloud.clouddms.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createMigrationJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createMigrationJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createMigrationJob with call error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.CreateMigrationJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.CreateMigrationJobRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createMigrationJob = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.createMigrationJob(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createMigrationJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createMigrationJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createMigrationJob with LRO error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.CreateMigrationJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.CreateMigrationJobRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createMigrationJob = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.createMigrationJob(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.createMigrationJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createMigrationJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateMigrationJobProgress without error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkCreateMigrationJobProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateMigrationJobProgress with error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkCreateMigrationJobProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('updateMigrationJob', () => { + it('invokes updateMigrationJob without error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.UpdateMigrationJobRequest() + ); + request.migrationJob ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.UpdateMigrationJobRequest', + ['migrationJob', 'name'] + ); + request.migrationJob.name = defaultValue1; + const expectedHeaderRequestParams = `migration_job.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateMigrationJob = + stubLongRunningCall(expectedResponse); + const [operation] = await client.updateMigrationJob(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateMigrationJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateMigrationJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateMigrationJob without error using callback', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.UpdateMigrationJobRequest() + ); + request.migrationJob ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.UpdateMigrationJobRequest', + ['migrationJob', 'name'] + ); + request.migrationJob.name = defaultValue1; + const expectedHeaderRequestParams = `migration_job.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateMigrationJob = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateMigrationJob( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.clouddms.v1.IMigrationJob, + protos.google.cloud.clouddms.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.clouddms.v1.IMigrationJob, + protos.google.cloud.clouddms.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateMigrationJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateMigrationJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateMigrationJob with call error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.UpdateMigrationJobRequest() + ); + request.migrationJob ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.UpdateMigrationJobRequest', + ['migrationJob', 'name'] + ); + request.migrationJob.name = defaultValue1; + const expectedHeaderRequestParams = `migration_job.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateMigrationJob = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.updateMigrationJob(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateMigrationJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateMigrationJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateMigrationJob with LRO error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.UpdateMigrationJobRequest() + ); + request.migrationJob ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.UpdateMigrationJobRequest', + ['migrationJob', 'name'] + ); + request.migrationJob.name = defaultValue1; + const expectedHeaderRequestParams = `migration_job.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateMigrationJob = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.updateMigrationJob(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.updateMigrationJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateMigrationJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateMigrationJobProgress without error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkUpdateMigrationJobProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateMigrationJobProgress with error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkUpdateMigrationJobProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('deleteMigrationJob', () => { + it('invokes deleteMigrationJob without error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.DeleteMigrationJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.DeleteMigrationJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteMigrationJob = + stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteMigrationJob(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteMigrationJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteMigrationJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteMigrationJob without error using callback', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.DeleteMigrationJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.DeleteMigrationJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteMigrationJob = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteMigrationJob( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.clouddms.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.clouddms.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteMigrationJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteMigrationJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteMigrationJob with call error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.DeleteMigrationJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.DeleteMigrationJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteMigrationJob = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteMigrationJob(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteMigrationJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteMigrationJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteMigrationJob with LRO error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.DeleteMigrationJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.DeleteMigrationJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteMigrationJob = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.deleteMigrationJob(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteMigrationJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteMigrationJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteMigrationJobProgress without error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkDeleteMigrationJobProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteMigrationJobProgress with error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkDeleteMigrationJobProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('startMigrationJob', () => { + it('invokes startMigrationJob without error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.StartMigrationJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.StartMigrationJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.startMigrationJob = + stubLongRunningCall(expectedResponse); + const [operation] = await client.startMigrationJob(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.startMigrationJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.startMigrationJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes startMigrationJob without error using callback', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.StartMigrationJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.StartMigrationJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.startMigrationJob = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.startMigrationJob( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.clouddms.v1.IMigrationJob, + protos.google.cloud.clouddms.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.clouddms.v1.IMigrationJob, + protos.google.cloud.clouddms.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.startMigrationJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.startMigrationJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes startMigrationJob with call error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.StartMigrationJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.StartMigrationJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.startMigrationJob = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.startMigrationJob(request), expectedError); + const actualRequest = ( + client.innerApiCalls.startMigrationJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.startMigrationJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes startMigrationJob with LRO error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.StartMigrationJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.StartMigrationJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.startMigrationJob = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.startMigrationJob(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.startMigrationJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.startMigrationJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkStartMigrationJobProgress without error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkStartMigrationJobProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkStartMigrationJobProgress with error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkStartMigrationJobProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('stopMigrationJob', () => { + it('invokes stopMigrationJob without error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.StopMigrationJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.StopMigrationJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.stopMigrationJob = + stubLongRunningCall(expectedResponse); + const [operation] = await client.stopMigrationJob(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.stopMigrationJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.stopMigrationJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes stopMigrationJob without error using callback', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.StopMigrationJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.StopMigrationJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.stopMigrationJob = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.stopMigrationJob( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.clouddms.v1.IMigrationJob, + protos.google.cloud.clouddms.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.clouddms.v1.IMigrationJob, + protos.google.cloud.clouddms.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.stopMigrationJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.stopMigrationJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes stopMigrationJob with call error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.StopMigrationJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.StopMigrationJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.stopMigrationJob = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.stopMigrationJob(request), expectedError); + const actualRequest = ( + client.innerApiCalls.stopMigrationJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.stopMigrationJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes stopMigrationJob with LRO error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.StopMigrationJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.StopMigrationJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.stopMigrationJob = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.stopMigrationJob(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.stopMigrationJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.stopMigrationJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkStopMigrationJobProgress without error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkStopMigrationJobProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkStopMigrationJobProgress with error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkStopMigrationJobProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('resumeMigrationJob', () => { + it('invokes resumeMigrationJob without error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.ResumeMigrationJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.ResumeMigrationJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.resumeMigrationJob = + stubLongRunningCall(expectedResponse); + const [operation] = await client.resumeMigrationJob(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.resumeMigrationJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.resumeMigrationJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes resumeMigrationJob without error using callback', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.ResumeMigrationJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.ResumeMigrationJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.resumeMigrationJob = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.resumeMigrationJob( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.clouddms.v1.IMigrationJob, + protos.google.cloud.clouddms.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.clouddms.v1.IMigrationJob, + protos.google.cloud.clouddms.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.resumeMigrationJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.resumeMigrationJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes resumeMigrationJob with call error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.ResumeMigrationJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.ResumeMigrationJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.resumeMigrationJob = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.resumeMigrationJob(request), expectedError); + const actualRequest = ( + client.innerApiCalls.resumeMigrationJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.resumeMigrationJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes resumeMigrationJob with LRO error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.ResumeMigrationJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.ResumeMigrationJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.resumeMigrationJob = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.resumeMigrationJob(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.resumeMigrationJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.resumeMigrationJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkResumeMigrationJobProgress without error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkResumeMigrationJobProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkResumeMigrationJobProgress with error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkResumeMigrationJobProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('promoteMigrationJob', () => { + it('invokes promoteMigrationJob without error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.PromoteMigrationJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.PromoteMigrationJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.promoteMigrationJob = + stubLongRunningCall(expectedResponse); + const [operation] = await client.promoteMigrationJob(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.promoteMigrationJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.promoteMigrationJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes promoteMigrationJob without error using callback', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.PromoteMigrationJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.PromoteMigrationJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.promoteMigrationJob = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.promoteMigrationJob( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.clouddms.v1.IMigrationJob, + protos.google.cloud.clouddms.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.clouddms.v1.IMigrationJob, + protos.google.cloud.clouddms.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.promoteMigrationJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.promoteMigrationJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes promoteMigrationJob with call error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.PromoteMigrationJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.PromoteMigrationJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.promoteMigrationJob = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.promoteMigrationJob(request), expectedError); + const actualRequest = ( + client.innerApiCalls.promoteMigrationJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.promoteMigrationJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes promoteMigrationJob with LRO error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.PromoteMigrationJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.PromoteMigrationJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.promoteMigrationJob = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.promoteMigrationJob(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.promoteMigrationJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.promoteMigrationJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkPromoteMigrationJobProgress without error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkPromoteMigrationJobProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkPromoteMigrationJobProgress with error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkPromoteMigrationJobProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('verifyMigrationJob', () => { + it('invokes verifyMigrationJob without error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.VerifyMigrationJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.VerifyMigrationJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.verifyMigrationJob = + stubLongRunningCall(expectedResponse); + const [operation] = await client.verifyMigrationJob(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.verifyMigrationJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.verifyMigrationJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes verifyMigrationJob without error using callback', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.VerifyMigrationJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.VerifyMigrationJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.verifyMigrationJob = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.verifyMigrationJob( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.clouddms.v1.IMigrationJob, + protos.google.cloud.clouddms.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.clouddms.v1.IMigrationJob, + protos.google.cloud.clouddms.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.verifyMigrationJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.verifyMigrationJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes verifyMigrationJob with call error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.VerifyMigrationJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.VerifyMigrationJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.verifyMigrationJob = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.verifyMigrationJob(request), expectedError); + const actualRequest = ( + client.innerApiCalls.verifyMigrationJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.verifyMigrationJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes verifyMigrationJob with LRO error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.VerifyMigrationJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.VerifyMigrationJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.verifyMigrationJob = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.verifyMigrationJob(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.verifyMigrationJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.verifyMigrationJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkVerifyMigrationJobProgress without error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkVerifyMigrationJobProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkVerifyMigrationJobProgress with error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkVerifyMigrationJobProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('restartMigrationJob', () => { + it('invokes restartMigrationJob without error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.RestartMigrationJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.RestartMigrationJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.restartMigrationJob = + stubLongRunningCall(expectedResponse); + const [operation] = await client.restartMigrationJob(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.restartMigrationJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.restartMigrationJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes restartMigrationJob without error using callback', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.RestartMigrationJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.RestartMigrationJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.restartMigrationJob = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.restartMigrationJob( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.clouddms.v1.IMigrationJob, + protos.google.cloud.clouddms.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.clouddms.v1.IMigrationJob, + protos.google.cloud.clouddms.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.restartMigrationJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.restartMigrationJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes restartMigrationJob with call error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.RestartMigrationJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.RestartMigrationJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.restartMigrationJob = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.restartMigrationJob(request), expectedError); + const actualRequest = ( + client.innerApiCalls.restartMigrationJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.restartMigrationJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes restartMigrationJob with LRO error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.RestartMigrationJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.RestartMigrationJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.restartMigrationJob = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.restartMigrationJob(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.restartMigrationJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.restartMigrationJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkRestartMigrationJobProgress without error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkRestartMigrationJobProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkRestartMigrationJobProgress with error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkRestartMigrationJobProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('createConnectionProfile', () => { + it('invokes createConnectionProfile without error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.CreateConnectionProfileRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.CreateConnectionProfileRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createConnectionProfile = + stubLongRunningCall(expectedResponse); + const [operation] = await client.createConnectionProfile(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createConnectionProfile as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createConnectionProfile as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createConnectionProfile without error using callback', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.CreateConnectionProfileRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.CreateConnectionProfileRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createConnectionProfile = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createConnectionProfile( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.clouddms.v1.IConnectionProfile, + protos.google.cloud.clouddms.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.clouddms.v1.IConnectionProfile, + protos.google.cloud.clouddms.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createConnectionProfile as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createConnectionProfile as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createConnectionProfile with call error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.CreateConnectionProfileRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.CreateConnectionProfileRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createConnectionProfile = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects( + client.createConnectionProfile(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.createConnectionProfile as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createConnectionProfile as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createConnectionProfile with LRO error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.CreateConnectionProfileRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.CreateConnectionProfileRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createConnectionProfile = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.createConnectionProfile(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.createConnectionProfile as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createConnectionProfile as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateConnectionProfileProgress without error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = + await client.checkCreateConnectionProfileProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateConnectionProfileProgress with error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkCreateConnectionProfileProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('updateConnectionProfile', () => { + it('invokes updateConnectionProfile without error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.UpdateConnectionProfileRequest() + ); + request.connectionProfile ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.UpdateConnectionProfileRequest', + ['connectionProfile', 'name'] + ); + request.connectionProfile.name = defaultValue1; + const expectedHeaderRequestParams = `connection_profile.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateConnectionProfile = + stubLongRunningCall(expectedResponse); + const [operation] = await client.updateConnectionProfile(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateConnectionProfile as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateConnectionProfile as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateConnectionProfile without error using callback', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.UpdateConnectionProfileRequest() + ); + request.connectionProfile ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.UpdateConnectionProfileRequest', + ['connectionProfile', 'name'] + ); + request.connectionProfile.name = defaultValue1; + const expectedHeaderRequestParams = `connection_profile.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateConnectionProfile = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateConnectionProfile( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.clouddms.v1.IConnectionProfile, + protos.google.cloud.clouddms.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.clouddms.v1.IConnectionProfile, + protos.google.cloud.clouddms.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateConnectionProfile as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateConnectionProfile as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateConnectionProfile with call error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.UpdateConnectionProfileRequest() + ); + request.connectionProfile ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.UpdateConnectionProfileRequest', + ['connectionProfile', 'name'] + ); + request.connectionProfile.name = defaultValue1; + const expectedHeaderRequestParams = `connection_profile.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateConnectionProfile = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects( + client.updateConnectionProfile(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.updateConnectionProfile as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateConnectionProfile as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateConnectionProfile with LRO error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.UpdateConnectionProfileRequest() + ); + request.connectionProfile ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.UpdateConnectionProfileRequest', + ['connectionProfile', 'name'] + ); + request.connectionProfile.name = defaultValue1; + const expectedHeaderRequestParams = `connection_profile.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateConnectionProfile = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.updateConnectionProfile(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.updateConnectionProfile as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateConnectionProfile as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateConnectionProfileProgress without error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = + await client.checkUpdateConnectionProfileProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateConnectionProfileProgress with error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkUpdateConnectionProfileProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('deleteConnectionProfile', () => { + it('invokes deleteConnectionProfile without error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.DeleteConnectionProfileRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.DeleteConnectionProfileRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteConnectionProfile = + stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteConnectionProfile(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteConnectionProfile as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteConnectionProfile as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteConnectionProfile without error using callback', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.DeleteConnectionProfileRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.DeleteConnectionProfileRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteConnectionProfile = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteConnectionProfile( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.clouddms.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.clouddms.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteConnectionProfile as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteConnectionProfile as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteConnectionProfile with call error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.DeleteConnectionProfileRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.DeleteConnectionProfileRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteConnectionProfile = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects( + client.deleteConnectionProfile(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.deleteConnectionProfile as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteConnectionProfile as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteConnectionProfile with LRO error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.DeleteConnectionProfileRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.DeleteConnectionProfileRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteConnectionProfile = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.deleteConnectionProfile(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteConnectionProfile as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteConnectionProfile as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteConnectionProfileProgress without error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = + await client.checkDeleteConnectionProfileProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteConnectionProfileProgress with error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkDeleteConnectionProfileProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('listMigrationJobs', () => { + it('invokes listMigrationJobs without error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.ListMigrationJobsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.ListMigrationJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.clouddms.v1.MigrationJob() + ), + generateSampleMessage( + new protos.google.cloud.clouddms.v1.MigrationJob() + ), + generateSampleMessage( + new protos.google.cloud.clouddms.v1.MigrationJob() + ), + ]; + client.innerApiCalls.listMigrationJobs = stubSimpleCall(expectedResponse); + const [response] = await client.listMigrationJobs(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listMigrationJobs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listMigrationJobs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listMigrationJobs without error using callback', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.ListMigrationJobsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.ListMigrationJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.clouddms.v1.MigrationJob() + ), + generateSampleMessage( + new protos.google.cloud.clouddms.v1.MigrationJob() + ), + generateSampleMessage( + new protos.google.cloud.clouddms.v1.MigrationJob() + ), + ]; + client.innerApiCalls.listMigrationJobs = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listMigrationJobs( + request, + ( + err?: Error | null, + result?: protos.google.cloud.clouddms.v1.IMigrationJob[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listMigrationJobs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listMigrationJobs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listMigrationJobs with error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.ListMigrationJobsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.ListMigrationJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listMigrationJobs = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listMigrationJobs(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listMigrationJobs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listMigrationJobs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listMigrationJobsStream without error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.ListMigrationJobsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.ListMigrationJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.clouddms.v1.MigrationJob() + ), + generateSampleMessage( + new protos.google.cloud.clouddms.v1.MigrationJob() + ), + generateSampleMessage( + new protos.google.cloud.clouddms.v1.MigrationJob() + ), + ]; + client.descriptors.page.listMigrationJobs.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listMigrationJobsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.clouddms.v1.MigrationJob[] = []; + stream.on( + 'data', + (response: protos.google.cloud.clouddms.v1.MigrationJob) => { + 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.listMigrationJobs.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listMigrationJobs, request) + ); + assert( + (client.descriptors.page.listMigrationJobs.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listMigrationJobsStream with error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.ListMigrationJobsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.ListMigrationJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listMigrationJobs.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listMigrationJobsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.clouddms.v1.MigrationJob[] = []; + stream.on( + 'data', + (response: protos.google.cloud.clouddms.v1.MigrationJob) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listMigrationJobs.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listMigrationJobs, request) + ); + assert( + (client.descriptors.page.listMigrationJobs.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listMigrationJobs without error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.ListMigrationJobsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.ListMigrationJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.clouddms.v1.MigrationJob() + ), + generateSampleMessage( + new protos.google.cloud.clouddms.v1.MigrationJob() + ), + generateSampleMessage( + new protos.google.cloud.clouddms.v1.MigrationJob() + ), + ]; + client.descriptors.page.listMigrationJobs.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.clouddms.v1.IMigrationJob[] = []; + const iterable = client.listMigrationJobsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listMigrationJobs.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listMigrationJobs.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listMigrationJobs with error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.ListMigrationJobsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.ListMigrationJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listMigrationJobs.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listMigrationJobsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.clouddms.v1.IMigrationJob[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listMigrationJobs.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listMigrationJobs.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listConnectionProfiles', () => { + it('invokes listConnectionProfiles without error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.ListConnectionProfilesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.ListConnectionProfilesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.clouddms.v1.ConnectionProfile() + ), + generateSampleMessage( + new protos.google.cloud.clouddms.v1.ConnectionProfile() + ), + generateSampleMessage( + new protos.google.cloud.clouddms.v1.ConnectionProfile() + ), + ]; + client.innerApiCalls.listConnectionProfiles = + stubSimpleCall(expectedResponse); + const [response] = await client.listConnectionProfiles(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listConnectionProfiles as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listConnectionProfiles as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listConnectionProfiles without error using callback', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.ListConnectionProfilesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.ListConnectionProfilesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.clouddms.v1.ConnectionProfile() + ), + generateSampleMessage( + new protos.google.cloud.clouddms.v1.ConnectionProfile() + ), + generateSampleMessage( + new protos.google.cloud.clouddms.v1.ConnectionProfile() + ), + ]; + client.innerApiCalls.listConnectionProfiles = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listConnectionProfiles( + request, + ( + err?: Error | null, + result?: protos.google.cloud.clouddms.v1.IConnectionProfile[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listConnectionProfiles as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listConnectionProfiles as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listConnectionProfiles with error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.ListConnectionProfilesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.ListConnectionProfilesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listConnectionProfiles = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.listConnectionProfiles(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.listConnectionProfiles as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listConnectionProfiles as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listConnectionProfilesStream without error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.ListConnectionProfilesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.ListConnectionProfilesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.clouddms.v1.ConnectionProfile() + ), + generateSampleMessage( + new protos.google.cloud.clouddms.v1.ConnectionProfile() + ), + generateSampleMessage( + new protos.google.cloud.clouddms.v1.ConnectionProfile() + ), + ]; + client.descriptors.page.listConnectionProfiles.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listConnectionProfilesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.clouddms.v1.ConnectionProfile[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.clouddms.v1.ConnectionProfile) => { + 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.listConnectionProfiles + .createStream as SinonStub + ) + .getCall(0) + .calledWith(client.innerApiCalls.listConnectionProfiles, request) + ); + assert( + ( + client.descriptors.page.listConnectionProfiles + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listConnectionProfilesStream with error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.ListConnectionProfilesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.ListConnectionProfilesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listConnectionProfiles.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listConnectionProfilesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.clouddms.v1.ConnectionProfile[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.clouddms.v1.ConnectionProfile) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + ( + client.descriptors.page.listConnectionProfiles + .createStream as SinonStub + ) + .getCall(0) + .calledWith(client.innerApiCalls.listConnectionProfiles, request) + ); + assert( + ( + client.descriptors.page.listConnectionProfiles + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listConnectionProfiles without error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.ListConnectionProfilesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.ListConnectionProfilesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.clouddms.v1.ConnectionProfile() + ), + generateSampleMessage( + new protos.google.cloud.clouddms.v1.ConnectionProfile() + ), + generateSampleMessage( + new protos.google.cloud.clouddms.v1.ConnectionProfile() + ), + ]; + client.descriptors.page.listConnectionProfiles.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.clouddms.v1.IConnectionProfile[] = + []; + const iterable = client.listConnectionProfilesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listConnectionProfiles + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.descriptors.page.listConnectionProfiles + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listConnectionProfiles with error', async () => { + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.clouddms.v1.ListConnectionProfilesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.clouddms.v1.ListConnectionProfilesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listConnectionProfiles.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listConnectionProfilesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.clouddms.v1.IConnectionProfile[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listConnectionProfiles + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.descriptors.page.listConnectionProfiles + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('Path templates', () => { + describe('connectionProfile', () => { + const fakePath = '/rendered/path/connectionProfile'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + connection_profile: 'connectionProfileValue', + }; + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.connectionProfilePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.connectionProfilePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('connectionProfilePath', () => { + const result = client.connectionProfilePath( + 'projectValue', + 'locationValue', + 'connectionProfileValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.connectionProfilePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromConnectionProfileName', () => { + const result = client.matchProjectFromConnectionProfileName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.connectionProfilePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromConnectionProfileName', () => { + const result = client.matchLocationFromConnectionProfileName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.connectionProfilePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConnectionProfileFromConnectionProfileName', () => { + const result = + client.matchConnectionProfileFromConnectionProfileName(fakePath); + assert.strictEqual(result, 'connectionProfileValue'); + assert( + ( + client.pathTemplates.connectionProfilePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('location', () => { + const fakePath = '/rendered/path/location'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + }; + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.locationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.locationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('locationPath', () => { + const result = client.locationPath('projectValue', 'locationValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.locationPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromLocationName', () => { + const result = client.matchProjectFromLocationName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromLocationName', () => { + const result = client.matchLocationFromLocationName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('migrationJob', () => { + const fakePath = '/rendered/path/migrationJob'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + migration_job: 'migrationJobValue', + }; + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.migrationJobPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.migrationJobPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('migrationJobPath', () => { + const result = client.migrationJobPath( + 'projectValue', + 'locationValue', + 'migrationJobValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.migrationJobPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromMigrationJobName', () => { + const result = client.matchProjectFromMigrationJobName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.migrationJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromMigrationJobName', () => { + const result = client.matchLocationFromMigrationJobName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.migrationJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchMigrationJobFromMigrationJobName', () => { + const result = client.matchMigrationJobFromMigrationJobName(fakePath); + assert.strictEqual(result, 'migrationJobValue'); + assert( + (client.pathTemplates.migrationJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('project', () => { + const fakePath = '/rendered/path/project'; + const expectedParameters = { + project: 'projectValue', + }; + const client = + new datamigrationserviceModule.v1.DataMigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectPath', () => { + const result = client.projectPath('projectValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectName', () => { + const result = client.matchProjectFromProjectName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); diff --git a/packages/google-cloud-clouddms/tsconfig.json b/packages/google-cloud-clouddms/tsconfig.json new file mode 100644 index 00000000000..c78f1c884ef --- /dev/null +++ b/packages/google-cloud-clouddms/tsconfig.json @@ -0,0 +1,19 @@ +{ + "extends": "./node_modules/gts/tsconfig-google.json", + "compilerOptions": { + "rootDir": ".", + "outDir": "build", + "resolveJsonModule": true, + "lib": [ + "es2018", + "dom" + ] + }, + "include": [ + "src/*.ts", + "src/**/*.ts", + "test/*.ts", + "test/**/*.ts", + "system-test/*.ts" + ] +} diff --git a/packages/google-cloud-clouddms/webpack.config.js b/packages/google-cloud-clouddms/webpack.config.js new file mode 100644 index 00000000000..c7f2e41c92f --- /dev/null +++ b/packages/google-cloud-clouddms/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: 'DataMigrationService', + filename: './data-migration-service.js', + }, + node: { + child_process: 'empty', + fs: 'empty', + crypto: 'empty', + }, + resolve: { + alias: { + '../../../package.json': path.resolve(__dirname, 'package.json'), + }, + extensions: ['.js', '.json', '.ts'], + }, + module: { + rules: [ + { + test: /\.tsx?$/, + use: 'ts-loader', + exclude: /node_modules/, + }, + { + test: /node_modules[\\/]@grpc[\\/]grpc-js/, + use: 'null-loader', + }, + { + test: /node_modules[\\/]grpc/, + use: 'null-loader', + }, + { + test: /node_modules[\\/]retry-request/, + use: 'null-loader', + }, + { + test: /node_modules[\\/]https?-proxy-agent/, + use: 'null-loader', + }, + { + test: /node_modules[\\/]gtoken/, + use: 'null-loader', + }, + ], + }, + mode: 'production', +}; diff --git a/release-please-config.json b/release-please-config.json index fbc05b32390..91ca5f88e4a 100644 --- a/release-please-config.json +++ b/release-please-config.json @@ -24,6 +24,7 @@ "packages/google-cloud-billing": {}, "packages/google-cloud-billing-budgets": {}, "packages/google-cloud-certificatemanager": {}, + "packages/google-cloud-clouddms": {}, "packages/google-cloud-contactcenterinsights": {}, "packages/google-cloud-channel": {}, "packages/google-cloud-contentwarehouse": {},