diff --git a/packages/google-cloud-vmmigration/.eslintignore b/packages/google-cloud-vmmigration/.eslintignore new file mode 100644 index 00000000000..ea5b04aebe6 --- /dev/null +++ b/packages/google-cloud-vmmigration/.eslintignore @@ -0,0 +1,7 @@ +**/node_modules +**/coverage +test/fixtures +build/ +docs/ +protos/ +samples/generated/ diff --git a/packages/google-cloud-vmmigration/.eslintrc.json b/packages/google-cloud-vmmigration/.eslintrc.json new file mode 100644 index 00000000000..78215349546 --- /dev/null +++ b/packages/google-cloud-vmmigration/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "./node_modules/gts" +} diff --git a/packages/google-cloud-vmmigration/.gitattributes b/packages/google-cloud-vmmigration/.gitattributes new file mode 100644 index 00000000000..33739cb74e4 --- /dev/null +++ b/packages/google-cloud-vmmigration/.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-vmmigration/.github/.OwlBot.yaml b/packages/google-cloud-vmmigration/.github/.OwlBot.yaml new file mode 100644 index 00000000000..1a2bd55ea0f --- /dev/null +++ b/packages/google-cloud-vmmigration/.github/.OwlBot.yaml @@ -0,0 +1,22 @@ +# Copyright 2021 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +docker: + image: gcr.io/cloud-devrel-public-resources/owlbot-nodejs:latest + +deep-remove-regex: + - /owl-bot-staging + +deep-copy-regex: + - source: /google/cloud/vmmigration/(.*)/.*-nodejs/(.*) + dest: /owl-bot-staging/$1/$2 diff --git a/packages/google-cloud-vmmigration/.gitignore b/packages/google-cloud-vmmigration/.gitignore new file mode 100644 index 00000000000..5d32b23782f --- /dev/null +++ b/packages/google-cloud-vmmigration/.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-vmmigration/.jsdoc.js b/packages/google-cloud-vmmigration/.jsdoc.js new file mode 100644 index 00000000000..a7063ae6f3b --- /dev/null +++ b/packages/google-cloud-vmmigration/.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/vmmigration', + theme: 'lumen', + default: { + outputSourceFiles: false + } + }, + markdown: { + idInHeadings: true + } +}; diff --git a/packages/google-cloud-vmmigration/.mocharc.js b/packages/google-cloud-vmmigration/.mocharc.js new file mode 100644 index 00000000000..0b600509bed --- /dev/null +++ b/packages/google-cloud-vmmigration/.mocharc.js @@ -0,0 +1,29 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +const config = { + "enable-source-maps": true, + "throw-deprecation": true, + "timeout": 10000, + "recursive": true +} +if (process.env.MOCHA_THROW_DEPRECATION === 'false') { + delete config['throw-deprecation']; +} +if (process.env.MOCHA_REPORTER) { + config.reporter = process.env.MOCHA_REPORTER; +} +if (process.env.MOCHA_REPORTER_OUTPUT) { + config['reporter-option'] = `output=${process.env.MOCHA_REPORTER_OUTPUT}`; +} +module.exports = config diff --git a/packages/google-cloud-vmmigration/.nycrc b/packages/google-cloud-vmmigration/.nycrc new file mode 100644 index 00000000000..b18d5472b62 --- /dev/null +++ b/packages/google-cloud-vmmigration/.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-vmmigration/.prettierignore b/packages/google-cloud-vmmigration/.prettierignore new file mode 100644 index 00000000000..9340ad9b86d --- /dev/null +++ b/packages/google-cloud-vmmigration/.prettierignore @@ -0,0 +1,6 @@ +**/node_modules +**/coverage +test/fixtures +build/ +docs/ +protos/ diff --git a/packages/google-cloud-vmmigration/.prettierrc.js b/packages/google-cloud-vmmigration/.prettierrc.js new file mode 100644 index 00000000000..d1b95106f4c --- /dev/null +++ b/packages/google-cloud-vmmigration/.prettierrc.js @@ -0,0 +1,17 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +module.exports = { + ...require('gts/.prettierrc.json') +} diff --git a/packages/google-cloud-vmmigration/.repo-metadata.json b/packages/google-cloud-vmmigration/.repo-metadata.json new file mode 100644 index 00000000000..c44157c2bc1 --- /dev/null +++ b/packages/google-cloud-vmmigration/.repo-metadata.json @@ -0,0 +1,16 @@ +{ + "name": "vmmigration", + "name_pretty": "Migrate for Compute Engine", + "product_documentation": "https://cloud.google.com/migrate/compute-engine/", + "client_documentation": "https://cloud.google.com/nodejs/docs/reference/vmmigration/latest", + "issue_tracker": "https://github.com/googleapis/nodejs-vmmigration/issues", + "release_level": "stable", + "language": "nodejs", + "repo": "googleapis/nodejs-vmmigration", + "distribution_name": "@google-cloud/vmmigration", + "api_id": "vmmigration.googleapis.com", + "default_version": "v1", + "requires_billing": true, + "api_shortname": "vmmigration", + "library_type": "GAPIC_AUTO" +} diff --git a/packages/google-cloud-vmmigration/CHANGELOG.md b/packages/google-cloud-vmmigration/CHANGELOG.md new file mode 100644 index 00000000000..e486650ee12 --- /dev/null +++ b/packages/google-cloud-vmmigration/CHANGELOG.md @@ -0,0 +1,64 @@ +# Changelog + +## [2.2.1](https://github.com/googleapis/nodejs-vmmigration/compare/v2.2.0...v2.2.1) (2022-11-11) + + +### Bug Fixes + +* **deps:** Use google-gax v3.5.2 ([#68](https://github.com/googleapis/nodejs-vmmigration/issues/68)) ([658939e](https://github.com/googleapis/nodejs-vmmigration/commit/658939eddfed48c3057a34053200e4773013cd36)) +* Do not import the whole google-gax from proto JS ([#1553](https://github.com/googleapis/nodejs-vmmigration/issues/1553)) ([#58](https://github.com/googleapis/nodejs-vmmigration/issues/58)) ([2904a86](https://github.com/googleapis/nodejs-vmmigration/commit/2904a8663508a1bef3c8637ebad6702d05bd1935)) +* Preserve default values in x-goog-request-params header ([#62](https://github.com/googleapis/nodejs-vmmigration/issues/62)) ([2a42aea](https://github.com/googleapis/nodejs-vmmigration/commit/2a42aea5c7b10e97b0f43f134d4351a0bd14abf0)) +* Regenerated protos JS and TS definitions ([#71](https://github.com/googleapis/nodejs-vmmigration/issues/71)) ([603438c](https://github.com/googleapis/nodejs-vmmigration/commit/603438c4a72376d71f87d16ef65de11e1e94589a)) +* Use _gaxModule when accessing gax for bundling ([#59](https://github.com/googleapis/nodejs-vmmigration/issues/59)) ([a74d392](https://github.com/googleapis/nodejs-vmmigration/commit/a74d39272844d45c1730eafc416a88c049499b18)) + +## [2.2.0](https://github.com/googleapis/nodejs-vmmigration/compare/v2.1.0...v2.2.0) (2022-08-23) + + +### Features + +* add upgrade appliance method, update other methods ([#53](https://github.com/googleapis/nodejs-vmmigration/issues/53)) ([5271100](https://github.com/googleapis/nodejs-vmmigration/commit/5271100c96928df3fd032e64718c19522c66d99e)) + + +### Bug Fixes + +* better support for fallback mode ([#55](https://github.com/googleapis/nodejs-vmmigration/issues/55)) ([d3c2f2d](https://github.com/googleapis/nodejs-vmmigration/commit/d3c2f2d3e730bf8d3c8168cb6fbc567f2fe01159)) +* change import long to require ([#56](https://github.com/googleapis/nodejs-vmmigration/issues/56)) ([7eb23fd](https://github.com/googleapis/nodejs-vmmigration/commit/7eb23fdc358abad1d0dc6432432732c2b75091a2)) +* remove pip install statements ([#1546](https://github.com/googleapis/nodejs-vmmigration/issues/1546)) ([#57](https://github.com/googleapis/nodejs-vmmigration/issues/57)) ([ad4ccd1](https://github.com/googleapis/nodejs-vmmigration/commit/ad4ccd1032c48002770bff672d2781bd63c1e692)) + +## [2.1.0](https://github.com/googleapis/nodejs-vmmigration/compare/v2.0.0...v2.1.0) (2022-07-13) + + +### Features + +* support regapic LRO ([#49](https://github.com/googleapis/nodejs-vmmigration/issues/49)) ([8a8ba70](https://github.com/googleapis/nodejs-vmmigration/commit/8a8ba705e8d956e080cc8ee23cf01b1605166283)) + +## [2.0.0](https://github.com/googleapis/nodejs-vmmigration/compare/v1.0.0...v2.0.0) (2022-05-19) + + +### ⚠ BREAKING CHANGES + +* update library to use Node 12 (#44) + +### Build System + +* update library to use Node 12 ([#44](https://github.com/googleapis/nodejs-vmmigration/issues/44)) ([fb018e1](https://github.com/googleapis/nodejs-vmmigration/commit/fb018e1b1eab36f07dfe5fc5d8279f1630271fb4)) + +## [1.0.0](https://github.com/googleapis/nodejs-vmmigration/compare/v0.2.0...v1.0.0) (2022-03-23) + + +### Features + +* promote to stable ([#31](https://github.com/googleapis/nodejs-vmmigration/issues/31)) ([edfa50a](https://github.com/googleapis/nodejs-vmmigration/commit/edfa50a047cf5968b75cd95b38d3c2953dd1cdca)) + +## 0.2.0 (2021-12-23) + + +### Features + +* initial generation of library ([#1](https://www.github.com/googleapis/nodejs-vmmigration/issues/1)) ([eccd6fb](https://www.github.com/googleapis/nodejs-vmmigration/commit/eccd6fb354e54b8077f8fa044bf857c6b2bf7378)) +* initial stub of library ([761868c](https://www.github.com/googleapis/nodejs-vmmigration/commit/761868c602c4857f5ef9517c478f034a65e97765)) + + +### Bug Fixes + +* **release:** release as pre-major ([#6](https://www.github.com/googleapis/nodejs-vmmigration/issues/6)) ([bedb2b7](https://www.github.com/googleapis/nodejs-vmmigration/commit/bedb2b7c0e2816742235d7b7e6a3b9325fb65344)) diff --git a/packages/google-cloud-vmmigration/CODE_OF_CONDUCT.md b/packages/google-cloud-vmmigration/CODE_OF_CONDUCT.md new file mode 100644 index 00000000000..2add2547a81 --- /dev/null +++ b/packages/google-cloud-vmmigration/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-vmmigration/CONTRIBUTING.md b/packages/google-cloud-vmmigration/CONTRIBUTING.md new file mode 100644 index 00000000000..1fde16042ad --- /dev/null +++ b/packages/google-cloud-vmmigration/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 Migrate for Compute Engine 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=vmmigration.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/getting-started \ No newline at end of file diff --git a/packages/google-cloud-vmmigration/LICENSE b/packages/google-cloud-vmmigration/LICENSE new file mode 100644 index 00000000000..d6456956733 --- /dev/null +++ b/packages/google-cloud-vmmigration/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-vmmigration/README.md b/packages/google-cloud-vmmigration/README.md new file mode 100644 index 00000000000..04da15ad8b2 --- /dev/null +++ b/packages/google-cloud-vmmigration/README.md @@ -0,0 +1,192 @@ +[//]: # "This README.md file is auto-generated, all changes to this file will be lost." +[//]: # "To regenerate it, use `python -m synthtool`." +Google Cloud Platform logo + +# [Migrate for Compute Engine: Node.js Client](https://github.com/googleapis/nodejs-vmmigration) + +[![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/vmmigration.svg)](https://www.npmjs.org/package/@google-cloud/vmmigration) + + + + +vmmigration client for Node.js + + +A comprehensive list of changes in each version may be found in +[the CHANGELOG](https://github.com/googleapis/nodejs-vmmigration/blob/main/CHANGELOG.md). + +* [Migrate for Compute Engine Node.js Client API Reference][client-docs] +* [Migrate for Compute Engine Documentation][product-docs] +* [github.com/googleapis/nodejs-vmmigration](https://github.com/googleapis/nodejs-vmmigration) + +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 Migrate for Compute Engine 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/vmmigration +``` + + +### Using the client library + +```javascript +/** + * TODO(developer): Uncomment these variables before running the sample. + */ +/** + * Required. The parent, which owns this collection of targets. + */ +// const parent = 'abc123' +/** + * Optional. The maximum number of targets to return. The service may return + * fewer than this value. If unspecified, at most 500 targets will be + * returned. The maximum value is 1000; values above 1000 will be coerced to + * 1000. + */ +// const pageSize = 1234 +/** + * Required. A page token, received from a previous `ListTargets` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListTargets` must + * match the call that provided the page token. + */ +// const pageToken = 'abc123' +/** + * Optional. The filter request. + */ +// const filter = 'abc123' +/** + * Optional. the order by fields for the result. + */ +// const orderBy = 'abc123' + +// Imports the Vmmigration library +const {VmMigrationClient} = require('@google-cloud/vmmigration').v1; + +// Instantiates a client +const vmmigrationClient = new VmMigrationClient(); + +async function callListTargetProjects() { + // Construct request + const request = { + parent, + pageToken, + }; + + // Run request + const iterable = await vmmigrationClient.listTargetProjectsAsync(request); + for await (const response of iterable) { + console.log(response); + } +} + +callListTargetProjects(); + +``` + + + +## Samples + +Samples are in the [`samples/`](https://github.com/googleapis/nodejs-vmmigration/tree/main/samples) directory. Each sample's `README.md` has instructions for running its sample. + +| Sample | Source Code | Try it | +| --------------------------- | --------------------------------- | ------ | +| Quickstart | [source code](https://github.com/googleapis/nodejs-vmmigration/blob/main/samples/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-vmmigration&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) | + + + +The [Migrate for Compute Engine 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/vmmigration@legacy-8` installs client libraries +for versions compatible with Node.js 8. + +## Versioning + +This library follows [Semantic Versioning](http://semver.org/). + + + +This library is considered to be **stable**. The code surface will not change in backwards-incompatible ways +unless absolutely necessary (e.g. because of critical security issues) or with +an extensive deprecation period. Issues and requests against **stable** libraries +are addressed with the highest priority. + + + + + + +More Information: [Google Cloud Platform Launch Stages][launch_stages] + +[launch_stages]: https://cloud.google.com/terms/launch-stages + +## Contributing + +Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/nodejs-vmmigration/blob/main/CONTRIBUTING.md). + +Please note that this `README.md`, the `samples/README.md`, +and a variety of configuration files in this repository (including `.nycrc` and `tsconfig.json`) +are generated from a central template. To edit one of these files, make an edit +to its templates in +[directory](https://github.com/googleapis/synthtool). + +## License + +Apache Version 2.0 + +See [LICENSE](https://github.com/googleapis/nodejs-vmmigration/blob/main/LICENSE) + +[client-docs]: https://cloud.google.com/nodejs/docs/reference/vmmigration/latest +[product-docs]: https://cloud.google.com/migrate/compute-engine/ +[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=vmmigration.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/getting-started diff --git a/packages/google-cloud-vmmigration/linkinator.config.json b/packages/google-cloud-vmmigration/linkinator.config.json new file mode 100644 index 00000000000..befd23c8633 --- /dev/null +++ b/packages/google-cloud-vmmigration/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-vmmigration/package.json b/packages/google-cloud-vmmigration/package.json new file mode 100644 index 00000000000..6a0195f42ae --- /dev/null +++ b/packages/google-cloud-vmmigration/package.json @@ -0,0 +1,67 @@ +{ + "name": "@google-cloud/vmmigration", + "version": "2.2.1", + "description": "vmmigration client for Node.js", + "repository": "googleapis/nodejs-vmmigration", + "license": "Apache-2.0", + "author": "Google LLC", + "main": "build/src/index.js", + "files": [ + "build/src", + "build/protos" + ], + "keywords": [ + "google apis client", + "google api client", + "google apis", + "google api", + "google", + "google cloud platform", + "google cloud", + "cloud", + "google vmmigration", + "vmmigration", + "vmmigration service" + ], + "scripts": { + "clean": "gts clean", + "compile": "tsc -p . && cp -r protos build/", + "compile-protos": "compileProtos src", + "docs": "jsdoc -c .jsdoc.js", + "predocs-test": "npm run docs", + "docs-test": "linkinator docs", + "fix": "gts fix", + "lint": "gts check", + "prepare": "npm run compile-protos && npm run compile", + "system-test": "c8 mocha build/system-test", + "test": "c8 mocha build/test", + "samples-test": "cd samples/ && npm link ../ && npm test && cd ../", + "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.7.2", + "gts": "^3.1.0", + "jsdoc": "^4.0.0", + "jsdoc-fresh": "^2.0.0", + "jsdoc-region-tag": "^2.0.0", + "linkinator": "^4.0.0", + "mocha": "^9.2.2", + "null-loader": "^4.0.1", + "pack-n-play": "^1.0.0-2", + "sinon": "^14.0.0", + "ts-loader": "^9.1.2", + "typescript": "^4.6.4", + "webpack": "^5.36.2", + "webpack-cli": "^4.7.0" + }, + "engines": { + "node": ">=12.0.0" + } +} diff --git a/packages/google-cloud-vmmigration/protos/google/cloud/vmmigration/v1/vmmigration.proto b/packages/google-cloud-vmmigration/protos/google/cloud/vmmigration/v1/vmmigration.proto new file mode 100644 index 00000000000..d5dfe9e0ddc --- /dev/null +++ b/packages/google-cloud-vmmigration/protos/google/cloud/vmmigration/v1/vmmigration.proto @@ -0,0 +1,2901 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.vmmigration.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; +import "google/rpc/error_details.proto"; +import "google/rpc/status.proto"; + +option csharp_namespace = "Google.Cloud.VMMigration.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/vmmigration/v1;vmmigration"; +option java_multiple_files = true; +option java_outer_classname = "VmMigrationProto"; +option java_package = "com.google.cloud.vmmigration.v1"; +option php_namespace = "Google\\Cloud\\VMMigration\\V1"; +option ruby_package = "Google::Cloud::VMMigration::V1"; + +// VM Migration Service +service VmMigration { + option (google.api.default_host) = "vmmigration.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Lists Sources in a given project and location. + rpc ListSources(ListSourcesRequest) returns (ListSourcesResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/sources" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of a single Source. + rpc GetSource(GetSourceRequest) returns (Source) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/sources/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a new Source in a given project and location. + rpc CreateSource(CreateSourceRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/sources" + body: "source" + }; + option (google.api.method_signature) = "parent,source,source_id"; + option (google.longrunning.operation_info) = { + response_type: "Source" + metadata_type: "OperationMetadata" + }; + } + + // Updates the parameters of a single Source. + rpc UpdateSource(UpdateSourceRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{source.name=projects/*/locations/*/sources/*}" + body: "source" + }; + option (google.api.method_signature) = "source,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "Source" + metadata_type: "OperationMetadata" + }; + } + + // Deletes a single Source. + rpc DeleteSource(DeleteSourceRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/sources/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OperationMetadata" + }; + } + + // List remote source's inventory of VMs. + // The remote source is the onprem vCenter (remote in the sense it's not in + // Compute Engine). The inventory describes the list of existing VMs in that + // source. Note that this operation lists the VMs on the remote source, as + // opposed to listing the MigratingVms resources in the vmmigration service. + rpc FetchInventory(FetchInventoryRequest) returns (FetchInventoryResponse) { + option (google.api.http) = { + get: "/v1/{source=projects/*/locations/*/sources/*}:fetchInventory" + }; + option (google.api.method_signature) = "source"; + } + + // Lists Utilization Reports of the given Source. + rpc ListUtilizationReports(ListUtilizationReportsRequest) + returns (ListUtilizationReportsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/sources/*}/utilizationReports" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets a single Utilization Report. + rpc GetUtilizationReport(GetUtilizationReportRequest) + returns (UtilizationReport) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/sources/*/utilizationReports/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a new UtilizationReport. + rpc CreateUtilizationReport(CreateUtilizationReportRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*/sources/*}/utilizationReports" + body: "utilization_report" + }; + option (google.api.method_signature) = + "parent,utilization_report,utilization_report_id"; + option (google.longrunning.operation_info) = { + response_type: "UtilizationReport" + metadata_type: "OperationMetadata" + }; + } + + // Deletes a single Utilization Report. + rpc DeleteUtilizationReport(DeleteUtilizationReportRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/sources/*/utilizationReports/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OperationMetadata" + }; + } + + // Lists DatacenterConnectors in a given Source. + rpc ListDatacenterConnectors(ListDatacenterConnectorsRequest) + returns (ListDatacenterConnectorsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/sources/*}/datacenterConnectors" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of a single DatacenterConnector. + rpc GetDatacenterConnector(GetDatacenterConnectorRequest) + returns (DatacenterConnector) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/sources/*/datacenterConnectors/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a new DatacenterConnector in a given Source. + rpc CreateDatacenterConnector(CreateDatacenterConnectorRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*/sources/*}/datacenterConnectors" + body: "datacenter_connector" + }; + option (google.api.method_signature) = + "parent,datacenter_connector,datacenter_connector_id"; + option (google.longrunning.operation_info) = { + response_type: "DatacenterConnector" + metadata_type: "OperationMetadata" + }; + } + + // Deletes a single DatacenterConnector. + rpc DeleteDatacenterConnector(DeleteDatacenterConnectorRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/sources/*/datacenterConnectors/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OperationMetadata" + }; + } + + // Upgrades the appliance relate to this DatacenterConnector to the in-place + // updateable version. + rpc UpgradeAppliance(UpgradeApplianceRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{datacenter_connector=projects/*/locations/*/sources/*/datacenterConnectors/*}:upgradeAppliance" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "UpgradeApplianceResponse" + metadata_type: "OperationMetadata" + }; + } + + // Creates a new MigratingVm in a given Source. + rpc CreateMigratingVm(CreateMigratingVmRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*/sources/*}/migratingVms" + body: "migrating_vm" + }; + option (google.api.method_signature) = + "parent,migrating_vm,migrating_vm_id"; + option (google.longrunning.operation_info) = { + response_type: "MigratingVm" + metadata_type: "OperationMetadata" + }; + } + + // Lists MigratingVms in a given Source. + rpc ListMigratingVms(ListMigratingVmsRequest) + returns (ListMigratingVmsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/sources/*}/migratingVms" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of a single MigratingVm. + rpc GetMigratingVm(GetMigratingVmRequest) returns (MigratingVm) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/sources/*/migratingVms/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Updates the parameters of a single MigratingVm. + rpc UpdateMigratingVm(UpdateMigratingVmRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{migrating_vm.name=projects/*/locations/*/sources/*/migratingVms/*}" + body: "migrating_vm" + }; + option (google.api.method_signature) = "migrating_vm,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "MigratingVm" + metadata_type: "OperationMetadata" + }; + } + + // Deletes a single MigratingVm. + rpc DeleteMigratingVm(DeleteMigratingVmRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/sources/*/migratingVms/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OperationMetadata" + }; + } + + // Starts migration for a VM. Starts the process of uploading + // data and creating snapshots, in replication cycles scheduled by the policy. + rpc StartMigration(StartMigrationRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{migrating_vm=projects/*/locations/*/sources/*/migratingVms/*}:startMigration" + body: "*" + }; + option (google.api.method_signature) = "migrating_vm"; + option (google.longrunning.operation_info) = { + response_type: "StartMigrationResponse" + metadata_type: "OperationMetadata" + }; + } + + // Resumes a migration for a VM. When called on a paused migration, will start + // the process of uploading data and creating snapshots; when called on a + // completed cut-over migration, will update the migration to active state and + // start the process of uploading data and creating snapshots. + rpc ResumeMigration(ResumeMigrationRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{migrating_vm=projects/*/locations/*/sources/*/migratingVms/*}:resumeMigration" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "ResumeMigrationResponse" + metadata_type: "OperationMetadata" + }; + } + + // Pauses a migration for a VM. If cycle tasks are running they will be + // cancelled, preserving source task data. Further replication cycles will not + // be triggered while the VM is paused. + rpc PauseMigration(PauseMigrationRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{migrating_vm=projects/*/locations/*/sources/*/migratingVms/*}:pauseMigration" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "PauseMigrationResponse" + metadata_type: "OperationMetadata" + }; + } + + // Marks a migration as completed, deleting migration resources that are no + // longer being used. Only applicable after cutover is done. + rpc FinalizeMigration(FinalizeMigrationRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{migrating_vm=projects/*/locations/*/sources/*/migratingVms/*}:finalizeMigration" + body: "*" + }; + option (google.api.method_signature) = "migrating_vm"; + option (google.longrunning.operation_info) = { + response_type: "FinalizeMigrationResponse" + metadata_type: "OperationMetadata" + }; + } + + // Initiates a Clone of a specific migrating VM. + rpc CreateCloneJob(CreateCloneJobRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*/sources/*/migratingVms/*}/cloneJobs" + body: "clone_job" + }; + option (google.api.method_signature) = "parent,clone_job,clone_job_id"; + option (google.longrunning.operation_info) = { + response_type: "CloneJob" + metadata_type: "OperationMetadata" + }; + } + + // Initiates the cancellation of a running clone job. + rpc CancelCloneJob(CancelCloneJobRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/sources/*/migratingVms/*/cloneJobs/*}:cancel" + body: "*" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "CancelCloneJobResponse" + metadata_type: "OperationMetadata" + }; + } + + // Lists CloneJobs of a given migrating VM. + rpc ListCloneJobs(ListCloneJobsRequest) returns (ListCloneJobsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/sources/*/migratingVms/*}/cloneJobs" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of a single CloneJob. + rpc GetCloneJob(GetCloneJobRequest) returns (CloneJob) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/sources/*/migratingVms/*/cloneJobs/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Initiates a Cutover of a specific migrating VM. + // The returned LRO is completed when the cutover job resource is created + // and the job is initiated. + rpc CreateCutoverJob(CreateCutoverJobRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*/sources/*/migratingVms/*}/cutoverJobs" + body: "cutover_job" + }; + option (google.api.method_signature) = "parent,cutover_job,cutover_job_id"; + option (google.longrunning.operation_info) = { + response_type: "CutoverJob" + metadata_type: "OperationMetadata" + }; + } + + // Initiates the cancellation of a running cutover job. + rpc CancelCutoverJob(CancelCutoverJobRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/sources/*/migratingVms/*/cutoverJobs/*}:cancel" + body: "*" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "CancelCutoverJobResponse" + metadata_type: "OperationMetadata" + }; + } + + // Lists CutoverJobs of a given migrating VM. + rpc ListCutoverJobs(ListCutoverJobsRequest) + returns (ListCutoverJobsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/sources/*/migratingVms/*}/cutoverJobs" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of a single CutoverJob. + rpc GetCutoverJob(GetCutoverJobRequest) returns (CutoverJob) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/sources/*/migratingVms/*/cutoverJobs/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists Groups in a given project and location. + rpc ListGroups(ListGroupsRequest) returns (ListGroupsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/groups" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of a single Group. + rpc GetGroup(GetGroupRequest) returns (Group) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/groups/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a new Group in a given project and location. + rpc CreateGroup(CreateGroupRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/groups" + body: "group" + }; + option (google.api.method_signature) = "parent,group,group_id"; + option (google.longrunning.operation_info) = { + response_type: "Group" + metadata_type: "OperationMetadata" + }; + } + + // Updates the parameters of a single Group. + rpc UpdateGroup(UpdateGroupRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{group.name=projects/*/locations/*/groups/*}" + body: "group" + }; + option (google.api.method_signature) = "group,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "Group" + metadata_type: "OperationMetadata" + }; + } + + // Deletes a single Group. + rpc DeleteGroup(DeleteGroupRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/groups/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OperationMetadata" + }; + } + + // Adds a MigratingVm to a Group. + rpc AddGroupMigration(AddGroupMigrationRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{group=projects/*/locations/*/groups/*}:addGroupMigration" + body: "*" + }; + option (google.api.method_signature) = "group"; + option (google.longrunning.operation_info) = { + response_type: "AddGroupMigrationResponse" + metadata_type: "OperationMetadata" + }; + } + + // Removes a MigratingVm from a Group. + rpc RemoveGroupMigration(RemoveGroupMigrationRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{group=projects/*/locations/*/groups/*}:removeGroupMigration" + body: "*" + }; + option (google.api.method_signature) = "group"; + option (google.longrunning.operation_info) = { + response_type: "RemoveGroupMigrationResponse" + metadata_type: "OperationMetadata" + }; + } + + // Lists TargetProjects in a given project. + // + // NOTE: TargetProject is a global resource; hence the only supported value + // for location is `global`. + rpc ListTargetProjects(ListTargetProjectsRequest) + returns (ListTargetProjectsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/targetProjects" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of a single TargetProject. + // + // NOTE: TargetProject is a global resource; hence the only supported value + // for location is `global`. + rpc GetTargetProject(GetTargetProjectRequest) returns (TargetProject) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/targetProjects/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a new TargetProject in a given project. + // + // NOTE: TargetProject is a global resource; hence the only supported value + // for location is `global`. + rpc CreateTargetProject(CreateTargetProjectRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/targetProjects" + body: "target_project" + }; + option (google.api.method_signature) = + "parent,target_project,target_project_id"; + option (google.longrunning.operation_info) = { + response_type: "TargetProject" + metadata_type: "OperationMetadata" + }; + } + + // Updates the parameters of a single TargetProject. + // + // NOTE: TargetProject is a global resource; hence the only supported value + // for location is `global`. + rpc UpdateTargetProject(UpdateTargetProjectRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{target_project.name=projects/*/locations/*/targetProjects/*}" + body: "target_project" + }; + option (google.api.method_signature) = "target_project,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "TargetProject" + metadata_type: "OperationMetadata" + }; + } + + // Deletes a single TargetProject. + // + // NOTE: TargetProject is a global resource; hence the only supported value + // for location is `global`. + rpc DeleteTargetProject(DeleteTargetProjectRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/targetProjects/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OperationMetadata" + }; + } +} + +// Controls the level of details of a Utilization Report. +enum UtilizationReportView { + // The default / unset value. + // The API will default to FULL on single report request and BASIC for + // multiple reports request. + UTILIZATION_REPORT_VIEW_UNSPECIFIED = 0; + + // Get the report metadata, without the list of VMs and their utilization + // info. + BASIC = 1; + + // Include everything. + FULL = 2; +} + +// Controls the level of details of a Migrating VM. +enum MigratingVmView { + // View is unspecified. The API will fallback to the default value. + MIGRATING_VM_VIEW_UNSPECIFIED = 0; + + // Get the migrating VM basic details. + // The basic details do not include the recent clone jobs and recent cutover + // jobs lists. + MIGRATING_VM_VIEW_BASIC = 1; + + // Include everything. + MIGRATING_VM_VIEW_FULL = 2; +} + +// Types of disks supported for Compute Engine VM. +enum ComputeEngineDiskType { + // An unspecified disk type. Will be used as STANDARD. + COMPUTE_ENGINE_DISK_TYPE_UNSPECIFIED = 0; + + // A Standard disk type. + COMPUTE_ENGINE_DISK_TYPE_STANDARD = 1; + + // SSD hard disk type. + COMPUTE_ENGINE_DISK_TYPE_SSD = 2; + + // An alternative to SSD persistent disks that balance performance and + // cost. + COMPUTE_ENGINE_DISK_TYPE_BALANCED = 3; +} + +// Types of licenses used in OS adaptation. +enum ComputeEngineLicenseType { + // The license type is the default for the OS. + COMPUTE_ENGINE_LICENSE_TYPE_DEFAULT = 0; + + // The license type is Pay As You Go license type. + COMPUTE_ENGINE_LICENSE_TYPE_PAYG = 1; + + // The license type is Bring Your Own License type. + COMPUTE_ENGINE_LICENSE_TYPE_BYOL = 2; +} + +// Possible values for vm boot option. +enum ComputeEngineBootOption { + // The boot option is unknown. + COMPUTE_ENGINE_BOOT_OPTION_UNSPECIFIED = 0; + + // The boot option is EFI. + COMPUTE_ENGINE_BOOT_OPTION_EFI = 1; + + // The boot option is BIOS. + COMPUTE_ENGINE_BOOT_OPTION_BIOS = 2; +} + +// ReplicationCycle contains information about the current replication cycle +// status. +message ReplicationCycle { + // The time the replication cycle has started. + google.protobuf.Timestamp start_time = 1; + + // The current progress in percentage of this cycle. + int32 progress_percent = 5; +} + +// ReplicationSync contain information about the last replica sync to the cloud. +message ReplicationSync { + // The most updated snapshot created time in the source that finished + // replication. + google.protobuf.Timestamp last_sync_time = 1; +} + +// MigratingVm describes the VM that will be migrated from a Source environment +// and its replication state. +message MigratingVm { + option (google.api.resource) = { + type: "vmmigration.googleapis.com/MigratingVm" + pattern: "projects/{project}/locations/{location}/sources/{source}/migratingVms/{migrating_vm}" + }; + + // The possible values of the state/health of source VM. + enum State { + // The state was not sampled by the health checks yet. + STATE_UNSPECIFIED = 0; + + // The VM in the source is being verified. + PENDING = 1; + + // The source VM was verified, and it's ready to start replication. + READY = 2; + + // Migration is going through the first sync cycle. + FIRST_SYNC = 3; + + // The replication is active, and it's running or scheduled to run. + ACTIVE = 4; + + // The source VM is being turned off, and a final replication is currently + // running. + CUTTING_OVER = 7; + + // The source VM was stopped and replicated. The replication is currently + // paused. + CUTOVER = 8; + + // A cutover job is active and replication cycle is running the final sync. + FINAL_SYNC = 9; + + // The replication was paused by the user and no cycles are scheduled to + // run. + PAUSED = 10; + + // The migrating VM is being finalized and migration resources are being + // removed. + FINALIZING = 11; + + // The replication process is done. The migrating VM is finalized and no + // longer consumes billable resources. + FINALIZED = 12; + + // The replication process encountered an unrecoverable error and was + // aborted. + ERROR = 13; + } + + // The default configuration of the target VM that will be created in GCP as a + // result of the migration. + oneof target_vm_defaults { + // Details of the target VM in Compute Engine. + ComputeEngineTargetDefaults compute_engine_target_defaults = 26; + } + + // Output only. The identifier of the MigratingVm. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The unique ID of the VM in the source. + // The VM's name in vSphere can be changed, so this is not the VM's name but + // rather its moRef id. This id is of the form vm-. + string source_vm_id = 2; + + // The display name attached to the MigratingVm by the user. + string display_name = 18; + + // The description attached to the migrating VM by the user. + string description = 3; + + // The replication schedule policy. + SchedulePolicy policy = 8; + + // Output only. The time the migrating VM was created (this refers to this + // resource and not to the time it was installed in the source). + google.protobuf.Timestamp create_time = 9 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The last time the migrating VM resource was updated. + google.protobuf.Timestamp update_time = 10 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The most updated snapshot created time in the source that + // finished replication. + ReplicationSync last_sync = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. State of the MigratingVm. + State state = 23 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The last time the migrating VM state was updated. + google.protobuf.Timestamp state_time = 22 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The percentage progress of the current running replication + // cycle. + ReplicationCycle current_sync_info = 13 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The group this migrating vm is included in, if any. The group + // is represented by the full path of the appropriate + // [Group][google.cloud.vmmigration.v1.Group] resource. + string group = 15 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + child_type: "vmmigration.googleapis.com/Group" + } + ]; + + // The labels of the migrating VM. + map labels = 16; + + // Output only. The recent [clone jobs][google.cloud.vmmigration.v1.CloneJob] + // performed on the migrating VM. This field holds the vm's last completed + // clone job and the vm's running clone job, if one exists. + // Note: To have this field populated you need to explicitly request it via + // the "view" parameter of the Get/List request. + repeated CloneJob recent_clone_jobs = 17 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Provides details on the state of the Migrating VM in case of + // an error in replication. + google.rpc.Status error = 19 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The recent cutover jobs performed on the migrating VM. + // This field holds the vm's last completed cutover job and the vm's + // running cutover job, if one exists. + // Note: To have this field populated you need to explicitly request it via + // the "view" parameter of the Get/List request. + repeated CutoverJob recent_cutover_jobs = 20 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// CloneJob describes the process of creating a clone of a +// [MigratingVM][google.cloud.vmmigration.v1.MigratingVm] to the +// requested target based on the latest successful uploaded snapshots. +// While the migration cycles of a MigratingVm take place, it is possible to +// verify the uploaded VM can be started in the cloud, by creating a clone. The +// clone can be created without any downtime, and it is created using the latest +// snapshots which are already in the cloud. The cloneJob is only responsible +// for its work, not its products, which means once it is finished, it will +// never touch the instance it created. It will only delete it in case of the +// CloneJob being cancelled or upon failure to clone. +message CloneJob { + option (google.api.resource) = { + type: "vmmigration.googleapis.com/CloneJob" + pattern: "projects/{project}/locations/{location}/sources/{source}/migratingVms/{migrating_vm}/cloneJobs/{clone_job}" + }; + + // Possible states of the clone job. + enum State { + // The state is unknown. This is used for API compatibility only and is not + // used by the system. + STATE_UNSPECIFIED = 0; + + // The clone job has not yet started. + PENDING = 1; + + // The clone job is active and running. + ACTIVE = 2; + + // The clone job finished with errors. + FAILED = 3; + + // The clone job finished successfully. + SUCCEEDED = 4; + + // The clone job was cancelled. + CANCELLED = 5; + + // The clone job is being cancelled. + CANCELLING = 6; + + // OS adaptation is running as part of the clone job to generate license. + ADAPTING_OS = 7; + } + + // Details of the VM to create as the target of this clone job. + oneof target_vm_details { + // Output only. Details of the target VM in Compute Engine. + ComputeEngineTargetDetails compute_engine_target_details = 20 + [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Output only. The time the clone job was created (as an API call, not when + // it was actually created in the target). + google.protobuf.Timestamp create_time = 1 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time the clone job was ended. + google.protobuf.Timestamp end_time = 22 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The name of the clone. + string name = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. State of the clone job. + State state = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time the state was last updated. + google.protobuf.Timestamp state_time = 14 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Provides details for the errors that led to the Clone Job's + // state. + google.rpc.Status error = 17 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// CutoverJob message describes a cutover of a migrating VM. The CutoverJob is +// the operation of shutting down the VM, creating a snapshot and +// clonning the VM using the replicated snapshot. +message CutoverJob { + option (google.api.resource) = { + type: "vmmigration.googleapis.com/CutoverJob" + pattern: "projects/{project}/locations/{location}/sources/{source}/migratingVms/{migrating_vm}/cutoverJobs/{cutover_job}" + }; + + // Possible states of the cutover job. + enum State { + // The state is unknown. This is used for API compatibility only and is not + // used by the system. + STATE_UNSPECIFIED = 0; + + // The cutover job has not yet started. + PENDING = 1; + + // The cutover job finished with errors. + FAILED = 2; + + // The cutover job finished successfully. + SUCCEEDED = 3; + + // The cutover job was cancelled. + CANCELLED = 4; + + // The cutover job is being cancelled. + CANCELLING = 5; + + // The cutover job is active and running. + ACTIVE = 6; + + // OS adaptation is running as part of the cutover job to generate license. + ADAPTING_OS = 7; + } + + // Details of the VM to create as the target of this cutover job. + oneof target_vm_details { + // Output only. Details of the target VM in Compute Engine. + ComputeEngineTargetDetails compute_engine_target_details = 14 + [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Output only. The time the cutover job was created (as an API call, not when + // it was actually created in the target). + google.protobuf.Timestamp create_time = 1 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time the cutover job had finished. + google.protobuf.Timestamp end_time = 16 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The name of the cutover job. + string name = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. State of the cutover job. + State state = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time the state was last updated. + google.protobuf.Timestamp state_time = 6 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The current progress in percentage of the cutover job. + int32 progress_percent = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Provides details for the errors that led to the Cutover Job's + // state. + google.rpc.Status error = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. A message providing possible extra details about the current + // state. + string state_message = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Request message for 'CreateCloneJob' request. +message CreateCloneJobRequest { + // Required. The Clone's parent. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "vmmigration.googleapis.com/CloneJob" + } + ]; + + // Required. The clone job identifier. + string clone_job_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The clone request body. + CloneJob clone_job = 3 [(google.api.field_behavior) = REQUIRED]; + + // A request ID to identify requests. Specify a unique request ID + // so that if you must retry your request, the server will know to ignore + // the request if it has already been completed. The server will guarantee + // that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and t + // he request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 4; +} + +// Request message for 'CancelCloneJob' request. +message CancelCloneJobRequest { + // Required. The clone job id + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "vmmigration.googleapis.com/CloneJob" + } + ]; +} + +// Response message for 'CancelCloneJob' request. +message CancelCloneJobResponse {} + +// Request message for 'ListCloneJobsRequest' request. +message ListCloneJobsRequest { + // Required. The parent, which owns this collection of source VMs. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "vmmigration.googleapis.com/CloneJob" + } + ]; + + // Optional. The maximum number of clone jobs to return. The service may + // return fewer than this value. If unspecified, at most 500 clone jobs will + // be returned. The maximum value is 1000; values above 1000 will be coerced + // to 1000. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Required. A page token, received from a previous `ListCloneJobs` call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to `ListCloneJobs` must + // match the call that provided the page token. + string page_token = 3 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The filter request. + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. the order by fields for the result. + string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for 'ListCloneJobs' request. +message ListCloneJobsResponse { + // Output only. The list of clone jobs response. + repeated CloneJob clone_jobs = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. 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 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Locations that could not be reached. + repeated string unreachable = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Request message for 'GetCloneJob' request. +message GetCloneJobRequest { + // Required. The name of the CloneJob. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "vmmigration.googleapis.com/CloneJob" + } + ]; +} + +// Source message describes a specific vm migration Source resource. It contains +// the source environment information. +message Source { + option (google.api.resource) = { + type: "vmmigration.googleapis.com/Source" + pattern: "projects/{project}/locations/{location}/sources/{source}" + }; + + oneof source_details { + // Vmware type source details. + VmwareSourceDetails vmware = 10; + } + + // Output only. The Source name. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The create time timestamp. + google.protobuf.Timestamp create_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The update time timestamp. + google.protobuf.Timestamp update_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The labels of the source. + map labels = 4; + + // User-provided description of the source. + string description = 6; +} + +// VmwareSourceDetails message describes a specific source details for the +// vmware source type. +message VmwareSourceDetails { + // The credentials username. + string username = 1; + + // Input only. The credentials password. This is write only and can not be + // read in a GET operation. + string password = 2 [(google.api.field_behavior) = INPUT_ONLY]; + + // The ip address of the vcenter this Source represents. + string vcenter_ip = 3; + + // The thumbprint representing the certificate for the vcenter. + string thumbprint = 4; +} + +// DatacenterConnector message describes a connector between the Source and GCP, +// which is installed on a vmware datacenter (an OVA vm installed by the user) +// to connect the Datacenter to GCP and support vm migration data transfer. +message DatacenterConnector { + option (google.api.resource) = { + type: "vmmigration.googleapis.com/DatacenterConnector" + pattern: "projects/{project}/locations/{location}/sources/{source}/datacenterConnectors/{datacenter_connector}" + }; + + // The possible values of the state. + enum State { + // The state is unknown. This is used for API compatibility only and is not + // used by the system. + STATE_UNSPECIFIED = 0; + + // The state was not sampled by the health checks yet. + PENDING = 1; + + // The source was sampled by health checks and is not available. + OFFLINE = 2; + + // The source is available but might not be usable yet due to unvalidated + // credentials or another reason. The credentials referred to are the ones + // to the Source. The error message will contain further details. + FAILED = 3; + + // The source exists and its credentials were verified. + ACTIVE = 4; + } + + // Output only. The time the connector was created (as an API call, not when + // it was actually installed). + google.protobuf.Timestamp create_time = 1 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The last time the connector was updated with an API call. + google.protobuf.Timestamp update_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The connector's name. + string name = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Immutable. A unique key for this connector. This key is internal to the OVA + // connector and is supplied with its creation during the registration process + // and can not be modified. + string registration_id = 12 [(google.api.field_behavior) = IMMUTABLE]; + + // The service account to use in the connector when communicating with the + // cloud. + string service_account = 5; + + // The version running in the DatacenterConnector. This is supplied by the OVA + // connector during the registration process and can not be modified. + string version = 6; + + // Output only. The communication channel between the datacenter connector and + // GCP. + string bucket = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. State of the DatacenterConnector, as determined by the health + // checks. + State state = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time the state was last set. + google.protobuf.Timestamp state_time = 8 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Provides details on the state of the Datacenter Connector in + // case of an error. + google.rpc.Status error = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Appliance OVA version. + // This is the OVA which is manually installed by the user and contains the + // infrastructure for the automatically updatable components on the appliance. + string appliance_infrastructure_version = 13 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Appliance last installed update bundle version. + // This is the version of the automatically updatable components on the + // appliance. + string appliance_software_version = 14 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The available versions for updating this appliance. + AvailableUpdates available_versions = 15 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The status of the current / last upgradeAppliance operation. + UpgradeStatus upgrade_status = 16 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// UpgradeStatus contains information about upgradeAppliance operation. +message UpgradeStatus { + // The possible values of the state. + enum State { + // The state was not sampled by the health checks yet. + STATE_UNSPECIFIED = 0; + + // The upgrade has started. + RUNNING = 1; + + // The upgrade failed. + FAILED = 2; + + // The upgrade finished successfully. + SUCCEEDED = 3; + } + + // The version to upgrade to. + string version = 1; + + // The state of the upgradeAppliance operation. + State state = 2; + + // Provides details on the state of the upgrade operation in case of an error. + google.rpc.Status error = 3; + + // The time the operation was started. + google.protobuf.Timestamp start_time = 4; + + // The version from which we upgraded. + string previous_version = 5; +} + +// Holds informatiom about the available versions for upgrade. +message AvailableUpdates { + // The newest deployable version of the appliance. + // The current appliance can't be updated into this version, and the owner + // must manually deploy this OVA to a new appliance. + ApplianceVersion new_deployable_appliance = 1; + + // The latest version for in place update. + // The current appliance can be updated to this version using the API or m4c + // CLI. + ApplianceVersion in_place_update = 2; +} + +// Describes an appliance version. +message ApplianceVersion { + // The appliance version. + string version = 1; + + // A link for downloading the version. + string uri = 2; + + // Determine whether it's critical to upgrade the appliance to this version. + bool critical = 3; + + // Link to a page that contains the version release notes. + string release_notes_uri = 4; +} + +// Request message for 'ListSources' request. +message ListSourcesRequest { + // Required. The parent, which owns this collection of sources. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "vmmigration.googleapis.com/Source" + } + ]; + + // Optional. The maximum number of sources to return. The service may return + // fewer than this value. If unspecified, at most 500 sources will be + // returned. The maximum value is 1000; values above 1000 will be coerced to + // 1000. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Required. A page token, received from a previous `ListSources` call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to `ListSources` must + // match the call that provided the page token. + string page_token = 3 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The filter request. + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. the order by fields for the result. + string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for 'ListSources' request. +message ListSourcesResponse { + // Output only. The list of sources response. + repeated Source sources = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. 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 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Locations that could not be reached. + repeated string unreachable = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Request message for 'GetSource' request. +message GetSourceRequest { + // Required. The Source name. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "vmmigration.googleapis.com/Source" + } + ]; +} + +// Request message for 'CreateSource' request. +message CreateSourceRequest { + // Required. The Source's parent. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "vmmigration.googleapis.com/Source" + } + ]; + + // Required. The source identifier. + string source_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The create request body. + Source source = 3 [(google.api.field_behavior) = REQUIRED]; + + // A request ID to identify requests. Specify a unique request ID + // so that if you must retry your request, the server will know to ignore + // the request if it has already been completed. The server will guarantee + // that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and t + // he request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 4; +} + +// Update message for 'UpdateSources' request. +message UpdateSourceRequest { + // Field mask is used to specify the fields to be overwritten in the + // Source resource by the update. + // The fields specified in the update_mask are relative to the resource, not + // the full request. A field will be overwritten if it is in the mask. If the + // user does not provide a mask then all fields will be overwritten. + google.protobuf.FieldMask update_mask = 1; + + // Required. The update request body. + Source source = 2 [(google.api.field_behavior) = REQUIRED]; + + // A request ID to identify requests. Specify a unique request ID + // so that if you must retry your request, the server will know to ignore + // the request if it has already been completed. The server will guarantee + // that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and t + // he request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 3; +} + +// Request message for 'DeleteSource' request. +message DeleteSourceRequest { + // Required. The Source name. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "vmmigration.googleapis.com/Source" + } + ]; + + // Optional. A request ID to identify requests. Specify a unique request ID + // so that if you must retry your request, the server will know to ignore + // the request if it has already been completed. The server will guarantee + // that for at least 60 minutes after the first request. + // + // For example, consider a situation where you make an initial request and t + // he request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for +// [fetchInventory][google.cloud.vmmigration.v1.VmMigration.FetchInventory]. +message FetchInventoryRequest { + // Required. The name of the Source. + string source = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "vmmigration.googleapis.com/Source" + } + ]; + + // If this flag is set to true, the source will be queried instead of using + // cached results. Using this flag will make the call slower. + bool force_refresh = 2; +} + +// VmwareVmDetails describes a VM in vCenter. +message VmwareVmDetails { + // Possible values for the power state of the VM. + enum PowerState { + // Power state is not specified. + POWER_STATE_UNSPECIFIED = 0; + + // The VM is turned ON. + ON = 1; + + // The VM is turned OFF. + OFF = 2; + + // The VM is suspended. This is similar to hibernation or sleep mode. + SUSPENDED = 3; + } + + // Possible values for vm boot option. + enum BootOption { + // The boot option is unknown. + BOOT_OPTION_UNSPECIFIED = 0; + + // The boot option is EFI. + EFI = 1; + + // The boot option is BIOS. + BIOS = 2; + } + + // The VM's id in the source (note that this is not the MigratingVm's id). + // This is the moref id of the VM. + string vm_id = 1; + + // The id of the vCenter's datacenter this VM is contained in. + string datacenter_id = 2; + + // The descriptive name of the vCenter's datacenter this VM is contained in. + string datacenter_description = 3; + + // The unique identifier of the VM in vCenter. + string uuid = 4; + + // The display name of the VM. Note that this is not necessarily unique. + string display_name = 5; + + // The power state of the VM at the moment list was taken. + PowerState power_state = 6; + + // The number of cpus in the VM. + int32 cpu_count = 7; + + // The size of the memory of the VM in MB. + int32 memory_mb = 8; + + // The number of disks the VM has. + int32 disk_count = 9; + + // The total size of the storage allocated to the VM in MB. + int64 committed_storage_mb = 12; + + // The VM's OS. See for example + // https://vdc-repo.vmware.com/vmwb-repository/dcr-public/da47f910-60ac-438b-8b9b-6122f4d14524/16b7274a-bf8b-4b4c-a05e-746f2aa93c8c/doc/vim.vm.GuestOsDescriptor.GuestOsIdentifier.html + // for types of strings this might hold. + string guest_description = 11; + + // Output only. The VM Boot Option. + BootOption boot_option = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// VmwareVmsDetails describes VMs in vCenter. +message VmwareVmsDetails { + // The details of the vmware VMs. + repeated VmwareVmDetails details = 1; +} + +// Response message for +// [fetchInventory][google.cloud.vmmigration.v1.VmMigration.FetchInventory]. +message FetchInventoryResponse { + oneof SourceVms { + // The description of the VMs in a Source of type Vmware. + VmwareVmsDetails vmware_vms = 1; + } + + // Output only. The timestamp when the source was last queried (if the result + // is from the cache). + google.protobuf.Timestamp update_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Utilization report details the utilization (CPU, memory, etc.) of selected +// source VMs. +message UtilizationReport { + option (google.api.resource) = { + type: "vmmigration.googleapis.com/UtilizationReport" + pattern: "projects/{project}/locations/{location}/sources/{source}/utilizationReports/{utilization_report}" + }; + + // Utilization report state. + enum State { + // The state is unknown. This value is not in use. + STATE_UNSPECIFIED = 0; + + // The report is in the making. + CREATING = 1; + + // Report creation completed successfully. + SUCCEEDED = 2; + + // Report creation failed. + FAILED = 3; + } + + // Report time frame options. + enum TimeFrame { + // The time frame was not specified and will default to WEEK. + TIME_FRAME_UNSPECIFIED = 0; + + // One week. + WEEK = 1; + + // One month. + MONTH = 2; + + // One year. + YEAR = 3; + } + + // Output only. The report unique name. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The report display name, as assigned by the user. + string display_name = 2; + + // Output only. Current state of the report. + State state = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time the state was last set. + google.protobuf.Timestamp state_time = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Provides details on the state of the report in case of an + // error. + google.rpc.Status error = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time the report was created (this refers to the time of + // the request, not the time the report creation completed). + google.protobuf.Timestamp create_time = 6 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Time frame of the report. + TimeFrame time_frame = 7; + + // Output only. The point in time when the time frame ends. Notice that the + // time frame is counted backwards. For instance if the "frame_end_time" value + // is 2021/01/20 and the time frame is WEEK then the report covers the week + // between 2021/01/20 and 2021/01/14. + google.protobuf.Timestamp frame_end_time = 8 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Total number of VMs included in the report. + int32 vm_count = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // List of utilization information per VM. + // When sent as part of the request, the "vm_id" field is used in order to + // specify which VMs to include in the report. In that case all other fields + // are ignored. + repeated VmUtilizationInfo vms = 10; +} + +// Utilization information of a single VM. +message VmUtilizationInfo { + oneof VmDetails { + // The description of the VM in a Source of type Vmware. + VmwareVmDetails vmware_vm_details = 1; + } + + // The VM's ID in the source. + string vm_id = 3; + + // Utilization metrics for this VM. + VmUtilizationMetrics utilization = 2; +} + +// Utilization metrics values for a single VM. +message VmUtilizationMetrics { + // Max CPU usage, percent. + int32 cpu_max_percent = 9; + + // Average CPU usage, percent. + int32 cpu_average_percent = 10; + + // Max memory usage, percent. + int32 memory_max_percent = 11; + + // Average memory usage, percent. + int32 memory_average_percent = 12; + + // Max disk IO rate, in kilobytes per second. + int64 disk_io_rate_max_kbps = 13; + + // Average disk IO rate, in kilobytes per second. + int64 disk_io_rate_average_kbps = 14; + + // Max network throughput (combined transmit-rates and receive-rates), in + // kilobytes per second. + int64 network_throughput_max_kbps = 15; + + // Average network throughput (combined transmit-rates and receive-rates), in + // kilobytes per second. + int64 network_throughput_average_kbps = 16; +} + +// Request message for 'ListUtilizationReports' request. +message ListUtilizationReportsRequest { + // Required. The Utilization Reports parent. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "vmmigration.googleapis.com/UtilizationReport" + } + ]; + + // Optional. The level of details of each report. + // Defaults to BASIC. + UtilizationReportView view = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The maximum number of reports to return. The service may return + // fewer than this value. If unspecified, at most 500 reports will be + // returned. The maximum value is 1000; values above 1000 will be coerced to + // 1000. + int32 page_size = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Required. A page token, received from a previous `ListUtilizationReports` + // call. Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to `ListUtilizationReports` + // must match the call that provided the page token. + string page_token = 4 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The filter request. + string filter = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. the order by fields for the result. + string order_by = 6 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for 'ListUtilizationReports' request. +message ListUtilizationReportsResponse { + // Output only. The list of reports. + repeated UtilizationReport utilization_reports = 1 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. 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 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Locations that could not be reached. + repeated string unreachable = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Request message for 'GetUtilizationReport' request. +message GetUtilizationReportRequest { + // Required. The Utilization Report name. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "vmmigration.googleapis.com/UtilizationReport" + } + ]; + + // Optional. The level of details of the report. + // Defaults to FULL + UtilizationReportView view = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for 'CreateUtilizationReport' request. +message CreateUtilizationReportRequest { + // Required. The Utilization Report's parent. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "vmmigration.googleapis.com/UtilizationReport" + } + ]; + + // Required. The report to create. + UtilizationReport utilization_report = 2 + [(google.api.field_behavior) = REQUIRED]; + + // Required. The ID to use for the report, which will become the final + // component of the reports's resource name. + // + // This value maximum length is 63 characters, and valid characters + // are /[a-z][0-9]-/. It must start with an english letter and must not + // end with a hyphen. + string utilization_report_id = 3 [(google.api.field_behavior) = REQUIRED]; + + // A request ID to identify requests. Specify a unique request ID + // so that if you must retry your request, the server will know to ignore + // the request if it has already been completed. The server will guarantee + // that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and t + // he request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 4; +} + +// Request message for 'DeleteUtilizationReport' request. +message DeleteUtilizationReportRequest { + // Required. The Utilization Report name. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "vmmigration.googleapis.com/UtilizationReport" + } + ]; + + // Optional. A request ID to identify requests. Specify a unique request ID + // so that if you must retry your request, the server will know to ignore + // the request if it has already been completed. The server will guarantee + // that for at least 60 minutes after the first request. + // + // For example, consider a situation where you make an initial request and t + // he request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for 'ListDatacenterConnectors' request. +message ListDatacenterConnectorsResponse { + // Output only. The list of sources response. + repeated DatacenterConnector datacenter_connectors = 1 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. 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 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Locations that could not be reached. + repeated string unreachable = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Request message for 'GetDatacenterConnector' request. +message GetDatacenterConnectorRequest { + // Required. The name of the DatacenterConnector. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "vmmigration.googleapis.com/DatacenterConnector" + } + ]; +} + +// Request message for 'CreateDatacenterConnector' request. +message CreateDatacenterConnectorRequest { + // Required. The DatacenterConnector's parent. + // Required. The Source in where the new DatacenterConnector will be created. + // For example: + // `projects/my-project/locations/us-central1/sources/my-source` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "vmmigration.googleapis.com/DatacenterConnector" + } + ]; + + // Required. The datacenterConnector identifier. + string datacenter_connector_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The create request body. + DatacenterConnector datacenter_connector = 3 + [(google.api.field_behavior) = REQUIRED]; + + // A request ID to identify requests. Specify a unique request ID + // so that if you must retry your request, the server will know to ignore + // the request if it has already been completed. The server will guarantee + // that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and t + // he request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 4; +} + +// Request message for 'DeleteDatacenterConnector' request. +message DeleteDatacenterConnectorRequest { + // Required. The DatacenterConnector name. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "vmmigration.googleapis.com/DatacenterConnector" + } + ]; + + // A request ID to identify requests. Specify a unique request ID + // so that if you must retry your request, the server will know to ignore + // the request if it has already been completed. The server will guarantee + // that for at least 60 minutes after the first request. + // + // For example, consider a situation where you make an initial request and t + // he request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 2; +} + +// Request message for 'UpgradeAppliance' request. +message UpgradeApplianceRequest { + // Required. The DatacenterConnector name. + string datacenter_connector = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "vmmigration.googleapis.com/DatacenterConnector" + } + ]; + + // A request ID to identify requests. Specify a unique request ID + // so that if you must retry your request, the server will know to ignore + // the request if it has already been completed. The server will guarantee + // that for at least 60 minutes after the first request. + // + // For example, consider a situation where you make an initial request and t + // he request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 2; +} + +// Response message for 'UpgradeAppliance' request. +message UpgradeApplianceResponse {} + +// Request message for 'ListDatacenterConnectors' request. +message ListDatacenterConnectorsRequest { + // Required. The parent, which owns this collection of connectors. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "vmmigration.googleapis.com/DatacenterConnector" + } + ]; + + // Optional. The maximum number of connectors to return. The service may + // return fewer than this value. If unspecified, at most 500 sources will be + // returned. The maximum value is 1000; values above 1000 will be coerced to + // 1000. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Required. A page token, received from a previous `ListDatacenterConnectors` + // call. Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to + // `ListDatacenterConnectors` must match the call that provided the page + // token. + string page_token = 3 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The filter request. + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. the order by fields for the result. + string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// ComputeEngineTargetDefaults is a collection of details for creating a VM in a +// target Compute Engine project. +message ComputeEngineTargetDefaults { + // The name of the VM to create. + string vm_name = 1; + + // The full path of the resource of type TargetProject which represents the + // Compute Engine project in which to create this VM. + string target_project = 2 [(google.api.resource_reference) = { + type: "vmmigration.googleapis.com/TargetProject" + }]; + + // The zone in which to create the VM. + string zone = 3; + + // The machine type series to create the VM with. + string machine_type_series = 4; + + // The machine type to create the VM with. + string machine_type = 5; + + // A map of network tags to associate with the VM. + repeated string network_tags = 6; + + // List of NICs connected to this VM. + repeated NetworkInterface network_interfaces = 7; + + // The service account to associate the VM with. + string service_account = 8; + + // The disk type to use in the VM. + ComputeEngineDiskType disk_type = 9; + + // A map of labels to associate with the VM. + map labels = 10; + + // The license type to use in OS adaptation. + ComputeEngineLicenseType license_type = 11; + + // Output only. The OS license returned from the adaptation module report. + AppliedLicense applied_license = 12 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Compute instance scheduling information (if empty default is used). + ComputeScheduling compute_scheduling = 13; + + // Defines whether the instance has Secure Boot enabled. + // This can be set to true only if the vm boot option is EFI. + bool secure_boot = 14; + + // Output only. The VM Boot Option, as set in the source vm. + ComputeEngineBootOption boot_option = 15 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The metadata key/value pairs to assign to the VM. + map metadata = 16; + + // Additional licenses to assign to the VM. + repeated string additional_licenses = 17; + + // The hostname to assign to the VM. + string hostname = 18; +} + +// ComputeEngineTargetDetails is a collection of details for creating a VM in a +// target Compute Engine project. +message ComputeEngineTargetDetails { + // The name of the VM to create. + string vm_name = 1; + + // The GCP target project ID or project name. + string project = 2; + + // The zone in which to create the VM. + string zone = 3; + + // The machine type series to create the VM with. + string machine_type_series = 4; + + // The machine type to create the VM with. + string machine_type = 5; + + // A map of network tags to associate with the VM. + repeated string network_tags = 6; + + // List of NICs connected to this VM. + repeated NetworkInterface network_interfaces = 7; + + // The service account to associate the VM with. + string service_account = 8; + + // The disk type to use in the VM. + ComputeEngineDiskType disk_type = 9; + + // A map of labels to associate with the VM. + map labels = 10; + + // The license type to use in OS adaptation. + ComputeEngineLicenseType license_type = 11; + + // The OS license returned from the adaptation module report. + AppliedLicense applied_license = 12; + + // Compute instance scheduling information (if empty default is used). + ComputeScheduling compute_scheduling = 13; + + // Defines whether the instance has Secure Boot enabled. + // This can be set to true only if the vm boot option is EFI. + bool secure_boot = 14; + + // The VM Boot Option, as set in the source vm. + ComputeEngineBootOption boot_option = 15; + + // The metadata key/value pairs to assign to the VM. + map metadata = 16; + + // Additional licenses to assign to the VM. + repeated string additional_licenses = 17; + + // The hostname to assign to the VM. + string hostname = 18; +} + +// NetworkInterface represents a NIC of a VM. +message NetworkInterface { + // The network to connect the NIC to. + string network = 1; + + // The subnetwork to connect the NIC to. + string subnetwork = 2; + + // The internal IP to define in the NIC. + // The formats accepted are: `ephemeral` \ ipv4 address \ a named address + // resource full path. + string internal_ip = 3; + + // The external IP to define in the NIC. + string external_ip = 4; +} + +// AppliedLicense holds the license data returned by adaptation module report. +message AppliedLicense { + // License types used in OS adaptation. + enum Type { + // Unspecified license for the OS. + TYPE_UNSPECIFIED = 0; + + // No license available for the OS. + NONE = 1; + + // The license type is Pay As You Go license type. + PAYG = 2; + + // The license type is is Bring Your Own License type. + BYOL = 3; + } + + // The license type that was used in OS adaptation. + Type type = 1; + + // The OS license returned from the adaptation module's report. + string os_license = 2; +} + +// Node Affinity: the configuration of desired nodes onto which this Instance +// could be scheduled. Based on +// https://cloud.google.com/compute/docs/reference/rest/v1/instances/setScheduling +message SchedulingNodeAffinity { + // Possible types of node selection operators. Valid operators are IN for + // affinity and NOT_IN for anti-affinity. + enum Operator { + // An unknown, unexpected behavior. + OPERATOR_UNSPECIFIED = 0; + + // The node resource group should be in these resources affinity. + IN = 1; + + // The node resource group should not be in these resources affinity. + NOT_IN = 2; + } + + // The label key of Node resource to reference. + string key = 1; + + // The operator to use for the node resources specified in the `values` + // parameter. + Operator operator = 2; + + // Corresponds to the label values of Node resource. + repeated string values = 3; +} + +// Scheduling information for VM on maintenance/restart behaviour and +// node allocation in sole tenant nodes. +message ComputeScheduling { + enum OnHostMaintenance { + // An unknown, unexpected behavior. + ON_HOST_MAINTENANCE_UNSPECIFIED = 0; + + // Terminate the instance when the host machine undergoes maintenance. + TERMINATE = 1; + + // Migrate the instance when the host machine undergoes maintenance. + MIGRATE = 2; + } + + // Defines whether the Instance should be automatically restarted whenever + // it is terminated by Compute Engine (not terminated by user). + enum RestartType { + // Unspecified behavior. This will use the default. + RESTART_TYPE_UNSPECIFIED = 0; + + // The Instance should be automatically restarted whenever it is + // terminated by Compute Engine. + AUTOMATIC_RESTART = 1; + + // The Instance isn't automatically restarted whenever it is + // terminated by Compute Engine. + NO_AUTOMATIC_RESTART = 2; + } + + // How the instance should behave when the host machine undergoes + // maintenance that may temporarily impact instance performance. + OnHostMaintenance on_host_maintenance = 1; + + // Whether the Instance should be automatically restarted whenever it is + // terminated by Compute Engine (not terminated by user). + // This configuration is identical to `automaticRestart` field in Compute + // Engine create instance under scheduling. + // It was changed to an enum (instead of a boolean) to match the default + // value in Compute Engine which is automatic restart. + RestartType restart_type = 5; + + // A set of node affinity and anti-affinity configurations for sole tenant + // nodes. + repeated SchedulingNodeAffinity node_affinities = 3; + + // The minimum number of virtual CPUs this instance will consume when + // running on a sole-tenant node. Ignored if no node_affinites are + // configured. + int32 min_node_cpus = 4; +} + +// A policy for scheduling replications. +message SchedulePolicy { + // The idle duration between replication stages. + google.protobuf.Duration idle_duration = 1; + + // A flag to indicate whether to skip OS adaptation during the replication + // sync. OS adaptation is a process where the VM's operating system undergoes + // changes and adaptations to fully function on Compute Engine. + bool skip_os_adaptation = 2; +} + +// Request message for 'CreateMigratingVm' request. +message CreateMigratingVmRequest { + // Required. The MigratingVm's parent. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "vmmigration.googleapis.com/MigratingVm" + } + ]; + + // Required. The migratingVm identifier. + string migrating_vm_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The create request body. + MigratingVm migrating_vm = 3 [(google.api.field_behavior) = REQUIRED]; + + // A request ID to identify requests. Specify a unique request ID + // so that if you must retry your request, the server will know to ignore + // the request if it has already been completed. The server will guarantee + // that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and t + // he request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 4; +} + +// Request message for 'LisMigratingVmsRequest' request. +message ListMigratingVmsRequest { + // Required. The parent, which owns this collection of MigratingVms. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "vmmigration.googleapis.com/MigratingVm" + } + ]; + + // Optional. The maximum number of migrating VMs to return. The service may + // return fewer than this value. If unspecified, at most 500 migrating VMs + // will be returned. The maximum value is 1000; values above 1000 will be + // coerced to 1000. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Required. A page token, received from a previous `ListMigratingVms` call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to `ListMigratingVms` + // must match the call that provided the page token. + string page_token = 3 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The filter request. + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. the order by fields for the result. + string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The level of details of each migrating VM. + MigratingVmView view = 6 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for 'ListMigratingVms' request. +message ListMigratingVmsResponse { + // Output only. The list of Migrating VMs response. + repeated MigratingVm migrating_vms = 1 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. 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 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Locations that could not be reached. + repeated string unreachable = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Request message for 'GetMigratingVm' request. +message GetMigratingVmRequest { + // Required. The name of the MigratingVm. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "vmmigration.googleapis.com/MigratingVm" + } + ]; + + // Optional. The level of details of the migrating VM. + MigratingVmView view = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for 'UpdateMigratingVm' request. +message UpdateMigratingVmRequest { + // Field mask is used to specify the fields to be overwritten in the + // MigratingVm resource by the update. + // The fields specified in the update_mask are relative to the resource, not + // the full request. A field will be overwritten if it is in the mask. If the + // user does not provide a mask then all fields will be overwritten. + google.protobuf.FieldMask update_mask = 1; + + // Required. The update request body. + MigratingVm migrating_vm = 2 [(google.api.field_behavior) = REQUIRED]; + + // A request ID to identify requests. Specify a unique request ID + // so that if you must retry your request, the server will know to ignore + // the request if it has already been completed. The server will guarantee + // that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and t + // he request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 3; +} + +// Request message for 'DeleteMigratingVm' request. +message DeleteMigratingVmRequest { + // Required. The name of the MigratingVm. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "vmmigration.googleapis.com/MigratingVm" + } + ]; +} + +// Request message for 'StartMigrationRequest' request. +message StartMigrationRequest { + // Required. The name of the MigratingVm. + string migrating_vm = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "vmmigration.googleapis.com/MigratingVm" + } + ]; +} + +// Response message for 'StartMigration' request. +message StartMigrationResponse {} + +// Request message for 'PauseMigration' request. +message PauseMigrationRequest { + // Required. The name of the MigratingVm. + string migrating_vm = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "vmmigration.googleapis.com/MigratingVm" + } + ]; +} + +// Response message for 'PauseMigration' request. +message PauseMigrationResponse {} + +// Request message for 'ResumeMigration' request. +message ResumeMigrationRequest { + // Required. The name of the MigratingVm. + string migrating_vm = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "vmmigration.googleapis.com/MigratingVm" + } + ]; +} + +// Response message for 'ResumeMigration' request. +message ResumeMigrationResponse {} + +// Request message for 'FinalizeMigration' request. +message FinalizeMigrationRequest { + // Required. The name of the MigratingVm. + string migrating_vm = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "vmmigration.googleapis.com/MigratingVm" + } + ]; +} + +// Response message for 'FinalizeMigration' request. +message FinalizeMigrationResponse {} + +// TargetProject message represents a target Compute Engine project for a +// migration or a clone. +message TargetProject { + option (google.api.resource) = { + type: "vmmigration.googleapis.com/TargetProject" + pattern: "projects/{project}/locations/{location}/targetProjects/{target_project}" + }; + + // Output only. The name of the target project. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The target project ID (number) or project name. + string project = 2; + + // The target project's description. + string description = 3; + + // Output only. The time this target project resource was created (not related + // to when the Compute Engine project it points to was created). + google.protobuf.Timestamp create_time = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The last time the target project resource was updated. + google.protobuf.Timestamp update_time = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Request message for 'GetTargetProject' call. +message GetTargetProjectRequest { + // Required. The TargetProject name. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "vmmigration.googleapis.com/TargetProject" + } + ]; +} + +// Request message for 'ListTargetProjects' call. +message ListTargetProjectsRequest { + // Required. The parent, which owns this collection of targets. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "vmmigration.googleapis.com/TargetProject" + } + ]; + + // Optional. The maximum number of targets to return. The service may return + // fewer than this value. If unspecified, at most 500 targets will be + // returned. The maximum value is 1000; values above 1000 will be coerced to + // 1000. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Required. A page token, received from a previous `ListTargets` call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to `ListTargets` must + // match the call that provided the page token. + string page_token = 3 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The filter request. + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. the order by fields for the result. + string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for 'ListTargetProjects' call. +message ListTargetProjectsResponse { + // Output only. The list of target response. + repeated TargetProject target_projects = 1 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. 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 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Locations that could not be reached. + repeated string unreachable = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Request message for 'CreateTargetProject' request. +message CreateTargetProjectRequest { + // Required. The TargetProject's parent. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "vmmigration.googleapis.com/TargetProject" + } + ]; + + // Required. The target_project identifier. + string target_project_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The create request body. + TargetProject target_project = 3 [(google.api.field_behavior) = REQUIRED]; + + // A request ID to identify requests. Specify a unique request ID + // so that if you must retry your request, the server will know to ignore + // the request if it has already been completed. The server will guarantee + // that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and t + // he request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 4; +} + +// Update message for 'UpdateTargetProject' request. +message UpdateTargetProjectRequest { + // Field mask is used to specify the fields to be overwritten in the + // TargetProject resource by the update. + // The fields specified in the update_mask are relative to the resource, not + // the full request. A field will be overwritten if it is in the mask. If the + // user does not provide a mask then all fields will be overwritten. + google.protobuf.FieldMask update_mask = 1; + + // Required. The update request body. + TargetProject target_project = 2 [(google.api.field_behavior) = REQUIRED]; + + // A request ID to identify requests. Specify a unique request ID + // so that if you must retry your request, the server will know to ignore + // the request if it has already been completed. The server will guarantee + // that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and t + // he request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 3; +} + +// Request message for 'DeleteTargetProject' request. +message DeleteTargetProjectRequest { + // Required. The TargetProject name. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "vmmigration.googleapis.com/TargetProject" + } + ]; + + // Optional. A request ID to identify requests. Specify a unique request ID + // so that if you must retry your request, the server will know to ignore + // the request if it has already been completed. The server will guarantee + // that for at least 60 minutes after the first request. + // + // For example, consider a situation where you make an initial request and t + // he request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Describes message for 'Group' resource. The Group is a collections of several +// MigratingVms. +message Group { + option (google.api.resource) = { + type: "vmmigration.googleapis.com/Group" + pattern: "projects/{project}/locations/{location}/groups/{group}" + }; + + // Output only. The Group name. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The create time timestamp. + google.protobuf.Timestamp create_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The update time timestamp. + google.protobuf.Timestamp update_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // User-provided description of the group. + string description = 4; + + // Display name is a user defined name for this group which can be updated. + string display_name = 5; +} + +// Request message for 'ListGroups' request. +message ListGroupsRequest { + // Required. The parent, which owns this collection of groups. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "vmmigration.googleapis.com/Group" + } + ]; + + // Optional. The maximum number of groups to return. The service may return + // fewer than this value. If unspecified, at most 500 groups will be + // returned. The maximum value is 1000; values above 1000 will be coerced to + // 1000. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Required. A page token, received from a previous `ListGroups` call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to `ListGroups` must + // match the call that provided the page token. + string page_token = 3 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The filter request. + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. the order by fields for the result. + string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for 'ListGroups' request. +message ListGroupsResponse { + // Output only. The list of groups response. + repeated Group groups = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. 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 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Locations that could not be reached. + repeated string unreachable = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Request message for 'GetGroup' request. +message GetGroupRequest { + // Required. The group name. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "vmmigration.googleapis.com/Group" + } + ]; +} + +// Request message for 'CreateGroup' request. +message CreateGroupRequest { + // Required. The Group's parent. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "vmmigration.googleapis.com/Group" + } + ]; + + // Required. The group identifier. + string group_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The create request body. + Group group = 3 [(google.api.field_behavior) = REQUIRED]; + + // A request ID to identify requests. Specify a unique request ID + // so that if you must retry your request, the server will know to ignore + // the request if it has already been completed. The server will guarantee + // that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and t + // he request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 4; +} + +// Update message for 'UpdateGroups' request. +message UpdateGroupRequest { + // Field mask is used to specify the fields to be overwritten in the + // Group resource by the update. + // The fields specified in the update_mask are relative to the resource, not + // the full request. A field will be overwritten if it is in the mask. If the + // user does not provide a mask then all fields will be overwritten. + google.protobuf.FieldMask update_mask = 1; + + // Required. The update request body. + Group group = 2 [(google.api.field_behavior) = REQUIRED]; + + // A request ID to identify requests. Specify a unique request ID + // so that if you must retry your request, the server will know to ignore + // the request if it has already been completed. The server will guarantee + // that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and t + // he request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 3; +} + +// Request message for 'DeleteGroup' request. +message DeleteGroupRequest { + // Required. The Group name. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "vmmigration.googleapis.com/Group" + } + ]; + + // Optional. A request ID to identify requests. Specify a unique request ID + // so that if you must retry your request, the server will know to ignore + // the request if it has already been completed. The server will guarantee + // that for at least 60 minutes after the first request. + // + // For example, consider a situation where you make an initial request and t + // he request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for 'AddGroupMigration' request. +message AddGroupMigrationRequest { + // Required. The full path name of the Group to add to. + string group = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "vmmigration.googleapis.com/Group" + } + ]; + + // The full path name of the MigratingVm to add. + string migrating_vm = 2 [(google.api.resource_reference) = { + type: "vmmigration.googleapis.com/MigratingVm" + }]; +} + +// Response message for 'AddGroupMigration' request. +message AddGroupMigrationResponse {} + +// Request message for 'RemoveMigration' request. +message RemoveGroupMigrationRequest { + // Required. The name of the Group. + string group = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "vmmigration.googleapis.com/Group" + } + ]; + + // The MigratingVm to remove. + string migrating_vm = 2 [(google.api.resource_reference) = { + type: "vmmigration.googleapis.com/MigratingVm" + }]; +} + +// Response message for 'RemoveMigration' request. +message RemoveGroupMigrationResponse {} + +// Request message for 'CreateCutoverJob' request. +message CreateCutoverJobRequest { + // Required. The Cutover's parent. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "vmmigration.googleapis.com/CutoverJob" + } + ]; + + // Required. The cutover job identifier. + string cutover_job_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The cutover request body. + CutoverJob cutover_job = 3 [(google.api.field_behavior) = REQUIRED]; + + // A request ID to identify requests. Specify a unique request ID + // so that if you must retry your request, the server will know to ignore + // the request if it has already been completed. The server will guarantee + // that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and t + // he request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 4; +} + +// Request message for 'CancelCutoverJob' request. +message CancelCutoverJobRequest { + // Required. The cutover job id + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "vmmigration.googleapis.com/CutoverJob" + } + ]; +} + +// Response message for 'CancelCutoverJob' request. +message CancelCutoverJobResponse {} + +// Request message for 'ListCutoverJobsRequest' request. +message ListCutoverJobsRequest { + // Required. The parent, which owns this collection of migrating VMs. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "vmmigration.googleapis.com/CutoverJob" + } + ]; + + // Optional. The maximum number of cutover jobs to return. The service may + // return fewer than this value. If unspecified, at most 500 cutover jobs will + // be returned. The maximum value is 1000; values above 1000 will be coerced + // to 1000. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Required. A page token, received from a previous `ListCutoverJobs` call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to `ListCutoverJobs` must + // match the call that provided the page token. + string page_token = 3 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The filter request. + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. the order by fields for the result. + string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for 'ListCutoverJobs' request. +message ListCutoverJobsResponse { + // Output only. The list of cutover jobs response. + repeated CutoverJob cutover_jobs = 1 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. 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 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Locations that could not be reached. + repeated string unreachable = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Request message for 'GetCutoverJob' request. +message GetCutoverJobRequest { + // Required. The name of the CutoverJob. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "vmmigration.googleapis.com/CutoverJob" + } + ]; +} + +// 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]; +} + +// Represents migration resource error information that can be used with +// google.rpc.Status message. MigrationError is used to present the user with +// error information in migration operations. +message MigrationError { + // Represents resource error codes. + enum ErrorCode { + // Default value. This value is not used. + ERROR_CODE_UNSPECIFIED = 0; + + // Migrate for Compute encountered an unknown error. + UNKNOWN_ERROR = 1; + + // Migrate for Compute encountered an error while validating replication + // source health. + SOURCE_VALIDATION_ERROR = 2; + + // Migrate for Compute encountered an error during source data operation. + SOURCE_REPLICATION_ERROR = 3; + + // Migrate for Compute encountered an error during target data operation. + TARGET_REPLICATION_ERROR = 4; + + // Migrate for Compute encountered an error during OS adaptation. + OS_ADAPTATION_ERROR = 5; + + // Migrate for Compute encountered an error in clone operation. + CLONE_ERROR = 6; + + // Migrate for Compute encountered an error in cutover operation. + CUTOVER_ERROR = 7; + + // Migrate for Compute encountered an error during utilization report + // creation. + UTILIZATION_REPORT_ERROR = 8; + + // Migrate for Compute encountered an error during appliance upgrade. + APPLIANCE_UPGRADE_ERROR = 9; + } + + // Output only. The error code. + ErrorCode code = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The localized error message. + google.rpc.LocalizedMessage error_message = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Suggested action for solving the error. + google.rpc.LocalizedMessage action_item = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. URL(s) pointing to additional information on handling the + // current error. + repeated google.rpc.Help.Link help_links = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time the error occurred. + google.protobuf.Timestamp error_time = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/packages/google-cloud-vmmigration/protos/protos.d.ts b/packages/google-cloud-vmmigration/protos/protos.d.ts new file mode 100644 index 00000000000..8eb3ba1064f --- /dev/null +++ b/packages/google-cloud-vmmigration/protos/protos.d.ts @@ -0,0 +1,18254 @@ +// 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 vmmigration. */ + namespace vmmigration { + + /** Namespace v1. */ + namespace v1 { + + /** Represents a VmMigration */ + class VmMigration extends $protobuf.rpc.Service { + + /** + * Constructs a new VmMigration 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 VmMigration 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): VmMigration; + + /** + * Calls ListSources. + * @param request ListSourcesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListSourcesResponse + */ + public listSources(request: google.cloud.vmmigration.v1.IListSourcesRequest, callback: google.cloud.vmmigration.v1.VmMigration.ListSourcesCallback): void; + + /** + * Calls ListSources. + * @param request ListSourcesRequest message or plain object + * @returns Promise + */ + public listSources(request: google.cloud.vmmigration.v1.IListSourcesRequest): Promise; + + /** + * Calls GetSource. + * @param request GetSourceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Source + */ + public getSource(request: google.cloud.vmmigration.v1.IGetSourceRequest, callback: google.cloud.vmmigration.v1.VmMigration.GetSourceCallback): void; + + /** + * Calls GetSource. + * @param request GetSourceRequest message or plain object + * @returns Promise + */ + public getSource(request: google.cloud.vmmigration.v1.IGetSourceRequest): Promise; + + /** + * Calls CreateSource. + * @param request CreateSourceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createSource(request: google.cloud.vmmigration.v1.ICreateSourceRequest, callback: google.cloud.vmmigration.v1.VmMigration.CreateSourceCallback): void; + + /** + * Calls CreateSource. + * @param request CreateSourceRequest message or plain object + * @returns Promise + */ + public createSource(request: google.cloud.vmmigration.v1.ICreateSourceRequest): Promise; + + /** + * Calls UpdateSource. + * @param request UpdateSourceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateSource(request: google.cloud.vmmigration.v1.IUpdateSourceRequest, callback: google.cloud.vmmigration.v1.VmMigration.UpdateSourceCallback): void; + + /** + * Calls UpdateSource. + * @param request UpdateSourceRequest message or plain object + * @returns Promise + */ + public updateSource(request: google.cloud.vmmigration.v1.IUpdateSourceRequest): Promise; + + /** + * Calls DeleteSource. + * @param request DeleteSourceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteSource(request: google.cloud.vmmigration.v1.IDeleteSourceRequest, callback: google.cloud.vmmigration.v1.VmMigration.DeleteSourceCallback): void; + + /** + * Calls DeleteSource. + * @param request DeleteSourceRequest message or plain object + * @returns Promise + */ + public deleteSource(request: google.cloud.vmmigration.v1.IDeleteSourceRequest): Promise; + + /** + * Calls FetchInventory. + * @param request FetchInventoryRequest message or plain object + * @param callback Node-style callback called with the error, if any, and FetchInventoryResponse + */ + public fetchInventory(request: google.cloud.vmmigration.v1.IFetchInventoryRequest, callback: google.cloud.vmmigration.v1.VmMigration.FetchInventoryCallback): void; + + /** + * Calls FetchInventory. + * @param request FetchInventoryRequest message or plain object + * @returns Promise + */ + public fetchInventory(request: google.cloud.vmmigration.v1.IFetchInventoryRequest): Promise; + + /** + * Calls ListUtilizationReports. + * @param request ListUtilizationReportsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListUtilizationReportsResponse + */ + public listUtilizationReports(request: google.cloud.vmmigration.v1.IListUtilizationReportsRequest, callback: google.cloud.vmmigration.v1.VmMigration.ListUtilizationReportsCallback): void; + + /** + * Calls ListUtilizationReports. + * @param request ListUtilizationReportsRequest message or plain object + * @returns Promise + */ + public listUtilizationReports(request: google.cloud.vmmigration.v1.IListUtilizationReportsRequest): Promise; + + /** + * Calls GetUtilizationReport. + * @param request GetUtilizationReportRequest message or plain object + * @param callback Node-style callback called with the error, if any, and UtilizationReport + */ + public getUtilizationReport(request: google.cloud.vmmigration.v1.IGetUtilizationReportRequest, callback: google.cloud.vmmigration.v1.VmMigration.GetUtilizationReportCallback): void; + + /** + * Calls GetUtilizationReport. + * @param request GetUtilizationReportRequest message or plain object + * @returns Promise + */ + public getUtilizationReport(request: google.cloud.vmmigration.v1.IGetUtilizationReportRequest): Promise; + + /** + * Calls CreateUtilizationReport. + * @param request CreateUtilizationReportRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createUtilizationReport(request: google.cloud.vmmigration.v1.ICreateUtilizationReportRequest, callback: google.cloud.vmmigration.v1.VmMigration.CreateUtilizationReportCallback): void; + + /** + * Calls CreateUtilizationReport. + * @param request CreateUtilizationReportRequest message or plain object + * @returns Promise + */ + public createUtilizationReport(request: google.cloud.vmmigration.v1.ICreateUtilizationReportRequest): Promise; + + /** + * Calls DeleteUtilizationReport. + * @param request DeleteUtilizationReportRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteUtilizationReport(request: google.cloud.vmmigration.v1.IDeleteUtilizationReportRequest, callback: google.cloud.vmmigration.v1.VmMigration.DeleteUtilizationReportCallback): void; + + /** + * Calls DeleteUtilizationReport. + * @param request DeleteUtilizationReportRequest message or plain object + * @returns Promise + */ + public deleteUtilizationReport(request: google.cloud.vmmigration.v1.IDeleteUtilizationReportRequest): Promise; + + /** + * Calls ListDatacenterConnectors. + * @param request ListDatacenterConnectorsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListDatacenterConnectorsResponse + */ + public listDatacenterConnectors(request: google.cloud.vmmigration.v1.IListDatacenterConnectorsRequest, callback: google.cloud.vmmigration.v1.VmMigration.ListDatacenterConnectorsCallback): void; + + /** + * Calls ListDatacenterConnectors. + * @param request ListDatacenterConnectorsRequest message or plain object + * @returns Promise + */ + public listDatacenterConnectors(request: google.cloud.vmmigration.v1.IListDatacenterConnectorsRequest): Promise; + + /** + * Calls GetDatacenterConnector. + * @param request GetDatacenterConnectorRequest message or plain object + * @param callback Node-style callback called with the error, if any, and DatacenterConnector + */ + public getDatacenterConnector(request: google.cloud.vmmigration.v1.IGetDatacenterConnectorRequest, callback: google.cloud.vmmigration.v1.VmMigration.GetDatacenterConnectorCallback): void; + + /** + * Calls GetDatacenterConnector. + * @param request GetDatacenterConnectorRequest message or plain object + * @returns Promise + */ + public getDatacenterConnector(request: google.cloud.vmmigration.v1.IGetDatacenterConnectorRequest): Promise; + + /** + * Calls CreateDatacenterConnector. + * @param request CreateDatacenterConnectorRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createDatacenterConnector(request: google.cloud.vmmigration.v1.ICreateDatacenterConnectorRequest, callback: google.cloud.vmmigration.v1.VmMigration.CreateDatacenterConnectorCallback): void; + + /** + * Calls CreateDatacenterConnector. + * @param request CreateDatacenterConnectorRequest message or plain object + * @returns Promise + */ + public createDatacenterConnector(request: google.cloud.vmmigration.v1.ICreateDatacenterConnectorRequest): Promise; + + /** + * Calls DeleteDatacenterConnector. + * @param request DeleteDatacenterConnectorRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteDatacenterConnector(request: google.cloud.vmmigration.v1.IDeleteDatacenterConnectorRequest, callback: google.cloud.vmmigration.v1.VmMigration.DeleteDatacenterConnectorCallback): void; + + /** + * Calls DeleteDatacenterConnector. + * @param request DeleteDatacenterConnectorRequest message or plain object + * @returns Promise + */ + public deleteDatacenterConnector(request: google.cloud.vmmigration.v1.IDeleteDatacenterConnectorRequest): Promise; + + /** + * Calls UpgradeAppliance. + * @param request UpgradeApplianceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public upgradeAppliance(request: google.cloud.vmmigration.v1.IUpgradeApplianceRequest, callback: google.cloud.vmmigration.v1.VmMigration.UpgradeApplianceCallback): void; + + /** + * Calls UpgradeAppliance. + * @param request UpgradeApplianceRequest message or plain object + * @returns Promise + */ + public upgradeAppliance(request: google.cloud.vmmigration.v1.IUpgradeApplianceRequest): Promise; + + /** + * Calls CreateMigratingVm. + * @param request CreateMigratingVmRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createMigratingVm(request: google.cloud.vmmigration.v1.ICreateMigratingVmRequest, callback: google.cloud.vmmigration.v1.VmMigration.CreateMigratingVmCallback): void; + + /** + * Calls CreateMigratingVm. + * @param request CreateMigratingVmRequest message or plain object + * @returns Promise + */ + public createMigratingVm(request: google.cloud.vmmigration.v1.ICreateMigratingVmRequest): Promise; + + /** + * Calls ListMigratingVms. + * @param request ListMigratingVmsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListMigratingVmsResponse + */ + public listMigratingVms(request: google.cloud.vmmigration.v1.IListMigratingVmsRequest, callback: google.cloud.vmmigration.v1.VmMigration.ListMigratingVmsCallback): void; + + /** + * Calls ListMigratingVms. + * @param request ListMigratingVmsRequest message or plain object + * @returns Promise + */ + public listMigratingVms(request: google.cloud.vmmigration.v1.IListMigratingVmsRequest): Promise; + + /** + * Calls GetMigratingVm. + * @param request GetMigratingVmRequest message or plain object + * @param callback Node-style callback called with the error, if any, and MigratingVm + */ + public getMigratingVm(request: google.cloud.vmmigration.v1.IGetMigratingVmRequest, callback: google.cloud.vmmigration.v1.VmMigration.GetMigratingVmCallback): void; + + /** + * Calls GetMigratingVm. + * @param request GetMigratingVmRequest message or plain object + * @returns Promise + */ + public getMigratingVm(request: google.cloud.vmmigration.v1.IGetMigratingVmRequest): Promise; + + /** + * Calls UpdateMigratingVm. + * @param request UpdateMigratingVmRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateMigratingVm(request: google.cloud.vmmigration.v1.IUpdateMigratingVmRequest, callback: google.cloud.vmmigration.v1.VmMigration.UpdateMigratingVmCallback): void; + + /** + * Calls UpdateMigratingVm. + * @param request UpdateMigratingVmRequest message or plain object + * @returns Promise + */ + public updateMigratingVm(request: google.cloud.vmmigration.v1.IUpdateMigratingVmRequest): Promise; + + /** + * Calls DeleteMigratingVm. + * @param request DeleteMigratingVmRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteMigratingVm(request: google.cloud.vmmigration.v1.IDeleteMigratingVmRequest, callback: google.cloud.vmmigration.v1.VmMigration.DeleteMigratingVmCallback): void; + + /** + * Calls DeleteMigratingVm. + * @param request DeleteMigratingVmRequest message or plain object + * @returns Promise + */ + public deleteMigratingVm(request: google.cloud.vmmigration.v1.IDeleteMigratingVmRequest): Promise; + + /** + * Calls StartMigration. + * @param request StartMigrationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public startMigration(request: google.cloud.vmmigration.v1.IStartMigrationRequest, callback: google.cloud.vmmigration.v1.VmMigration.StartMigrationCallback): void; + + /** + * Calls StartMigration. + * @param request StartMigrationRequest message or plain object + * @returns Promise + */ + public startMigration(request: google.cloud.vmmigration.v1.IStartMigrationRequest): Promise; + + /** + * Calls ResumeMigration. + * @param request ResumeMigrationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public resumeMigration(request: google.cloud.vmmigration.v1.IResumeMigrationRequest, callback: google.cloud.vmmigration.v1.VmMigration.ResumeMigrationCallback): void; + + /** + * Calls ResumeMigration. + * @param request ResumeMigrationRequest message or plain object + * @returns Promise + */ + public resumeMigration(request: google.cloud.vmmigration.v1.IResumeMigrationRequest): Promise; + + /** + * Calls PauseMigration. + * @param request PauseMigrationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public pauseMigration(request: google.cloud.vmmigration.v1.IPauseMigrationRequest, callback: google.cloud.vmmigration.v1.VmMigration.PauseMigrationCallback): void; + + /** + * Calls PauseMigration. + * @param request PauseMigrationRequest message or plain object + * @returns Promise + */ + public pauseMigration(request: google.cloud.vmmigration.v1.IPauseMigrationRequest): Promise; + + /** + * Calls FinalizeMigration. + * @param request FinalizeMigrationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public finalizeMigration(request: google.cloud.vmmigration.v1.IFinalizeMigrationRequest, callback: google.cloud.vmmigration.v1.VmMigration.FinalizeMigrationCallback): void; + + /** + * Calls FinalizeMigration. + * @param request FinalizeMigrationRequest message or plain object + * @returns Promise + */ + public finalizeMigration(request: google.cloud.vmmigration.v1.IFinalizeMigrationRequest): Promise; + + /** + * Calls CreateCloneJob. + * @param request CreateCloneJobRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createCloneJob(request: google.cloud.vmmigration.v1.ICreateCloneJobRequest, callback: google.cloud.vmmigration.v1.VmMigration.CreateCloneJobCallback): void; + + /** + * Calls CreateCloneJob. + * @param request CreateCloneJobRequest message or plain object + * @returns Promise + */ + public createCloneJob(request: google.cloud.vmmigration.v1.ICreateCloneJobRequest): Promise; + + /** + * Calls CancelCloneJob. + * @param request CancelCloneJobRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public cancelCloneJob(request: google.cloud.vmmigration.v1.ICancelCloneJobRequest, callback: google.cloud.vmmigration.v1.VmMigration.CancelCloneJobCallback): void; + + /** + * Calls CancelCloneJob. + * @param request CancelCloneJobRequest message or plain object + * @returns Promise + */ + public cancelCloneJob(request: google.cloud.vmmigration.v1.ICancelCloneJobRequest): Promise; + + /** + * Calls ListCloneJobs. + * @param request ListCloneJobsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListCloneJobsResponse + */ + public listCloneJobs(request: google.cloud.vmmigration.v1.IListCloneJobsRequest, callback: google.cloud.vmmigration.v1.VmMigration.ListCloneJobsCallback): void; + + /** + * Calls ListCloneJobs. + * @param request ListCloneJobsRequest message or plain object + * @returns Promise + */ + public listCloneJobs(request: google.cloud.vmmigration.v1.IListCloneJobsRequest): Promise; + + /** + * Calls GetCloneJob. + * @param request GetCloneJobRequest message or plain object + * @param callback Node-style callback called with the error, if any, and CloneJob + */ + public getCloneJob(request: google.cloud.vmmigration.v1.IGetCloneJobRequest, callback: google.cloud.vmmigration.v1.VmMigration.GetCloneJobCallback): void; + + /** + * Calls GetCloneJob. + * @param request GetCloneJobRequest message or plain object + * @returns Promise + */ + public getCloneJob(request: google.cloud.vmmigration.v1.IGetCloneJobRequest): Promise; + + /** + * Calls CreateCutoverJob. + * @param request CreateCutoverJobRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createCutoverJob(request: google.cloud.vmmigration.v1.ICreateCutoverJobRequest, callback: google.cloud.vmmigration.v1.VmMigration.CreateCutoverJobCallback): void; + + /** + * Calls CreateCutoverJob. + * @param request CreateCutoverJobRequest message or plain object + * @returns Promise + */ + public createCutoverJob(request: google.cloud.vmmigration.v1.ICreateCutoverJobRequest): Promise; + + /** + * Calls CancelCutoverJob. + * @param request CancelCutoverJobRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public cancelCutoverJob(request: google.cloud.vmmigration.v1.ICancelCutoverJobRequest, callback: google.cloud.vmmigration.v1.VmMigration.CancelCutoverJobCallback): void; + + /** + * Calls CancelCutoverJob. + * @param request CancelCutoverJobRequest message or plain object + * @returns Promise + */ + public cancelCutoverJob(request: google.cloud.vmmigration.v1.ICancelCutoverJobRequest): Promise; + + /** + * Calls ListCutoverJobs. + * @param request ListCutoverJobsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListCutoverJobsResponse + */ + public listCutoverJobs(request: google.cloud.vmmigration.v1.IListCutoverJobsRequest, callback: google.cloud.vmmigration.v1.VmMigration.ListCutoverJobsCallback): void; + + /** + * Calls ListCutoverJobs. + * @param request ListCutoverJobsRequest message or plain object + * @returns Promise + */ + public listCutoverJobs(request: google.cloud.vmmigration.v1.IListCutoverJobsRequest): Promise; + + /** + * Calls GetCutoverJob. + * @param request GetCutoverJobRequest message or plain object + * @param callback Node-style callback called with the error, if any, and CutoverJob + */ + public getCutoverJob(request: google.cloud.vmmigration.v1.IGetCutoverJobRequest, callback: google.cloud.vmmigration.v1.VmMigration.GetCutoverJobCallback): void; + + /** + * Calls GetCutoverJob. + * @param request GetCutoverJobRequest message or plain object + * @returns Promise + */ + public getCutoverJob(request: google.cloud.vmmigration.v1.IGetCutoverJobRequest): Promise; + + /** + * Calls ListGroups. + * @param request ListGroupsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListGroupsResponse + */ + public listGroups(request: google.cloud.vmmigration.v1.IListGroupsRequest, callback: google.cloud.vmmigration.v1.VmMigration.ListGroupsCallback): void; + + /** + * Calls ListGroups. + * @param request ListGroupsRequest message or plain object + * @returns Promise + */ + public listGroups(request: google.cloud.vmmigration.v1.IListGroupsRequest): Promise; + + /** + * Calls GetGroup. + * @param request GetGroupRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Group + */ + public getGroup(request: google.cloud.vmmigration.v1.IGetGroupRequest, callback: google.cloud.vmmigration.v1.VmMigration.GetGroupCallback): void; + + /** + * Calls GetGroup. + * @param request GetGroupRequest message or plain object + * @returns Promise + */ + public getGroup(request: google.cloud.vmmigration.v1.IGetGroupRequest): Promise; + + /** + * Calls CreateGroup. + * @param request CreateGroupRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createGroup(request: google.cloud.vmmigration.v1.ICreateGroupRequest, callback: google.cloud.vmmigration.v1.VmMigration.CreateGroupCallback): void; + + /** + * Calls CreateGroup. + * @param request CreateGroupRequest message or plain object + * @returns Promise + */ + public createGroup(request: google.cloud.vmmigration.v1.ICreateGroupRequest): Promise; + + /** + * Calls UpdateGroup. + * @param request UpdateGroupRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateGroup(request: google.cloud.vmmigration.v1.IUpdateGroupRequest, callback: google.cloud.vmmigration.v1.VmMigration.UpdateGroupCallback): void; + + /** + * Calls UpdateGroup. + * @param request UpdateGroupRequest message or plain object + * @returns Promise + */ + public updateGroup(request: google.cloud.vmmigration.v1.IUpdateGroupRequest): Promise; + + /** + * Calls DeleteGroup. + * @param request DeleteGroupRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteGroup(request: google.cloud.vmmigration.v1.IDeleteGroupRequest, callback: google.cloud.vmmigration.v1.VmMigration.DeleteGroupCallback): void; + + /** + * Calls DeleteGroup. + * @param request DeleteGroupRequest message or plain object + * @returns Promise + */ + public deleteGroup(request: google.cloud.vmmigration.v1.IDeleteGroupRequest): Promise; + + /** + * Calls AddGroupMigration. + * @param request AddGroupMigrationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public addGroupMigration(request: google.cloud.vmmigration.v1.IAddGroupMigrationRequest, callback: google.cloud.vmmigration.v1.VmMigration.AddGroupMigrationCallback): void; + + /** + * Calls AddGroupMigration. + * @param request AddGroupMigrationRequest message or plain object + * @returns Promise + */ + public addGroupMigration(request: google.cloud.vmmigration.v1.IAddGroupMigrationRequest): Promise; + + /** + * Calls RemoveGroupMigration. + * @param request RemoveGroupMigrationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public removeGroupMigration(request: google.cloud.vmmigration.v1.IRemoveGroupMigrationRequest, callback: google.cloud.vmmigration.v1.VmMigration.RemoveGroupMigrationCallback): void; + + /** + * Calls RemoveGroupMigration. + * @param request RemoveGroupMigrationRequest message or plain object + * @returns Promise + */ + public removeGroupMigration(request: google.cloud.vmmigration.v1.IRemoveGroupMigrationRequest): Promise; + + /** + * Calls ListTargetProjects. + * @param request ListTargetProjectsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListTargetProjectsResponse + */ + public listTargetProjects(request: google.cloud.vmmigration.v1.IListTargetProjectsRequest, callback: google.cloud.vmmigration.v1.VmMigration.ListTargetProjectsCallback): void; + + /** + * Calls ListTargetProjects. + * @param request ListTargetProjectsRequest message or plain object + * @returns Promise + */ + public listTargetProjects(request: google.cloud.vmmigration.v1.IListTargetProjectsRequest): Promise; + + /** + * Calls GetTargetProject. + * @param request GetTargetProjectRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TargetProject + */ + public getTargetProject(request: google.cloud.vmmigration.v1.IGetTargetProjectRequest, callback: google.cloud.vmmigration.v1.VmMigration.GetTargetProjectCallback): void; + + /** + * Calls GetTargetProject. + * @param request GetTargetProjectRequest message or plain object + * @returns Promise + */ + public getTargetProject(request: google.cloud.vmmigration.v1.IGetTargetProjectRequest): Promise; + + /** + * Calls CreateTargetProject. + * @param request CreateTargetProjectRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createTargetProject(request: google.cloud.vmmigration.v1.ICreateTargetProjectRequest, callback: google.cloud.vmmigration.v1.VmMigration.CreateTargetProjectCallback): void; + + /** + * Calls CreateTargetProject. + * @param request CreateTargetProjectRequest message or plain object + * @returns Promise + */ + public createTargetProject(request: google.cloud.vmmigration.v1.ICreateTargetProjectRequest): Promise; + + /** + * Calls UpdateTargetProject. + * @param request UpdateTargetProjectRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateTargetProject(request: google.cloud.vmmigration.v1.IUpdateTargetProjectRequest, callback: google.cloud.vmmigration.v1.VmMigration.UpdateTargetProjectCallback): void; + + /** + * Calls UpdateTargetProject. + * @param request UpdateTargetProjectRequest message or plain object + * @returns Promise + */ + public updateTargetProject(request: google.cloud.vmmigration.v1.IUpdateTargetProjectRequest): Promise; + + /** + * Calls DeleteTargetProject. + * @param request DeleteTargetProjectRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteTargetProject(request: google.cloud.vmmigration.v1.IDeleteTargetProjectRequest, callback: google.cloud.vmmigration.v1.VmMigration.DeleteTargetProjectCallback): void; + + /** + * Calls DeleteTargetProject. + * @param request DeleteTargetProjectRequest message or plain object + * @returns Promise + */ + public deleteTargetProject(request: google.cloud.vmmigration.v1.IDeleteTargetProjectRequest): Promise; + } + + namespace VmMigration { + + /** + * Callback as used by {@link google.cloud.vmmigration.v1.VmMigration|listSources}. + * @param error Error, if any + * @param [response] ListSourcesResponse + */ + type ListSourcesCallback = (error: (Error|null), response?: google.cloud.vmmigration.v1.ListSourcesResponse) => void; + + /** + * Callback as used by {@link google.cloud.vmmigration.v1.VmMigration|getSource}. + * @param error Error, if any + * @param [response] Source + */ + type GetSourceCallback = (error: (Error|null), response?: google.cloud.vmmigration.v1.Source) => void; + + /** + * Callback as used by {@link google.cloud.vmmigration.v1.VmMigration|createSource}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateSourceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.vmmigration.v1.VmMigration|updateSource}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateSourceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.vmmigration.v1.VmMigration|deleteSource}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteSourceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.vmmigration.v1.VmMigration|fetchInventory}. + * @param error Error, if any + * @param [response] FetchInventoryResponse + */ + type FetchInventoryCallback = (error: (Error|null), response?: google.cloud.vmmigration.v1.FetchInventoryResponse) => void; + + /** + * Callback as used by {@link google.cloud.vmmigration.v1.VmMigration|listUtilizationReports}. + * @param error Error, if any + * @param [response] ListUtilizationReportsResponse + */ + type ListUtilizationReportsCallback = (error: (Error|null), response?: google.cloud.vmmigration.v1.ListUtilizationReportsResponse) => void; + + /** + * Callback as used by {@link google.cloud.vmmigration.v1.VmMigration|getUtilizationReport}. + * @param error Error, if any + * @param [response] UtilizationReport + */ + type GetUtilizationReportCallback = (error: (Error|null), response?: google.cloud.vmmigration.v1.UtilizationReport) => void; + + /** + * Callback as used by {@link google.cloud.vmmigration.v1.VmMigration|createUtilizationReport}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateUtilizationReportCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.vmmigration.v1.VmMigration|deleteUtilizationReport}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteUtilizationReportCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.vmmigration.v1.VmMigration|listDatacenterConnectors}. + * @param error Error, if any + * @param [response] ListDatacenterConnectorsResponse + */ + type ListDatacenterConnectorsCallback = (error: (Error|null), response?: google.cloud.vmmigration.v1.ListDatacenterConnectorsResponse) => void; + + /** + * Callback as used by {@link google.cloud.vmmigration.v1.VmMigration|getDatacenterConnector}. + * @param error Error, if any + * @param [response] DatacenterConnector + */ + type GetDatacenterConnectorCallback = (error: (Error|null), response?: google.cloud.vmmigration.v1.DatacenterConnector) => void; + + /** + * Callback as used by {@link google.cloud.vmmigration.v1.VmMigration|createDatacenterConnector}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateDatacenterConnectorCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.vmmigration.v1.VmMigration|deleteDatacenterConnector}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteDatacenterConnectorCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.vmmigration.v1.VmMigration|upgradeAppliance}. + * @param error Error, if any + * @param [response] Operation + */ + type UpgradeApplianceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.vmmigration.v1.VmMigration|createMigratingVm}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateMigratingVmCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.vmmigration.v1.VmMigration|listMigratingVms}. + * @param error Error, if any + * @param [response] ListMigratingVmsResponse + */ + type ListMigratingVmsCallback = (error: (Error|null), response?: google.cloud.vmmigration.v1.ListMigratingVmsResponse) => void; + + /** + * Callback as used by {@link google.cloud.vmmigration.v1.VmMigration|getMigratingVm}. + * @param error Error, if any + * @param [response] MigratingVm + */ + type GetMigratingVmCallback = (error: (Error|null), response?: google.cloud.vmmigration.v1.MigratingVm) => void; + + /** + * Callback as used by {@link google.cloud.vmmigration.v1.VmMigration|updateMigratingVm}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateMigratingVmCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.vmmigration.v1.VmMigration|deleteMigratingVm}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteMigratingVmCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.vmmigration.v1.VmMigration|startMigration}. + * @param error Error, if any + * @param [response] Operation + */ + type StartMigrationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.vmmigration.v1.VmMigration|resumeMigration}. + * @param error Error, if any + * @param [response] Operation + */ + type ResumeMigrationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.vmmigration.v1.VmMigration|pauseMigration}. + * @param error Error, if any + * @param [response] Operation + */ + type PauseMigrationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.vmmigration.v1.VmMigration|finalizeMigration}. + * @param error Error, if any + * @param [response] Operation + */ + type FinalizeMigrationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.vmmigration.v1.VmMigration|createCloneJob}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateCloneJobCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.vmmigration.v1.VmMigration|cancelCloneJob}. + * @param error Error, if any + * @param [response] Operation + */ + type CancelCloneJobCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.vmmigration.v1.VmMigration|listCloneJobs}. + * @param error Error, if any + * @param [response] ListCloneJobsResponse + */ + type ListCloneJobsCallback = (error: (Error|null), response?: google.cloud.vmmigration.v1.ListCloneJobsResponse) => void; + + /** + * Callback as used by {@link google.cloud.vmmigration.v1.VmMigration|getCloneJob}. + * @param error Error, if any + * @param [response] CloneJob + */ + type GetCloneJobCallback = (error: (Error|null), response?: google.cloud.vmmigration.v1.CloneJob) => void; + + /** + * Callback as used by {@link google.cloud.vmmigration.v1.VmMigration|createCutoverJob}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateCutoverJobCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.vmmigration.v1.VmMigration|cancelCutoverJob}. + * @param error Error, if any + * @param [response] Operation + */ + type CancelCutoverJobCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.vmmigration.v1.VmMigration|listCutoverJobs}. + * @param error Error, if any + * @param [response] ListCutoverJobsResponse + */ + type ListCutoverJobsCallback = (error: (Error|null), response?: google.cloud.vmmigration.v1.ListCutoverJobsResponse) => void; + + /** + * Callback as used by {@link google.cloud.vmmigration.v1.VmMigration|getCutoverJob}. + * @param error Error, if any + * @param [response] CutoverJob + */ + type GetCutoverJobCallback = (error: (Error|null), response?: google.cloud.vmmigration.v1.CutoverJob) => void; + + /** + * Callback as used by {@link google.cloud.vmmigration.v1.VmMigration|listGroups}. + * @param error Error, if any + * @param [response] ListGroupsResponse + */ + type ListGroupsCallback = (error: (Error|null), response?: google.cloud.vmmigration.v1.ListGroupsResponse) => void; + + /** + * Callback as used by {@link google.cloud.vmmigration.v1.VmMigration|getGroup}. + * @param error Error, if any + * @param [response] Group + */ + type GetGroupCallback = (error: (Error|null), response?: google.cloud.vmmigration.v1.Group) => void; + + /** + * Callback as used by {@link google.cloud.vmmigration.v1.VmMigration|createGroup}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateGroupCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.vmmigration.v1.VmMigration|updateGroup}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateGroupCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.vmmigration.v1.VmMigration|deleteGroup}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteGroupCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.vmmigration.v1.VmMigration|addGroupMigration}. + * @param error Error, if any + * @param [response] Operation + */ + type AddGroupMigrationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.vmmigration.v1.VmMigration|removeGroupMigration}. + * @param error Error, if any + * @param [response] Operation + */ + type RemoveGroupMigrationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.vmmigration.v1.VmMigration|listTargetProjects}. + * @param error Error, if any + * @param [response] ListTargetProjectsResponse + */ + type ListTargetProjectsCallback = (error: (Error|null), response?: google.cloud.vmmigration.v1.ListTargetProjectsResponse) => void; + + /** + * Callback as used by {@link google.cloud.vmmigration.v1.VmMigration|getTargetProject}. + * @param error Error, if any + * @param [response] TargetProject + */ + type GetTargetProjectCallback = (error: (Error|null), response?: google.cloud.vmmigration.v1.TargetProject) => void; + + /** + * Callback as used by {@link google.cloud.vmmigration.v1.VmMigration|createTargetProject}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateTargetProjectCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.vmmigration.v1.VmMigration|updateTargetProject}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateTargetProjectCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.vmmigration.v1.VmMigration|deleteTargetProject}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteTargetProjectCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + } + + /** UtilizationReportView enum. */ + enum UtilizationReportView { + UTILIZATION_REPORT_VIEW_UNSPECIFIED = 0, + BASIC = 1, + FULL = 2 + } + + /** MigratingVmView enum. */ + enum MigratingVmView { + MIGRATING_VM_VIEW_UNSPECIFIED = 0, + MIGRATING_VM_VIEW_BASIC = 1, + MIGRATING_VM_VIEW_FULL = 2 + } + + /** ComputeEngineDiskType enum. */ + enum ComputeEngineDiskType { + COMPUTE_ENGINE_DISK_TYPE_UNSPECIFIED = 0, + COMPUTE_ENGINE_DISK_TYPE_STANDARD = 1, + COMPUTE_ENGINE_DISK_TYPE_SSD = 2, + COMPUTE_ENGINE_DISK_TYPE_BALANCED = 3 + } + + /** ComputeEngineLicenseType enum. */ + enum ComputeEngineLicenseType { + COMPUTE_ENGINE_LICENSE_TYPE_DEFAULT = 0, + COMPUTE_ENGINE_LICENSE_TYPE_PAYG = 1, + COMPUTE_ENGINE_LICENSE_TYPE_BYOL = 2 + } + + /** ComputeEngineBootOption enum. */ + enum ComputeEngineBootOption { + COMPUTE_ENGINE_BOOT_OPTION_UNSPECIFIED = 0, + COMPUTE_ENGINE_BOOT_OPTION_EFI = 1, + COMPUTE_ENGINE_BOOT_OPTION_BIOS = 2 + } + + /** Properties of a ReplicationCycle. */ + interface IReplicationCycle { + + /** ReplicationCycle startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** ReplicationCycle progressPercent */ + progressPercent?: (number|null); + } + + /** Represents a ReplicationCycle. */ + class ReplicationCycle implements IReplicationCycle { + + /** + * Constructs a new ReplicationCycle. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vmmigration.v1.IReplicationCycle); + + /** ReplicationCycle startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** ReplicationCycle progressPercent. */ + public progressPercent: number; + + /** + * Creates a new ReplicationCycle instance using the specified properties. + * @param [properties] Properties to set + * @returns ReplicationCycle instance + */ + public static create(properties?: google.cloud.vmmigration.v1.IReplicationCycle): google.cloud.vmmigration.v1.ReplicationCycle; + + /** + * Encodes the specified ReplicationCycle message. Does not implicitly {@link google.cloud.vmmigration.v1.ReplicationCycle.verify|verify} messages. + * @param message ReplicationCycle message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vmmigration.v1.IReplicationCycle, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReplicationCycle message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.ReplicationCycle.verify|verify} messages. + * @param message ReplicationCycle message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vmmigration.v1.IReplicationCycle, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReplicationCycle message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReplicationCycle + * @throws {Error} If the payload is not 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.vmmigration.v1.ReplicationCycle; + + /** + * Decodes a ReplicationCycle message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReplicationCycle + * @throws {Error} If the payload 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.vmmigration.v1.ReplicationCycle; + + /** + * Verifies a ReplicationCycle message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReplicationCycle message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReplicationCycle + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vmmigration.v1.ReplicationCycle; + + /** + * Creates a plain object from a ReplicationCycle message. Also converts values to other types if specified. + * @param message ReplicationCycle + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vmmigration.v1.ReplicationCycle, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReplicationCycle to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReplicationCycle + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ReplicationSync. */ + interface IReplicationSync { + + /** ReplicationSync lastSyncTime */ + lastSyncTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a ReplicationSync. */ + class ReplicationSync implements IReplicationSync { + + /** + * Constructs a new ReplicationSync. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vmmigration.v1.IReplicationSync); + + /** ReplicationSync lastSyncTime. */ + public lastSyncTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new ReplicationSync instance using the specified properties. + * @param [properties] Properties to set + * @returns ReplicationSync instance + */ + public static create(properties?: google.cloud.vmmigration.v1.IReplicationSync): google.cloud.vmmigration.v1.ReplicationSync; + + /** + * Encodes the specified ReplicationSync message. Does not implicitly {@link google.cloud.vmmigration.v1.ReplicationSync.verify|verify} messages. + * @param message ReplicationSync message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vmmigration.v1.IReplicationSync, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReplicationSync message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.ReplicationSync.verify|verify} messages. + * @param message ReplicationSync message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vmmigration.v1.IReplicationSync, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReplicationSync message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReplicationSync + * @throws {Error} If the payload is not 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.vmmigration.v1.ReplicationSync; + + /** + * Decodes a ReplicationSync message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReplicationSync + * @throws {Error} If the payload 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.vmmigration.v1.ReplicationSync; + + /** + * Verifies a ReplicationSync message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReplicationSync message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReplicationSync + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vmmigration.v1.ReplicationSync; + + /** + * Creates a plain object from a ReplicationSync message. Also converts values to other types if specified. + * @param message ReplicationSync + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vmmigration.v1.ReplicationSync, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReplicationSync to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReplicationSync + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MigratingVm. */ + interface IMigratingVm { + + /** MigratingVm computeEngineTargetDefaults */ + computeEngineTargetDefaults?: (google.cloud.vmmigration.v1.IComputeEngineTargetDefaults|null); + + /** MigratingVm name */ + name?: (string|null); + + /** MigratingVm sourceVmId */ + sourceVmId?: (string|null); + + /** MigratingVm displayName */ + displayName?: (string|null); + + /** MigratingVm description */ + description?: (string|null); + + /** MigratingVm policy */ + policy?: (google.cloud.vmmigration.v1.ISchedulePolicy|null); + + /** MigratingVm createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** MigratingVm updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** MigratingVm lastSync */ + lastSync?: (google.cloud.vmmigration.v1.IReplicationSync|null); + + /** MigratingVm state */ + state?: (google.cloud.vmmigration.v1.MigratingVm.State|keyof typeof google.cloud.vmmigration.v1.MigratingVm.State|null); + + /** MigratingVm stateTime */ + stateTime?: (google.protobuf.ITimestamp|null); + + /** MigratingVm currentSyncInfo */ + currentSyncInfo?: (google.cloud.vmmigration.v1.IReplicationCycle|null); + + /** MigratingVm group */ + group?: (string|null); + + /** MigratingVm labels */ + labels?: ({ [k: string]: string }|null); + + /** MigratingVm recentCloneJobs */ + recentCloneJobs?: (google.cloud.vmmigration.v1.ICloneJob[]|null); + + /** MigratingVm error */ + error?: (google.rpc.IStatus|null); + + /** MigratingVm recentCutoverJobs */ + recentCutoverJobs?: (google.cloud.vmmigration.v1.ICutoverJob[]|null); + } + + /** Represents a MigratingVm. */ + class MigratingVm implements IMigratingVm { + + /** + * Constructs a new MigratingVm. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vmmigration.v1.IMigratingVm); + + /** MigratingVm computeEngineTargetDefaults. */ + public computeEngineTargetDefaults?: (google.cloud.vmmigration.v1.IComputeEngineTargetDefaults|null); + + /** MigratingVm name. */ + public name: string; + + /** MigratingVm sourceVmId. */ + public sourceVmId: string; + + /** MigratingVm displayName. */ + public displayName: string; + + /** MigratingVm description. */ + public description: string; + + /** MigratingVm policy. */ + public policy?: (google.cloud.vmmigration.v1.ISchedulePolicy|null); + + /** MigratingVm createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** MigratingVm updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** MigratingVm lastSync. */ + public lastSync?: (google.cloud.vmmigration.v1.IReplicationSync|null); + + /** MigratingVm state. */ + public state: (google.cloud.vmmigration.v1.MigratingVm.State|keyof typeof google.cloud.vmmigration.v1.MigratingVm.State); + + /** MigratingVm stateTime. */ + public stateTime?: (google.protobuf.ITimestamp|null); + + /** MigratingVm currentSyncInfo. */ + public currentSyncInfo?: (google.cloud.vmmigration.v1.IReplicationCycle|null); + + /** MigratingVm group. */ + public group: string; + + /** MigratingVm labels. */ + public labels: { [k: string]: string }; + + /** MigratingVm recentCloneJobs. */ + public recentCloneJobs: google.cloud.vmmigration.v1.ICloneJob[]; + + /** MigratingVm error. */ + public error?: (google.rpc.IStatus|null); + + /** MigratingVm recentCutoverJobs. */ + public recentCutoverJobs: google.cloud.vmmigration.v1.ICutoverJob[]; + + /** MigratingVm targetVmDefaults. */ + public targetVmDefaults?: "computeEngineTargetDefaults"; + + /** + * Creates a new MigratingVm instance using the specified properties. + * @param [properties] Properties to set + * @returns MigratingVm instance + */ + public static create(properties?: google.cloud.vmmigration.v1.IMigratingVm): google.cloud.vmmigration.v1.MigratingVm; + + /** + * Encodes the specified MigratingVm message. Does not implicitly {@link google.cloud.vmmigration.v1.MigratingVm.verify|verify} messages. + * @param message MigratingVm message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vmmigration.v1.IMigratingVm, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MigratingVm message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.MigratingVm.verify|verify} messages. + * @param message MigratingVm message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vmmigration.v1.IMigratingVm, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MigratingVm message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MigratingVm + * @throws {Error} If the payload is not 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.vmmigration.v1.MigratingVm; + + /** + * Decodes a MigratingVm message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MigratingVm + * @throws {Error} If the payload 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.vmmigration.v1.MigratingVm; + + /** + * Verifies a MigratingVm message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MigratingVm message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MigratingVm + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vmmigration.v1.MigratingVm; + + /** + * Creates a plain object from a MigratingVm message. Also converts values to other types if specified. + * @param message MigratingVm + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vmmigration.v1.MigratingVm, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MigratingVm to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MigratingVm + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace MigratingVm { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + PENDING = 1, + READY = 2, + FIRST_SYNC = 3, + ACTIVE = 4, + CUTTING_OVER = 7, + CUTOVER = 8, + FINAL_SYNC = 9, + PAUSED = 10, + FINALIZING = 11, + FINALIZED = 12, + ERROR = 13 + } + } + + /** Properties of a CloneJob. */ + interface ICloneJob { + + /** CloneJob computeEngineTargetDetails */ + computeEngineTargetDetails?: (google.cloud.vmmigration.v1.IComputeEngineTargetDetails|null); + + /** CloneJob createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** CloneJob endTime */ + endTime?: (google.protobuf.ITimestamp|null); + + /** CloneJob name */ + name?: (string|null); + + /** CloneJob state */ + state?: (google.cloud.vmmigration.v1.CloneJob.State|keyof typeof google.cloud.vmmigration.v1.CloneJob.State|null); + + /** CloneJob stateTime */ + stateTime?: (google.protobuf.ITimestamp|null); + + /** CloneJob error */ + error?: (google.rpc.IStatus|null); + } + + /** Represents a CloneJob. */ + class CloneJob implements ICloneJob { + + /** + * Constructs a new CloneJob. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vmmigration.v1.ICloneJob); + + /** CloneJob computeEngineTargetDetails. */ + public computeEngineTargetDetails?: (google.cloud.vmmigration.v1.IComputeEngineTargetDetails|null); + + /** CloneJob createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** CloneJob endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** CloneJob name. */ + public name: string; + + /** CloneJob state. */ + public state: (google.cloud.vmmigration.v1.CloneJob.State|keyof typeof google.cloud.vmmigration.v1.CloneJob.State); + + /** CloneJob stateTime. */ + public stateTime?: (google.protobuf.ITimestamp|null); + + /** CloneJob error. */ + public error?: (google.rpc.IStatus|null); + + /** CloneJob targetVmDetails. */ + public targetVmDetails?: "computeEngineTargetDetails"; + + /** + * Creates a new CloneJob instance using the specified properties. + * @param [properties] Properties to set + * @returns CloneJob instance + */ + public static create(properties?: google.cloud.vmmigration.v1.ICloneJob): google.cloud.vmmigration.v1.CloneJob; + + /** + * Encodes the specified CloneJob message. Does not implicitly {@link google.cloud.vmmigration.v1.CloneJob.verify|verify} messages. + * @param message CloneJob message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vmmigration.v1.ICloneJob, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CloneJob message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.CloneJob.verify|verify} messages. + * @param message CloneJob message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vmmigration.v1.ICloneJob, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CloneJob message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CloneJob + * @throws {Error} If the payload is not 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.vmmigration.v1.CloneJob; + + /** + * Decodes a CloneJob message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CloneJob + * @throws {Error} If the payload 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.vmmigration.v1.CloneJob; + + /** + * Verifies a CloneJob message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CloneJob message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CloneJob + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vmmigration.v1.CloneJob; + + /** + * Creates a plain object from a CloneJob message. Also converts values to other types if specified. + * @param message CloneJob + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vmmigration.v1.CloneJob, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CloneJob to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CloneJob + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace CloneJob { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + PENDING = 1, + ACTIVE = 2, + FAILED = 3, + SUCCEEDED = 4, + CANCELLED = 5, + CANCELLING = 6, + ADAPTING_OS = 7 + } + } + + /** Properties of a CutoverJob. */ + interface ICutoverJob { + + /** CutoverJob computeEngineTargetDetails */ + computeEngineTargetDetails?: (google.cloud.vmmigration.v1.IComputeEngineTargetDetails|null); + + /** CutoverJob createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** CutoverJob endTime */ + endTime?: (google.protobuf.ITimestamp|null); + + /** CutoverJob name */ + name?: (string|null); + + /** CutoverJob state */ + state?: (google.cloud.vmmigration.v1.CutoverJob.State|keyof typeof google.cloud.vmmigration.v1.CutoverJob.State|null); + + /** CutoverJob stateTime */ + stateTime?: (google.protobuf.ITimestamp|null); + + /** CutoverJob progressPercent */ + progressPercent?: (number|null); + + /** CutoverJob error */ + error?: (google.rpc.IStatus|null); + + /** CutoverJob stateMessage */ + stateMessage?: (string|null); + } + + /** Represents a CutoverJob. */ + class CutoverJob implements ICutoverJob { + + /** + * Constructs a new CutoverJob. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vmmigration.v1.ICutoverJob); + + /** CutoverJob computeEngineTargetDetails. */ + public computeEngineTargetDetails?: (google.cloud.vmmigration.v1.IComputeEngineTargetDetails|null); + + /** CutoverJob createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** CutoverJob endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** CutoverJob name. */ + public name: string; + + /** CutoverJob state. */ + public state: (google.cloud.vmmigration.v1.CutoverJob.State|keyof typeof google.cloud.vmmigration.v1.CutoverJob.State); + + /** CutoverJob stateTime. */ + public stateTime?: (google.protobuf.ITimestamp|null); + + /** CutoverJob progressPercent. */ + public progressPercent: number; + + /** CutoverJob error. */ + public error?: (google.rpc.IStatus|null); + + /** CutoverJob stateMessage. */ + public stateMessage: string; + + /** CutoverJob targetVmDetails. */ + public targetVmDetails?: "computeEngineTargetDetails"; + + /** + * Creates a new CutoverJob instance using the specified properties. + * @param [properties] Properties to set + * @returns CutoverJob instance + */ + public static create(properties?: google.cloud.vmmigration.v1.ICutoverJob): google.cloud.vmmigration.v1.CutoverJob; + + /** + * Encodes the specified CutoverJob message. Does not implicitly {@link google.cloud.vmmigration.v1.CutoverJob.verify|verify} messages. + * @param message CutoverJob message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vmmigration.v1.ICutoverJob, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CutoverJob message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.CutoverJob.verify|verify} messages. + * @param message CutoverJob message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vmmigration.v1.ICutoverJob, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CutoverJob message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CutoverJob + * @throws {Error} If the payload is not 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.vmmigration.v1.CutoverJob; + + /** + * Decodes a CutoverJob message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CutoverJob + * @throws {Error} If the payload 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.vmmigration.v1.CutoverJob; + + /** + * Verifies a CutoverJob message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CutoverJob message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CutoverJob + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vmmigration.v1.CutoverJob; + + /** + * Creates a plain object from a CutoverJob message. Also converts values to other types if specified. + * @param message CutoverJob + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vmmigration.v1.CutoverJob, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CutoverJob to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CutoverJob + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace CutoverJob { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + PENDING = 1, + FAILED = 2, + SUCCEEDED = 3, + CANCELLED = 4, + CANCELLING = 5, + ACTIVE = 6, + ADAPTING_OS = 7 + } + } + + /** Properties of a CreateCloneJobRequest. */ + interface ICreateCloneJobRequest { + + /** CreateCloneJobRequest parent */ + parent?: (string|null); + + /** CreateCloneJobRequest cloneJobId */ + cloneJobId?: (string|null); + + /** CreateCloneJobRequest cloneJob */ + cloneJob?: (google.cloud.vmmigration.v1.ICloneJob|null); + + /** CreateCloneJobRequest requestId */ + requestId?: (string|null); + } + + /** Represents a CreateCloneJobRequest. */ + class CreateCloneJobRequest implements ICreateCloneJobRequest { + + /** + * Constructs a new CreateCloneJobRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vmmigration.v1.ICreateCloneJobRequest); + + /** CreateCloneJobRequest parent. */ + public parent: string; + + /** CreateCloneJobRequest cloneJobId. */ + public cloneJobId: string; + + /** CreateCloneJobRequest cloneJob. */ + public cloneJob?: (google.cloud.vmmigration.v1.ICloneJob|null); + + /** CreateCloneJobRequest requestId. */ + public requestId: string; + + /** + * Creates a new CreateCloneJobRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateCloneJobRequest instance + */ + public static create(properties?: google.cloud.vmmigration.v1.ICreateCloneJobRequest): google.cloud.vmmigration.v1.CreateCloneJobRequest; + + /** + * Encodes the specified CreateCloneJobRequest message. Does not implicitly {@link google.cloud.vmmigration.v1.CreateCloneJobRequest.verify|verify} messages. + * @param message CreateCloneJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vmmigration.v1.ICreateCloneJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateCloneJobRequest message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.CreateCloneJobRequest.verify|verify} messages. + * @param message CreateCloneJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vmmigration.v1.ICreateCloneJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateCloneJobRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateCloneJobRequest + * @throws {Error} If the payload is not 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.vmmigration.v1.CreateCloneJobRequest; + + /** + * Decodes a CreateCloneJobRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateCloneJobRequest + * @throws {Error} If the payload 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.vmmigration.v1.CreateCloneJobRequest; + + /** + * Verifies a CreateCloneJobRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateCloneJobRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateCloneJobRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vmmigration.v1.CreateCloneJobRequest; + + /** + * Creates a plain object from a CreateCloneJobRequest message. Also converts values to other types if specified. + * @param message CreateCloneJobRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vmmigration.v1.CreateCloneJobRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateCloneJobRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateCloneJobRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CancelCloneJobRequest. */ + interface ICancelCloneJobRequest { + + /** CancelCloneJobRequest name */ + name?: (string|null); + } + + /** Represents a CancelCloneJobRequest. */ + class CancelCloneJobRequest implements ICancelCloneJobRequest { + + /** + * Constructs a new CancelCloneJobRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vmmigration.v1.ICancelCloneJobRequest); + + /** CancelCloneJobRequest name. */ + public name: string; + + /** + * Creates a new CancelCloneJobRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CancelCloneJobRequest instance + */ + public static create(properties?: google.cloud.vmmigration.v1.ICancelCloneJobRequest): google.cloud.vmmigration.v1.CancelCloneJobRequest; + + /** + * Encodes the specified CancelCloneJobRequest message. Does not implicitly {@link google.cloud.vmmigration.v1.CancelCloneJobRequest.verify|verify} messages. + * @param message CancelCloneJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vmmigration.v1.ICancelCloneJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CancelCloneJobRequest message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.CancelCloneJobRequest.verify|verify} messages. + * @param message CancelCloneJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vmmigration.v1.ICancelCloneJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CancelCloneJobRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CancelCloneJobRequest + * @throws {Error} If the payload is not 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.vmmigration.v1.CancelCloneJobRequest; + + /** + * Decodes a CancelCloneJobRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CancelCloneJobRequest + * @throws {Error} If the payload 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.vmmigration.v1.CancelCloneJobRequest; + + /** + * Verifies a CancelCloneJobRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CancelCloneJobRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CancelCloneJobRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vmmigration.v1.CancelCloneJobRequest; + + /** + * Creates a plain object from a CancelCloneJobRequest message. Also converts values to other types if specified. + * @param message CancelCloneJobRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vmmigration.v1.CancelCloneJobRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CancelCloneJobRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CancelCloneJobRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CancelCloneJobResponse. */ + interface ICancelCloneJobResponse { + } + + /** Represents a CancelCloneJobResponse. */ + class CancelCloneJobResponse implements ICancelCloneJobResponse { + + /** + * Constructs a new CancelCloneJobResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vmmigration.v1.ICancelCloneJobResponse); + + /** + * Creates a new CancelCloneJobResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns CancelCloneJobResponse instance + */ + public static create(properties?: google.cloud.vmmigration.v1.ICancelCloneJobResponse): google.cloud.vmmigration.v1.CancelCloneJobResponse; + + /** + * Encodes the specified CancelCloneJobResponse message. Does not implicitly {@link google.cloud.vmmigration.v1.CancelCloneJobResponse.verify|verify} messages. + * @param message CancelCloneJobResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vmmigration.v1.ICancelCloneJobResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CancelCloneJobResponse message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.CancelCloneJobResponse.verify|verify} messages. + * @param message CancelCloneJobResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vmmigration.v1.ICancelCloneJobResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CancelCloneJobResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CancelCloneJobResponse + * @throws {Error} If the payload is not 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.vmmigration.v1.CancelCloneJobResponse; + + /** + * Decodes a CancelCloneJobResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CancelCloneJobResponse + * @throws {Error} If the payload 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.vmmigration.v1.CancelCloneJobResponse; + + /** + * Verifies a CancelCloneJobResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CancelCloneJobResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CancelCloneJobResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vmmigration.v1.CancelCloneJobResponse; + + /** + * Creates a plain object from a CancelCloneJobResponse message. Also converts values to other types if specified. + * @param message CancelCloneJobResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vmmigration.v1.CancelCloneJobResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CancelCloneJobResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CancelCloneJobResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListCloneJobsRequest. */ + interface IListCloneJobsRequest { + + /** ListCloneJobsRequest parent */ + parent?: (string|null); + + /** ListCloneJobsRequest pageSize */ + pageSize?: (number|null); + + /** ListCloneJobsRequest pageToken */ + pageToken?: (string|null); + + /** ListCloneJobsRequest filter */ + filter?: (string|null); + + /** ListCloneJobsRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListCloneJobsRequest. */ + class ListCloneJobsRequest implements IListCloneJobsRequest { + + /** + * Constructs a new ListCloneJobsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vmmigration.v1.IListCloneJobsRequest); + + /** ListCloneJobsRequest parent. */ + public parent: string; + + /** ListCloneJobsRequest pageSize. */ + public pageSize: number; + + /** ListCloneJobsRequest pageToken. */ + public pageToken: string; + + /** ListCloneJobsRequest filter. */ + public filter: string; + + /** ListCloneJobsRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListCloneJobsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListCloneJobsRequest instance + */ + public static create(properties?: google.cloud.vmmigration.v1.IListCloneJobsRequest): google.cloud.vmmigration.v1.ListCloneJobsRequest; + + /** + * Encodes the specified ListCloneJobsRequest message. Does not implicitly {@link google.cloud.vmmigration.v1.ListCloneJobsRequest.verify|verify} messages. + * @param message ListCloneJobsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vmmigration.v1.IListCloneJobsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListCloneJobsRequest message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.ListCloneJobsRequest.verify|verify} messages. + * @param message ListCloneJobsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vmmigration.v1.IListCloneJobsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListCloneJobsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListCloneJobsRequest + * @throws {Error} If the payload is not 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.vmmigration.v1.ListCloneJobsRequest; + + /** + * Decodes a ListCloneJobsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListCloneJobsRequest + * @throws {Error} If the payload 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.vmmigration.v1.ListCloneJobsRequest; + + /** + * Verifies a ListCloneJobsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListCloneJobsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListCloneJobsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vmmigration.v1.ListCloneJobsRequest; + + /** + * Creates a plain object from a ListCloneJobsRequest message. Also converts values to other types if specified. + * @param message ListCloneJobsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vmmigration.v1.ListCloneJobsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListCloneJobsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListCloneJobsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListCloneJobsResponse. */ + interface IListCloneJobsResponse { + + /** ListCloneJobsResponse cloneJobs */ + cloneJobs?: (google.cloud.vmmigration.v1.ICloneJob[]|null); + + /** ListCloneJobsResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListCloneJobsResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListCloneJobsResponse. */ + class ListCloneJobsResponse implements IListCloneJobsResponse { + + /** + * Constructs a new ListCloneJobsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vmmigration.v1.IListCloneJobsResponse); + + /** ListCloneJobsResponse cloneJobs. */ + public cloneJobs: google.cloud.vmmigration.v1.ICloneJob[]; + + /** ListCloneJobsResponse nextPageToken. */ + public nextPageToken: string; + + /** ListCloneJobsResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListCloneJobsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListCloneJobsResponse instance + */ + public static create(properties?: google.cloud.vmmigration.v1.IListCloneJobsResponse): google.cloud.vmmigration.v1.ListCloneJobsResponse; + + /** + * Encodes the specified ListCloneJobsResponse message. Does not implicitly {@link google.cloud.vmmigration.v1.ListCloneJobsResponse.verify|verify} messages. + * @param message ListCloneJobsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vmmigration.v1.IListCloneJobsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListCloneJobsResponse message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.ListCloneJobsResponse.verify|verify} messages. + * @param message ListCloneJobsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vmmigration.v1.IListCloneJobsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListCloneJobsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListCloneJobsResponse + * @throws {Error} If the payload is not 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.vmmigration.v1.ListCloneJobsResponse; + + /** + * Decodes a ListCloneJobsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListCloneJobsResponse + * @throws {Error} If the payload 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.vmmigration.v1.ListCloneJobsResponse; + + /** + * Verifies a ListCloneJobsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListCloneJobsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListCloneJobsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vmmigration.v1.ListCloneJobsResponse; + + /** + * Creates a plain object from a ListCloneJobsResponse message. Also converts values to other types if specified. + * @param message ListCloneJobsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vmmigration.v1.ListCloneJobsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListCloneJobsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListCloneJobsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetCloneJobRequest. */ + interface IGetCloneJobRequest { + + /** GetCloneJobRequest name */ + name?: (string|null); + } + + /** Represents a GetCloneJobRequest. */ + class GetCloneJobRequest implements IGetCloneJobRequest { + + /** + * Constructs a new GetCloneJobRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vmmigration.v1.IGetCloneJobRequest); + + /** GetCloneJobRequest name. */ + public name: string; + + /** + * Creates a new GetCloneJobRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetCloneJobRequest instance + */ + public static create(properties?: google.cloud.vmmigration.v1.IGetCloneJobRequest): google.cloud.vmmigration.v1.GetCloneJobRequest; + + /** + * Encodes the specified GetCloneJobRequest message. Does not implicitly {@link google.cloud.vmmigration.v1.GetCloneJobRequest.verify|verify} messages. + * @param message GetCloneJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vmmigration.v1.IGetCloneJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetCloneJobRequest message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.GetCloneJobRequest.verify|verify} messages. + * @param message GetCloneJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vmmigration.v1.IGetCloneJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetCloneJobRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetCloneJobRequest + * @throws {Error} If the payload is not 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.vmmigration.v1.GetCloneJobRequest; + + /** + * Decodes a GetCloneJobRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetCloneJobRequest + * @throws {Error} If the payload 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.vmmigration.v1.GetCloneJobRequest; + + /** + * Verifies a GetCloneJobRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetCloneJobRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetCloneJobRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vmmigration.v1.GetCloneJobRequest; + + /** + * Creates a plain object from a GetCloneJobRequest message. Also converts values to other types if specified. + * @param message GetCloneJobRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vmmigration.v1.GetCloneJobRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetCloneJobRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetCloneJobRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Source. */ + interface ISource { + + /** Source vmware */ + vmware?: (google.cloud.vmmigration.v1.IVmwareSourceDetails|null); + + /** Source name */ + name?: (string|null); + + /** Source createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Source updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Source labels */ + labels?: ({ [k: string]: string }|null); + + /** Source description */ + description?: (string|null); + } + + /** Represents a Source. */ + class Source implements ISource { + + /** + * Constructs a new Source. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vmmigration.v1.ISource); + + /** Source vmware. */ + public vmware?: (google.cloud.vmmigration.v1.IVmwareSourceDetails|null); + + /** Source name. */ + public name: string; + + /** Source createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Source updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Source labels. */ + public labels: { [k: string]: string }; + + /** Source description. */ + public description: string; + + /** Source sourceDetails. */ + public sourceDetails?: "vmware"; + + /** + * Creates a new Source instance using the specified properties. + * @param [properties] Properties to set + * @returns Source instance + */ + public static create(properties?: google.cloud.vmmigration.v1.ISource): google.cloud.vmmigration.v1.Source; + + /** + * Encodes the specified Source message. Does not implicitly {@link google.cloud.vmmigration.v1.Source.verify|verify} messages. + * @param message Source message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vmmigration.v1.ISource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Source message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.Source.verify|verify} messages. + * @param message Source message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vmmigration.v1.ISource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Source message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Source + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.vmmigration.v1.Source; + + /** + * Decodes a Source message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Source + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.vmmigration.v1.Source; + + /** + * Verifies a Source message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Source message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Source + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vmmigration.v1.Source; + + /** + * Creates a plain object from a Source message. Also converts values to other types if specified. + * @param message Source + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vmmigration.v1.Source, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Source to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Source + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a VmwareSourceDetails. */ + interface IVmwareSourceDetails { + + /** VmwareSourceDetails username */ + username?: (string|null); + + /** VmwareSourceDetails password */ + password?: (string|null); + + /** VmwareSourceDetails vcenterIp */ + vcenterIp?: (string|null); + + /** VmwareSourceDetails thumbprint */ + thumbprint?: (string|null); + } + + /** Represents a VmwareSourceDetails. */ + class VmwareSourceDetails implements IVmwareSourceDetails { + + /** + * Constructs a new VmwareSourceDetails. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vmmigration.v1.IVmwareSourceDetails); + + /** VmwareSourceDetails username. */ + public username: string; + + /** VmwareSourceDetails password. */ + public password: string; + + /** VmwareSourceDetails vcenterIp. */ + public vcenterIp: string; + + /** VmwareSourceDetails thumbprint. */ + public thumbprint: string; + + /** + * Creates a new VmwareSourceDetails instance using the specified properties. + * @param [properties] Properties to set + * @returns VmwareSourceDetails instance + */ + public static create(properties?: google.cloud.vmmigration.v1.IVmwareSourceDetails): google.cloud.vmmigration.v1.VmwareSourceDetails; + + /** + * Encodes the specified VmwareSourceDetails message. Does not implicitly {@link google.cloud.vmmigration.v1.VmwareSourceDetails.verify|verify} messages. + * @param message VmwareSourceDetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vmmigration.v1.IVmwareSourceDetails, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VmwareSourceDetails message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.VmwareSourceDetails.verify|verify} messages. + * @param message VmwareSourceDetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vmmigration.v1.IVmwareSourceDetails, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VmwareSourceDetails message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VmwareSourceDetails + * @throws {Error} If the payload is not 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.vmmigration.v1.VmwareSourceDetails; + + /** + * Decodes a VmwareSourceDetails message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VmwareSourceDetails + * @throws {Error} If the payload 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.vmmigration.v1.VmwareSourceDetails; + + /** + * Verifies a VmwareSourceDetails message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a VmwareSourceDetails message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VmwareSourceDetails + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vmmigration.v1.VmwareSourceDetails; + + /** + * Creates a plain object from a VmwareSourceDetails message. Also converts values to other types if specified. + * @param message VmwareSourceDetails + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vmmigration.v1.VmwareSourceDetails, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VmwareSourceDetails to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VmwareSourceDetails + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DatacenterConnector. */ + interface IDatacenterConnector { + + /** DatacenterConnector createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** DatacenterConnector updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** DatacenterConnector name */ + name?: (string|null); + + /** DatacenterConnector registrationId */ + registrationId?: (string|null); + + /** DatacenterConnector serviceAccount */ + serviceAccount?: (string|null); + + /** DatacenterConnector version */ + version?: (string|null); + + /** DatacenterConnector bucket */ + bucket?: (string|null); + + /** DatacenterConnector state */ + state?: (google.cloud.vmmigration.v1.DatacenterConnector.State|keyof typeof google.cloud.vmmigration.v1.DatacenterConnector.State|null); + + /** DatacenterConnector stateTime */ + stateTime?: (google.protobuf.ITimestamp|null); + + /** DatacenterConnector error */ + error?: (google.rpc.IStatus|null); + + /** DatacenterConnector applianceInfrastructureVersion */ + applianceInfrastructureVersion?: (string|null); + + /** DatacenterConnector applianceSoftwareVersion */ + applianceSoftwareVersion?: (string|null); + + /** DatacenterConnector availableVersions */ + availableVersions?: (google.cloud.vmmigration.v1.IAvailableUpdates|null); + + /** DatacenterConnector upgradeStatus */ + upgradeStatus?: (google.cloud.vmmigration.v1.IUpgradeStatus|null); + } + + /** Represents a DatacenterConnector. */ + class DatacenterConnector implements IDatacenterConnector { + + /** + * Constructs a new DatacenterConnector. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vmmigration.v1.IDatacenterConnector); + + /** DatacenterConnector createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** DatacenterConnector updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** DatacenterConnector name. */ + public name: string; + + /** DatacenterConnector registrationId. */ + public registrationId: string; + + /** DatacenterConnector serviceAccount. */ + public serviceAccount: string; + + /** DatacenterConnector version. */ + public version: string; + + /** DatacenterConnector bucket. */ + public bucket: string; + + /** DatacenterConnector state. */ + public state: (google.cloud.vmmigration.v1.DatacenterConnector.State|keyof typeof google.cloud.vmmigration.v1.DatacenterConnector.State); + + /** DatacenterConnector stateTime. */ + public stateTime?: (google.protobuf.ITimestamp|null); + + /** DatacenterConnector error. */ + public error?: (google.rpc.IStatus|null); + + /** DatacenterConnector applianceInfrastructureVersion. */ + public applianceInfrastructureVersion: string; + + /** DatacenterConnector applianceSoftwareVersion. */ + public applianceSoftwareVersion: string; + + /** DatacenterConnector availableVersions. */ + public availableVersions?: (google.cloud.vmmigration.v1.IAvailableUpdates|null); + + /** DatacenterConnector upgradeStatus. */ + public upgradeStatus?: (google.cloud.vmmigration.v1.IUpgradeStatus|null); + + /** + * Creates a new DatacenterConnector instance using the specified properties. + * @param [properties] Properties to set + * @returns DatacenterConnector instance + */ + public static create(properties?: google.cloud.vmmigration.v1.IDatacenterConnector): google.cloud.vmmigration.v1.DatacenterConnector; + + /** + * Encodes the specified DatacenterConnector message. Does not implicitly {@link google.cloud.vmmigration.v1.DatacenterConnector.verify|verify} messages. + * @param message DatacenterConnector message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vmmigration.v1.IDatacenterConnector, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DatacenterConnector message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.DatacenterConnector.verify|verify} messages. + * @param message DatacenterConnector message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vmmigration.v1.IDatacenterConnector, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DatacenterConnector message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DatacenterConnector + * @throws {Error} If the payload is not 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.vmmigration.v1.DatacenterConnector; + + /** + * Decodes a DatacenterConnector message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DatacenterConnector + * @throws {Error} If the payload 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.vmmigration.v1.DatacenterConnector; + + /** + * Verifies a DatacenterConnector message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DatacenterConnector message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DatacenterConnector + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vmmigration.v1.DatacenterConnector; + + /** + * Creates a plain object from a DatacenterConnector message. Also converts values to other types if specified. + * @param message DatacenterConnector + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vmmigration.v1.DatacenterConnector, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DatacenterConnector to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DatacenterConnector + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace DatacenterConnector { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + PENDING = 1, + OFFLINE = 2, + FAILED = 3, + ACTIVE = 4 + } + } + + /** Properties of an UpgradeStatus. */ + interface IUpgradeStatus { + + /** UpgradeStatus version */ + version?: (string|null); + + /** UpgradeStatus state */ + state?: (google.cloud.vmmigration.v1.UpgradeStatus.State|keyof typeof google.cloud.vmmigration.v1.UpgradeStatus.State|null); + + /** UpgradeStatus error */ + error?: (google.rpc.IStatus|null); + + /** UpgradeStatus startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** UpgradeStatus previousVersion */ + previousVersion?: (string|null); + } + + /** Represents an UpgradeStatus. */ + class UpgradeStatus implements IUpgradeStatus { + + /** + * Constructs a new UpgradeStatus. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vmmigration.v1.IUpgradeStatus); + + /** UpgradeStatus version. */ + public version: string; + + /** UpgradeStatus state. */ + public state: (google.cloud.vmmigration.v1.UpgradeStatus.State|keyof typeof google.cloud.vmmigration.v1.UpgradeStatus.State); + + /** UpgradeStatus error. */ + public error?: (google.rpc.IStatus|null); + + /** UpgradeStatus startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** UpgradeStatus previousVersion. */ + public previousVersion: string; + + /** + * Creates a new UpgradeStatus instance using the specified properties. + * @param [properties] Properties to set + * @returns UpgradeStatus instance + */ + public static create(properties?: google.cloud.vmmigration.v1.IUpgradeStatus): google.cloud.vmmigration.v1.UpgradeStatus; + + /** + * Encodes the specified UpgradeStatus message. Does not implicitly {@link google.cloud.vmmigration.v1.UpgradeStatus.verify|verify} messages. + * @param message UpgradeStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vmmigration.v1.IUpgradeStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpgradeStatus message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.UpgradeStatus.verify|verify} messages. + * @param message UpgradeStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vmmigration.v1.IUpgradeStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpgradeStatus message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpgradeStatus + * @throws {Error} If the payload is not 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.vmmigration.v1.UpgradeStatus; + + /** + * Decodes an UpgradeStatus message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpgradeStatus + * @throws {Error} If the payload 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.vmmigration.v1.UpgradeStatus; + + /** + * Verifies an UpgradeStatus message. + * @param message Plain 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 UpgradeStatus message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpgradeStatus + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vmmigration.v1.UpgradeStatus; + + /** + * Creates a plain object from an UpgradeStatus message. Also converts values to other types if specified. + * @param message UpgradeStatus + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vmmigration.v1.UpgradeStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpgradeStatus to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpgradeStatus + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace UpgradeStatus { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + RUNNING = 1, + FAILED = 2, + SUCCEEDED = 3 + } + } + + /** Properties of an AvailableUpdates. */ + interface IAvailableUpdates { + + /** AvailableUpdates newDeployableAppliance */ + newDeployableAppliance?: (google.cloud.vmmigration.v1.IApplianceVersion|null); + + /** AvailableUpdates inPlaceUpdate */ + inPlaceUpdate?: (google.cloud.vmmigration.v1.IApplianceVersion|null); + } + + /** Represents an AvailableUpdates. */ + class AvailableUpdates implements IAvailableUpdates { + + /** + * Constructs a new AvailableUpdates. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vmmigration.v1.IAvailableUpdates); + + /** AvailableUpdates newDeployableAppliance. */ + public newDeployableAppliance?: (google.cloud.vmmigration.v1.IApplianceVersion|null); + + /** AvailableUpdates inPlaceUpdate. */ + public inPlaceUpdate?: (google.cloud.vmmigration.v1.IApplianceVersion|null); + + /** + * Creates a new AvailableUpdates instance using the specified properties. + * @param [properties] Properties to set + * @returns AvailableUpdates instance + */ + public static create(properties?: google.cloud.vmmigration.v1.IAvailableUpdates): google.cloud.vmmigration.v1.AvailableUpdates; + + /** + * Encodes the specified AvailableUpdates message. Does not implicitly {@link google.cloud.vmmigration.v1.AvailableUpdates.verify|verify} messages. + * @param message AvailableUpdates message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vmmigration.v1.IAvailableUpdates, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AvailableUpdates message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.AvailableUpdates.verify|verify} messages. + * @param message AvailableUpdates message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vmmigration.v1.IAvailableUpdates, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AvailableUpdates message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AvailableUpdates + * @throws {Error} If the payload is not 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.vmmigration.v1.AvailableUpdates; + + /** + * Decodes an AvailableUpdates message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AvailableUpdates + * @throws {Error} If the payload 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.vmmigration.v1.AvailableUpdates; + + /** + * Verifies an AvailableUpdates message. + * @param message Plain 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 AvailableUpdates message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AvailableUpdates + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vmmigration.v1.AvailableUpdates; + + /** + * Creates a plain object from an AvailableUpdates message. Also converts values to other types if specified. + * @param message AvailableUpdates + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vmmigration.v1.AvailableUpdates, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AvailableUpdates to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AvailableUpdates + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ApplianceVersion. */ + interface IApplianceVersion { + + /** ApplianceVersion version */ + version?: (string|null); + + /** ApplianceVersion uri */ + uri?: (string|null); + + /** ApplianceVersion critical */ + critical?: (boolean|null); + + /** ApplianceVersion releaseNotesUri */ + releaseNotesUri?: (string|null); + } + + /** Represents an ApplianceVersion. */ + class ApplianceVersion implements IApplianceVersion { + + /** + * Constructs a new ApplianceVersion. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vmmigration.v1.IApplianceVersion); + + /** ApplianceVersion version. */ + public version: string; + + /** ApplianceVersion uri. */ + public uri: string; + + /** ApplianceVersion critical. */ + public critical: boolean; + + /** ApplianceVersion releaseNotesUri. */ + public releaseNotesUri: string; + + /** + * Creates a new ApplianceVersion instance using the specified properties. + * @param [properties] Properties to set + * @returns ApplianceVersion instance + */ + public static create(properties?: google.cloud.vmmigration.v1.IApplianceVersion): google.cloud.vmmigration.v1.ApplianceVersion; + + /** + * Encodes the specified ApplianceVersion message. Does not implicitly {@link google.cloud.vmmigration.v1.ApplianceVersion.verify|verify} messages. + * @param message ApplianceVersion message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vmmigration.v1.IApplianceVersion, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ApplianceVersion message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.ApplianceVersion.verify|verify} messages. + * @param message ApplianceVersion message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vmmigration.v1.IApplianceVersion, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ApplianceVersion message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ApplianceVersion + * @throws {Error} If the payload is not 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.vmmigration.v1.ApplianceVersion; + + /** + * Decodes an ApplianceVersion message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ApplianceVersion + * @throws {Error} If the payload 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.vmmigration.v1.ApplianceVersion; + + /** + * Verifies an ApplianceVersion message. + * @param message Plain 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 ApplianceVersion message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ApplianceVersion + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vmmigration.v1.ApplianceVersion; + + /** + * Creates a plain object from an ApplianceVersion message. Also converts values to other types if specified. + * @param message ApplianceVersion + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vmmigration.v1.ApplianceVersion, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ApplianceVersion to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ApplianceVersion + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListSourcesRequest. */ + interface IListSourcesRequest { + + /** ListSourcesRequest parent */ + parent?: (string|null); + + /** ListSourcesRequest pageSize */ + pageSize?: (number|null); + + /** ListSourcesRequest pageToken */ + pageToken?: (string|null); + + /** ListSourcesRequest filter */ + filter?: (string|null); + + /** ListSourcesRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListSourcesRequest. */ + class ListSourcesRequest implements IListSourcesRequest { + + /** + * Constructs a new ListSourcesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vmmigration.v1.IListSourcesRequest); + + /** ListSourcesRequest parent. */ + public parent: string; + + /** ListSourcesRequest pageSize. */ + public pageSize: number; + + /** ListSourcesRequest pageToken. */ + public pageToken: string; + + /** ListSourcesRequest filter. */ + public filter: string; + + /** ListSourcesRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListSourcesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListSourcesRequest instance + */ + public static create(properties?: google.cloud.vmmigration.v1.IListSourcesRequest): google.cloud.vmmigration.v1.ListSourcesRequest; + + /** + * Encodes the specified ListSourcesRequest message. Does not implicitly {@link google.cloud.vmmigration.v1.ListSourcesRequest.verify|verify} messages. + * @param message ListSourcesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vmmigration.v1.IListSourcesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListSourcesRequest message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.ListSourcesRequest.verify|verify} messages. + * @param message ListSourcesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vmmigration.v1.IListSourcesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListSourcesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListSourcesRequest + * @throws {Error} If the payload is not 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.vmmigration.v1.ListSourcesRequest; + + /** + * Decodes a ListSourcesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListSourcesRequest + * @throws {Error} If the payload 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.vmmigration.v1.ListSourcesRequest; + + /** + * Verifies a ListSourcesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListSourcesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListSourcesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vmmigration.v1.ListSourcesRequest; + + /** + * Creates a plain object from a ListSourcesRequest message. Also converts values to other types if specified. + * @param message ListSourcesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vmmigration.v1.ListSourcesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListSourcesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListSourcesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListSourcesResponse. */ + interface IListSourcesResponse { + + /** ListSourcesResponse sources */ + sources?: (google.cloud.vmmigration.v1.ISource[]|null); + + /** ListSourcesResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListSourcesResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListSourcesResponse. */ + class ListSourcesResponse implements IListSourcesResponse { + + /** + * Constructs a new ListSourcesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vmmigration.v1.IListSourcesResponse); + + /** ListSourcesResponse sources. */ + public sources: google.cloud.vmmigration.v1.ISource[]; + + /** ListSourcesResponse nextPageToken. */ + public nextPageToken: string; + + /** ListSourcesResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListSourcesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListSourcesResponse instance + */ + public static create(properties?: google.cloud.vmmigration.v1.IListSourcesResponse): google.cloud.vmmigration.v1.ListSourcesResponse; + + /** + * Encodes the specified ListSourcesResponse message. Does not implicitly {@link google.cloud.vmmigration.v1.ListSourcesResponse.verify|verify} messages. + * @param message ListSourcesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vmmigration.v1.IListSourcesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListSourcesResponse message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.ListSourcesResponse.verify|verify} messages. + * @param message ListSourcesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vmmigration.v1.IListSourcesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListSourcesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListSourcesResponse + * @throws {Error} If the payload is not 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.vmmigration.v1.ListSourcesResponse; + + /** + * Decodes a ListSourcesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListSourcesResponse + * @throws {Error} If the payload 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.vmmigration.v1.ListSourcesResponse; + + /** + * Verifies a ListSourcesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListSourcesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListSourcesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vmmigration.v1.ListSourcesResponse; + + /** + * Creates a plain object from a ListSourcesResponse message. Also converts values to other types if specified. + * @param message ListSourcesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vmmigration.v1.ListSourcesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListSourcesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListSourcesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetSourceRequest. */ + interface IGetSourceRequest { + + /** GetSourceRequest name */ + name?: (string|null); + } + + /** Represents a GetSourceRequest. */ + class GetSourceRequest implements IGetSourceRequest { + + /** + * Constructs a new GetSourceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vmmigration.v1.IGetSourceRequest); + + /** GetSourceRequest name. */ + public name: string; + + /** + * Creates a new GetSourceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetSourceRequest instance + */ + public static create(properties?: google.cloud.vmmigration.v1.IGetSourceRequest): google.cloud.vmmigration.v1.GetSourceRequest; + + /** + * Encodes the specified GetSourceRequest message. Does not implicitly {@link google.cloud.vmmigration.v1.GetSourceRequest.verify|verify} messages. + * @param message GetSourceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vmmigration.v1.IGetSourceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetSourceRequest message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.GetSourceRequest.verify|verify} messages. + * @param message GetSourceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vmmigration.v1.IGetSourceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetSourceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetSourceRequest + * @throws {Error} If the payload is not 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.vmmigration.v1.GetSourceRequest; + + /** + * Decodes a GetSourceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetSourceRequest + * @throws {Error} If the payload 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.vmmigration.v1.GetSourceRequest; + + /** + * Verifies a GetSourceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetSourceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetSourceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vmmigration.v1.GetSourceRequest; + + /** + * Creates a plain object from a GetSourceRequest message. Also converts values to other types if specified. + * @param message GetSourceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vmmigration.v1.GetSourceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetSourceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetSourceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateSourceRequest. */ + interface ICreateSourceRequest { + + /** CreateSourceRequest parent */ + parent?: (string|null); + + /** CreateSourceRequest sourceId */ + sourceId?: (string|null); + + /** CreateSourceRequest source */ + source?: (google.cloud.vmmigration.v1.ISource|null); + + /** CreateSourceRequest requestId */ + requestId?: (string|null); + } + + /** Represents a CreateSourceRequest. */ + class CreateSourceRequest implements ICreateSourceRequest { + + /** + * Constructs a new CreateSourceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vmmigration.v1.ICreateSourceRequest); + + /** CreateSourceRequest parent. */ + public parent: string; + + /** CreateSourceRequest sourceId. */ + public sourceId: string; + + /** CreateSourceRequest source. */ + public source?: (google.cloud.vmmigration.v1.ISource|null); + + /** CreateSourceRequest requestId. */ + public requestId: string; + + /** + * Creates a new CreateSourceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateSourceRequest instance + */ + public static create(properties?: google.cloud.vmmigration.v1.ICreateSourceRequest): google.cloud.vmmigration.v1.CreateSourceRequest; + + /** + * Encodes the specified CreateSourceRequest message. Does not implicitly {@link google.cloud.vmmigration.v1.CreateSourceRequest.verify|verify} messages. + * @param message CreateSourceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vmmigration.v1.ICreateSourceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateSourceRequest message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.CreateSourceRequest.verify|verify} messages. + * @param message CreateSourceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vmmigration.v1.ICreateSourceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateSourceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateSourceRequest + * @throws {Error} If the payload is not 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.vmmigration.v1.CreateSourceRequest; + + /** + * Decodes a CreateSourceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateSourceRequest + * @throws {Error} If the payload 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.vmmigration.v1.CreateSourceRequest; + + /** + * Verifies a CreateSourceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateSourceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateSourceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vmmigration.v1.CreateSourceRequest; + + /** + * Creates a plain object from a CreateSourceRequest message. Also converts values to other types if specified. + * @param message CreateSourceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vmmigration.v1.CreateSourceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateSourceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateSourceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateSourceRequest. */ + interface IUpdateSourceRequest { + + /** UpdateSourceRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateSourceRequest source */ + source?: (google.cloud.vmmigration.v1.ISource|null); + + /** UpdateSourceRequest requestId */ + requestId?: (string|null); + } + + /** Represents an UpdateSourceRequest. */ + class UpdateSourceRequest implements IUpdateSourceRequest { + + /** + * Constructs a new UpdateSourceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vmmigration.v1.IUpdateSourceRequest); + + /** UpdateSourceRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateSourceRequest source. */ + public source?: (google.cloud.vmmigration.v1.ISource|null); + + /** UpdateSourceRequest requestId. */ + public requestId: string; + + /** + * Creates a new UpdateSourceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateSourceRequest instance + */ + public static create(properties?: google.cloud.vmmigration.v1.IUpdateSourceRequest): google.cloud.vmmigration.v1.UpdateSourceRequest; + + /** + * Encodes the specified UpdateSourceRequest message. Does not implicitly {@link google.cloud.vmmigration.v1.UpdateSourceRequest.verify|verify} messages. + * @param message UpdateSourceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vmmigration.v1.IUpdateSourceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateSourceRequest message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.UpdateSourceRequest.verify|verify} messages. + * @param message UpdateSourceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vmmigration.v1.IUpdateSourceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateSourceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateSourceRequest + * @throws {Error} If the payload is not 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.vmmigration.v1.UpdateSourceRequest; + + /** + * Decodes an UpdateSourceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateSourceRequest + * @throws {Error} If the payload 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.vmmigration.v1.UpdateSourceRequest; + + /** + * Verifies an UpdateSourceRequest message. + * @param message Plain 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 UpdateSourceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateSourceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vmmigration.v1.UpdateSourceRequest; + + /** + * Creates a plain object from an UpdateSourceRequest message. Also converts values to other types if specified. + * @param message UpdateSourceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vmmigration.v1.UpdateSourceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateSourceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateSourceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteSourceRequest. */ + interface IDeleteSourceRequest { + + /** DeleteSourceRequest name */ + name?: (string|null); + + /** DeleteSourceRequest requestId */ + requestId?: (string|null); + } + + /** Represents a DeleteSourceRequest. */ + class DeleteSourceRequest implements IDeleteSourceRequest { + + /** + * Constructs a new DeleteSourceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vmmigration.v1.IDeleteSourceRequest); + + /** DeleteSourceRequest name. */ + public name: string; + + /** DeleteSourceRequest requestId. */ + public requestId: string; + + /** + * Creates a new DeleteSourceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteSourceRequest instance + */ + public static create(properties?: google.cloud.vmmigration.v1.IDeleteSourceRequest): google.cloud.vmmigration.v1.DeleteSourceRequest; + + /** + * Encodes the specified DeleteSourceRequest message. Does not implicitly {@link google.cloud.vmmigration.v1.DeleteSourceRequest.verify|verify} messages. + * @param message DeleteSourceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vmmigration.v1.IDeleteSourceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteSourceRequest message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.DeleteSourceRequest.verify|verify} messages. + * @param message DeleteSourceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vmmigration.v1.IDeleteSourceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteSourceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteSourceRequest + * @throws {Error} If the payload is not 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.vmmigration.v1.DeleteSourceRequest; + + /** + * Decodes a DeleteSourceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteSourceRequest + * @throws {Error} If the payload 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.vmmigration.v1.DeleteSourceRequest; + + /** + * Verifies a DeleteSourceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteSourceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteSourceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vmmigration.v1.DeleteSourceRequest; + + /** + * Creates a plain object from a DeleteSourceRequest message. Also converts values to other types if specified. + * @param message DeleteSourceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vmmigration.v1.DeleteSourceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteSourceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteSourceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FetchInventoryRequest. */ + interface IFetchInventoryRequest { + + /** FetchInventoryRequest source */ + source?: (string|null); + + /** FetchInventoryRequest forceRefresh */ + forceRefresh?: (boolean|null); + } + + /** Represents a FetchInventoryRequest. */ + class FetchInventoryRequest implements IFetchInventoryRequest { + + /** + * Constructs a new FetchInventoryRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vmmigration.v1.IFetchInventoryRequest); + + /** FetchInventoryRequest source. */ + public source: string; + + /** FetchInventoryRequest forceRefresh. */ + public forceRefresh: boolean; + + /** + * Creates a new FetchInventoryRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns FetchInventoryRequest instance + */ + public static create(properties?: google.cloud.vmmigration.v1.IFetchInventoryRequest): google.cloud.vmmigration.v1.FetchInventoryRequest; + + /** + * Encodes the specified FetchInventoryRequest message. Does not implicitly {@link google.cloud.vmmigration.v1.FetchInventoryRequest.verify|verify} messages. + * @param message FetchInventoryRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vmmigration.v1.IFetchInventoryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FetchInventoryRequest message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.FetchInventoryRequest.verify|verify} messages. + * @param message FetchInventoryRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vmmigration.v1.IFetchInventoryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FetchInventoryRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FetchInventoryRequest + * @throws {Error} If the payload is not 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.vmmigration.v1.FetchInventoryRequest; + + /** + * Decodes a FetchInventoryRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FetchInventoryRequest + * @throws {Error} If the payload 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.vmmigration.v1.FetchInventoryRequest; + + /** + * Verifies a FetchInventoryRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FetchInventoryRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FetchInventoryRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vmmigration.v1.FetchInventoryRequest; + + /** + * Creates a plain object from a FetchInventoryRequest message. Also converts values to other types if specified. + * @param message FetchInventoryRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vmmigration.v1.FetchInventoryRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FetchInventoryRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FetchInventoryRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a VmwareVmDetails. */ + interface IVmwareVmDetails { + + /** VmwareVmDetails vmId */ + vmId?: (string|null); + + /** VmwareVmDetails datacenterId */ + datacenterId?: (string|null); + + /** VmwareVmDetails datacenterDescription */ + datacenterDescription?: (string|null); + + /** VmwareVmDetails uuid */ + uuid?: (string|null); + + /** VmwareVmDetails displayName */ + displayName?: (string|null); + + /** VmwareVmDetails powerState */ + powerState?: (google.cloud.vmmigration.v1.VmwareVmDetails.PowerState|keyof typeof google.cloud.vmmigration.v1.VmwareVmDetails.PowerState|null); + + /** VmwareVmDetails cpuCount */ + cpuCount?: (number|null); + + /** VmwareVmDetails memoryMb */ + memoryMb?: (number|null); + + /** VmwareVmDetails diskCount */ + diskCount?: (number|null); + + /** VmwareVmDetails committedStorageMb */ + committedStorageMb?: (number|Long|string|null); + + /** VmwareVmDetails guestDescription */ + guestDescription?: (string|null); + + /** VmwareVmDetails bootOption */ + bootOption?: (google.cloud.vmmigration.v1.VmwareVmDetails.BootOption|keyof typeof google.cloud.vmmigration.v1.VmwareVmDetails.BootOption|null); + } + + /** Represents a VmwareVmDetails. */ + class VmwareVmDetails implements IVmwareVmDetails { + + /** + * Constructs a new VmwareVmDetails. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vmmigration.v1.IVmwareVmDetails); + + /** VmwareVmDetails vmId. */ + public vmId: string; + + /** VmwareVmDetails datacenterId. */ + public datacenterId: string; + + /** VmwareVmDetails datacenterDescription. */ + public datacenterDescription: string; + + /** VmwareVmDetails uuid. */ + public uuid: string; + + /** VmwareVmDetails displayName. */ + public displayName: string; + + /** VmwareVmDetails powerState. */ + public powerState: (google.cloud.vmmigration.v1.VmwareVmDetails.PowerState|keyof typeof google.cloud.vmmigration.v1.VmwareVmDetails.PowerState); + + /** VmwareVmDetails cpuCount. */ + public cpuCount: number; + + /** VmwareVmDetails memoryMb. */ + public memoryMb: number; + + /** VmwareVmDetails diskCount. */ + public diskCount: number; + + /** VmwareVmDetails committedStorageMb. */ + public committedStorageMb: (number|Long|string); + + /** VmwareVmDetails guestDescription. */ + public guestDescription: string; + + /** VmwareVmDetails bootOption. */ + public bootOption: (google.cloud.vmmigration.v1.VmwareVmDetails.BootOption|keyof typeof google.cloud.vmmigration.v1.VmwareVmDetails.BootOption); + + /** + * Creates a new VmwareVmDetails instance using the specified properties. + * @param [properties] Properties to set + * @returns VmwareVmDetails instance + */ + public static create(properties?: google.cloud.vmmigration.v1.IVmwareVmDetails): google.cloud.vmmigration.v1.VmwareVmDetails; + + /** + * Encodes the specified VmwareVmDetails message. Does not implicitly {@link google.cloud.vmmigration.v1.VmwareVmDetails.verify|verify} messages. + * @param message VmwareVmDetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vmmigration.v1.IVmwareVmDetails, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VmwareVmDetails message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.VmwareVmDetails.verify|verify} messages. + * @param message VmwareVmDetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vmmigration.v1.IVmwareVmDetails, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VmwareVmDetails message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VmwareVmDetails + * @throws {Error} If the payload is not 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.vmmigration.v1.VmwareVmDetails; + + /** + * Decodes a VmwareVmDetails message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VmwareVmDetails + * @throws {Error} If the payload 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.vmmigration.v1.VmwareVmDetails; + + /** + * Verifies a VmwareVmDetails message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a VmwareVmDetails message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VmwareVmDetails + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vmmigration.v1.VmwareVmDetails; + + /** + * Creates a plain object from a VmwareVmDetails message. Also converts values to other types if specified. + * @param message VmwareVmDetails + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vmmigration.v1.VmwareVmDetails, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VmwareVmDetails to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VmwareVmDetails + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace VmwareVmDetails { + + /** PowerState enum. */ + enum PowerState { + POWER_STATE_UNSPECIFIED = 0, + ON = 1, + OFF = 2, + SUSPENDED = 3 + } + + /** BootOption enum. */ + enum BootOption { + BOOT_OPTION_UNSPECIFIED = 0, + EFI = 1, + BIOS = 2 + } + } + + /** Properties of a VmwareVmsDetails. */ + interface IVmwareVmsDetails { + + /** VmwareVmsDetails details */ + details?: (google.cloud.vmmigration.v1.IVmwareVmDetails[]|null); + } + + /** Represents a VmwareVmsDetails. */ + class VmwareVmsDetails implements IVmwareVmsDetails { + + /** + * Constructs a new VmwareVmsDetails. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vmmigration.v1.IVmwareVmsDetails); + + /** VmwareVmsDetails details. */ + public details: google.cloud.vmmigration.v1.IVmwareVmDetails[]; + + /** + * Creates a new VmwareVmsDetails instance using the specified properties. + * @param [properties] Properties to set + * @returns VmwareVmsDetails instance + */ + public static create(properties?: google.cloud.vmmigration.v1.IVmwareVmsDetails): google.cloud.vmmigration.v1.VmwareVmsDetails; + + /** + * Encodes the specified VmwareVmsDetails message. Does not implicitly {@link google.cloud.vmmigration.v1.VmwareVmsDetails.verify|verify} messages. + * @param message VmwareVmsDetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vmmigration.v1.IVmwareVmsDetails, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VmwareVmsDetails message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.VmwareVmsDetails.verify|verify} messages. + * @param message VmwareVmsDetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vmmigration.v1.IVmwareVmsDetails, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VmwareVmsDetails message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VmwareVmsDetails + * @throws {Error} If the payload is not 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.vmmigration.v1.VmwareVmsDetails; + + /** + * Decodes a VmwareVmsDetails message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VmwareVmsDetails + * @throws {Error} If the payload 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.vmmigration.v1.VmwareVmsDetails; + + /** + * Verifies a VmwareVmsDetails message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a VmwareVmsDetails message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VmwareVmsDetails + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vmmigration.v1.VmwareVmsDetails; + + /** + * Creates a plain object from a VmwareVmsDetails message. Also converts values to other types if specified. + * @param message VmwareVmsDetails + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vmmigration.v1.VmwareVmsDetails, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VmwareVmsDetails to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VmwareVmsDetails + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FetchInventoryResponse. */ + interface IFetchInventoryResponse { + + /** FetchInventoryResponse vmwareVms */ + vmwareVms?: (google.cloud.vmmigration.v1.IVmwareVmsDetails|null); + + /** FetchInventoryResponse updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a FetchInventoryResponse. */ + class FetchInventoryResponse implements IFetchInventoryResponse { + + /** + * Constructs a new FetchInventoryResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vmmigration.v1.IFetchInventoryResponse); + + /** FetchInventoryResponse vmwareVms. */ + public vmwareVms?: (google.cloud.vmmigration.v1.IVmwareVmsDetails|null); + + /** FetchInventoryResponse updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** FetchInventoryResponse SourceVms. */ + public SourceVms?: "vmwareVms"; + + /** + * Creates a new FetchInventoryResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns FetchInventoryResponse instance + */ + public static create(properties?: google.cloud.vmmigration.v1.IFetchInventoryResponse): google.cloud.vmmigration.v1.FetchInventoryResponse; + + /** + * Encodes the specified FetchInventoryResponse message. Does not implicitly {@link google.cloud.vmmigration.v1.FetchInventoryResponse.verify|verify} messages. + * @param message FetchInventoryResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vmmigration.v1.IFetchInventoryResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FetchInventoryResponse message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.FetchInventoryResponse.verify|verify} messages. + * @param message FetchInventoryResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vmmigration.v1.IFetchInventoryResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FetchInventoryResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FetchInventoryResponse + * @throws {Error} If the payload is not 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.vmmigration.v1.FetchInventoryResponse; + + /** + * Decodes a FetchInventoryResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FetchInventoryResponse + * @throws {Error} If the payload 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.vmmigration.v1.FetchInventoryResponse; + + /** + * Verifies a FetchInventoryResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FetchInventoryResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FetchInventoryResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vmmigration.v1.FetchInventoryResponse; + + /** + * Creates a plain object from a FetchInventoryResponse message. Also converts values to other types if specified. + * @param message FetchInventoryResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vmmigration.v1.FetchInventoryResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FetchInventoryResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FetchInventoryResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UtilizationReport. */ + interface IUtilizationReport { + + /** UtilizationReport name */ + name?: (string|null); + + /** UtilizationReport displayName */ + displayName?: (string|null); + + /** UtilizationReport state */ + state?: (google.cloud.vmmigration.v1.UtilizationReport.State|keyof typeof google.cloud.vmmigration.v1.UtilizationReport.State|null); + + /** UtilizationReport stateTime */ + stateTime?: (google.protobuf.ITimestamp|null); + + /** UtilizationReport error */ + error?: (google.rpc.IStatus|null); + + /** UtilizationReport createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** UtilizationReport timeFrame */ + timeFrame?: (google.cloud.vmmigration.v1.UtilizationReport.TimeFrame|keyof typeof google.cloud.vmmigration.v1.UtilizationReport.TimeFrame|null); + + /** UtilizationReport frameEndTime */ + frameEndTime?: (google.protobuf.ITimestamp|null); + + /** UtilizationReport vmCount */ + vmCount?: (number|null); + + /** UtilizationReport vms */ + vms?: (google.cloud.vmmigration.v1.IVmUtilizationInfo[]|null); + } + + /** Represents an UtilizationReport. */ + class UtilizationReport implements IUtilizationReport { + + /** + * Constructs a new UtilizationReport. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vmmigration.v1.IUtilizationReport); + + /** UtilizationReport name. */ + public name: string; + + /** UtilizationReport displayName. */ + public displayName: string; + + /** UtilizationReport state. */ + public state: (google.cloud.vmmigration.v1.UtilizationReport.State|keyof typeof google.cloud.vmmigration.v1.UtilizationReport.State); + + /** UtilizationReport stateTime. */ + public stateTime?: (google.protobuf.ITimestamp|null); + + /** UtilizationReport error. */ + public error?: (google.rpc.IStatus|null); + + /** UtilizationReport createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** UtilizationReport timeFrame. */ + public timeFrame: (google.cloud.vmmigration.v1.UtilizationReport.TimeFrame|keyof typeof google.cloud.vmmigration.v1.UtilizationReport.TimeFrame); + + /** UtilizationReport frameEndTime. */ + public frameEndTime?: (google.protobuf.ITimestamp|null); + + /** UtilizationReport vmCount. */ + public vmCount: number; + + /** UtilizationReport vms. */ + public vms: google.cloud.vmmigration.v1.IVmUtilizationInfo[]; + + /** + * Creates a new UtilizationReport instance using the specified properties. + * @param [properties] Properties to set + * @returns UtilizationReport instance + */ + public static create(properties?: google.cloud.vmmigration.v1.IUtilizationReport): google.cloud.vmmigration.v1.UtilizationReport; + + /** + * Encodes the specified UtilizationReport message. Does not implicitly {@link google.cloud.vmmigration.v1.UtilizationReport.verify|verify} messages. + * @param message UtilizationReport message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vmmigration.v1.IUtilizationReport, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UtilizationReport message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.UtilizationReport.verify|verify} messages. + * @param message UtilizationReport message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vmmigration.v1.IUtilizationReport, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UtilizationReport message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UtilizationReport + * @throws {Error} If the payload is not 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.vmmigration.v1.UtilizationReport; + + /** + * Decodes an UtilizationReport message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UtilizationReport + * @throws {Error} If the payload 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.vmmigration.v1.UtilizationReport; + + /** + * Verifies an UtilizationReport message. + * @param message Plain 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 UtilizationReport message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UtilizationReport + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vmmigration.v1.UtilizationReport; + + /** + * Creates a plain object from an UtilizationReport message. Also converts values to other types if specified. + * @param message UtilizationReport + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vmmigration.v1.UtilizationReport, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UtilizationReport to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UtilizationReport + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace UtilizationReport { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + CREATING = 1, + SUCCEEDED = 2, + FAILED = 3 + } + + /** TimeFrame enum. */ + enum TimeFrame { + TIME_FRAME_UNSPECIFIED = 0, + WEEK = 1, + MONTH = 2, + YEAR = 3 + } + } + + /** Properties of a VmUtilizationInfo. */ + interface IVmUtilizationInfo { + + /** VmUtilizationInfo vmwareVmDetails */ + vmwareVmDetails?: (google.cloud.vmmigration.v1.IVmwareVmDetails|null); + + /** VmUtilizationInfo vmId */ + vmId?: (string|null); + + /** VmUtilizationInfo utilization */ + utilization?: (google.cloud.vmmigration.v1.IVmUtilizationMetrics|null); + } + + /** Represents a VmUtilizationInfo. */ + class VmUtilizationInfo implements IVmUtilizationInfo { + + /** + * Constructs a new VmUtilizationInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vmmigration.v1.IVmUtilizationInfo); + + /** VmUtilizationInfo vmwareVmDetails. */ + public vmwareVmDetails?: (google.cloud.vmmigration.v1.IVmwareVmDetails|null); + + /** VmUtilizationInfo vmId. */ + public vmId: string; + + /** VmUtilizationInfo utilization. */ + public utilization?: (google.cloud.vmmigration.v1.IVmUtilizationMetrics|null); + + /** VmUtilizationInfo VmDetails. */ + public VmDetails?: "vmwareVmDetails"; + + /** + * Creates a new VmUtilizationInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns VmUtilizationInfo instance + */ + public static create(properties?: google.cloud.vmmigration.v1.IVmUtilizationInfo): google.cloud.vmmigration.v1.VmUtilizationInfo; + + /** + * Encodes the specified VmUtilizationInfo message. Does not implicitly {@link google.cloud.vmmigration.v1.VmUtilizationInfo.verify|verify} messages. + * @param message VmUtilizationInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vmmigration.v1.IVmUtilizationInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VmUtilizationInfo message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.VmUtilizationInfo.verify|verify} messages. + * @param message VmUtilizationInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vmmigration.v1.IVmUtilizationInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VmUtilizationInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VmUtilizationInfo + * @throws {Error} If the payload is not 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.vmmigration.v1.VmUtilizationInfo; + + /** + * Decodes a VmUtilizationInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VmUtilizationInfo + * @throws {Error} If the payload 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.vmmigration.v1.VmUtilizationInfo; + + /** + * Verifies a VmUtilizationInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a VmUtilizationInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VmUtilizationInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vmmigration.v1.VmUtilizationInfo; + + /** + * Creates a plain object from a VmUtilizationInfo message. Also converts values to other types if specified. + * @param message VmUtilizationInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vmmigration.v1.VmUtilizationInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VmUtilizationInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VmUtilizationInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a VmUtilizationMetrics. */ + interface IVmUtilizationMetrics { + + /** VmUtilizationMetrics cpuMaxPercent */ + cpuMaxPercent?: (number|null); + + /** VmUtilizationMetrics cpuAveragePercent */ + cpuAveragePercent?: (number|null); + + /** VmUtilizationMetrics memoryMaxPercent */ + memoryMaxPercent?: (number|null); + + /** VmUtilizationMetrics memoryAveragePercent */ + memoryAveragePercent?: (number|null); + + /** VmUtilizationMetrics diskIoRateMaxKbps */ + diskIoRateMaxKbps?: (number|Long|string|null); + + /** VmUtilizationMetrics diskIoRateAverageKbps */ + diskIoRateAverageKbps?: (number|Long|string|null); + + /** VmUtilizationMetrics networkThroughputMaxKbps */ + networkThroughputMaxKbps?: (number|Long|string|null); + + /** VmUtilizationMetrics networkThroughputAverageKbps */ + networkThroughputAverageKbps?: (number|Long|string|null); + } + + /** Represents a VmUtilizationMetrics. */ + class VmUtilizationMetrics implements IVmUtilizationMetrics { + + /** + * Constructs a new VmUtilizationMetrics. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vmmigration.v1.IVmUtilizationMetrics); + + /** VmUtilizationMetrics cpuMaxPercent. */ + public cpuMaxPercent: number; + + /** VmUtilizationMetrics cpuAveragePercent. */ + public cpuAveragePercent: number; + + /** VmUtilizationMetrics memoryMaxPercent. */ + public memoryMaxPercent: number; + + /** VmUtilizationMetrics memoryAveragePercent. */ + public memoryAveragePercent: number; + + /** VmUtilizationMetrics diskIoRateMaxKbps. */ + public diskIoRateMaxKbps: (number|Long|string); + + /** VmUtilizationMetrics diskIoRateAverageKbps. */ + public diskIoRateAverageKbps: (number|Long|string); + + /** VmUtilizationMetrics networkThroughputMaxKbps. */ + public networkThroughputMaxKbps: (number|Long|string); + + /** VmUtilizationMetrics networkThroughputAverageKbps. */ + public networkThroughputAverageKbps: (number|Long|string); + + /** + * Creates a new VmUtilizationMetrics instance using the specified properties. + * @param [properties] Properties to set + * @returns VmUtilizationMetrics instance + */ + public static create(properties?: google.cloud.vmmigration.v1.IVmUtilizationMetrics): google.cloud.vmmigration.v1.VmUtilizationMetrics; + + /** + * Encodes the specified VmUtilizationMetrics message. Does not implicitly {@link google.cloud.vmmigration.v1.VmUtilizationMetrics.verify|verify} messages. + * @param message VmUtilizationMetrics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vmmigration.v1.IVmUtilizationMetrics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VmUtilizationMetrics message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.VmUtilizationMetrics.verify|verify} messages. + * @param message VmUtilizationMetrics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vmmigration.v1.IVmUtilizationMetrics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VmUtilizationMetrics message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VmUtilizationMetrics + * @throws {Error} If the payload is not 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.vmmigration.v1.VmUtilizationMetrics; + + /** + * Decodes a VmUtilizationMetrics message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VmUtilizationMetrics + * @throws {Error} If the payload 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.vmmigration.v1.VmUtilizationMetrics; + + /** + * Verifies a VmUtilizationMetrics message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a VmUtilizationMetrics message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VmUtilizationMetrics + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vmmigration.v1.VmUtilizationMetrics; + + /** + * Creates a plain object from a VmUtilizationMetrics message. Also converts values to other types if specified. + * @param message VmUtilizationMetrics + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vmmigration.v1.VmUtilizationMetrics, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VmUtilizationMetrics to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VmUtilizationMetrics + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListUtilizationReportsRequest. */ + interface IListUtilizationReportsRequest { + + /** ListUtilizationReportsRequest parent */ + parent?: (string|null); + + /** ListUtilizationReportsRequest view */ + view?: (google.cloud.vmmigration.v1.UtilizationReportView|keyof typeof google.cloud.vmmigration.v1.UtilizationReportView|null); + + /** ListUtilizationReportsRequest pageSize */ + pageSize?: (number|null); + + /** ListUtilizationReportsRequest pageToken */ + pageToken?: (string|null); + + /** ListUtilizationReportsRequest filter */ + filter?: (string|null); + + /** ListUtilizationReportsRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListUtilizationReportsRequest. */ + class ListUtilizationReportsRequest implements IListUtilizationReportsRequest { + + /** + * Constructs a new ListUtilizationReportsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vmmigration.v1.IListUtilizationReportsRequest); + + /** ListUtilizationReportsRequest parent. */ + public parent: string; + + /** ListUtilizationReportsRequest view. */ + public view: (google.cloud.vmmigration.v1.UtilizationReportView|keyof typeof google.cloud.vmmigration.v1.UtilizationReportView); + + /** ListUtilizationReportsRequest pageSize. */ + public pageSize: number; + + /** ListUtilizationReportsRequest pageToken. */ + public pageToken: string; + + /** ListUtilizationReportsRequest filter. */ + public filter: string; + + /** ListUtilizationReportsRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListUtilizationReportsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListUtilizationReportsRequest instance + */ + public static create(properties?: google.cloud.vmmigration.v1.IListUtilizationReportsRequest): google.cloud.vmmigration.v1.ListUtilizationReportsRequest; + + /** + * Encodes the specified ListUtilizationReportsRequest message. Does not implicitly {@link google.cloud.vmmigration.v1.ListUtilizationReportsRequest.verify|verify} messages. + * @param message ListUtilizationReportsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vmmigration.v1.IListUtilizationReportsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListUtilizationReportsRequest message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.ListUtilizationReportsRequest.verify|verify} messages. + * @param message ListUtilizationReportsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vmmigration.v1.IListUtilizationReportsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListUtilizationReportsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListUtilizationReportsRequest + * @throws {Error} If the payload is not 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.vmmigration.v1.ListUtilizationReportsRequest; + + /** + * Decodes a ListUtilizationReportsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListUtilizationReportsRequest + * @throws {Error} If the payload 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.vmmigration.v1.ListUtilizationReportsRequest; + + /** + * Verifies a ListUtilizationReportsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListUtilizationReportsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListUtilizationReportsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vmmigration.v1.ListUtilizationReportsRequest; + + /** + * Creates a plain object from a ListUtilizationReportsRequest message. Also converts values to other types if specified. + * @param message ListUtilizationReportsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vmmigration.v1.ListUtilizationReportsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListUtilizationReportsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListUtilizationReportsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListUtilizationReportsResponse. */ + interface IListUtilizationReportsResponse { + + /** ListUtilizationReportsResponse utilizationReports */ + utilizationReports?: (google.cloud.vmmigration.v1.IUtilizationReport[]|null); + + /** ListUtilizationReportsResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListUtilizationReportsResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListUtilizationReportsResponse. */ + class ListUtilizationReportsResponse implements IListUtilizationReportsResponse { + + /** + * Constructs a new ListUtilizationReportsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vmmigration.v1.IListUtilizationReportsResponse); + + /** ListUtilizationReportsResponse utilizationReports. */ + public utilizationReports: google.cloud.vmmigration.v1.IUtilizationReport[]; + + /** ListUtilizationReportsResponse nextPageToken. */ + public nextPageToken: string; + + /** ListUtilizationReportsResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListUtilizationReportsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListUtilizationReportsResponse instance + */ + public static create(properties?: google.cloud.vmmigration.v1.IListUtilizationReportsResponse): google.cloud.vmmigration.v1.ListUtilizationReportsResponse; + + /** + * Encodes the specified ListUtilizationReportsResponse message. Does not implicitly {@link google.cloud.vmmigration.v1.ListUtilizationReportsResponse.verify|verify} messages. + * @param message ListUtilizationReportsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vmmigration.v1.IListUtilizationReportsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListUtilizationReportsResponse message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.ListUtilizationReportsResponse.verify|verify} messages. + * @param message ListUtilizationReportsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vmmigration.v1.IListUtilizationReportsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListUtilizationReportsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListUtilizationReportsResponse + * @throws {Error} If the payload is not 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.vmmigration.v1.ListUtilizationReportsResponse; + + /** + * Decodes a ListUtilizationReportsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListUtilizationReportsResponse + * @throws {Error} If the payload 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.vmmigration.v1.ListUtilizationReportsResponse; + + /** + * Verifies a ListUtilizationReportsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListUtilizationReportsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListUtilizationReportsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vmmigration.v1.ListUtilizationReportsResponse; + + /** + * Creates a plain object from a ListUtilizationReportsResponse message. Also converts values to other types if specified. + * @param message ListUtilizationReportsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vmmigration.v1.ListUtilizationReportsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListUtilizationReportsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListUtilizationReportsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetUtilizationReportRequest. */ + interface IGetUtilizationReportRequest { + + /** GetUtilizationReportRequest name */ + name?: (string|null); + + /** GetUtilizationReportRequest view */ + view?: (google.cloud.vmmigration.v1.UtilizationReportView|keyof typeof google.cloud.vmmigration.v1.UtilizationReportView|null); + } + + /** Represents a GetUtilizationReportRequest. */ + class GetUtilizationReportRequest implements IGetUtilizationReportRequest { + + /** + * Constructs a new GetUtilizationReportRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vmmigration.v1.IGetUtilizationReportRequest); + + /** GetUtilizationReportRequest name. */ + public name: string; + + /** GetUtilizationReportRequest view. */ + public view: (google.cloud.vmmigration.v1.UtilizationReportView|keyof typeof google.cloud.vmmigration.v1.UtilizationReportView); + + /** + * Creates a new GetUtilizationReportRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetUtilizationReportRequest instance + */ + public static create(properties?: google.cloud.vmmigration.v1.IGetUtilizationReportRequest): google.cloud.vmmigration.v1.GetUtilizationReportRequest; + + /** + * Encodes the specified GetUtilizationReportRequest message. Does not implicitly {@link google.cloud.vmmigration.v1.GetUtilizationReportRequest.verify|verify} messages. + * @param message GetUtilizationReportRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vmmigration.v1.IGetUtilizationReportRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetUtilizationReportRequest message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.GetUtilizationReportRequest.verify|verify} messages. + * @param message GetUtilizationReportRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vmmigration.v1.IGetUtilizationReportRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetUtilizationReportRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetUtilizationReportRequest + * @throws {Error} If the payload is not 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.vmmigration.v1.GetUtilizationReportRequest; + + /** + * Decodes a GetUtilizationReportRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetUtilizationReportRequest + * @throws {Error} If the payload 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.vmmigration.v1.GetUtilizationReportRequest; + + /** + * Verifies a GetUtilizationReportRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetUtilizationReportRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetUtilizationReportRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vmmigration.v1.GetUtilizationReportRequest; + + /** + * Creates a plain object from a GetUtilizationReportRequest message. Also converts values to other types if specified. + * @param message GetUtilizationReportRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vmmigration.v1.GetUtilizationReportRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetUtilizationReportRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetUtilizationReportRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateUtilizationReportRequest. */ + interface ICreateUtilizationReportRequest { + + /** CreateUtilizationReportRequest parent */ + parent?: (string|null); + + /** CreateUtilizationReportRequest utilizationReport */ + utilizationReport?: (google.cloud.vmmigration.v1.IUtilizationReport|null); + + /** CreateUtilizationReportRequest utilizationReportId */ + utilizationReportId?: (string|null); + + /** CreateUtilizationReportRequest requestId */ + requestId?: (string|null); + } + + /** Represents a CreateUtilizationReportRequest. */ + class CreateUtilizationReportRequest implements ICreateUtilizationReportRequest { + + /** + * Constructs a new CreateUtilizationReportRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vmmigration.v1.ICreateUtilizationReportRequest); + + /** CreateUtilizationReportRequest parent. */ + public parent: string; + + /** CreateUtilizationReportRequest utilizationReport. */ + public utilizationReport?: (google.cloud.vmmigration.v1.IUtilizationReport|null); + + /** CreateUtilizationReportRequest utilizationReportId. */ + public utilizationReportId: string; + + /** CreateUtilizationReportRequest requestId. */ + public requestId: string; + + /** + * Creates a new CreateUtilizationReportRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateUtilizationReportRequest instance + */ + public static create(properties?: google.cloud.vmmigration.v1.ICreateUtilizationReportRequest): google.cloud.vmmigration.v1.CreateUtilizationReportRequest; + + /** + * Encodes the specified CreateUtilizationReportRequest message. Does not implicitly {@link google.cloud.vmmigration.v1.CreateUtilizationReportRequest.verify|verify} messages. + * @param message CreateUtilizationReportRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vmmigration.v1.ICreateUtilizationReportRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateUtilizationReportRequest message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.CreateUtilizationReportRequest.verify|verify} messages. + * @param message CreateUtilizationReportRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vmmigration.v1.ICreateUtilizationReportRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateUtilizationReportRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateUtilizationReportRequest + * @throws {Error} If the payload is not 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.vmmigration.v1.CreateUtilizationReportRequest; + + /** + * Decodes a CreateUtilizationReportRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateUtilizationReportRequest + * @throws {Error} If the payload 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.vmmigration.v1.CreateUtilizationReportRequest; + + /** + * Verifies a CreateUtilizationReportRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateUtilizationReportRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateUtilizationReportRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vmmigration.v1.CreateUtilizationReportRequest; + + /** + * Creates a plain object from a CreateUtilizationReportRequest message. Also converts values to other types if specified. + * @param message CreateUtilizationReportRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vmmigration.v1.CreateUtilizationReportRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateUtilizationReportRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateUtilizationReportRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteUtilizationReportRequest. */ + interface IDeleteUtilizationReportRequest { + + /** DeleteUtilizationReportRequest name */ + name?: (string|null); + + /** DeleteUtilizationReportRequest requestId */ + requestId?: (string|null); + } + + /** Represents a DeleteUtilizationReportRequest. */ + class DeleteUtilizationReportRequest implements IDeleteUtilizationReportRequest { + + /** + * Constructs a new DeleteUtilizationReportRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vmmigration.v1.IDeleteUtilizationReportRequest); + + /** DeleteUtilizationReportRequest name. */ + public name: string; + + /** DeleteUtilizationReportRequest requestId. */ + public requestId: string; + + /** + * Creates a new DeleteUtilizationReportRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteUtilizationReportRequest instance + */ + public static create(properties?: google.cloud.vmmigration.v1.IDeleteUtilizationReportRequest): google.cloud.vmmigration.v1.DeleteUtilizationReportRequest; + + /** + * Encodes the specified DeleteUtilizationReportRequest message. Does not implicitly {@link google.cloud.vmmigration.v1.DeleteUtilizationReportRequest.verify|verify} messages. + * @param message DeleteUtilizationReportRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vmmigration.v1.IDeleteUtilizationReportRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteUtilizationReportRequest message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.DeleteUtilizationReportRequest.verify|verify} messages. + * @param message DeleteUtilizationReportRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vmmigration.v1.IDeleteUtilizationReportRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteUtilizationReportRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteUtilizationReportRequest + * @throws {Error} If the payload is not 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.vmmigration.v1.DeleteUtilizationReportRequest; + + /** + * Decodes a DeleteUtilizationReportRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteUtilizationReportRequest + * @throws {Error} If the payload 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.vmmigration.v1.DeleteUtilizationReportRequest; + + /** + * Verifies a DeleteUtilizationReportRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteUtilizationReportRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteUtilizationReportRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vmmigration.v1.DeleteUtilizationReportRequest; + + /** + * Creates a plain object from a DeleteUtilizationReportRequest message. Also converts values to other types if specified. + * @param message DeleteUtilizationReportRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vmmigration.v1.DeleteUtilizationReportRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteUtilizationReportRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteUtilizationReportRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListDatacenterConnectorsResponse. */ + interface IListDatacenterConnectorsResponse { + + /** ListDatacenterConnectorsResponse datacenterConnectors */ + datacenterConnectors?: (google.cloud.vmmigration.v1.IDatacenterConnector[]|null); + + /** ListDatacenterConnectorsResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListDatacenterConnectorsResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListDatacenterConnectorsResponse. */ + class ListDatacenterConnectorsResponse implements IListDatacenterConnectorsResponse { + + /** + * Constructs a new ListDatacenterConnectorsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vmmigration.v1.IListDatacenterConnectorsResponse); + + /** ListDatacenterConnectorsResponse datacenterConnectors. */ + public datacenterConnectors: google.cloud.vmmigration.v1.IDatacenterConnector[]; + + /** ListDatacenterConnectorsResponse nextPageToken. */ + public nextPageToken: string; + + /** ListDatacenterConnectorsResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListDatacenterConnectorsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListDatacenterConnectorsResponse instance + */ + public static create(properties?: google.cloud.vmmigration.v1.IListDatacenterConnectorsResponse): google.cloud.vmmigration.v1.ListDatacenterConnectorsResponse; + + /** + * Encodes the specified ListDatacenterConnectorsResponse message. Does not implicitly {@link google.cloud.vmmigration.v1.ListDatacenterConnectorsResponse.verify|verify} messages. + * @param message ListDatacenterConnectorsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vmmigration.v1.IListDatacenterConnectorsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListDatacenterConnectorsResponse message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.ListDatacenterConnectorsResponse.verify|verify} messages. + * @param message ListDatacenterConnectorsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vmmigration.v1.IListDatacenterConnectorsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListDatacenterConnectorsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListDatacenterConnectorsResponse + * @throws {Error} If the payload is not 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.vmmigration.v1.ListDatacenterConnectorsResponse; + + /** + * Decodes a ListDatacenterConnectorsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListDatacenterConnectorsResponse + * @throws {Error} If the payload 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.vmmigration.v1.ListDatacenterConnectorsResponse; + + /** + * Verifies a ListDatacenterConnectorsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListDatacenterConnectorsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListDatacenterConnectorsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vmmigration.v1.ListDatacenterConnectorsResponse; + + /** + * Creates a plain object from a ListDatacenterConnectorsResponse message. Also converts values to other types if specified. + * @param message ListDatacenterConnectorsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vmmigration.v1.ListDatacenterConnectorsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListDatacenterConnectorsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListDatacenterConnectorsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetDatacenterConnectorRequest. */ + interface IGetDatacenterConnectorRequest { + + /** GetDatacenterConnectorRequest name */ + name?: (string|null); + } + + /** Represents a GetDatacenterConnectorRequest. */ + class GetDatacenterConnectorRequest implements IGetDatacenterConnectorRequest { + + /** + * Constructs a new GetDatacenterConnectorRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vmmigration.v1.IGetDatacenterConnectorRequest); + + /** GetDatacenterConnectorRequest name. */ + public name: string; + + /** + * Creates a new GetDatacenterConnectorRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetDatacenterConnectorRequest instance + */ + public static create(properties?: google.cloud.vmmigration.v1.IGetDatacenterConnectorRequest): google.cloud.vmmigration.v1.GetDatacenterConnectorRequest; + + /** + * Encodes the specified GetDatacenterConnectorRequest message. Does not implicitly {@link google.cloud.vmmigration.v1.GetDatacenterConnectorRequest.verify|verify} messages. + * @param message GetDatacenterConnectorRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vmmigration.v1.IGetDatacenterConnectorRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetDatacenterConnectorRequest message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.GetDatacenterConnectorRequest.verify|verify} messages. + * @param message GetDatacenterConnectorRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vmmigration.v1.IGetDatacenterConnectorRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetDatacenterConnectorRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetDatacenterConnectorRequest + * @throws {Error} If the payload is not 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.vmmigration.v1.GetDatacenterConnectorRequest; + + /** + * Decodes a GetDatacenterConnectorRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetDatacenterConnectorRequest + * @throws {Error} If the payload 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.vmmigration.v1.GetDatacenterConnectorRequest; + + /** + * Verifies a GetDatacenterConnectorRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetDatacenterConnectorRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetDatacenterConnectorRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vmmigration.v1.GetDatacenterConnectorRequest; + + /** + * Creates a plain object from a GetDatacenterConnectorRequest message. Also converts values to other types if specified. + * @param message GetDatacenterConnectorRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vmmigration.v1.GetDatacenterConnectorRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetDatacenterConnectorRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetDatacenterConnectorRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateDatacenterConnectorRequest. */ + interface ICreateDatacenterConnectorRequest { + + /** CreateDatacenterConnectorRequest parent */ + parent?: (string|null); + + /** CreateDatacenterConnectorRequest datacenterConnectorId */ + datacenterConnectorId?: (string|null); + + /** CreateDatacenterConnectorRequest datacenterConnector */ + datacenterConnector?: (google.cloud.vmmigration.v1.IDatacenterConnector|null); + + /** CreateDatacenterConnectorRequest requestId */ + requestId?: (string|null); + } + + /** Represents a CreateDatacenterConnectorRequest. */ + class CreateDatacenterConnectorRequest implements ICreateDatacenterConnectorRequest { + + /** + * Constructs a new CreateDatacenterConnectorRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vmmigration.v1.ICreateDatacenterConnectorRequest); + + /** CreateDatacenterConnectorRequest parent. */ + public parent: string; + + /** CreateDatacenterConnectorRequest datacenterConnectorId. */ + public datacenterConnectorId: string; + + /** CreateDatacenterConnectorRequest datacenterConnector. */ + public datacenterConnector?: (google.cloud.vmmigration.v1.IDatacenterConnector|null); + + /** CreateDatacenterConnectorRequest requestId. */ + public requestId: string; + + /** + * Creates a new CreateDatacenterConnectorRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateDatacenterConnectorRequest instance + */ + public static create(properties?: google.cloud.vmmigration.v1.ICreateDatacenterConnectorRequest): google.cloud.vmmigration.v1.CreateDatacenterConnectorRequest; + + /** + * Encodes the specified CreateDatacenterConnectorRequest message. Does not implicitly {@link google.cloud.vmmigration.v1.CreateDatacenterConnectorRequest.verify|verify} messages. + * @param message CreateDatacenterConnectorRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vmmigration.v1.ICreateDatacenterConnectorRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateDatacenterConnectorRequest message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.CreateDatacenterConnectorRequest.verify|verify} messages. + * @param message CreateDatacenterConnectorRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vmmigration.v1.ICreateDatacenterConnectorRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateDatacenterConnectorRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateDatacenterConnectorRequest + * @throws {Error} If the payload is not 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.vmmigration.v1.CreateDatacenterConnectorRequest; + + /** + * Decodes a CreateDatacenterConnectorRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateDatacenterConnectorRequest + * @throws {Error} If the payload 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.vmmigration.v1.CreateDatacenterConnectorRequest; + + /** + * Verifies a CreateDatacenterConnectorRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateDatacenterConnectorRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateDatacenterConnectorRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vmmigration.v1.CreateDatacenterConnectorRequest; + + /** + * Creates a plain object from a CreateDatacenterConnectorRequest message. Also converts values to other types if specified. + * @param message CreateDatacenterConnectorRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vmmigration.v1.CreateDatacenterConnectorRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateDatacenterConnectorRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateDatacenterConnectorRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteDatacenterConnectorRequest. */ + interface IDeleteDatacenterConnectorRequest { + + /** DeleteDatacenterConnectorRequest name */ + name?: (string|null); + + /** DeleteDatacenterConnectorRequest requestId */ + requestId?: (string|null); + } + + /** Represents a DeleteDatacenterConnectorRequest. */ + class DeleteDatacenterConnectorRequest implements IDeleteDatacenterConnectorRequest { + + /** + * Constructs a new DeleteDatacenterConnectorRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vmmigration.v1.IDeleteDatacenterConnectorRequest); + + /** DeleteDatacenterConnectorRequest name. */ + public name: string; + + /** DeleteDatacenterConnectorRequest requestId. */ + public requestId: string; + + /** + * Creates a new DeleteDatacenterConnectorRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteDatacenterConnectorRequest instance + */ + public static create(properties?: google.cloud.vmmigration.v1.IDeleteDatacenterConnectorRequest): google.cloud.vmmigration.v1.DeleteDatacenterConnectorRequest; + + /** + * Encodes the specified DeleteDatacenterConnectorRequest message. Does not implicitly {@link google.cloud.vmmigration.v1.DeleteDatacenterConnectorRequest.verify|verify} messages. + * @param message DeleteDatacenterConnectorRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vmmigration.v1.IDeleteDatacenterConnectorRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteDatacenterConnectorRequest message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.DeleteDatacenterConnectorRequest.verify|verify} messages. + * @param message DeleteDatacenterConnectorRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vmmigration.v1.IDeleteDatacenterConnectorRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteDatacenterConnectorRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteDatacenterConnectorRequest + * @throws {Error} If the payload is not 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.vmmigration.v1.DeleteDatacenterConnectorRequest; + + /** + * Decodes a DeleteDatacenterConnectorRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteDatacenterConnectorRequest + * @throws {Error} If the payload 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.vmmigration.v1.DeleteDatacenterConnectorRequest; + + /** + * Verifies a DeleteDatacenterConnectorRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteDatacenterConnectorRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteDatacenterConnectorRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vmmigration.v1.DeleteDatacenterConnectorRequest; + + /** + * Creates a plain object from a DeleteDatacenterConnectorRequest message. Also converts values to other types if specified. + * @param message DeleteDatacenterConnectorRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vmmigration.v1.DeleteDatacenterConnectorRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteDatacenterConnectorRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteDatacenterConnectorRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpgradeApplianceRequest. */ + interface IUpgradeApplianceRequest { + + /** UpgradeApplianceRequest datacenterConnector */ + datacenterConnector?: (string|null); + + /** UpgradeApplianceRequest requestId */ + requestId?: (string|null); + } + + /** Represents an UpgradeApplianceRequest. */ + class UpgradeApplianceRequest implements IUpgradeApplianceRequest { + + /** + * Constructs a new UpgradeApplianceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vmmigration.v1.IUpgradeApplianceRequest); + + /** UpgradeApplianceRequest datacenterConnector. */ + public datacenterConnector: string; + + /** UpgradeApplianceRequest requestId. */ + public requestId: string; + + /** + * Creates a new UpgradeApplianceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpgradeApplianceRequest instance + */ + public static create(properties?: google.cloud.vmmigration.v1.IUpgradeApplianceRequest): google.cloud.vmmigration.v1.UpgradeApplianceRequest; + + /** + * Encodes the specified UpgradeApplianceRequest message. Does not implicitly {@link google.cloud.vmmigration.v1.UpgradeApplianceRequest.verify|verify} messages. + * @param message UpgradeApplianceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vmmigration.v1.IUpgradeApplianceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpgradeApplianceRequest message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.UpgradeApplianceRequest.verify|verify} messages. + * @param message UpgradeApplianceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vmmigration.v1.IUpgradeApplianceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpgradeApplianceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpgradeApplianceRequest + * @throws {Error} If the payload is not 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.vmmigration.v1.UpgradeApplianceRequest; + + /** + * Decodes an UpgradeApplianceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpgradeApplianceRequest + * @throws {Error} If the payload 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.vmmigration.v1.UpgradeApplianceRequest; + + /** + * Verifies an UpgradeApplianceRequest message. + * @param message Plain 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 UpgradeApplianceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpgradeApplianceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vmmigration.v1.UpgradeApplianceRequest; + + /** + * Creates a plain object from an UpgradeApplianceRequest message. Also converts values to other types if specified. + * @param message UpgradeApplianceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vmmigration.v1.UpgradeApplianceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpgradeApplianceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpgradeApplianceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpgradeApplianceResponse. */ + interface IUpgradeApplianceResponse { + } + + /** Represents an UpgradeApplianceResponse. */ + class UpgradeApplianceResponse implements IUpgradeApplianceResponse { + + /** + * Constructs a new UpgradeApplianceResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vmmigration.v1.IUpgradeApplianceResponse); + + /** + * Creates a new UpgradeApplianceResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns UpgradeApplianceResponse instance + */ + public static create(properties?: google.cloud.vmmigration.v1.IUpgradeApplianceResponse): google.cloud.vmmigration.v1.UpgradeApplianceResponse; + + /** + * Encodes the specified UpgradeApplianceResponse message. Does not implicitly {@link google.cloud.vmmigration.v1.UpgradeApplianceResponse.verify|verify} messages. + * @param message UpgradeApplianceResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vmmigration.v1.IUpgradeApplianceResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpgradeApplianceResponse message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.UpgradeApplianceResponse.verify|verify} messages. + * @param message UpgradeApplianceResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vmmigration.v1.IUpgradeApplianceResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpgradeApplianceResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpgradeApplianceResponse + * @throws {Error} If the payload is not 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.vmmigration.v1.UpgradeApplianceResponse; + + /** + * Decodes an UpgradeApplianceResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpgradeApplianceResponse + * @throws {Error} If the payload 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.vmmigration.v1.UpgradeApplianceResponse; + + /** + * Verifies an UpgradeApplianceResponse message. + * @param message Plain 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 UpgradeApplianceResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpgradeApplianceResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vmmigration.v1.UpgradeApplianceResponse; + + /** + * Creates a plain object from an UpgradeApplianceResponse message. Also converts values to other types if specified. + * @param message UpgradeApplianceResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vmmigration.v1.UpgradeApplianceResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpgradeApplianceResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpgradeApplianceResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListDatacenterConnectorsRequest. */ + interface IListDatacenterConnectorsRequest { + + /** ListDatacenterConnectorsRequest parent */ + parent?: (string|null); + + /** ListDatacenterConnectorsRequest pageSize */ + pageSize?: (number|null); + + /** ListDatacenterConnectorsRequest pageToken */ + pageToken?: (string|null); + + /** ListDatacenterConnectorsRequest filter */ + filter?: (string|null); + + /** ListDatacenterConnectorsRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListDatacenterConnectorsRequest. */ + class ListDatacenterConnectorsRequest implements IListDatacenterConnectorsRequest { + + /** + * Constructs a new ListDatacenterConnectorsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vmmigration.v1.IListDatacenterConnectorsRequest); + + /** ListDatacenterConnectorsRequest parent. */ + public parent: string; + + /** ListDatacenterConnectorsRequest pageSize. */ + public pageSize: number; + + /** ListDatacenterConnectorsRequest pageToken. */ + public pageToken: string; + + /** ListDatacenterConnectorsRequest filter. */ + public filter: string; + + /** ListDatacenterConnectorsRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListDatacenterConnectorsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListDatacenterConnectorsRequest instance + */ + public static create(properties?: google.cloud.vmmigration.v1.IListDatacenterConnectorsRequest): google.cloud.vmmigration.v1.ListDatacenterConnectorsRequest; + + /** + * Encodes the specified ListDatacenterConnectorsRequest message. Does not implicitly {@link google.cloud.vmmigration.v1.ListDatacenterConnectorsRequest.verify|verify} messages. + * @param message ListDatacenterConnectorsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vmmigration.v1.IListDatacenterConnectorsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListDatacenterConnectorsRequest message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.ListDatacenterConnectorsRequest.verify|verify} messages. + * @param message ListDatacenterConnectorsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vmmigration.v1.IListDatacenterConnectorsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListDatacenterConnectorsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListDatacenterConnectorsRequest + * @throws {Error} If the payload is not 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.vmmigration.v1.ListDatacenterConnectorsRequest; + + /** + * Decodes a ListDatacenterConnectorsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListDatacenterConnectorsRequest + * @throws {Error} If the payload 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.vmmigration.v1.ListDatacenterConnectorsRequest; + + /** + * Verifies a ListDatacenterConnectorsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListDatacenterConnectorsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListDatacenterConnectorsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vmmigration.v1.ListDatacenterConnectorsRequest; + + /** + * Creates a plain object from a ListDatacenterConnectorsRequest message. Also converts values to other types if specified. + * @param message ListDatacenterConnectorsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vmmigration.v1.ListDatacenterConnectorsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListDatacenterConnectorsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListDatacenterConnectorsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ComputeEngineTargetDefaults. */ + interface IComputeEngineTargetDefaults { + + /** ComputeEngineTargetDefaults vmName */ + vmName?: (string|null); + + /** ComputeEngineTargetDefaults targetProject */ + targetProject?: (string|null); + + /** ComputeEngineTargetDefaults zone */ + zone?: (string|null); + + /** ComputeEngineTargetDefaults machineTypeSeries */ + machineTypeSeries?: (string|null); + + /** ComputeEngineTargetDefaults machineType */ + machineType?: (string|null); + + /** ComputeEngineTargetDefaults networkTags */ + networkTags?: (string[]|null); + + /** ComputeEngineTargetDefaults networkInterfaces */ + networkInterfaces?: (google.cloud.vmmigration.v1.INetworkInterface[]|null); + + /** ComputeEngineTargetDefaults serviceAccount */ + serviceAccount?: (string|null); + + /** ComputeEngineTargetDefaults diskType */ + diskType?: (google.cloud.vmmigration.v1.ComputeEngineDiskType|keyof typeof google.cloud.vmmigration.v1.ComputeEngineDiskType|null); + + /** ComputeEngineTargetDefaults labels */ + labels?: ({ [k: string]: string }|null); + + /** ComputeEngineTargetDefaults licenseType */ + licenseType?: (google.cloud.vmmigration.v1.ComputeEngineLicenseType|keyof typeof google.cloud.vmmigration.v1.ComputeEngineLicenseType|null); + + /** ComputeEngineTargetDefaults appliedLicense */ + appliedLicense?: (google.cloud.vmmigration.v1.IAppliedLicense|null); + + /** ComputeEngineTargetDefaults computeScheduling */ + computeScheduling?: (google.cloud.vmmigration.v1.IComputeScheduling|null); + + /** ComputeEngineTargetDefaults secureBoot */ + secureBoot?: (boolean|null); + + /** ComputeEngineTargetDefaults bootOption */ + bootOption?: (google.cloud.vmmigration.v1.ComputeEngineBootOption|keyof typeof google.cloud.vmmigration.v1.ComputeEngineBootOption|null); + + /** ComputeEngineTargetDefaults metadata */ + metadata?: ({ [k: string]: string }|null); + + /** ComputeEngineTargetDefaults additionalLicenses */ + additionalLicenses?: (string[]|null); + + /** ComputeEngineTargetDefaults hostname */ + hostname?: (string|null); + } + + /** Represents a ComputeEngineTargetDefaults. */ + class ComputeEngineTargetDefaults implements IComputeEngineTargetDefaults { + + /** + * Constructs a new ComputeEngineTargetDefaults. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vmmigration.v1.IComputeEngineTargetDefaults); + + /** ComputeEngineTargetDefaults vmName. */ + public vmName: string; + + /** ComputeEngineTargetDefaults targetProject. */ + public targetProject: string; + + /** ComputeEngineTargetDefaults zone. */ + public zone: string; + + /** ComputeEngineTargetDefaults machineTypeSeries. */ + public machineTypeSeries: string; + + /** ComputeEngineTargetDefaults machineType. */ + public machineType: string; + + /** ComputeEngineTargetDefaults networkTags. */ + public networkTags: string[]; + + /** ComputeEngineTargetDefaults networkInterfaces. */ + public networkInterfaces: google.cloud.vmmigration.v1.INetworkInterface[]; + + /** ComputeEngineTargetDefaults serviceAccount. */ + public serviceAccount: string; + + /** ComputeEngineTargetDefaults diskType. */ + public diskType: (google.cloud.vmmigration.v1.ComputeEngineDiskType|keyof typeof google.cloud.vmmigration.v1.ComputeEngineDiskType); + + /** ComputeEngineTargetDefaults labels. */ + public labels: { [k: string]: string }; + + /** ComputeEngineTargetDefaults licenseType. */ + public licenseType: (google.cloud.vmmigration.v1.ComputeEngineLicenseType|keyof typeof google.cloud.vmmigration.v1.ComputeEngineLicenseType); + + /** ComputeEngineTargetDefaults appliedLicense. */ + public appliedLicense?: (google.cloud.vmmigration.v1.IAppliedLicense|null); + + /** ComputeEngineTargetDefaults computeScheduling. */ + public computeScheduling?: (google.cloud.vmmigration.v1.IComputeScheduling|null); + + /** ComputeEngineTargetDefaults secureBoot. */ + public secureBoot: boolean; + + /** ComputeEngineTargetDefaults bootOption. */ + public bootOption: (google.cloud.vmmigration.v1.ComputeEngineBootOption|keyof typeof google.cloud.vmmigration.v1.ComputeEngineBootOption); + + /** ComputeEngineTargetDefaults metadata. */ + public metadata: { [k: string]: string }; + + /** ComputeEngineTargetDefaults additionalLicenses. */ + public additionalLicenses: string[]; + + /** ComputeEngineTargetDefaults hostname. */ + public hostname: string; + + /** + * Creates a new ComputeEngineTargetDefaults instance using the specified properties. + * @param [properties] Properties to set + * @returns ComputeEngineTargetDefaults instance + */ + public static create(properties?: google.cloud.vmmigration.v1.IComputeEngineTargetDefaults): google.cloud.vmmigration.v1.ComputeEngineTargetDefaults; + + /** + * Encodes the specified ComputeEngineTargetDefaults message. Does not implicitly {@link google.cloud.vmmigration.v1.ComputeEngineTargetDefaults.verify|verify} messages. + * @param message ComputeEngineTargetDefaults message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vmmigration.v1.IComputeEngineTargetDefaults, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ComputeEngineTargetDefaults message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.ComputeEngineTargetDefaults.verify|verify} messages. + * @param message ComputeEngineTargetDefaults message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vmmigration.v1.IComputeEngineTargetDefaults, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ComputeEngineTargetDefaults message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ComputeEngineTargetDefaults + * @throws {Error} If the payload is not 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.vmmigration.v1.ComputeEngineTargetDefaults; + + /** + * Decodes a ComputeEngineTargetDefaults message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ComputeEngineTargetDefaults + * @throws {Error} If the payload 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.vmmigration.v1.ComputeEngineTargetDefaults; + + /** + * Verifies a ComputeEngineTargetDefaults message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ComputeEngineTargetDefaults message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ComputeEngineTargetDefaults + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vmmigration.v1.ComputeEngineTargetDefaults; + + /** + * Creates a plain object from a ComputeEngineTargetDefaults message. Also converts values to other types if specified. + * @param message ComputeEngineTargetDefaults + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vmmigration.v1.ComputeEngineTargetDefaults, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ComputeEngineTargetDefaults to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ComputeEngineTargetDefaults + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ComputeEngineTargetDetails. */ + interface IComputeEngineTargetDetails { + + /** ComputeEngineTargetDetails vmName */ + vmName?: (string|null); + + /** ComputeEngineTargetDetails project */ + project?: (string|null); + + /** ComputeEngineTargetDetails zone */ + zone?: (string|null); + + /** ComputeEngineTargetDetails machineTypeSeries */ + machineTypeSeries?: (string|null); + + /** ComputeEngineTargetDetails machineType */ + machineType?: (string|null); + + /** ComputeEngineTargetDetails networkTags */ + networkTags?: (string[]|null); + + /** ComputeEngineTargetDetails networkInterfaces */ + networkInterfaces?: (google.cloud.vmmigration.v1.INetworkInterface[]|null); + + /** ComputeEngineTargetDetails serviceAccount */ + serviceAccount?: (string|null); + + /** ComputeEngineTargetDetails diskType */ + diskType?: (google.cloud.vmmigration.v1.ComputeEngineDiskType|keyof typeof google.cloud.vmmigration.v1.ComputeEngineDiskType|null); + + /** ComputeEngineTargetDetails labels */ + labels?: ({ [k: string]: string }|null); + + /** ComputeEngineTargetDetails licenseType */ + licenseType?: (google.cloud.vmmigration.v1.ComputeEngineLicenseType|keyof typeof google.cloud.vmmigration.v1.ComputeEngineLicenseType|null); + + /** ComputeEngineTargetDetails appliedLicense */ + appliedLicense?: (google.cloud.vmmigration.v1.IAppliedLicense|null); + + /** ComputeEngineTargetDetails computeScheduling */ + computeScheduling?: (google.cloud.vmmigration.v1.IComputeScheduling|null); + + /** ComputeEngineTargetDetails secureBoot */ + secureBoot?: (boolean|null); + + /** ComputeEngineTargetDetails bootOption */ + bootOption?: (google.cloud.vmmigration.v1.ComputeEngineBootOption|keyof typeof google.cloud.vmmigration.v1.ComputeEngineBootOption|null); + + /** ComputeEngineTargetDetails metadata */ + metadata?: ({ [k: string]: string }|null); + + /** ComputeEngineTargetDetails additionalLicenses */ + additionalLicenses?: (string[]|null); + + /** ComputeEngineTargetDetails hostname */ + hostname?: (string|null); + } + + /** Represents a ComputeEngineTargetDetails. */ + class ComputeEngineTargetDetails implements IComputeEngineTargetDetails { + + /** + * Constructs a new ComputeEngineTargetDetails. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vmmigration.v1.IComputeEngineTargetDetails); + + /** ComputeEngineTargetDetails vmName. */ + public vmName: string; + + /** ComputeEngineTargetDetails project. */ + public project: string; + + /** ComputeEngineTargetDetails zone. */ + public zone: string; + + /** ComputeEngineTargetDetails machineTypeSeries. */ + public machineTypeSeries: string; + + /** ComputeEngineTargetDetails machineType. */ + public machineType: string; + + /** ComputeEngineTargetDetails networkTags. */ + public networkTags: string[]; + + /** ComputeEngineTargetDetails networkInterfaces. */ + public networkInterfaces: google.cloud.vmmigration.v1.INetworkInterface[]; + + /** ComputeEngineTargetDetails serviceAccount. */ + public serviceAccount: string; + + /** ComputeEngineTargetDetails diskType. */ + public diskType: (google.cloud.vmmigration.v1.ComputeEngineDiskType|keyof typeof google.cloud.vmmigration.v1.ComputeEngineDiskType); + + /** ComputeEngineTargetDetails labels. */ + public labels: { [k: string]: string }; + + /** ComputeEngineTargetDetails licenseType. */ + public licenseType: (google.cloud.vmmigration.v1.ComputeEngineLicenseType|keyof typeof google.cloud.vmmigration.v1.ComputeEngineLicenseType); + + /** ComputeEngineTargetDetails appliedLicense. */ + public appliedLicense?: (google.cloud.vmmigration.v1.IAppliedLicense|null); + + /** ComputeEngineTargetDetails computeScheduling. */ + public computeScheduling?: (google.cloud.vmmigration.v1.IComputeScheduling|null); + + /** ComputeEngineTargetDetails secureBoot. */ + public secureBoot: boolean; + + /** ComputeEngineTargetDetails bootOption. */ + public bootOption: (google.cloud.vmmigration.v1.ComputeEngineBootOption|keyof typeof google.cloud.vmmigration.v1.ComputeEngineBootOption); + + /** ComputeEngineTargetDetails metadata. */ + public metadata: { [k: string]: string }; + + /** ComputeEngineTargetDetails additionalLicenses. */ + public additionalLicenses: string[]; + + /** ComputeEngineTargetDetails hostname. */ + public hostname: string; + + /** + * Creates a new ComputeEngineTargetDetails instance using the specified properties. + * @param [properties] Properties to set + * @returns ComputeEngineTargetDetails instance + */ + public static create(properties?: google.cloud.vmmigration.v1.IComputeEngineTargetDetails): google.cloud.vmmigration.v1.ComputeEngineTargetDetails; + + /** + * Encodes the specified ComputeEngineTargetDetails message. Does not implicitly {@link google.cloud.vmmigration.v1.ComputeEngineTargetDetails.verify|verify} messages. + * @param message ComputeEngineTargetDetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vmmigration.v1.IComputeEngineTargetDetails, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ComputeEngineTargetDetails message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.ComputeEngineTargetDetails.verify|verify} messages. + * @param message ComputeEngineTargetDetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vmmigration.v1.IComputeEngineTargetDetails, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ComputeEngineTargetDetails message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ComputeEngineTargetDetails + * @throws {Error} If the payload is not 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.vmmigration.v1.ComputeEngineTargetDetails; + + /** + * Decodes a ComputeEngineTargetDetails message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ComputeEngineTargetDetails + * @throws {Error} If the payload 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.vmmigration.v1.ComputeEngineTargetDetails; + + /** + * Verifies a ComputeEngineTargetDetails message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ComputeEngineTargetDetails message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ComputeEngineTargetDetails + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vmmigration.v1.ComputeEngineTargetDetails; + + /** + * Creates a plain object from a ComputeEngineTargetDetails message. Also converts values to other types if specified. + * @param message ComputeEngineTargetDetails + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vmmigration.v1.ComputeEngineTargetDetails, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ComputeEngineTargetDetails to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ComputeEngineTargetDetails + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NetworkInterface. */ + interface INetworkInterface { + + /** NetworkInterface network */ + network?: (string|null); + + /** NetworkInterface subnetwork */ + subnetwork?: (string|null); + + /** NetworkInterface internalIp */ + internalIp?: (string|null); + + /** NetworkInterface externalIp */ + externalIp?: (string|null); + } + + /** Represents a NetworkInterface. */ + class NetworkInterface implements INetworkInterface { + + /** + * Constructs a new NetworkInterface. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vmmigration.v1.INetworkInterface); + + /** NetworkInterface network. */ + public network: string; + + /** NetworkInterface subnetwork. */ + public subnetwork: string; + + /** NetworkInterface internalIp. */ + public internalIp: string; + + /** NetworkInterface externalIp. */ + public externalIp: string; + + /** + * Creates a new NetworkInterface instance using the specified properties. + * @param [properties] Properties to set + * @returns NetworkInterface instance + */ + public static create(properties?: google.cloud.vmmigration.v1.INetworkInterface): google.cloud.vmmigration.v1.NetworkInterface; + + /** + * Encodes the specified NetworkInterface message. Does not implicitly {@link google.cloud.vmmigration.v1.NetworkInterface.verify|verify} messages. + * @param message NetworkInterface message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vmmigration.v1.INetworkInterface, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NetworkInterface message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.NetworkInterface.verify|verify} messages. + * @param message NetworkInterface message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vmmigration.v1.INetworkInterface, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NetworkInterface message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NetworkInterface + * @throws {Error} If the payload is not 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.vmmigration.v1.NetworkInterface; + + /** + * Decodes a NetworkInterface message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NetworkInterface + * @throws {Error} If the payload 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.vmmigration.v1.NetworkInterface; + + /** + * Verifies a NetworkInterface message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NetworkInterface message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NetworkInterface + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vmmigration.v1.NetworkInterface; + + /** + * Creates a plain object from a NetworkInterface message. Also converts values to other types if specified. + * @param message NetworkInterface + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vmmigration.v1.NetworkInterface, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NetworkInterface to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NetworkInterface + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AppliedLicense. */ + interface IAppliedLicense { + + /** AppliedLicense type */ + type?: (google.cloud.vmmigration.v1.AppliedLicense.Type|keyof typeof google.cloud.vmmigration.v1.AppliedLicense.Type|null); + + /** AppliedLicense osLicense */ + osLicense?: (string|null); + } + + /** Represents an AppliedLicense. */ + class AppliedLicense implements IAppliedLicense { + + /** + * Constructs a new AppliedLicense. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vmmigration.v1.IAppliedLicense); + + /** AppliedLicense type. */ + public type: (google.cloud.vmmigration.v1.AppliedLicense.Type|keyof typeof google.cloud.vmmigration.v1.AppliedLicense.Type); + + /** AppliedLicense osLicense. */ + public osLicense: string; + + /** + * Creates a new AppliedLicense instance using the specified properties. + * @param [properties] Properties to set + * @returns AppliedLicense instance + */ + public static create(properties?: google.cloud.vmmigration.v1.IAppliedLicense): google.cloud.vmmigration.v1.AppliedLicense; + + /** + * Encodes the specified AppliedLicense message. Does not implicitly {@link google.cloud.vmmigration.v1.AppliedLicense.verify|verify} messages. + * @param message AppliedLicense message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vmmigration.v1.IAppliedLicense, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AppliedLicense message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.AppliedLicense.verify|verify} messages. + * @param message AppliedLicense message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vmmigration.v1.IAppliedLicense, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AppliedLicense message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AppliedLicense + * @throws {Error} If the payload is not 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.vmmigration.v1.AppliedLicense; + + /** + * Decodes an AppliedLicense message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AppliedLicense + * @throws {Error} If the payload 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.vmmigration.v1.AppliedLicense; + + /** + * Verifies an AppliedLicense message. + * @param message Plain 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 AppliedLicense message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AppliedLicense + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vmmigration.v1.AppliedLicense; + + /** + * Creates a plain object from an AppliedLicense message. Also converts values to other types if specified. + * @param message AppliedLicense + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vmmigration.v1.AppliedLicense, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AppliedLicense to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AppliedLicense + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace AppliedLicense { + + /** Type enum. */ + enum Type { + TYPE_UNSPECIFIED = 0, + NONE = 1, + PAYG = 2, + BYOL = 3 + } + } + + /** Properties of a SchedulingNodeAffinity. */ + interface ISchedulingNodeAffinity { + + /** SchedulingNodeAffinity key */ + key?: (string|null); + + /** SchedulingNodeAffinity operator */ + operator?: (google.cloud.vmmigration.v1.SchedulingNodeAffinity.Operator|keyof typeof google.cloud.vmmigration.v1.SchedulingNodeAffinity.Operator|null); + + /** SchedulingNodeAffinity values */ + values?: (string[]|null); + } + + /** Represents a SchedulingNodeAffinity. */ + class SchedulingNodeAffinity implements ISchedulingNodeAffinity { + + /** + * Constructs a new SchedulingNodeAffinity. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vmmigration.v1.ISchedulingNodeAffinity); + + /** SchedulingNodeAffinity key. */ + public key: string; + + /** SchedulingNodeAffinity operator. */ + public operator: (google.cloud.vmmigration.v1.SchedulingNodeAffinity.Operator|keyof typeof google.cloud.vmmigration.v1.SchedulingNodeAffinity.Operator); + + /** SchedulingNodeAffinity values. */ + public values: string[]; + + /** + * Creates a new SchedulingNodeAffinity instance using the specified properties. + * @param [properties] Properties to set + * @returns SchedulingNodeAffinity instance + */ + public static create(properties?: google.cloud.vmmigration.v1.ISchedulingNodeAffinity): google.cloud.vmmigration.v1.SchedulingNodeAffinity; + + /** + * Encodes the specified SchedulingNodeAffinity message. Does not implicitly {@link google.cloud.vmmigration.v1.SchedulingNodeAffinity.verify|verify} messages. + * @param message SchedulingNodeAffinity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vmmigration.v1.ISchedulingNodeAffinity, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SchedulingNodeAffinity message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.SchedulingNodeAffinity.verify|verify} messages. + * @param message SchedulingNodeAffinity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vmmigration.v1.ISchedulingNodeAffinity, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SchedulingNodeAffinity message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SchedulingNodeAffinity + * @throws {Error} If the payload is not 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.vmmigration.v1.SchedulingNodeAffinity; + + /** + * Decodes a SchedulingNodeAffinity message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SchedulingNodeAffinity + * @throws {Error} If the payload 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.vmmigration.v1.SchedulingNodeAffinity; + + /** + * Verifies a SchedulingNodeAffinity message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SchedulingNodeAffinity message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SchedulingNodeAffinity + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vmmigration.v1.SchedulingNodeAffinity; + + /** + * Creates a plain object from a SchedulingNodeAffinity message. Also converts values to other types if specified. + * @param message SchedulingNodeAffinity + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vmmigration.v1.SchedulingNodeAffinity, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SchedulingNodeAffinity to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SchedulingNodeAffinity + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SchedulingNodeAffinity { + + /** Operator enum. */ + enum Operator { + OPERATOR_UNSPECIFIED = 0, + IN = 1, + NOT_IN = 2 + } + } + + /** Properties of a ComputeScheduling. */ + interface IComputeScheduling { + + /** ComputeScheduling onHostMaintenance */ + onHostMaintenance?: (google.cloud.vmmigration.v1.ComputeScheduling.OnHostMaintenance|keyof typeof google.cloud.vmmigration.v1.ComputeScheduling.OnHostMaintenance|null); + + /** ComputeScheduling restartType */ + restartType?: (google.cloud.vmmigration.v1.ComputeScheduling.RestartType|keyof typeof google.cloud.vmmigration.v1.ComputeScheduling.RestartType|null); + + /** ComputeScheduling nodeAffinities */ + nodeAffinities?: (google.cloud.vmmigration.v1.ISchedulingNodeAffinity[]|null); + + /** ComputeScheduling minNodeCpus */ + minNodeCpus?: (number|null); + } + + /** Represents a ComputeScheduling. */ + class ComputeScheduling implements IComputeScheduling { + + /** + * Constructs a new ComputeScheduling. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vmmigration.v1.IComputeScheduling); + + /** ComputeScheduling onHostMaintenance. */ + public onHostMaintenance: (google.cloud.vmmigration.v1.ComputeScheduling.OnHostMaintenance|keyof typeof google.cloud.vmmigration.v1.ComputeScheduling.OnHostMaintenance); + + /** ComputeScheduling restartType. */ + public restartType: (google.cloud.vmmigration.v1.ComputeScheduling.RestartType|keyof typeof google.cloud.vmmigration.v1.ComputeScheduling.RestartType); + + /** ComputeScheduling nodeAffinities. */ + public nodeAffinities: google.cloud.vmmigration.v1.ISchedulingNodeAffinity[]; + + /** ComputeScheduling minNodeCpus. */ + public minNodeCpus: number; + + /** + * Creates a new ComputeScheduling instance using the specified properties. + * @param [properties] Properties to set + * @returns ComputeScheduling instance + */ + public static create(properties?: google.cloud.vmmigration.v1.IComputeScheduling): google.cloud.vmmigration.v1.ComputeScheduling; + + /** + * Encodes the specified ComputeScheduling message. Does not implicitly {@link google.cloud.vmmigration.v1.ComputeScheduling.verify|verify} messages. + * @param message ComputeScheduling message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vmmigration.v1.IComputeScheduling, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ComputeScheduling message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.ComputeScheduling.verify|verify} messages. + * @param message ComputeScheduling message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vmmigration.v1.IComputeScheduling, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ComputeScheduling message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ComputeScheduling + * @throws {Error} If the payload is not 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.vmmigration.v1.ComputeScheduling; + + /** + * Decodes a ComputeScheduling message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ComputeScheduling + * @throws {Error} If the payload 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.vmmigration.v1.ComputeScheduling; + + /** + * Verifies a ComputeScheduling message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ComputeScheduling message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ComputeScheduling + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vmmigration.v1.ComputeScheduling; + + /** + * Creates a plain object from a ComputeScheduling message. Also converts values to other types if specified. + * @param message ComputeScheduling + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vmmigration.v1.ComputeScheduling, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ComputeScheduling to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ComputeScheduling + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ComputeScheduling { + + /** OnHostMaintenance enum. */ + enum OnHostMaintenance { + ON_HOST_MAINTENANCE_UNSPECIFIED = 0, + TERMINATE = 1, + MIGRATE = 2 + } + + /** RestartType enum. */ + enum RestartType { + RESTART_TYPE_UNSPECIFIED = 0, + AUTOMATIC_RESTART = 1, + NO_AUTOMATIC_RESTART = 2 + } + } + + /** Properties of a SchedulePolicy. */ + interface ISchedulePolicy { + + /** SchedulePolicy idleDuration */ + idleDuration?: (google.protobuf.IDuration|null); + + /** SchedulePolicy skipOsAdaptation */ + skipOsAdaptation?: (boolean|null); + } + + /** Represents a SchedulePolicy. */ + class SchedulePolicy implements ISchedulePolicy { + + /** + * Constructs a new SchedulePolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vmmigration.v1.ISchedulePolicy); + + /** SchedulePolicy idleDuration. */ + public idleDuration?: (google.protobuf.IDuration|null); + + /** SchedulePolicy skipOsAdaptation. */ + public skipOsAdaptation: boolean; + + /** + * Creates a new SchedulePolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns SchedulePolicy instance + */ + public static create(properties?: google.cloud.vmmigration.v1.ISchedulePolicy): google.cloud.vmmigration.v1.SchedulePolicy; + + /** + * Encodes the specified SchedulePolicy message. Does not implicitly {@link google.cloud.vmmigration.v1.SchedulePolicy.verify|verify} messages. + * @param message SchedulePolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vmmigration.v1.ISchedulePolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SchedulePolicy message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.SchedulePolicy.verify|verify} messages. + * @param message SchedulePolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vmmigration.v1.ISchedulePolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SchedulePolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SchedulePolicy + * @throws {Error} If the payload is not 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.vmmigration.v1.SchedulePolicy; + + /** + * Decodes a SchedulePolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SchedulePolicy + * @throws {Error} If the payload 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.vmmigration.v1.SchedulePolicy; + + /** + * Verifies a SchedulePolicy message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SchedulePolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SchedulePolicy + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vmmigration.v1.SchedulePolicy; + + /** + * Creates a plain object from a SchedulePolicy message. Also converts values to other types if specified. + * @param message SchedulePolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vmmigration.v1.SchedulePolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SchedulePolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SchedulePolicy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateMigratingVmRequest. */ + interface ICreateMigratingVmRequest { + + /** CreateMigratingVmRequest parent */ + parent?: (string|null); + + /** CreateMigratingVmRequest migratingVmId */ + migratingVmId?: (string|null); + + /** CreateMigratingVmRequest migratingVm */ + migratingVm?: (google.cloud.vmmigration.v1.IMigratingVm|null); + + /** CreateMigratingVmRequest requestId */ + requestId?: (string|null); + } + + /** Represents a CreateMigratingVmRequest. */ + class CreateMigratingVmRequest implements ICreateMigratingVmRequest { + + /** + * Constructs a new CreateMigratingVmRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vmmigration.v1.ICreateMigratingVmRequest); + + /** CreateMigratingVmRequest parent. */ + public parent: string; + + /** CreateMigratingVmRequest migratingVmId. */ + public migratingVmId: string; + + /** CreateMigratingVmRequest migratingVm. */ + public migratingVm?: (google.cloud.vmmigration.v1.IMigratingVm|null); + + /** CreateMigratingVmRequest requestId. */ + public requestId: string; + + /** + * Creates a new CreateMigratingVmRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateMigratingVmRequest instance + */ + public static create(properties?: google.cloud.vmmigration.v1.ICreateMigratingVmRequest): google.cloud.vmmigration.v1.CreateMigratingVmRequest; + + /** + * Encodes the specified CreateMigratingVmRequest message. Does not implicitly {@link google.cloud.vmmigration.v1.CreateMigratingVmRequest.verify|verify} messages. + * @param message CreateMigratingVmRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vmmigration.v1.ICreateMigratingVmRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateMigratingVmRequest message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.CreateMigratingVmRequest.verify|verify} messages. + * @param message CreateMigratingVmRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vmmigration.v1.ICreateMigratingVmRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateMigratingVmRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateMigratingVmRequest + * @throws {Error} If the payload is not 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.vmmigration.v1.CreateMigratingVmRequest; + + /** + * Decodes a CreateMigratingVmRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateMigratingVmRequest + * @throws {Error} If the payload 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.vmmigration.v1.CreateMigratingVmRequest; + + /** + * Verifies a CreateMigratingVmRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateMigratingVmRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateMigratingVmRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vmmigration.v1.CreateMigratingVmRequest; + + /** + * Creates a plain object from a CreateMigratingVmRequest message. Also converts values to other types if specified. + * @param message CreateMigratingVmRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vmmigration.v1.CreateMigratingVmRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateMigratingVmRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateMigratingVmRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListMigratingVmsRequest. */ + interface IListMigratingVmsRequest { + + /** ListMigratingVmsRequest parent */ + parent?: (string|null); + + /** ListMigratingVmsRequest pageSize */ + pageSize?: (number|null); + + /** ListMigratingVmsRequest pageToken */ + pageToken?: (string|null); + + /** ListMigratingVmsRequest filter */ + filter?: (string|null); + + /** ListMigratingVmsRequest orderBy */ + orderBy?: (string|null); + + /** ListMigratingVmsRequest view */ + view?: (google.cloud.vmmigration.v1.MigratingVmView|keyof typeof google.cloud.vmmigration.v1.MigratingVmView|null); + } + + /** Represents a ListMigratingVmsRequest. */ + class ListMigratingVmsRequest implements IListMigratingVmsRequest { + + /** + * Constructs a new ListMigratingVmsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vmmigration.v1.IListMigratingVmsRequest); + + /** ListMigratingVmsRequest parent. */ + public parent: string; + + /** ListMigratingVmsRequest pageSize. */ + public pageSize: number; + + /** ListMigratingVmsRequest pageToken. */ + public pageToken: string; + + /** ListMigratingVmsRequest filter. */ + public filter: string; + + /** ListMigratingVmsRequest orderBy. */ + public orderBy: string; + + /** ListMigratingVmsRequest view. */ + public view: (google.cloud.vmmigration.v1.MigratingVmView|keyof typeof google.cloud.vmmigration.v1.MigratingVmView); + + /** + * Creates a new ListMigratingVmsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListMigratingVmsRequest instance + */ + public static create(properties?: google.cloud.vmmigration.v1.IListMigratingVmsRequest): google.cloud.vmmigration.v1.ListMigratingVmsRequest; + + /** + * Encodes the specified ListMigratingVmsRequest message. Does not implicitly {@link google.cloud.vmmigration.v1.ListMigratingVmsRequest.verify|verify} messages. + * @param message ListMigratingVmsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vmmigration.v1.IListMigratingVmsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListMigratingVmsRequest message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.ListMigratingVmsRequest.verify|verify} messages. + * @param message ListMigratingVmsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vmmigration.v1.IListMigratingVmsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListMigratingVmsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListMigratingVmsRequest + * @throws {Error} If the payload is not 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.vmmigration.v1.ListMigratingVmsRequest; + + /** + * Decodes a ListMigratingVmsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListMigratingVmsRequest + * @throws {Error} If the payload 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.vmmigration.v1.ListMigratingVmsRequest; + + /** + * Verifies a ListMigratingVmsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListMigratingVmsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListMigratingVmsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vmmigration.v1.ListMigratingVmsRequest; + + /** + * Creates a plain object from a ListMigratingVmsRequest message. Also converts values to other types if specified. + * @param message ListMigratingVmsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vmmigration.v1.ListMigratingVmsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListMigratingVmsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListMigratingVmsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListMigratingVmsResponse. */ + interface IListMigratingVmsResponse { + + /** ListMigratingVmsResponse migratingVms */ + migratingVms?: (google.cloud.vmmigration.v1.IMigratingVm[]|null); + + /** ListMigratingVmsResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListMigratingVmsResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListMigratingVmsResponse. */ + class ListMigratingVmsResponse implements IListMigratingVmsResponse { + + /** + * Constructs a new ListMigratingVmsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vmmigration.v1.IListMigratingVmsResponse); + + /** ListMigratingVmsResponse migratingVms. */ + public migratingVms: google.cloud.vmmigration.v1.IMigratingVm[]; + + /** ListMigratingVmsResponse nextPageToken. */ + public nextPageToken: string; + + /** ListMigratingVmsResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListMigratingVmsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListMigratingVmsResponse instance + */ + public static create(properties?: google.cloud.vmmigration.v1.IListMigratingVmsResponse): google.cloud.vmmigration.v1.ListMigratingVmsResponse; + + /** + * Encodes the specified ListMigratingVmsResponse message. Does not implicitly {@link google.cloud.vmmigration.v1.ListMigratingVmsResponse.verify|verify} messages. + * @param message ListMigratingVmsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vmmigration.v1.IListMigratingVmsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListMigratingVmsResponse message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.ListMigratingVmsResponse.verify|verify} messages. + * @param message ListMigratingVmsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vmmigration.v1.IListMigratingVmsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListMigratingVmsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListMigratingVmsResponse + * @throws {Error} If the payload is not 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.vmmigration.v1.ListMigratingVmsResponse; + + /** + * Decodes a ListMigratingVmsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListMigratingVmsResponse + * @throws {Error} If the payload 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.vmmigration.v1.ListMigratingVmsResponse; + + /** + * Verifies a ListMigratingVmsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListMigratingVmsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListMigratingVmsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vmmigration.v1.ListMigratingVmsResponse; + + /** + * Creates a plain object from a ListMigratingVmsResponse message. Also converts values to other types if specified. + * @param message ListMigratingVmsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vmmigration.v1.ListMigratingVmsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListMigratingVmsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListMigratingVmsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetMigratingVmRequest. */ + interface IGetMigratingVmRequest { + + /** GetMigratingVmRequest name */ + name?: (string|null); + + /** GetMigratingVmRequest view */ + view?: (google.cloud.vmmigration.v1.MigratingVmView|keyof typeof google.cloud.vmmigration.v1.MigratingVmView|null); + } + + /** Represents a GetMigratingVmRequest. */ + class GetMigratingVmRequest implements IGetMigratingVmRequest { + + /** + * Constructs a new GetMigratingVmRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vmmigration.v1.IGetMigratingVmRequest); + + /** GetMigratingVmRequest name. */ + public name: string; + + /** GetMigratingVmRequest view. */ + public view: (google.cloud.vmmigration.v1.MigratingVmView|keyof typeof google.cloud.vmmigration.v1.MigratingVmView); + + /** + * Creates a new GetMigratingVmRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetMigratingVmRequest instance + */ + public static create(properties?: google.cloud.vmmigration.v1.IGetMigratingVmRequest): google.cloud.vmmigration.v1.GetMigratingVmRequest; + + /** + * Encodes the specified GetMigratingVmRequest message. Does not implicitly {@link google.cloud.vmmigration.v1.GetMigratingVmRequest.verify|verify} messages. + * @param message GetMigratingVmRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vmmigration.v1.IGetMigratingVmRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetMigratingVmRequest message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.GetMigratingVmRequest.verify|verify} messages. + * @param message GetMigratingVmRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vmmigration.v1.IGetMigratingVmRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetMigratingVmRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetMigratingVmRequest + * @throws {Error} If the payload is not 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.vmmigration.v1.GetMigratingVmRequest; + + /** + * Decodes a GetMigratingVmRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetMigratingVmRequest + * @throws {Error} If the payload 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.vmmigration.v1.GetMigratingVmRequest; + + /** + * Verifies a GetMigratingVmRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetMigratingVmRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetMigratingVmRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vmmigration.v1.GetMigratingVmRequest; + + /** + * Creates a plain object from a GetMigratingVmRequest message. Also converts values to other types if specified. + * @param message GetMigratingVmRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vmmigration.v1.GetMigratingVmRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetMigratingVmRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetMigratingVmRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateMigratingVmRequest. */ + interface IUpdateMigratingVmRequest { + + /** UpdateMigratingVmRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateMigratingVmRequest migratingVm */ + migratingVm?: (google.cloud.vmmigration.v1.IMigratingVm|null); + + /** UpdateMigratingVmRequest requestId */ + requestId?: (string|null); + } + + /** Represents an UpdateMigratingVmRequest. */ + class UpdateMigratingVmRequest implements IUpdateMigratingVmRequest { + + /** + * Constructs a new UpdateMigratingVmRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vmmigration.v1.IUpdateMigratingVmRequest); + + /** UpdateMigratingVmRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateMigratingVmRequest migratingVm. */ + public migratingVm?: (google.cloud.vmmigration.v1.IMigratingVm|null); + + /** UpdateMigratingVmRequest requestId. */ + public requestId: string; + + /** + * Creates a new UpdateMigratingVmRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateMigratingVmRequest instance + */ + public static create(properties?: google.cloud.vmmigration.v1.IUpdateMigratingVmRequest): google.cloud.vmmigration.v1.UpdateMigratingVmRequest; + + /** + * Encodes the specified UpdateMigratingVmRequest message. Does not implicitly {@link google.cloud.vmmigration.v1.UpdateMigratingVmRequest.verify|verify} messages. + * @param message UpdateMigratingVmRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vmmigration.v1.IUpdateMigratingVmRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateMigratingVmRequest message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.UpdateMigratingVmRequest.verify|verify} messages. + * @param message UpdateMigratingVmRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vmmigration.v1.IUpdateMigratingVmRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateMigratingVmRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateMigratingVmRequest + * @throws {Error} If the payload is not 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.vmmigration.v1.UpdateMigratingVmRequest; + + /** + * Decodes an UpdateMigratingVmRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateMigratingVmRequest + * @throws {Error} If the payload 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.vmmigration.v1.UpdateMigratingVmRequest; + + /** + * Verifies an UpdateMigratingVmRequest message. + * @param message Plain 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 UpdateMigratingVmRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateMigratingVmRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vmmigration.v1.UpdateMigratingVmRequest; + + /** + * Creates a plain object from an UpdateMigratingVmRequest message. Also converts values to other types if specified. + * @param message UpdateMigratingVmRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vmmigration.v1.UpdateMigratingVmRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateMigratingVmRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateMigratingVmRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteMigratingVmRequest. */ + interface IDeleteMigratingVmRequest { + + /** DeleteMigratingVmRequest name */ + name?: (string|null); + } + + /** Represents a DeleteMigratingVmRequest. */ + class DeleteMigratingVmRequest implements IDeleteMigratingVmRequest { + + /** + * Constructs a new DeleteMigratingVmRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vmmigration.v1.IDeleteMigratingVmRequest); + + /** DeleteMigratingVmRequest name. */ + public name: string; + + /** + * Creates a new DeleteMigratingVmRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteMigratingVmRequest instance + */ + public static create(properties?: google.cloud.vmmigration.v1.IDeleteMigratingVmRequest): google.cloud.vmmigration.v1.DeleteMigratingVmRequest; + + /** + * Encodes the specified DeleteMigratingVmRequest message. Does not implicitly {@link google.cloud.vmmigration.v1.DeleteMigratingVmRequest.verify|verify} messages. + * @param message DeleteMigratingVmRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vmmigration.v1.IDeleteMigratingVmRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteMigratingVmRequest message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.DeleteMigratingVmRequest.verify|verify} messages. + * @param message DeleteMigratingVmRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vmmigration.v1.IDeleteMigratingVmRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteMigratingVmRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteMigratingVmRequest + * @throws {Error} If the payload is not 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.vmmigration.v1.DeleteMigratingVmRequest; + + /** + * Decodes a DeleteMigratingVmRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteMigratingVmRequest + * @throws {Error} If the payload 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.vmmigration.v1.DeleteMigratingVmRequest; + + /** + * Verifies a DeleteMigratingVmRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteMigratingVmRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteMigratingVmRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vmmigration.v1.DeleteMigratingVmRequest; + + /** + * Creates a plain object from a DeleteMigratingVmRequest message. Also converts values to other types if specified. + * @param message DeleteMigratingVmRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vmmigration.v1.DeleteMigratingVmRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteMigratingVmRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteMigratingVmRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StartMigrationRequest. */ + interface IStartMigrationRequest { + + /** StartMigrationRequest migratingVm */ + migratingVm?: (string|null); + } + + /** Represents a StartMigrationRequest. */ + class StartMigrationRequest implements IStartMigrationRequest { + + /** + * Constructs a new StartMigrationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vmmigration.v1.IStartMigrationRequest); + + /** StartMigrationRequest migratingVm. */ + public migratingVm: string; + + /** + * Creates a new StartMigrationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns StartMigrationRequest instance + */ + public static create(properties?: google.cloud.vmmigration.v1.IStartMigrationRequest): google.cloud.vmmigration.v1.StartMigrationRequest; + + /** + * Encodes the specified StartMigrationRequest message. Does not implicitly {@link google.cloud.vmmigration.v1.StartMigrationRequest.verify|verify} messages. + * @param message StartMigrationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vmmigration.v1.IStartMigrationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StartMigrationRequest message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.StartMigrationRequest.verify|verify} messages. + * @param message StartMigrationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vmmigration.v1.IStartMigrationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StartMigrationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StartMigrationRequest + * @throws {Error} If the payload is not 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.vmmigration.v1.StartMigrationRequest; + + /** + * Decodes a StartMigrationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StartMigrationRequest + * @throws {Error} If the payload 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.vmmigration.v1.StartMigrationRequest; + + /** + * Verifies a StartMigrationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StartMigrationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StartMigrationRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vmmigration.v1.StartMigrationRequest; + + /** + * Creates a plain object from a StartMigrationRequest message. Also converts values to other types if specified. + * @param message StartMigrationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vmmigration.v1.StartMigrationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StartMigrationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StartMigrationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StartMigrationResponse. */ + interface IStartMigrationResponse { + } + + /** Represents a StartMigrationResponse. */ + class StartMigrationResponse implements IStartMigrationResponse { + + /** + * Constructs a new StartMigrationResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vmmigration.v1.IStartMigrationResponse); + + /** + * Creates a new StartMigrationResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns StartMigrationResponse instance + */ + public static create(properties?: google.cloud.vmmigration.v1.IStartMigrationResponse): google.cloud.vmmigration.v1.StartMigrationResponse; + + /** + * Encodes the specified StartMigrationResponse message. Does not implicitly {@link google.cloud.vmmigration.v1.StartMigrationResponse.verify|verify} messages. + * @param message StartMigrationResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vmmigration.v1.IStartMigrationResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StartMigrationResponse message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.StartMigrationResponse.verify|verify} messages. + * @param message StartMigrationResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vmmigration.v1.IStartMigrationResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StartMigrationResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StartMigrationResponse + * @throws {Error} If the payload is not 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.vmmigration.v1.StartMigrationResponse; + + /** + * Decodes a StartMigrationResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StartMigrationResponse + * @throws {Error} If the payload 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.vmmigration.v1.StartMigrationResponse; + + /** + * Verifies a StartMigrationResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StartMigrationResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StartMigrationResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vmmigration.v1.StartMigrationResponse; + + /** + * Creates a plain object from a StartMigrationResponse message. Also converts values to other types if specified. + * @param message StartMigrationResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vmmigration.v1.StartMigrationResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StartMigrationResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StartMigrationResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PauseMigrationRequest. */ + interface IPauseMigrationRequest { + + /** PauseMigrationRequest migratingVm */ + migratingVm?: (string|null); + } + + /** Represents a PauseMigrationRequest. */ + class PauseMigrationRequest implements IPauseMigrationRequest { + + /** + * Constructs a new PauseMigrationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vmmigration.v1.IPauseMigrationRequest); + + /** PauseMigrationRequest migratingVm. */ + public migratingVm: string; + + /** + * Creates a new PauseMigrationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns PauseMigrationRequest instance + */ + public static create(properties?: google.cloud.vmmigration.v1.IPauseMigrationRequest): google.cloud.vmmigration.v1.PauseMigrationRequest; + + /** + * Encodes the specified PauseMigrationRequest message. Does not implicitly {@link google.cloud.vmmigration.v1.PauseMigrationRequest.verify|verify} messages. + * @param message PauseMigrationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vmmigration.v1.IPauseMigrationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PauseMigrationRequest message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.PauseMigrationRequest.verify|verify} messages. + * @param message PauseMigrationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vmmigration.v1.IPauseMigrationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PauseMigrationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PauseMigrationRequest + * @throws {Error} If the payload is not 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.vmmigration.v1.PauseMigrationRequest; + + /** + * Decodes a PauseMigrationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PauseMigrationRequest + * @throws {Error} If the payload 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.vmmigration.v1.PauseMigrationRequest; + + /** + * Verifies a PauseMigrationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PauseMigrationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PauseMigrationRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vmmigration.v1.PauseMigrationRequest; + + /** + * Creates a plain object from a PauseMigrationRequest message. Also converts values to other types if specified. + * @param message PauseMigrationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vmmigration.v1.PauseMigrationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PauseMigrationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PauseMigrationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PauseMigrationResponse. */ + interface IPauseMigrationResponse { + } + + /** Represents a PauseMigrationResponse. */ + class PauseMigrationResponse implements IPauseMigrationResponse { + + /** + * Constructs a new PauseMigrationResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vmmigration.v1.IPauseMigrationResponse); + + /** + * Creates a new PauseMigrationResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns PauseMigrationResponse instance + */ + public static create(properties?: google.cloud.vmmigration.v1.IPauseMigrationResponse): google.cloud.vmmigration.v1.PauseMigrationResponse; + + /** + * Encodes the specified PauseMigrationResponse message. Does not implicitly {@link google.cloud.vmmigration.v1.PauseMigrationResponse.verify|verify} messages. + * @param message PauseMigrationResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vmmigration.v1.IPauseMigrationResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PauseMigrationResponse message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.PauseMigrationResponse.verify|verify} messages. + * @param message PauseMigrationResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vmmigration.v1.IPauseMigrationResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PauseMigrationResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PauseMigrationResponse + * @throws {Error} If the payload is not 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.vmmigration.v1.PauseMigrationResponse; + + /** + * Decodes a PauseMigrationResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PauseMigrationResponse + * @throws {Error} If the payload 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.vmmigration.v1.PauseMigrationResponse; + + /** + * Verifies a PauseMigrationResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PauseMigrationResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PauseMigrationResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vmmigration.v1.PauseMigrationResponse; + + /** + * Creates a plain object from a PauseMigrationResponse message. Also converts values to other types if specified. + * @param message PauseMigrationResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vmmigration.v1.PauseMigrationResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PauseMigrationResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PauseMigrationResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ResumeMigrationRequest. */ + interface IResumeMigrationRequest { + + /** ResumeMigrationRequest migratingVm */ + migratingVm?: (string|null); + } + + /** Represents a ResumeMigrationRequest. */ + class ResumeMigrationRequest implements IResumeMigrationRequest { + + /** + * Constructs a new ResumeMigrationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vmmigration.v1.IResumeMigrationRequest); + + /** ResumeMigrationRequest migratingVm. */ + public migratingVm: string; + + /** + * Creates a new ResumeMigrationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ResumeMigrationRequest instance + */ + public static create(properties?: google.cloud.vmmigration.v1.IResumeMigrationRequest): google.cloud.vmmigration.v1.ResumeMigrationRequest; + + /** + * Encodes the specified ResumeMigrationRequest message. Does not implicitly {@link google.cloud.vmmigration.v1.ResumeMigrationRequest.verify|verify} messages. + * @param message ResumeMigrationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vmmigration.v1.IResumeMigrationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResumeMigrationRequest message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.ResumeMigrationRequest.verify|verify} messages. + * @param message ResumeMigrationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vmmigration.v1.IResumeMigrationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResumeMigrationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResumeMigrationRequest + * @throws {Error} If the payload is not 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.vmmigration.v1.ResumeMigrationRequest; + + /** + * Decodes a ResumeMigrationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResumeMigrationRequest + * @throws {Error} If the payload 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.vmmigration.v1.ResumeMigrationRequest; + + /** + * Verifies a ResumeMigrationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResumeMigrationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResumeMigrationRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vmmigration.v1.ResumeMigrationRequest; + + /** + * Creates a plain object from a ResumeMigrationRequest message. Also converts values to other types if specified. + * @param message ResumeMigrationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vmmigration.v1.ResumeMigrationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResumeMigrationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResumeMigrationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ResumeMigrationResponse. */ + interface IResumeMigrationResponse { + } + + /** Represents a ResumeMigrationResponse. */ + class ResumeMigrationResponse implements IResumeMigrationResponse { + + /** + * Constructs a new ResumeMigrationResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vmmigration.v1.IResumeMigrationResponse); + + /** + * Creates a new ResumeMigrationResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ResumeMigrationResponse instance + */ + public static create(properties?: google.cloud.vmmigration.v1.IResumeMigrationResponse): google.cloud.vmmigration.v1.ResumeMigrationResponse; + + /** + * Encodes the specified ResumeMigrationResponse message. Does not implicitly {@link google.cloud.vmmigration.v1.ResumeMigrationResponse.verify|verify} messages. + * @param message ResumeMigrationResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vmmigration.v1.IResumeMigrationResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResumeMigrationResponse message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.ResumeMigrationResponse.verify|verify} messages. + * @param message ResumeMigrationResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vmmigration.v1.IResumeMigrationResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResumeMigrationResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResumeMigrationResponse + * @throws {Error} If the payload is not 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.vmmigration.v1.ResumeMigrationResponse; + + /** + * Decodes a ResumeMigrationResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResumeMigrationResponse + * @throws {Error} If the payload 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.vmmigration.v1.ResumeMigrationResponse; + + /** + * Verifies a ResumeMigrationResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResumeMigrationResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResumeMigrationResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vmmigration.v1.ResumeMigrationResponse; + + /** + * Creates a plain object from a ResumeMigrationResponse message. Also converts values to other types if specified. + * @param message ResumeMigrationResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vmmigration.v1.ResumeMigrationResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResumeMigrationResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResumeMigrationResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FinalizeMigrationRequest. */ + interface IFinalizeMigrationRequest { + + /** FinalizeMigrationRequest migratingVm */ + migratingVm?: (string|null); + } + + /** Represents a FinalizeMigrationRequest. */ + class FinalizeMigrationRequest implements IFinalizeMigrationRequest { + + /** + * Constructs a new FinalizeMigrationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vmmigration.v1.IFinalizeMigrationRequest); + + /** FinalizeMigrationRequest migratingVm. */ + public migratingVm: string; + + /** + * Creates a new FinalizeMigrationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns FinalizeMigrationRequest instance + */ + public static create(properties?: google.cloud.vmmigration.v1.IFinalizeMigrationRequest): google.cloud.vmmigration.v1.FinalizeMigrationRequest; + + /** + * Encodes the specified FinalizeMigrationRequest message. Does not implicitly {@link google.cloud.vmmigration.v1.FinalizeMigrationRequest.verify|verify} messages. + * @param message FinalizeMigrationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vmmigration.v1.IFinalizeMigrationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FinalizeMigrationRequest message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.FinalizeMigrationRequest.verify|verify} messages. + * @param message FinalizeMigrationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vmmigration.v1.IFinalizeMigrationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FinalizeMigrationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FinalizeMigrationRequest + * @throws {Error} If the payload is not 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.vmmigration.v1.FinalizeMigrationRequest; + + /** + * Decodes a FinalizeMigrationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FinalizeMigrationRequest + * @throws {Error} If the payload 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.vmmigration.v1.FinalizeMigrationRequest; + + /** + * Verifies a FinalizeMigrationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FinalizeMigrationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FinalizeMigrationRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vmmigration.v1.FinalizeMigrationRequest; + + /** + * Creates a plain object from a FinalizeMigrationRequest message. Also converts values to other types if specified. + * @param message FinalizeMigrationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vmmigration.v1.FinalizeMigrationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FinalizeMigrationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FinalizeMigrationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FinalizeMigrationResponse. */ + interface IFinalizeMigrationResponse { + } + + /** Represents a FinalizeMigrationResponse. */ + class FinalizeMigrationResponse implements IFinalizeMigrationResponse { + + /** + * Constructs a new FinalizeMigrationResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vmmigration.v1.IFinalizeMigrationResponse); + + /** + * Creates a new FinalizeMigrationResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns FinalizeMigrationResponse instance + */ + public static create(properties?: google.cloud.vmmigration.v1.IFinalizeMigrationResponse): google.cloud.vmmigration.v1.FinalizeMigrationResponse; + + /** + * Encodes the specified FinalizeMigrationResponse message. Does not implicitly {@link google.cloud.vmmigration.v1.FinalizeMigrationResponse.verify|verify} messages. + * @param message FinalizeMigrationResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vmmigration.v1.IFinalizeMigrationResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FinalizeMigrationResponse message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.FinalizeMigrationResponse.verify|verify} messages. + * @param message FinalizeMigrationResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vmmigration.v1.IFinalizeMigrationResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FinalizeMigrationResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FinalizeMigrationResponse + * @throws {Error} If the payload is not 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.vmmigration.v1.FinalizeMigrationResponse; + + /** + * Decodes a FinalizeMigrationResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FinalizeMigrationResponse + * @throws {Error} If the payload 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.vmmigration.v1.FinalizeMigrationResponse; + + /** + * Verifies a FinalizeMigrationResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FinalizeMigrationResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FinalizeMigrationResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vmmigration.v1.FinalizeMigrationResponse; + + /** + * Creates a plain object from a FinalizeMigrationResponse message. Also converts values to other types if specified. + * @param message FinalizeMigrationResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vmmigration.v1.FinalizeMigrationResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FinalizeMigrationResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FinalizeMigrationResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TargetProject. */ + interface ITargetProject { + + /** TargetProject name */ + name?: (string|null); + + /** TargetProject project */ + project?: (string|null); + + /** TargetProject description */ + description?: (string|null); + + /** TargetProject createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** TargetProject updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a TargetProject. */ + class TargetProject implements ITargetProject { + + /** + * Constructs a new TargetProject. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vmmigration.v1.ITargetProject); + + /** TargetProject name. */ + public name: string; + + /** TargetProject project. */ + public project: string; + + /** TargetProject description. */ + public description: string; + + /** TargetProject createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** TargetProject updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new TargetProject instance using the specified properties. + * @param [properties] Properties to set + * @returns TargetProject instance + */ + public static create(properties?: google.cloud.vmmigration.v1.ITargetProject): google.cloud.vmmigration.v1.TargetProject; + + /** + * Encodes the specified TargetProject message. Does not implicitly {@link google.cloud.vmmigration.v1.TargetProject.verify|verify} messages. + * @param message TargetProject message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vmmigration.v1.ITargetProject, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TargetProject message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.TargetProject.verify|verify} messages. + * @param message TargetProject message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vmmigration.v1.ITargetProject, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TargetProject message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TargetProject + * @throws {Error} If the payload is not 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.vmmigration.v1.TargetProject; + + /** + * Decodes a TargetProject message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TargetProject + * @throws {Error} If the payload 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.vmmigration.v1.TargetProject; + + /** + * Verifies a TargetProject message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TargetProject message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TargetProject + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vmmigration.v1.TargetProject; + + /** + * Creates a plain object from a TargetProject message. Also converts values to other types if specified. + * @param message TargetProject + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vmmigration.v1.TargetProject, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TargetProject to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TargetProject + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetTargetProjectRequest. */ + interface IGetTargetProjectRequest { + + /** GetTargetProjectRequest name */ + name?: (string|null); + } + + /** Represents a GetTargetProjectRequest. */ + class GetTargetProjectRequest implements IGetTargetProjectRequest { + + /** + * Constructs a new GetTargetProjectRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vmmigration.v1.IGetTargetProjectRequest); + + /** GetTargetProjectRequest name. */ + public name: string; + + /** + * Creates a new GetTargetProjectRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetTargetProjectRequest instance + */ + public static create(properties?: google.cloud.vmmigration.v1.IGetTargetProjectRequest): google.cloud.vmmigration.v1.GetTargetProjectRequest; + + /** + * Encodes the specified GetTargetProjectRequest message. Does not implicitly {@link google.cloud.vmmigration.v1.GetTargetProjectRequest.verify|verify} messages. + * @param message GetTargetProjectRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vmmigration.v1.IGetTargetProjectRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetTargetProjectRequest message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.GetTargetProjectRequest.verify|verify} messages. + * @param message GetTargetProjectRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vmmigration.v1.IGetTargetProjectRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetTargetProjectRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetTargetProjectRequest + * @throws {Error} If the payload is not 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.vmmigration.v1.GetTargetProjectRequest; + + /** + * Decodes a GetTargetProjectRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetTargetProjectRequest + * @throws {Error} If the payload 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.vmmigration.v1.GetTargetProjectRequest; + + /** + * Verifies a GetTargetProjectRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetTargetProjectRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetTargetProjectRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vmmigration.v1.GetTargetProjectRequest; + + /** + * Creates a plain object from a GetTargetProjectRequest message. Also converts values to other types if specified. + * @param message GetTargetProjectRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vmmigration.v1.GetTargetProjectRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetTargetProjectRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetTargetProjectRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListTargetProjectsRequest. */ + interface IListTargetProjectsRequest { + + /** ListTargetProjectsRequest parent */ + parent?: (string|null); + + /** ListTargetProjectsRequest pageSize */ + pageSize?: (number|null); + + /** ListTargetProjectsRequest pageToken */ + pageToken?: (string|null); + + /** ListTargetProjectsRequest filter */ + filter?: (string|null); + + /** ListTargetProjectsRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListTargetProjectsRequest. */ + class ListTargetProjectsRequest implements IListTargetProjectsRequest { + + /** + * Constructs a new ListTargetProjectsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vmmigration.v1.IListTargetProjectsRequest); + + /** ListTargetProjectsRequest parent. */ + public parent: string; + + /** ListTargetProjectsRequest pageSize. */ + public pageSize: number; + + /** ListTargetProjectsRequest pageToken. */ + public pageToken: string; + + /** ListTargetProjectsRequest filter. */ + public filter: string; + + /** ListTargetProjectsRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListTargetProjectsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListTargetProjectsRequest instance + */ + public static create(properties?: google.cloud.vmmigration.v1.IListTargetProjectsRequest): google.cloud.vmmigration.v1.ListTargetProjectsRequest; + + /** + * Encodes the specified ListTargetProjectsRequest message. Does not implicitly {@link google.cloud.vmmigration.v1.ListTargetProjectsRequest.verify|verify} messages. + * @param message ListTargetProjectsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vmmigration.v1.IListTargetProjectsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListTargetProjectsRequest message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.ListTargetProjectsRequest.verify|verify} messages. + * @param message ListTargetProjectsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vmmigration.v1.IListTargetProjectsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListTargetProjectsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListTargetProjectsRequest + * @throws {Error} If the payload is not 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.vmmigration.v1.ListTargetProjectsRequest; + + /** + * Decodes a ListTargetProjectsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListTargetProjectsRequest + * @throws {Error} If the payload 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.vmmigration.v1.ListTargetProjectsRequest; + + /** + * Verifies a ListTargetProjectsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListTargetProjectsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListTargetProjectsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vmmigration.v1.ListTargetProjectsRequest; + + /** + * Creates a plain object from a ListTargetProjectsRequest message. Also converts values to other types if specified. + * @param message ListTargetProjectsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vmmigration.v1.ListTargetProjectsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListTargetProjectsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListTargetProjectsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListTargetProjectsResponse. */ + interface IListTargetProjectsResponse { + + /** ListTargetProjectsResponse targetProjects */ + targetProjects?: (google.cloud.vmmigration.v1.ITargetProject[]|null); + + /** ListTargetProjectsResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListTargetProjectsResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListTargetProjectsResponse. */ + class ListTargetProjectsResponse implements IListTargetProjectsResponse { + + /** + * Constructs a new ListTargetProjectsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vmmigration.v1.IListTargetProjectsResponse); + + /** ListTargetProjectsResponse targetProjects. */ + public targetProjects: google.cloud.vmmigration.v1.ITargetProject[]; + + /** ListTargetProjectsResponse nextPageToken. */ + public nextPageToken: string; + + /** ListTargetProjectsResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListTargetProjectsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListTargetProjectsResponse instance + */ + public static create(properties?: google.cloud.vmmigration.v1.IListTargetProjectsResponse): google.cloud.vmmigration.v1.ListTargetProjectsResponse; + + /** + * Encodes the specified ListTargetProjectsResponse message. Does not implicitly {@link google.cloud.vmmigration.v1.ListTargetProjectsResponse.verify|verify} messages. + * @param message ListTargetProjectsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vmmigration.v1.IListTargetProjectsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListTargetProjectsResponse message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.ListTargetProjectsResponse.verify|verify} messages. + * @param message ListTargetProjectsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vmmigration.v1.IListTargetProjectsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListTargetProjectsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListTargetProjectsResponse + * @throws {Error} If the payload is not 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.vmmigration.v1.ListTargetProjectsResponse; + + /** + * Decodes a ListTargetProjectsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListTargetProjectsResponse + * @throws {Error} If the payload 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.vmmigration.v1.ListTargetProjectsResponse; + + /** + * Verifies a ListTargetProjectsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListTargetProjectsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListTargetProjectsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vmmigration.v1.ListTargetProjectsResponse; + + /** + * Creates a plain object from a ListTargetProjectsResponse message. Also converts values to other types if specified. + * @param message ListTargetProjectsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vmmigration.v1.ListTargetProjectsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListTargetProjectsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListTargetProjectsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateTargetProjectRequest. */ + interface ICreateTargetProjectRequest { + + /** CreateTargetProjectRequest parent */ + parent?: (string|null); + + /** CreateTargetProjectRequest targetProjectId */ + targetProjectId?: (string|null); + + /** CreateTargetProjectRequest targetProject */ + targetProject?: (google.cloud.vmmigration.v1.ITargetProject|null); + + /** CreateTargetProjectRequest requestId */ + requestId?: (string|null); + } + + /** Represents a CreateTargetProjectRequest. */ + class CreateTargetProjectRequest implements ICreateTargetProjectRequest { + + /** + * Constructs a new CreateTargetProjectRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vmmigration.v1.ICreateTargetProjectRequest); + + /** CreateTargetProjectRequest parent. */ + public parent: string; + + /** CreateTargetProjectRequest targetProjectId. */ + public targetProjectId: string; + + /** CreateTargetProjectRequest targetProject. */ + public targetProject?: (google.cloud.vmmigration.v1.ITargetProject|null); + + /** CreateTargetProjectRequest requestId. */ + public requestId: string; + + /** + * Creates a new CreateTargetProjectRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateTargetProjectRequest instance + */ + public static create(properties?: google.cloud.vmmigration.v1.ICreateTargetProjectRequest): google.cloud.vmmigration.v1.CreateTargetProjectRequest; + + /** + * Encodes the specified CreateTargetProjectRequest message. Does not implicitly {@link google.cloud.vmmigration.v1.CreateTargetProjectRequest.verify|verify} messages. + * @param message CreateTargetProjectRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vmmigration.v1.ICreateTargetProjectRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateTargetProjectRequest message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.CreateTargetProjectRequest.verify|verify} messages. + * @param message CreateTargetProjectRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vmmigration.v1.ICreateTargetProjectRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateTargetProjectRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateTargetProjectRequest + * @throws {Error} If the payload is not 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.vmmigration.v1.CreateTargetProjectRequest; + + /** + * Decodes a CreateTargetProjectRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateTargetProjectRequest + * @throws {Error} If the payload 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.vmmigration.v1.CreateTargetProjectRequest; + + /** + * Verifies a CreateTargetProjectRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateTargetProjectRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateTargetProjectRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vmmigration.v1.CreateTargetProjectRequest; + + /** + * Creates a plain object from a CreateTargetProjectRequest message. Also converts values to other types if specified. + * @param message CreateTargetProjectRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vmmigration.v1.CreateTargetProjectRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateTargetProjectRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateTargetProjectRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateTargetProjectRequest. */ + interface IUpdateTargetProjectRequest { + + /** UpdateTargetProjectRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateTargetProjectRequest targetProject */ + targetProject?: (google.cloud.vmmigration.v1.ITargetProject|null); + + /** UpdateTargetProjectRequest requestId */ + requestId?: (string|null); + } + + /** Represents an UpdateTargetProjectRequest. */ + class UpdateTargetProjectRequest implements IUpdateTargetProjectRequest { + + /** + * Constructs a new UpdateTargetProjectRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vmmigration.v1.IUpdateTargetProjectRequest); + + /** UpdateTargetProjectRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateTargetProjectRequest targetProject. */ + public targetProject?: (google.cloud.vmmigration.v1.ITargetProject|null); + + /** UpdateTargetProjectRequest requestId. */ + public requestId: string; + + /** + * Creates a new UpdateTargetProjectRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateTargetProjectRequest instance + */ + public static create(properties?: google.cloud.vmmigration.v1.IUpdateTargetProjectRequest): google.cloud.vmmigration.v1.UpdateTargetProjectRequest; + + /** + * Encodes the specified UpdateTargetProjectRequest message. Does not implicitly {@link google.cloud.vmmigration.v1.UpdateTargetProjectRequest.verify|verify} messages. + * @param message UpdateTargetProjectRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vmmigration.v1.IUpdateTargetProjectRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateTargetProjectRequest message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.UpdateTargetProjectRequest.verify|verify} messages. + * @param message UpdateTargetProjectRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vmmigration.v1.IUpdateTargetProjectRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateTargetProjectRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateTargetProjectRequest + * @throws {Error} If the payload is not 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.vmmigration.v1.UpdateTargetProjectRequest; + + /** + * Decodes an UpdateTargetProjectRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateTargetProjectRequest + * @throws {Error} If the payload 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.vmmigration.v1.UpdateTargetProjectRequest; + + /** + * Verifies an UpdateTargetProjectRequest message. + * @param message Plain 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 UpdateTargetProjectRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateTargetProjectRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vmmigration.v1.UpdateTargetProjectRequest; + + /** + * Creates a plain object from an UpdateTargetProjectRequest message. Also converts values to other types if specified. + * @param message UpdateTargetProjectRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vmmigration.v1.UpdateTargetProjectRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateTargetProjectRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateTargetProjectRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteTargetProjectRequest. */ + interface IDeleteTargetProjectRequest { + + /** DeleteTargetProjectRequest name */ + name?: (string|null); + + /** DeleteTargetProjectRequest requestId */ + requestId?: (string|null); + } + + /** Represents a DeleteTargetProjectRequest. */ + class DeleteTargetProjectRequest implements IDeleteTargetProjectRequest { + + /** + * Constructs a new DeleteTargetProjectRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vmmigration.v1.IDeleteTargetProjectRequest); + + /** DeleteTargetProjectRequest name. */ + public name: string; + + /** DeleteTargetProjectRequest requestId. */ + public requestId: string; + + /** + * Creates a new DeleteTargetProjectRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteTargetProjectRequest instance + */ + public static create(properties?: google.cloud.vmmigration.v1.IDeleteTargetProjectRequest): google.cloud.vmmigration.v1.DeleteTargetProjectRequest; + + /** + * Encodes the specified DeleteTargetProjectRequest message. Does not implicitly {@link google.cloud.vmmigration.v1.DeleteTargetProjectRequest.verify|verify} messages. + * @param message DeleteTargetProjectRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vmmigration.v1.IDeleteTargetProjectRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteTargetProjectRequest message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.DeleteTargetProjectRequest.verify|verify} messages. + * @param message DeleteTargetProjectRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vmmigration.v1.IDeleteTargetProjectRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteTargetProjectRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteTargetProjectRequest + * @throws {Error} If the payload is not 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.vmmigration.v1.DeleteTargetProjectRequest; + + /** + * Decodes a DeleteTargetProjectRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteTargetProjectRequest + * @throws {Error} If the payload 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.vmmigration.v1.DeleteTargetProjectRequest; + + /** + * Verifies a DeleteTargetProjectRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteTargetProjectRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteTargetProjectRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vmmigration.v1.DeleteTargetProjectRequest; + + /** + * Creates a plain object from a DeleteTargetProjectRequest message. Also converts values to other types if specified. + * @param message DeleteTargetProjectRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vmmigration.v1.DeleteTargetProjectRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteTargetProjectRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteTargetProjectRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Group. */ + interface IGroup { + + /** Group name */ + name?: (string|null); + + /** Group createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Group updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Group description */ + description?: (string|null); + + /** Group displayName */ + displayName?: (string|null); + } + + /** Represents a Group. */ + class Group implements IGroup { + + /** + * Constructs a new Group. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vmmigration.v1.IGroup); + + /** Group name. */ + public name: string; + + /** Group createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Group updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Group description. */ + public description: string; + + /** Group displayName. */ + public displayName: string; + + /** + * Creates a new Group instance using the specified properties. + * @param [properties] Properties to set + * @returns Group instance + */ + public static create(properties?: google.cloud.vmmigration.v1.IGroup): google.cloud.vmmigration.v1.Group; + + /** + * Encodes the specified Group message. Does not implicitly {@link google.cloud.vmmigration.v1.Group.verify|verify} messages. + * @param message Group message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vmmigration.v1.IGroup, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Group message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.Group.verify|verify} messages. + * @param message Group message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vmmigration.v1.IGroup, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Group message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Group + * @throws {Error} If the payload is not 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.vmmigration.v1.Group; + + /** + * Decodes a Group message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Group + * @throws {Error} If the payload 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.vmmigration.v1.Group; + + /** + * Verifies a Group message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Group message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Group + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vmmigration.v1.Group; + + /** + * Creates a plain object from a Group message. Also converts values to other types if specified. + * @param message Group + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vmmigration.v1.Group, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Group to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Group + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListGroupsRequest. */ + interface IListGroupsRequest { + + /** ListGroupsRequest parent */ + parent?: (string|null); + + /** ListGroupsRequest pageSize */ + pageSize?: (number|null); + + /** ListGroupsRequest pageToken */ + pageToken?: (string|null); + + /** ListGroupsRequest filter */ + filter?: (string|null); + + /** ListGroupsRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListGroupsRequest. */ + class ListGroupsRequest implements IListGroupsRequest { + + /** + * Constructs a new ListGroupsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vmmigration.v1.IListGroupsRequest); + + /** ListGroupsRequest parent. */ + public parent: string; + + /** ListGroupsRequest pageSize. */ + public pageSize: number; + + /** ListGroupsRequest pageToken. */ + public pageToken: string; + + /** ListGroupsRequest filter. */ + public filter: string; + + /** ListGroupsRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListGroupsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListGroupsRequest instance + */ + public static create(properties?: google.cloud.vmmigration.v1.IListGroupsRequest): google.cloud.vmmigration.v1.ListGroupsRequest; + + /** + * Encodes the specified ListGroupsRequest message. Does not implicitly {@link google.cloud.vmmigration.v1.ListGroupsRequest.verify|verify} messages. + * @param message ListGroupsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vmmigration.v1.IListGroupsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListGroupsRequest message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.ListGroupsRequest.verify|verify} messages. + * @param message ListGroupsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vmmigration.v1.IListGroupsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListGroupsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListGroupsRequest + * @throws {Error} If the payload is not 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.vmmigration.v1.ListGroupsRequest; + + /** + * Decodes a ListGroupsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListGroupsRequest + * @throws {Error} If the payload 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.vmmigration.v1.ListGroupsRequest; + + /** + * Verifies a ListGroupsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListGroupsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListGroupsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vmmigration.v1.ListGroupsRequest; + + /** + * Creates a plain object from a ListGroupsRequest message. Also converts values to other types if specified. + * @param message ListGroupsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vmmigration.v1.ListGroupsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListGroupsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListGroupsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListGroupsResponse. */ + interface IListGroupsResponse { + + /** ListGroupsResponse groups */ + groups?: (google.cloud.vmmigration.v1.IGroup[]|null); + + /** ListGroupsResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListGroupsResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListGroupsResponse. */ + class ListGroupsResponse implements IListGroupsResponse { + + /** + * Constructs a new ListGroupsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vmmigration.v1.IListGroupsResponse); + + /** ListGroupsResponse groups. */ + public groups: google.cloud.vmmigration.v1.IGroup[]; + + /** ListGroupsResponse nextPageToken. */ + public nextPageToken: string; + + /** ListGroupsResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListGroupsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListGroupsResponse instance + */ + public static create(properties?: google.cloud.vmmigration.v1.IListGroupsResponse): google.cloud.vmmigration.v1.ListGroupsResponse; + + /** + * Encodes the specified ListGroupsResponse message. Does not implicitly {@link google.cloud.vmmigration.v1.ListGroupsResponse.verify|verify} messages. + * @param message ListGroupsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vmmigration.v1.IListGroupsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListGroupsResponse message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.ListGroupsResponse.verify|verify} messages. + * @param message ListGroupsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vmmigration.v1.IListGroupsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListGroupsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListGroupsResponse + * @throws {Error} If the payload is not 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.vmmigration.v1.ListGroupsResponse; + + /** + * Decodes a ListGroupsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListGroupsResponse + * @throws {Error} If the payload 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.vmmigration.v1.ListGroupsResponse; + + /** + * Verifies a ListGroupsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListGroupsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListGroupsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vmmigration.v1.ListGroupsResponse; + + /** + * Creates a plain object from a ListGroupsResponse message. Also converts values to other types if specified. + * @param message ListGroupsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vmmigration.v1.ListGroupsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListGroupsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListGroupsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetGroupRequest. */ + interface IGetGroupRequest { + + /** GetGroupRequest name */ + name?: (string|null); + } + + /** Represents a GetGroupRequest. */ + class GetGroupRequest implements IGetGroupRequest { + + /** + * Constructs a new GetGroupRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vmmigration.v1.IGetGroupRequest); + + /** GetGroupRequest name. */ + public name: string; + + /** + * Creates a new GetGroupRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetGroupRequest instance + */ + public static create(properties?: google.cloud.vmmigration.v1.IGetGroupRequest): google.cloud.vmmigration.v1.GetGroupRequest; + + /** + * Encodes the specified GetGroupRequest message. Does not implicitly {@link google.cloud.vmmigration.v1.GetGroupRequest.verify|verify} messages. + * @param message GetGroupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vmmigration.v1.IGetGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetGroupRequest message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.GetGroupRequest.verify|verify} messages. + * @param message GetGroupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vmmigration.v1.IGetGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetGroupRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetGroupRequest + * @throws {Error} If the payload is not 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.vmmigration.v1.GetGroupRequest; + + /** + * Decodes a GetGroupRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetGroupRequest + * @throws {Error} If the payload 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.vmmigration.v1.GetGroupRequest; + + /** + * Verifies a GetGroupRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetGroupRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetGroupRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vmmigration.v1.GetGroupRequest; + + /** + * Creates a plain object from a GetGroupRequest message. Also converts values to other types if specified. + * @param message GetGroupRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vmmigration.v1.GetGroupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetGroupRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetGroupRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateGroupRequest. */ + interface ICreateGroupRequest { + + /** CreateGroupRequest parent */ + parent?: (string|null); + + /** CreateGroupRequest groupId */ + groupId?: (string|null); + + /** CreateGroupRequest group */ + group?: (google.cloud.vmmigration.v1.IGroup|null); + + /** CreateGroupRequest requestId */ + requestId?: (string|null); + } + + /** Represents a CreateGroupRequest. */ + class CreateGroupRequest implements ICreateGroupRequest { + + /** + * Constructs a new CreateGroupRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vmmigration.v1.ICreateGroupRequest); + + /** CreateGroupRequest parent. */ + public parent: string; + + /** CreateGroupRequest groupId. */ + public groupId: string; + + /** CreateGroupRequest group. */ + public group?: (google.cloud.vmmigration.v1.IGroup|null); + + /** CreateGroupRequest requestId. */ + public requestId: string; + + /** + * Creates a new CreateGroupRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateGroupRequest instance + */ + public static create(properties?: google.cloud.vmmigration.v1.ICreateGroupRequest): google.cloud.vmmigration.v1.CreateGroupRequest; + + /** + * Encodes the specified CreateGroupRequest message. Does not implicitly {@link google.cloud.vmmigration.v1.CreateGroupRequest.verify|verify} messages. + * @param message CreateGroupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vmmigration.v1.ICreateGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateGroupRequest message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.CreateGroupRequest.verify|verify} messages. + * @param message CreateGroupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vmmigration.v1.ICreateGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateGroupRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateGroupRequest + * @throws {Error} If the payload is not 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.vmmigration.v1.CreateGroupRequest; + + /** + * Decodes a CreateGroupRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateGroupRequest + * @throws {Error} If the payload 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.vmmigration.v1.CreateGroupRequest; + + /** + * Verifies a CreateGroupRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateGroupRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateGroupRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vmmigration.v1.CreateGroupRequest; + + /** + * Creates a plain object from a CreateGroupRequest message. Also converts values to other types if specified. + * @param message CreateGroupRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vmmigration.v1.CreateGroupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateGroupRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateGroupRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateGroupRequest. */ + interface IUpdateGroupRequest { + + /** UpdateGroupRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateGroupRequest group */ + group?: (google.cloud.vmmigration.v1.IGroup|null); + + /** UpdateGroupRequest requestId */ + requestId?: (string|null); + } + + /** Represents an UpdateGroupRequest. */ + class UpdateGroupRequest implements IUpdateGroupRequest { + + /** + * Constructs a new UpdateGroupRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vmmigration.v1.IUpdateGroupRequest); + + /** UpdateGroupRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateGroupRequest group. */ + public group?: (google.cloud.vmmigration.v1.IGroup|null); + + /** UpdateGroupRequest requestId. */ + public requestId: string; + + /** + * Creates a new UpdateGroupRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateGroupRequest instance + */ + public static create(properties?: google.cloud.vmmigration.v1.IUpdateGroupRequest): google.cloud.vmmigration.v1.UpdateGroupRequest; + + /** + * Encodes the specified UpdateGroupRequest message. Does not implicitly {@link google.cloud.vmmigration.v1.UpdateGroupRequest.verify|verify} messages. + * @param message UpdateGroupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vmmigration.v1.IUpdateGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateGroupRequest message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.UpdateGroupRequest.verify|verify} messages. + * @param message UpdateGroupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vmmigration.v1.IUpdateGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateGroupRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateGroupRequest + * @throws {Error} If the payload is not 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.vmmigration.v1.UpdateGroupRequest; + + /** + * Decodes an UpdateGroupRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateGroupRequest + * @throws {Error} If the payload 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.vmmigration.v1.UpdateGroupRequest; + + /** + * Verifies an UpdateGroupRequest message. + * @param message Plain 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 UpdateGroupRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateGroupRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vmmigration.v1.UpdateGroupRequest; + + /** + * Creates a plain object from an UpdateGroupRequest message. Also converts values to other types if specified. + * @param message UpdateGroupRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vmmigration.v1.UpdateGroupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateGroupRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateGroupRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteGroupRequest. */ + interface IDeleteGroupRequest { + + /** DeleteGroupRequest name */ + name?: (string|null); + + /** DeleteGroupRequest requestId */ + requestId?: (string|null); + } + + /** Represents a DeleteGroupRequest. */ + class DeleteGroupRequest implements IDeleteGroupRequest { + + /** + * Constructs a new DeleteGroupRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vmmigration.v1.IDeleteGroupRequest); + + /** DeleteGroupRequest name. */ + public name: string; + + /** DeleteGroupRequest requestId. */ + public requestId: string; + + /** + * Creates a new DeleteGroupRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteGroupRequest instance + */ + public static create(properties?: google.cloud.vmmigration.v1.IDeleteGroupRequest): google.cloud.vmmigration.v1.DeleteGroupRequest; + + /** + * Encodes the specified DeleteGroupRequest message. Does not implicitly {@link google.cloud.vmmigration.v1.DeleteGroupRequest.verify|verify} messages. + * @param message DeleteGroupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vmmigration.v1.IDeleteGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteGroupRequest message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.DeleteGroupRequest.verify|verify} messages. + * @param message DeleteGroupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vmmigration.v1.IDeleteGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteGroupRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteGroupRequest + * @throws {Error} If the payload is not 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.vmmigration.v1.DeleteGroupRequest; + + /** + * Decodes a DeleteGroupRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteGroupRequest + * @throws {Error} If the payload 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.vmmigration.v1.DeleteGroupRequest; + + /** + * Verifies a DeleteGroupRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteGroupRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteGroupRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vmmigration.v1.DeleteGroupRequest; + + /** + * Creates a plain object from a DeleteGroupRequest message. Also converts values to other types if specified. + * @param message DeleteGroupRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vmmigration.v1.DeleteGroupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteGroupRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteGroupRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AddGroupMigrationRequest. */ + interface IAddGroupMigrationRequest { + + /** AddGroupMigrationRequest group */ + group?: (string|null); + + /** AddGroupMigrationRequest migratingVm */ + migratingVm?: (string|null); + } + + /** Represents an AddGroupMigrationRequest. */ + class AddGroupMigrationRequest implements IAddGroupMigrationRequest { + + /** + * Constructs a new AddGroupMigrationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vmmigration.v1.IAddGroupMigrationRequest); + + /** AddGroupMigrationRequest group. */ + public group: string; + + /** AddGroupMigrationRequest migratingVm. */ + public migratingVm: string; + + /** + * Creates a new AddGroupMigrationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns AddGroupMigrationRequest instance + */ + public static create(properties?: google.cloud.vmmigration.v1.IAddGroupMigrationRequest): google.cloud.vmmigration.v1.AddGroupMigrationRequest; + + /** + * Encodes the specified AddGroupMigrationRequest message. Does not implicitly {@link google.cloud.vmmigration.v1.AddGroupMigrationRequest.verify|verify} messages. + * @param message AddGroupMigrationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vmmigration.v1.IAddGroupMigrationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AddGroupMigrationRequest message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.AddGroupMigrationRequest.verify|verify} messages. + * @param message AddGroupMigrationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vmmigration.v1.IAddGroupMigrationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AddGroupMigrationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AddGroupMigrationRequest + * @throws {Error} If the payload is not 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.vmmigration.v1.AddGroupMigrationRequest; + + /** + * Decodes an AddGroupMigrationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AddGroupMigrationRequest + * @throws {Error} If the payload 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.vmmigration.v1.AddGroupMigrationRequest; + + /** + * Verifies an AddGroupMigrationRequest message. + * @param message Plain 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 AddGroupMigrationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AddGroupMigrationRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vmmigration.v1.AddGroupMigrationRequest; + + /** + * Creates a plain object from an AddGroupMigrationRequest message. Also converts values to other types if specified. + * @param message AddGroupMigrationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vmmigration.v1.AddGroupMigrationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AddGroupMigrationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AddGroupMigrationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AddGroupMigrationResponse. */ + interface IAddGroupMigrationResponse { + } + + /** Represents an AddGroupMigrationResponse. */ + class AddGroupMigrationResponse implements IAddGroupMigrationResponse { + + /** + * Constructs a new AddGroupMigrationResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vmmigration.v1.IAddGroupMigrationResponse); + + /** + * Creates a new AddGroupMigrationResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns AddGroupMigrationResponse instance + */ + public static create(properties?: google.cloud.vmmigration.v1.IAddGroupMigrationResponse): google.cloud.vmmigration.v1.AddGroupMigrationResponse; + + /** + * Encodes the specified AddGroupMigrationResponse message. Does not implicitly {@link google.cloud.vmmigration.v1.AddGroupMigrationResponse.verify|verify} messages. + * @param message AddGroupMigrationResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vmmigration.v1.IAddGroupMigrationResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AddGroupMigrationResponse message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.AddGroupMigrationResponse.verify|verify} messages. + * @param message AddGroupMigrationResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vmmigration.v1.IAddGroupMigrationResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AddGroupMigrationResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AddGroupMigrationResponse + * @throws {Error} If the payload is not 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.vmmigration.v1.AddGroupMigrationResponse; + + /** + * Decodes an AddGroupMigrationResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AddGroupMigrationResponse + * @throws {Error} If the payload 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.vmmigration.v1.AddGroupMigrationResponse; + + /** + * Verifies an AddGroupMigrationResponse message. + * @param message Plain 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 AddGroupMigrationResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AddGroupMigrationResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vmmigration.v1.AddGroupMigrationResponse; + + /** + * Creates a plain object from an AddGroupMigrationResponse message. Also converts values to other types if specified. + * @param message AddGroupMigrationResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vmmigration.v1.AddGroupMigrationResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AddGroupMigrationResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AddGroupMigrationResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RemoveGroupMigrationRequest. */ + interface IRemoveGroupMigrationRequest { + + /** RemoveGroupMigrationRequest group */ + group?: (string|null); + + /** RemoveGroupMigrationRequest migratingVm */ + migratingVm?: (string|null); + } + + /** Represents a RemoveGroupMigrationRequest. */ + class RemoveGroupMigrationRequest implements IRemoveGroupMigrationRequest { + + /** + * Constructs a new RemoveGroupMigrationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vmmigration.v1.IRemoveGroupMigrationRequest); + + /** RemoveGroupMigrationRequest group. */ + public group: string; + + /** RemoveGroupMigrationRequest migratingVm. */ + public migratingVm: string; + + /** + * Creates a new RemoveGroupMigrationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RemoveGroupMigrationRequest instance + */ + public static create(properties?: google.cloud.vmmigration.v1.IRemoveGroupMigrationRequest): google.cloud.vmmigration.v1.RemoveGroupMigrationRequest; + + /** + * Encodes the specified RemoveGroupMigrationRequest message. Does not implicitly {@link google.cloud.vmmigration.v1.RemoveGroupMigrationRequest.verify|verify} messages. + * @param message RemoveGroupMigrationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vmmigration.v1.IRemoveGroupMigrationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RemoveGroupMigrationRequest message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.RemoveGroupMigrationRequest.verify|verify} messages. + * @param message RemoveGroupMigrationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vmmigration.v1.IRemoveGroupMigrationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RemoveGroupMigrationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RemoveGroupMigrationRequest + * @throws {Error} If the payload is not 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.vmmigration.v1.RemoveGroupMigrationRequest; + + /** + * Decodes a RemoveGroupMigrationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RemoveGroupMigrationRequest + * @throws {Error} If the payload 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.vmmigration.v1.RemoveGroupMigrationRequest; + + /** + * Verifies a RemoveGroupMigrationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RemoveGroupMigrationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RemoveGroupMigrationRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vmmigration.v1.RemoveGroupMigrationRequest; + + /** + * Creates a plain object from a RemoveGroupMigrationRequest message. Also converts values to other types if specified. + * @param message RemoveGroupMigrationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vmmigration.v1.RemoveGroupMigrationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RemoveGroupMigrationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RemoveGroupMigrationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RemoveGroupMigrationResponse. */ + interface IRemoveGroupMigrationResponse { + } + + /** Represents a RemoveGroupMigrationResponse. */ + class RemoveGroupMigrationResponse implements IRemoveGroupMigrationResponse { + + /** + * Constructs a new RemoveGroupMigrationResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vmmigration.v1.IRemoveGroupMigrationResponse); + + /** + * Creates a new RemoveGroupMigrationResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns RemoveGroupMigrationResponse instance + */ + public static create(properties?: google.cloud.vmmigration.v1.IRemoveGroupMigrationResponse): google.cloud.vmmigration.v1.RemoveGroupMigrationResponse; + + /** + * Encodes the specified RemoveGroupMigrationResponse message. Does not implicitly {@link google.cloud.vmmigration.v1.RemoveGroupMigrationResponse.verify|verify} messages. + * @param message RemoveGroupMigrationResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vmmigration.v1.IRemoveGroupMigrationResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RemoveGroupMigrationResponse message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.RemoveGroupMigrationResponse.verify|verify} messages. + * @param message RemoveGroupMigrationResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vmmigration.v1.IRemoveGroupMigrationResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RemoveGroupMigrationResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RemoveGroupMigrationResponse + * @throws {Error} If the payload is not 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.vmmigration.v1.RemoveGroupMigrationResponse; + + /** + * Decodes a RemoveGroupMigrationResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RemoveGroupMigrationResponse + * @throws {Error} If the payload 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.vmmigration.v1.RemoveGroupMigrationResponse; + + /** + * Verifies a RemoveGroupMigrationResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RemoveGroupMigrationResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RemoveGroupMigrationResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vmmigration.v1.RemoveGroupMigrationResponse; + + /** + * Creates a plain object from a RemoveGroupMigrationResponse message. Also converts values to other types if specified. + * @param message RemoveGroupMigrationResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vmmigration.v1.RemoveGroupMigrationResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RemoveGroupMigrationResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RemoveGroupMigrationResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateCutoverJobRequest. */ + interface ICreateCutoverJobRequest { + + /** CreateCutoverJobRequest parent */ + parent?: (string|null); + + /** CreateCutoverJobRequest cutoverJobId */ + cutoverJobId?: (string|null); + + /** CreateCutoverJobRequest cutoverJob */ + cutoverJob?: (google.cloud.vmmigration.v1.ICutoverJob|null); + + /** CreateCutoverJobRequest requestId */ + requestId?: (string|null); + } + + /** Represents a CreateCutoverJobRequest. */ + class CreateCutoverJobRequest implements ICreateCutoverJobRequest { + + /** + * Constructs a new CreateCutoverJobRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vmmigration.v1.ICreateCutoverJobRequest); + + /** CreateCutoverJobRequest parent. */ + public parent: string; + + /** CreateCutoverJobRequest cutoverJobId. */ + public cutoverJobId: string; + + /** CreateCutoverJobRequest cutoverJob. */ + public cutoverJob?: (google.cloud.vmmigration.v1.ICutoverJob|null); + + /** CreateCutoverJobRequest requestId. */ + public requestId: string; + + /** + * Creates a new CreateCutoverJobRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateCutoverJobRequest instance + */ + public static create(properties?: google.cloud.vmmigration.v1.ICreateCutoverJobRequest): google.cloud.vmmigration.v1.CreateCutoverJobRequest; + + /** + * Encodes the specified CreateCutoverJobRequest message. Does not implicitly {@link google.cloud.vmmigration.v1.CreateCutoverJobRequest.verify|verify} messages. + * @param message CreateCutoverJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vmmigration.v1.ICreateCutoverJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateCutoverJobRequest message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.CreateCutoverJobRequest.verify|verify} messages. + * @param message CreateCutoverJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vmmigration.v1.ICreateCutoverJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateCutoverJobRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateCutoverJobRequest + * @throws {Error} If the payload is not 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.vmmigration.v1.CreateCutoverJobRequest; + + /** + * Decodes a CreateCutoverJobRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateCutoverJobRequest + * @throws {Error} If the payload 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.vmmigration.v1.CreateCutoverJobRequest; + + /** + * Verifies a CreateCutoverJobRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateCutoverJobRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateCutoverJobRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vmmigration.v1.CreateCutoverJobRequest; + + /** + * Creates a plain object from a CreateCutoverJobRequest message. Also converts values to other types if specified. + * @param message CreateCutoverJobRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vmmigration.v1.CreateCutoverJobRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateCutoverJobRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateCutoverJobRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CancelCutoverJobRequest. */ + interface ICancelCutoverJobRequest { + + /** CancelCutoverJobRequest name */ + name?: (string|null); + } + + /** Represents a CancelCutoverJobRequest. */ + class CancelCutoverJobRequest implements ICancelCutoverJobRequest { + + /** + * Constructs a new CancelCutoverJobRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vmmigration.v1.ICancelCutoverJobRequest); + + /** CancelCutoverJobRequest name. */ + public name: string; + + /** + * Creates a new CancelCutoverJobRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CancelCutoverJobRequest instance + */ + public static create(properties?: google.cloud.vmmigration.v1.ICancelCutoverJobRequest): google.cloud.vmmigration.v1.CancelCutoverJobRequest; + + /** + * Encodes the specified CancelCutoverJobRequest message. Does not implicitly {@link google.cloud.vmmigration.v1.CancelCutoverJobRequest.verify|verify} messages. + * @param message CancelCutoverJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vmmigration.v1.ICancelCutoverJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CancelCutoverJobRequest message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.CancelCutoverJobRequest.verify|verify} messages. + * @param message CancelCutoverJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vmmigration.v1.ICancelCutoverJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CancelCutoverJobRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CancelCutoverJobRequest + * @throws {Error} If the payload is not 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.vmmigration.v1.CancelCutoverJobRequest; + + /** + * Decodes a CancelCutoverJobRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CancelCutoverJobRequest + * @throws {Error} If the payload 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.vmmigration.v1.CancelCutoverJobRequest; + + /** + * Verifies a CancelCutoverJobRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CancelCutoverJobRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CancelCutoverJobRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vmmigration.v1.CancelCutoverJobRequest; + + /** + * Creates a plain object from a CancelCutoverJobRequest message. Also converts values to other types if specified. + * @param message CancelCutoverJobRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vmmigration.v1.CancelCutoverJobRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CancelCutoverJobRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CancelCutoverJobRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CancelCutoverJobResponse. */ + interface ICancelCutoverJobResponse { + } + + /** Represents a CancelCutoverJobResponse. */ + class CancelCutoverJobResponse implements ICancelCutoverJobResponse { + + /** + * Constructs a new CancelCutoverJobResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vmmigration.v1.ICancelCutoverJobResponse); + + /** + * Creates a new CancelCutoverJobResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns CancelCutoverJobResponse instance + */ + public static create(properties?: google.cloud.vmmigration.v1.ICancelCutoverJobResponse): google.cloud.vmmigration.v1.CancelCutoverJobResponse; + + /** + * Encodes the specified CancelCutoverJobResponse message. Does not implicitly {@link google.cloud.vmmigration.v1.CancelCutoverJobResponse.verify|verify} messages. + * @param message CancelCutoverJobResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vmmigration.v1.ICancelCutoverJobResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CancelCutoverJobResponse message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.CancelCutoverJobResponse.verify|verify} messages. + * @param message CancelCutoverJobResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vmmigration.v1.ICancelCutoverJobResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CancelCutoverJobResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CancelCutoverJobResponse + * @throws {Error} If the payload is not 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.vmmigration.v1.CancelCutoverJobResponse; + + /** + * Decodes a CancelCutoverJobResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CancelCutoverJobResponse + * @throws {Error} If the payload 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.vmmigration.v1.CancelCutoverJobResponse; + + /** + * Verifies a CancelCutoverJobResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CancelCutoverJobResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CancelCutoverJobResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vmmigration.v1.CancelCutoverJobResponse; + + /** + * Creates a plain object from a CancelCutoverJobResponse message. Also converts values to other types if specified. + * @param message CancelCutoverJobResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vmmigration.v1.CancelCutoverJobResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CancelCutoverJobResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CancelCutoverJobResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListCutoverJobsRequest. */ + interface IListCutoverJobsRequest { + + /** ListCutoverJobsRequest parent */ + parent?: (string|null); + + /** ListCutoverJobsRequest pageSize */ + pageSize?: (number|null); + + /** ListCutoverJobsRequest pageToken */ + pageToken?: (string|null); + + /** ListCutoverJobsRequest filter */ + filter?: (string|null); + + /** ListCutoverJobsRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListCutoverJobsRequest. */ + class ListCutoverJobsRequest implements IListCutoverJobsRequest { + + /** + * Constructs a new ListCutoverJobsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vmmigration.v1.IListCutoverJobsRequest); + + /** ListCutoverJobsRequest parent. */ + public parent: string; + + /** ListCutoverJobsRequest pageSize. */ + public pageSize: number; + + /** ListCutoverJobsRequest pageToken. */ + public pageToken: string; + + /** ListCutoverJobsRequest filter. */ + public filter: string; + + /** ListCutoverJobsRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListCutoverJobsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListCutoverJobsRequest instance + */ + public static create(properties?: google.cloud.vmmigration.v1.IListCutoverJobsRequest): google.cloud.vmmigration.v1.ListCutoverJobsRequest; + + /** + * Encodes the specified ListCutoverJobsRequest message. Does not implicitly {@link google.cloud.vmmigration.v1.ListCutoverJobsRequest.verify|verify} messages. + * @param message ListCutoverJobsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vmmigration.v1.IListCutoverJobsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListCutoverJobsRequest message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.ListCutoverJobsRequest.verify|verify} messages. + * @param message ListCutoverJobsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vmmigration.v1.IListCutoverJobsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListCutoverJobsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListCutoverJobsRequest + * @throws {Error} If the payload is not 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.vmmigration.v1.ListCutoverJobsRequest; + + /** + * Decodes a ListCutoverJobsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListCutoverJobsRequest + * @throws {Error} If the payload 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.vmmigration.v1.ListCutoverJobsRequest; + + /** + * Verifies a ListCutoverJobsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListCutoverJobsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListCutoverJobsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vmmigration.v1.ListCutoverJobsRequest; + + /** + * Creates a plain object from a ListCutoverJobsRequest message. Also converts values to other types if specified. + * @param message ListCutoverJobsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vmmigration.v1.ListCutoverJobsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListCutoverJobsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListCutoverJobsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListCutoverJobsResponse. */ + interface IListCutoverJobsResponse { + + /** ListCutoverJobsResponse cutoverJobs */ + cutoverJobs?: (google.cloud.vmmigration.v1.ICutoverJob[]|null); + + /** ListCutoverJobsResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListCutoverJobsResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListCutoverJobsResponse. */ + class ListCutoverJobsResponse implements IListCutoverJobsResponse { + + /** + * Constructs a new ListCutoverJobsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vmmigration.v1.IListCutoverJobsResponse); + + /** ListCutoverJobsResponse cutoverJobs. */ + public cutoverJobs: google.cloud.vmmigration.v1.ICutoverJob[]; + + /** ListCutoverJobsResponse nextPageToken. */ + public nextPageToken: string; + + /** ListCutoverJobsResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListCutoverJobsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListCutoverJobsResponse instance + */ + public static create(properties?: google.cloud.vmmigration.v1.IListCutoverJobsResponse): google.cloud.vmmigration.v1.ListCutoverJobsResponse; + + /** + * Encodes the specified ListCutoverJobsResponse message. Does not implicitly {@link google.cloud.vmmigration.v1.ListCutoverJobsResponse.verify|verify} messages. + * @param message ListCutoverJobsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vmmigration.v1.IListCutoverJobsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListCutoverJobsResponse message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.ListCutoverJobsResponse.verify|verify} messages. + * @param message ListCutoverJobsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vmmigration.v1.IListCutoverJobsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListCutoverJobsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListCutoverJobsResponse + * @throws {Error} If the payload is not 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.vmmigration.v1.ListCutoverJobsResponse; + + /** + * Decodes a ListCutoverJobsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListCutoverJobsResponse + * @throws {Error} If the payload 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.vmmigration.v1.ListCutoverJobsResponse; + + /** + * Verifies a ListCutoverJobsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListCutoverJobsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListCutoverJobsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vmmigration.v1.ListCutoverJobsResponse; + + /** + * Creates a plain object from a ListCutoverJobsResponse message. Also converts values to other types if specified. + * @param message ListCutoverJobsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vmmigration.v1.ListCutoverJobsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListCutoverJobsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListCutoverJobsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetCutoverJobRequest. */ + interface IGetCutoverJobRequest { + + /** GetCutoverJobRequest name */ + name?: (string|null); + } + + /** Represents a GetCutoverJobRequest. */ + class GetCutoverJobRequest implements IGetCutoverJobRequest { + + /** + * Constructs a new GetCutoverJobRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vmmigration.v1.IGetCutoverJobRequest); + + /** GetCutoverJobRequest name. */ + public name: string; + + /** + * Creates a new GetCutoverJobRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetCutoverJobRequest instance + */ + public static create(properties?: google.cloud.vmmigration.v1.IGetCutoverJobRequest): google.cloud.vmmigration.v1.GetCutoverJobRequest; + + /** + * Encodes the specified GetCutoverJobRequest message. Does not implicitly {@link google.cloud.vmmigration.v1.GetCutoverJobRequest.verify|verify} messages. + * @param message GetCutoverJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vmmigration.v1.IGetCutoverJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetCutoverJobRequest message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.GetCutoverJobRequest.verify|verify} messages. + * @param message GetCutoverJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vmmigration.v1.IGetCutoverJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetCutoverJobRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetCutoverJobRequest + * @throws {Error} If the payload is not 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.vmmigration.v1.GetCutoverJobRequest; + + /** + * Decodes a GetCutoverJobRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetCutoverJobRequest + * @throws {Error} If the payload 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.vmmigration.v1.GetCutoverJobRequest; + + /** + * Verifies a GetCutoverJobRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetCutoverJobRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetCutoverJobRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vmmigration.v1.GetCutoverJobRequest; + + /** + * Creates a plain object from a GetCutoverJobRequest message. Also converts values to other types if specified. + * @param message GetCutoverJobRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vmmigration.v1.GetCutoverJobRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetCutoverJobRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetCutoverJobRequest + * @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.vmmigration.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.vmmigration.v1.IOperationMetadata): google.cloud.vmmigration.v1.OperationMetadata; + + /** + * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.vmmigration.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.vmmigration.v1.IOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.vmmigration.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.vmmigration.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.vmmigration.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.vmmigration.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.vmmigration.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.vmmigration.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 MigrationError. */ + interface IMigrationError { + + /** MigrationError code */ + code?: (google.cloud.vmmigration.v1.MigrationError.ErrorCode|keyof typeof google.cloud.vmmigration.v1.MigrationError.ErrorCode|null); + + /** MigrationError errorMessage */ + errorMessage?: (google.rpc.ILocalizedMessage|null); + + /** MigrationError actionItem */ + actionItem?: (google.rpc.ILocalizedMessage|null); + + /** MigrationError helpLinks */ + helpLinks?: (google.rpc.Help.ILink[]|null); + + /** MigrationError errorTime */ + errorTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a MigrationError. */ + class MigrationError implements IMigrationError { + + /** + * Constructs a new MigrationError. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vmmigration.v1.IMigrationError); + + /** MigrationError code. */ + public code: (google.cloud.vmmigration.v1.MigrationError.ErrorCode|keyof typeof google.cloud.vmmigration.v1.MigrationError.ErrorCode); + + /** MigrationError errorMessage. */ + public errorMessage?: (google.rpc.ILocalizedMessage|null); + + /** MigrationError actionItem. */ + public actionItem?: (google.rpc.ILocalizedMessage|null); + + /** MigrationError helpLinks. */ + public helpLinks: google.rpc.Help.ILink[]; + + /** MigrationError errorTime. */ + public errorTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new MigrationError instance using the specified properties. + * @param [properties] Properties to set + * @returns MigrationError instance + */ + public static create(properties?: google.cloud.vmmigration.v1.IMigrationError): google.cloud.vmmigration.v1.MigrationError; + + /** + * Encodes the specified MigrationError message. Does not implicitly {@link google.cloud.vmmigration.v1.MigrationError.verify|verify} messages. + * @param message MigrationError message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vmmigration.v1.IMigrationError, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MigrationError message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.MigrationError.verify|verify} messages. + * @param message MigrationError message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vmmigration.v1.IMigrationError, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MigrationError message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MigrationError + * @throws {Error} If the payload is not 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.vmmigration.v1.MigrationError; + + /** + * Decodes a MigrationError message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MigrationError + * @throws {Error} If the payload 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.vmmigration.v1.MigrationError; + + /** + * Verifies a MigrationError message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MigrationError message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MigrationError + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vmmigration.v1.MigrationError; + + /** + * Creates a plain object from a MigrationError message. Also converts values to other types if specified. + * @param message MigrationError + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vmmigration.v1.MigrationError, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MigrationError to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MigrationError + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace MigrationError { + + /** ErrorCode enum. */ + enum ErrorCode { + ERROR_CODE_UNSPECIFIED = 0, + UNKNOWN_ERROR = 1, + SOURCE_VALIDATION_ERROR = 2, + SOURCE_REPLICATION_ERROR = 3, + TARGET_REPLICATION_ERROR = 4, + OS_ADAPTATION_ERROR = 5, + CLONE_ERROR = 6, + CUTOVER_ERROR = 7, + UTILIZATION_REPORT_ERROR = 8, + APPLIANCE_UPGRADE_ERROR = 9 + } + } + } + } + } + + /** Namespace api. */ + namespace api { + + /** Properties of a Http. */ + interface IHttp { + + /** Http rules */ + rules?: (google.api.IHttpRule[]|null); + + /** Http fullyDecodeReservedExpansion */ + fullyDecodeReservedExpansion?: (boolean|null); + } + + /** Represents a Http. */ + class Http implements IHttp { + + /** + * Constructs a new Http. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IHttp); + + /** Http rules. */ + public rules: google.api.IHttpRule[]; + + /** Http fullyDecodeReservedExpansion. */ + public fullyDecodeReservedExpansion: boolean; + + /** + * Creates a new Http instance using the specified properties. + * @param [properties] Properties to set + * @returns Http instance + */ + public static create(properties?: google.api.IHttp): google.api.Http; + + /** + * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @param message Http message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @param message Http message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Http message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.Http; + + /** + * Decodes a Http message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.Http; + + /** + * Verifies a Http message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Http message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Http + */ + public static fromObject(object: { [k: string]: any }): google.api.Http; + + /** + * Creates a plain object from a Http message. Also converts values to other types if specified. + * @param message Http + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.Http, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Http to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Http + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a HttpRule. */ + interface IHttpRule { + + /** HttpRule selector */ + selector?: (string|null); + + /** HttpRule get */ + get?: (string|null); + + /** HttpRule put */ + put?: (string|null); + + /** HttpRule post */ + post?: (string|null); + + /** HttpRule delete */ + "delete"?: (string|null); + + /** HttpRule patch */ + patch?: (string|null); + + /** HttpRule custom */ + custom?: (google.api.ICustomHttpPattern|null); + + /** HttpRule body */ + body?: (string|null); + + /** HttpRule responseBody */ + responseBody?: (string|null); + + /** HttpRule additionalBindings */ + additionalBindings?: (google.api.IHttpRule[]|null); + } + + /** Represents a HttpRule. */ + class HttpRule implements IHttpRule { + + /** + * Constructs a new HttpRule. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IHttpRule); + + /** HttpRule selector. */ + public selector: string; + + /** HttpRule get. */ + public get?: (string|null); + + /** HttpRule put. */ + public put?: (string|null); + + /** HttpRule post. */ + public post?: (string|null); + + /** HttpRule delete. */ + public delete?: (string|null); + + /** HttpRule patch. */ + public patch?: (string|null); + + /** HttpRule custom. */ + public custom?: (google.api.ICustomHttpPattern|null); + + /** HttpRule body. */ + public body: string; + + /** HttpRule responseBody. */ + public responseBody: string; + + /** HttpRule additionalBindings. */ + public additionalBindings: google.api.IHttpRule[]; + + /** HttpRule pattern. */ + public pattern?: ("get"|"put"|"post"|"delete"|"patch"|"custom"); + + /** + * Creates a new HttpRule instance using the specified properties. + * @param [properties] Properties to set + * @returns HttpRule instance + */ + public static create(properties?: google.api.IHttpRule): google.api.HttpRule; + + /** + * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @param message HttpRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @param message HttpRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HttpRule message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.HttpRule; + + /** + * Decodes a HttpRule message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.HttpRule; + + /** + * Verifies a HttpRule message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HttpRule + */ + public static fromObject(object: { [k: string]: any }): google.api.HttpRule; + + /** + * Creates a plain object from a HttpRule message. Also converts values to other types if specified. + * @param message HttpRule + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.HttpRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HttpRule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for HttpRule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomHttpPattern. */ + interface ICustomHttpPattern { + + /** CustomHttpPattern kind */ + kind?: (string|null); + + /** CustomHttpPattern path */ + path?: (string|null); + } + + /** Represents a CustomHttpPattern. */ + class CustomHttpPattern implements ICustomHttpPattern { + + /** + * Constructs a new CustomHttpPattern. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ICustomHttpPattern); + + /** CustomHttpPattern kind. */ + public kind: string; + + /** CustomHttpPattern path. */ + public path: string; + + /** + * Creates a new CustomHttpPattern instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomHttpPattern instance + */ + public static create(properties?: google.api.ICustomHttpPattern): google.api.CustomHttpPattern; + + /** + * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @param message CustomHttpPattern message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @param message CustomHttpPattern message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CustomHttpPattern; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CustomHttpPattern; + + /** + * Verifies a CustomHttpPattern message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CustomHttpPattern + */ + public static fromObject(object: { [k: string]: any }): google.api.CustomHttpPattern; + + /** + * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. + * @param message CustomHttpPattern + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.CustomHttpPattern, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CustomHttpPattern to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CustomHttpPattern + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** FieldBehavior enum. */ + enum FieldBehavior { + FIELD_BEHAVIOR_UNSPECIFIED = 0, + OPTIONAL = 1, + REQUIRED = 2, + OUTPUT_ONLY = 3, + INPUT_ONLY = 4, + IMMUTABLE = 5, + UNORDERED_LIST = 6, + NON_EMPTY_DEFAULT = 7 + } + + /** Properties of a ResourceDescriptor. */ + interface IResourceDescriptor { + + /** ResourceDescriptor type */ + type?: (string|null); + + /** ResourceDescriptor pattern */ + pattern?: (string[]|null); + + /** ResourceDescriptor nameField */ + nameField?: (string|null); + + /** ResourceDescriptor history */ + history?: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History|null); + + /** ResourceDescriptor plural */ + plural?: (string|null); + + /** ResourceDescriptor singular */ + singular?: (string|null); + + /** ResourceDescriptor style */ + style?: (google.api.ResourceDescriptor.Style[]|null); + } + + /** Represents a ResourceDescriptor. */ + class ResourceDescriptor implements IResourceDescriptor { + + /** + * Constructs a new ResourceDescriptor. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IResourceDescriptor); + + /** ResourceDescriptor type. */ + public type: string; + + /** ResourceDescriptor pattern. */ + public pattern: string[]; + + /** ResourceDescriptor nameField. */ + public nameField: string; + + /** ResourceDescriptor history. */ + public history: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History); + + /** ResourceDescriptor plural. */ + public plural: string; + + /** ResourceDescriptor singular. */ + public singular: string; + + /** ResourceDescriptor style. */ + public style: google.api.ResourceDescriptor.Style[]; + + /** + * Creates a new ResourceDescriptor instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourceDescriptor instance + */ + public static create(properties?: google.api.IResourceDescriptor): google.api.ResourceDescriptor; + + /** + * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @param message ResourceDescriptor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @param message ResourceDescriptor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ResourceDescriptor; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ResourceDescriptor; + + /** + * Verifies a ResourceDescriptor message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourceDescriptor + */ + public static fromObject(object: { [k: string]: any }): google.api.ResourceDescriptor; + + /** + * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. + * @param message ResourceDescriptor + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.ResourceDescriptor, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourceDescriptor to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResourceDescriptor + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ResourceDescriptor { + + /** History enum. */ + enum History { + HISTORY_UNSPECIFIED = 0, + ORIGINALLY_SINGLE_PATTERN = 1, + FUTURE_MULTI_PATTERN = 2 + } + + /** Style enum. */ + enum Style { + STYLE_UNSPECIFIED = 0, + DECLARATIVE_FRIENDLY = 1 + } + } + + /** Properties of a ResourceReference. */ + interface IResourceReference { + + /** ResourceReference type */ + type?: (string|null); + + /** ResourceReference childType */ + childType?: (string|null); + } + + /** Represents a ResourceReference. */ + class ResourceReference implements IResourceReference { + + /** + * Constructs a new ResourceReference. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IResourceReference); + + /** ResourceReference type. */ + public type: string; + + /** ResourceReference childType. */ + public childType: string; + + /** + * Creates a new ResourceReference instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourceReference instance + */ + public static create(properties?: google.api.IResourceReference): google.api.ResourceReference; + + /** + * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @param message ResourceReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @param message ResourceReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourceReference message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ResourceReference; + + /** + * Decodes a ResourceReference message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ResourceReference; + + /** + * Verifies a ResourceReference message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourceReference + */ + public static fromObject(object: { [k: string]: any }): google.api.ResourceReference; + + /** + * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. + * @param message ResourceReference + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.ResourceReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourceReference to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResourceReference + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace protobuf. */ + namespace protobuf { + + /** Properties of a FileDescriptorSet. */ + interface IFileDescriptorSet { + + /** FileDescriptorSet file */ + file?: (google.protobuf.IFileDescriptorProto[]|null); + } + + /** Represents a FileDescriptorSet. */ + class FileDescriptorSet implements IFileDescriptorSet { + + /** + * Constructs a new FileDescriptorSet. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileDescriptorSet); + + /** FileDescriptorSet file. */ + public file: google.protobuf.IFileDescriptorProto[]; + + /** + * Creates a new FileDescriptorSet instance using the specified properties. + * @param [properties] Properties to set + * @returns FileDescriptorSet instance + */ + public static create(properties?: google.protobuf.IFileDescriptorSet): google.protobuf.FileDescriptorSet; + + /** + * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @param message FileDescriptorSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @param message FileDescriptorSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileDescriptorSet; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileDescriptorSet; + + /** + * Verifies a FileDescriptorSet message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileDescriptorSet + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorSet; + + /** + * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. + * @param message FileDescriptorSet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileDescriptorSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileDescriptorSet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FileDescriptorSet + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FileDescriptorProto. */ + interface IFileDescriptorProto { + + /** FileDescriptorProto name */ + name?: (string|null); + + /** FileDescriptorProto package */ + "package"?: (string|null); + + /** FileDescriptorProto dependency */ + dependency?: (string[]|null); + + /** FileDescriptorProto publicDependency */ + publicDependency?: (number[]|null); + + /** FileDescriptorProto weakDependency */ + weakDependency?: (number[]|null); + + /** FileDescriptorProto messageType */ + messageType?: (google.protobuf.IDescriptorProto[]|null); + + /** FileDescriptorProto enumType */ + enumType?: (google.protobuf.IEnumDescriptorProto[]|null); + + /** FileDescriptorProto service */ + service?: (google.protobuf.IServiceDescriptorProto[]|null); + + /** FileDescriptorProto extension */ + extension?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** FileDescriptorProto options */ + options?: (google.protobuf.IFileOptions|null); + + /** FileDescriptorProto sourceCodeInfo */ + sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); + + /** FileDescriptorProto syntax */ + syntax?: (string|null); + + /** FileDescriptorProto edition */ + edition?: (string|null); + } + + /** Represents a FileDescriptorProto. */ + class FileDescriptorProto implements IFileDescriptorProto { + + /** + * Constructs a new FileDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileDescriptorProto); + + /** FileDescriptorProto name. */ + public name: string; + + /** FileDescriptorProto package. */ + public package: string; + + /** FileDescriptorProto dependency. */ + public dependency: string[]; + + /** FileDescriptorProto publicDependency. */ + public publicDependency: number[]; + + /** FileDescriptorProto weakDependency. */ + public weakDependency: number[]; + + /** FileDescriptorProto messageType. */ + public messageType: google.protobuf.IDescriptorProto[]; + + /** FileDescriptorProto enumType. */ + public enumType: google.protobuf.IEnumDescriptorProto[]; + + /** FileDescriptorProto service. */ + public service: google.protobuf.IServiceDescriptorProto[]; + + /** FileDescriptorProto extension. */ + public extension: google.protobuf.IFieldDescriptorProto[]; + + /** FileDescriptorProto options. */ + public options?: (google.protobuf.IFileOptions|null); + + /** FileDescriptorProto sourceCodeInfo. */ + public sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); + + /** FileDescriptorProto syntax. */ + public syntax: string; + + /** FileDescriptorProto edition. */ + public edition: string; + + /** + * Creates a new FileDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns FileDescriptorProto instance + */ + public static create(properties?: google.protobuf.IFileDescriptorProto): google.protobuf.FileDescriptorProto; + + /** + * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @param message FileDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @param message FileDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileDescriptorProto; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileDescriptorProto; + + /** + * Verifies a FileDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorProto; + + /** + * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. + * @param message FileDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FileDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DescriptorProto. */ + interface IDescriptorProto { + + /** DescriptorProto name */ + name?: (string|null); + + /** DescriptorProto field */ + field?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** DescriptorProto extension */ + extension?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** DescriptorProto nestedType */ + nestedType?: (google.protobuf.IDescriptorProto[]|null); + + /** DescriptorProto enumType */ + enumType?: (google.protobuf.IEnumDescriptorProto[]|null); + + /** DescriptorProto extensionRange */ + extensionRange?: (google.protobuf.DescriptorProto.IExtensionRange[]|null); + + /** DescriptorProto oneofDecl */ + oneofDecl?: (google.protobuf.IOneofDescriptorProto[]|null); + + /** DescriptorProto options */ + options?: (google.protobuf.IMessageOptions|null); + + /** DescriptorProto reservedRange */ + reservedRange?: (google.protobuf.DescriptorProto.IReservedRange[]|null); + + /** DescriptorProto reservedName */ + reservedName?: (string[]|null); + } + + /** Represents a DescriptorProto. */ + class DescriptorProto implements IDescriptorProto { + + /** + * Constructs a new DescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IDescriptorProto); + + /** DescriptorProto name. */ + public name: string; + + /** DescriptorProto field. */ + public field: google.protobuf.IFieldDescriptorProto[]; + + /** DescriptorProto extension. */ + public extension: google.protobuf.IFieldDescriptorProto[]; + + /** DescriptorProto nestedType. */ + public nestedType: google.protobuf.IDescriptorProto[]; + + /** DescriptorProto enumType. */ + public enumType: google.protobuf.IEnumDescriptorProto[]; + + /** DescriptorProto extensionRange. */ + public extensionRange: google.protobuf.DescriptorProto.IExtensionRange[]; + + /** DescriptorProto oneofDecl. */ + public oneofDecl: google.protobuf.IOneofDescriptorProto[]; + + /** DescriptorProto options. */ + public options?: (google.protobuf.IMessageOptions|null); + + /** DescriptorProto reservedRange. */ + public reservedRange: google.protobuf.DescriptorProto.IReservedRange[]; + + /** DescriptorProto reservedName. */ + public reservedName: string[]; + + /** + * Creates a new DescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns DescriptorProto instance + */ + public static create(properties?: google.protobuf.IDescriptorProto): google.protobuf.DescriptorProto; + + /** + * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @param message DescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @param message DescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto; + + /** + * Verifies a DescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto; + + /** + * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. + * @param message DescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace DescriptorProto { + + /** Properties of an ExtensionRange. */ + interface IExtensionRange { + + /** ExtensionRange start */ + start?: (number|null); + + /** ExtensionRange end */ + end?: (number|null); + + /** ExtensionRange options */ + options?: (google.protobuf.IExtensionRangeOptions|null); + } + + /** Represents an ExtensionRange. */ + class ExtensionRange implements IExtensionRange { + + /** + * Constructs a new ExtensionRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.DescriptorProto.IExtensionRange); + + /** ExtensionRange start. */ + public start: number; + + /** ExtensionRange end. */ + public end: number; + + /** ExtensionRange options. */ + public options?: (google.protobuf.IExtensionRangeOptions|null); + + /** + * Creates a new ExtensionRange instance using the specified properties. + * @param [properties] Properties to set + * @returns ExtensionRange instance + */ + public static create(properties?: google.protobuf.DescriptorProto.IExtensionRange): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @param message ExtensionRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @param message ExtensionRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Verifies an ExtensionRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExtensionRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. + * @param message ExtensionRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto.ExtensionRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExtensionRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExtensionRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ReservedRange. */ + interface IReservedRange { + + /** ReservedRange start */ + start?: (number|null); + + /** ReservedRange end */ + end?: (number|null); + } + + /** Represents a ReservedRange. */ + class ReservedRange implements IReservedRange { + + /** + * Constructs a new ReservedRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.DescriptorProto.IReservedRange); + + /** ReservedRange start. */ + public start: number; + + /** ReservedRange end. */ + public end: number; + + /** + * Creates a new ReservedRange instance using the specified properties. + * @param [properties] Properties to set + * @returns ReservedRange instance + */ + public static create(properties?: google.protobuf.DescriptorProto.IReservedRange): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @param message ReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @param message ReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReservedRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Decodes a ReservedRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Verifies a ReservedRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReservedRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. + * @param message ReservedRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto.ReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReservedRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReservedRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an ExtensionRangeOptions. */ + interface IExtensionRangeOptions { + + /** ExtensionRangeOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an ExtensionRangeOptions. */ + class ExtensionRangeOptions implements IExtensionRangeOptions { + + /** + * Constructs a new ExtensionRangeOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IExtensionRangeOptions); + + /** ExtensionRangeOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new ExtensionRangeOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns ExtensionRangeOptions instance + */ + public static create(properties?: google.protobuf.IExtensionRangeOptions): google.protobuf.ExtensionRangeOptions; + + /** + * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @param message ExtensionRangeOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @param message ExtensionRangeOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ExtensionRangeOptions; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ExtensionRangeOptions; + + /** + * Verifies an ExtensionRangeOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExtensionRangeOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ExtensionRangeOptions; + + /** + * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. + * @param message ExtensionRangeOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ExtensionRangeOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExtensionRangeOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExtensionRangeOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FieldDescriptorProto. */ + interface IFieldDescriptorProto { + + /** FieldDescriptorProto name */ + name?: (string|null); + + /** FieldDescriptorProto number */ + number?: (number|null); + + /** FieldDescriptorProto label */ + label?: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label|null); + + /** FieldDescriptorProto type */ + type?: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type|null); + + /** FieldDescriptorProto typeName */ + typeName?: (string|null); + + /** FieldDescriptorProto extendee */ + extendee?: (string|null); + + /** FieldDescriptorProto defaultValue */ + defaultValue?: (string|null); + + /** FieldDescriptorProto oneofIndex */ + oneofIndex?: (number|null); + + /** FieldDescriptorProto jsonName */ + jsonName?: (string|null); + + /** FieldDescriptorProto options */ + options?: (google.protobuf.IFieldOptions|null); + + /** FieldDescriptorProto proto3Optional */ + proto3Optional?: (boolean|null); + } + + /** Represents a FieldDescriptorProto. */ + class FieldDescriptorProto implements IFieldDescriptorProto { + + /** + * Constructs a new FieldDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldDescriptorProto); + + /** FieldDescriptorProto name. */ + public name: string; + + /** FieldDescriptorProto number. */ + public number: number; + + /** FieldDescriptorProto label. */ + public label: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label); + + /** FieldDescriptorProto type. */ + public type: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type); + + /** FieldDescriptorProto typeName. */ + public typeName: string; + + /** FieldDescriptorProto extendee. */ + public extendee: string; + + /** FieldDescriptorProto defaultValue. */ + public defaultValue: string; + + /** FieldDescriptorProto oneofIndex. */ + public oneofIndex: number; + + /** FieldDescriptorProto jsonName. */ + public jsonName: string; + + /** FieldDescriptorProto options. */ + public options?: (google.protobuf.IFieldOptions|null); + + /** FieldDescriptorProto proto3Optional. */ + public proto3Optional: boolean; + + /** + * Creates a new FieldDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldDescriptorProto instance + */ + public static create(properties?: google.protobuf.IFieldDescriptorProto): google.protobuf.FieldDescriptorProto; + + /** + * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @param message FieldDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @param message FieldDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldDescriptorProto; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldDescriptorProto; + + /** + * Verifies a FieldDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldDescriptorProto; + + /** + * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. + * @param message FieldDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FieldDescriptorProto { + + /** Type enum. */ + enum Type { + TYPE_DOUBLE = 1, + TYPE_FLOAT = 2, + TYPE_INT64 = 3, + TYPE_UINT64 = 4, + TYPE_INT32 = 5, + TYPE_FIXED64 = 6, + TYPE_FIXED32 = 7, + TYPE_BOOL = 8, + TYPE_STRING = 9, + TYPE_GROUP = 10, + TYPE_MESSAGE = 11, + TYPE_BYTES = 12, + TYPE_UINT32 = 13, + TYPE_ENUM = 14, + TYPE_SFIXED32 = 15, + TYPE_SFIXED64 = 16, + TYPE_SINT32 = 17, + TYPE_SINT64 = 18 + } + + /** Label enum. */ + enum Label { + LABEL_OPTIONAL = 1, + LABEL_REQUIRED = 2, + LABEL_REPEATED = 3 + } + } + + /** Properties of an OneofDescriptorProto. */ + interface IOneofDescriptorProto { + + /** OneofDescriptorProto name */ + name?: (string|null); + + /** OneofDescriptorProto options */ + options?: (google.protobuf.IOneofOptions|null); + } + + /** Represents an OneofDescriptorProto. */ + class OneofDescriptorProto implements IOneofDescriptorProto { + + /** + * Constructs a new OneofDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IOneofDescriptorProto); + + /** OneofDescriptorProto name. */ + public name: string; + + /** OneofDescriptorProto options. */ + public options?: (google.protobuf.IOneofOptions|null); + + /** + * Creates a new OneofDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns OneofDescriptorProto instance + */ + public static create(properties?: google.protobuf.IOneofDescriptorProto): google.protobuf.OneofDescriptorProto; + + /** + * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @param message OneofDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @param message OneofDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofDescriptorProto; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofDescriptorProto; + + /** + * Verifies an OneofDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OneofDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.OneofDescriptorProto; + + /** + * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. + * @param message OneofDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.OneofDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OneofDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OneofDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnumDescriptorProto. */ + interface IEnumDescriptorProto { + + /** EnumDescriptorProto name */ + name?: (string|null); + + /** EnumDescriptorProto value */ + value?: (google.protobuf.IEnumValueDescriptorProto[]|null); + + /** EnumDescriptorProto options */ + options?: (google.protobuf.IEnumOptions|null); + + /** EnumDescriptorProto reservedRange */ + reservedRange?: (google.protobuf.EnumDescriptorProto.IEnumReservedRange[]|null); + + /** EnumDescriptorProto reservedName */ + reservedName?: (string[]|null); + } + + /** Represents an EnumDescriptorProto. */ + class EnumDescriptorProto implements IEnumDescriptorProto { + + /** + * Constructs a new EnumDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumDescriptorProto); + + /** EnumDescriptorProto name. */ + public name: string; + + /** EnumDescriptorProto value. */ + public value: google.protobuf.IEnumValueDescriptorProto[]; + + /** EnumDescriptorProto options. */ + public options?: (google.protobuf.IEnumOptions|null); + + /** EnumDescriptorProto reservedRange. */ + public reservedRange: google.protobuf.EnumDescriptorProto.IEnumReservedRange[]; + + /** EnumDescriptorProto reservedName. */ + public reservedName: string[]; + + /** + * Creates a new EnumDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumDescriptorProto instance + */ + public static create(properties?: google.protobuf.IEnumDescriptorProto): google.protobuf.EnumDescriptorProto; + + /** + * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @param message EnumDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @param message EnumDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto; + + /** + * Verifies an EnumDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto; + + /** + * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. + * @param message EnumDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace EnumDescriptorProto { + + /** Properties of an EnumReservedRange. */ + interface IEnumReservedRange { + + /** EnumReservedRange start */ + start?: (number|null); + + /** EnumReservedRange end */ + end?: (number|null); + } + + /** Represents an EnumReservedRange. */ + class EnumReservedRange implements IEnumReservedRange { + + /** + * Constructs a new EnumReservedRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange); + + /** EnumReservedRange start. */ + public start: number; + + /** EnumReservedRange end. */ + public end: number; + + /** + * Creates a new EnumReservedRange instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumReservedRange instance + */ + public static create(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @param message EnumReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @param message EnumReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Verifies an EnumReservedRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumReservedRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. + * @param message EnumReservedRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumDescriptorProto.EnumReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumReservedRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumReservedRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an EnumValueDescriptorProto. */ + interface IEnumValueDescriptorProto { + + /** EnumValueDescriptorProto name */ + name?: (string|null); + + /** EnumValueDescriptorProto number */ + number?: (number|null); + + /** EnumValueDescriptorProto options */ + options?: (google.protobuf.IEnumValueOptions|null); + } + + /** Represents an EnumValueDescriptorProto. */ + class EnumValueDescriptorProto implements IEnumValueDescriptorProto { + + /** + * Constructs a new EnumValueDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumValueDescriptorProto); + + /** EnumValueDescriptorProto name. */ + public name: string; + + /** EnumValueDescriptorProto number. */ + public number: number; + + /** EnumValueDescriptorProto options. */ + public options?: (google.protobuf.IEnumValueOptions|null); + + /** + * Creates a new EnumValueDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumValueDescriptorProto instance + */ + public static create(properties?: google.protobuf.IEnumValueDescriptorProto): google.protobuf.EnumValueDescriptorProto; + + /** + * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @param message EnumValueDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @param message EnumValueDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueDescriptorProto; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueDescriptorProto; + + /** + * Verifies an EnumValueDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumValueDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueDescriptorProto; + + /** + * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. + * @param message EnumValueDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumValueDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumValueDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumValueDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceDescriptorProto. */ + interface IServiceDescriptorProto { + + /** ServiceDescriptorProto name */ + name?: (string|null); + + /** ServiceDescriptorProto method */ + method?: (google.protobuf.IMethodDescriptorProto[]|null); + + /** ServiceDescriptorProto options */ + options?: (google.protobuf.IServiceOptions|null); + } + + /** Represents a ServiceDescriptorProto. */ + class ServiceDescriptorProto implements IServiceDescriptorProto { + + /** + * Constructs a new ServiceDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceDescriptorProto); + + /** ServiceDescriptorProto name. */ + public name: string; + + /** ServiceDescriptorProto method. */ + public method: google.protobuf.IMethodDescriptorProto[]; + + /** ServiceDescriptorProto options. */ + public options?: (google.protobuf.IServiceOptions|null); + + /** + * Creates a new ServiceDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceDescriptorProto instance + */ + public static create(properties?: google.protobuf.IServiceDescriptorProto): google.protobuf.ServiceDescriptorProto; + + /** + * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @param message ServiceDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @param message ServiceDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceDescriptorProto; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceDescriptorProto; + + /** + * Verifies a ServiceDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceDescriptorProto; + + /** + * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. + * @param message ServiceDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ServiceDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ServiceDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MethodDescriptorProto. */ + interface IMethodDescriptorProto { + + /** MethodDescriptorProto name */ + name?: (string|null); + + /** MethodDescriptorProto inputType */ + inputType?: (string|null); + + /** MethodDescriptorProto outputType */ + outputType?: (string|null); + + /** MethodDescriptorProto options */ + options?: (google.protobuf.IMethodOptions|null); + + /** MethodDescriptorProto clientStreaming */ + clientStreaming?: (boolean|null); + + /** MethodDescriptorProto serverStreaming */ + serverStreaming?: (boolean|null); + } + + /** Represents a MethodDescriptorProto. */ + class MethodDescriptorProto implements IMethodDescriptorProto { + + /** + * Constructs a new MethodDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMethodDescriptorProto); + + /** MethodDescriptorProto name. */ + public name: string; + + /** MethodDescriptorProto inputType. */ + public inputType: string; + + /** MethodDescriptorProto outputType. */ + public outputType: string; + + /** MethodDescriptorProto options. */ + public options?: (google.protobuf.IMethodOptions|null); + + /** MethodDescriptorProto clientStreaming. */ + public clientStreaming: boolean; + + /** MethodDescriptorProto serverStreaming. */ + public serverStreaming: boolean; + + /** + * Creates a new MethodDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodDescriptorProto instance + */ + public static create(properties?: google.protobuf.IMethodDescriptorProto): google.protobuf.MethodDescriptorProto; + + /** + * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @param message MethodDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @param message MethodDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodDescriptorProto; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodDescriptorProto; + + /** + * Verifies a MethodDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MethodDescriptorProto; + + /** + * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. + * @param message MethodDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MethodDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MethodDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FileOptions. */ + interface IFileOptions { + + /** FileOptions javaPackage */ + javaPackage?: (string|null); + + /** FileOptions javaOuterClassname */ + javaOuterClassname?: (string|null); + + /** FileOptions javaMultipleFiles */ + javaMultipleFiles?: (boolean|null); + + /** FileOptions javaGenerateEqualsAndHash */ + javaGenerateEqualsAndHash?: (boolean|null); + + /** FileOptions javaStringCheckUtf8 */ + javaStringCheckUtf8?: (boolean|null); + + /** FileOptions optimizeFor */ + optimizeFor?: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode|null); + + /** FileOptions goPackage */ + goPackage?: (string|null); + + /** FileOptions ccGenericServices */ + ccGenericServices?: (boolean|null); + + /** FileOptions javaGenericServices */ + javaGenericServices?: (boolean|null); + + /** FileOptions pyGenericServices */ + pyGenericServices?: (boolean|null); + + /** FileOptions phpGenericServices */ + phpGenericServices?: (boolean|null); + + /** FileOptions deprecated */ + deprecated?: (boolean|null); + + /** FileOptions ccEnableArenas */ + ccEnableArenas?: (boolean|null); + + /** FileOptions objcClassPrefix */ + objcClassPrefix?: (string|null); + + /** FileOptions csharpNamespace */ + csharpNamespace?: (string|null); + + /** FileOptions swiftPrefix */ + swiftPrefix?: (string|null); + + /** FileOptions phpClassPrefix */ + phpClassPrefix?: (string|null); + + /** FileOptions phpNamespace */ + phpNamespace?: (string|null); + + /** FileOptions phpMetadataNamespace */ + phpMetadataNamespace?: (string|null); + + /** FileOptions rubyPackage */ + rubyPackage?: (string|null); + + /** FileOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** FileOptions .google.api.resourceDefinition */ + ".google.api.resourceDefinition"?: (google.api.IResourceDescriptor[]|null); + } + + /** Represents a FileOptions. */ + class FileOptions implements IFileOptions { + + /** + * Constructs a new FileOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileOptions); + + /** FileOptions javaPackage. */ + public javaPackage: string; + + /** FileOptions javaOuterClassname. */ + public javaOuterClassname: string; + + /** FileOptions javaMultipleFiles. */ + public javaMultipleFiles: boolean; + + /** FileOptions javaGenerateEqualsAndHash. */ + public javaGenerateEqualsAndHash: boolean; + + /** FileOptions javaStringCheckUtf8. */ + public javaStringCheckUtf8: boolean; + + /** FileOptions optimizeFor. */ + public optimizeFor: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode); + + /** FileOptions goPackage. */ + public goPackage: string; + + /** FileOptions ccGenericServices. */ + public ccGenericServices: boolean; + + /** FileOptions javaGenericServices. */ + public javaGenericServices: boolean; + + /** FileOptions pyGenericServices. */ + public pyGenericServices: boolean; + + /** FileOptions phpGenericServices. */ + public phpGenericServices: boolean; + + /** FileOptions deprecated. */ + public deprecated: boolean; + + /** FileOptions ccEnableArenas. */ + public ccEnableArenas: boolean; + + /** FileOptions objcClassPrefix. */ + public objcClassPrefix: string; + + /** FileOptions csharpNamespace. */ + public csharpNamespace: string; + + /** FileOptions swiftPrefix. */ + public swiftPrefix: string; + + /** FileOptions phpClassPrefix. */ + public phpClassPrefix: string; + + /** FileOptions phpNamespace. */ + public phpNamespace: string; + + /** FileOptions phpMetadataNamespace. */ + public phpMetadataNamespace: string; + + /** FileOptions rubyPackage. */ + public rubyPackage: string; + + /** FileOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new FileOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns FileOptions instance + */ + public static create(properties?: google.protobuf.IFileOptions): google.protobuf.FileOptions; + + /** + * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @param message FileOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @param message FileOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileOptions; + + /** + * Decodes a FileOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileOptions; + + /** + * Verifies a FileOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileOptions; + + /** + * Creates a plain object from a FileOptions message. Also converts values to other types if specified. + * @param message FileOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FileOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FileOptions { + + /** OptimizeMode enum. */ + enum OptimizeMode { + SPEED = 1, + CODE_SIZE = 2, + LITE_RUNTIME = 3 + } + } + + /** Properties of a MessageOptions. */ + interface IMessageOptions { + + /** MessageOptions messageSetWireFormat */ + messageSetWireFormat?: (boolean|null); + + /** MessageOptions noStandardDescriptorAccessor */ + noStandardDescriptorAccessor?: (boolean|null); + + /** MessageOptions deprecated */ + deprecated?: (boolean|null); + + /** MessageOptions mapEntry */ + mapEntry?: (boolean|null); + + /** MessageOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** MessageOptions .google.api.resource */ + ".google.api.resource"?: (google.api.IResourceDescriptor|null); + } + + /** Represents a MessageOptions. */ + class MessageOptions implements IMessageOptions { + + /** + * Constructs a new MessageOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMessageOptions); + + /** MessageOptions messageSetWireFormat. */ + public messageSetWireFormat: boolean; + + /** MessageOptions noStandardDescriptorAccessor. */ + public noStandardDescriptorAccessor: boolean; + + /** MessageOptions deprecated. */ + public deprecated: boolean; + + /** MessageOptions mapEntry. */ + public mapEntry: boolean; + + /** MessageOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new MessageOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns MessageOptions instance + */ + public static create(properties?: google.protobuf.IMessageOptions): google.protobuf.MessageOptions; + + /** + * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @param message MessageOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @param message MessageOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MessageOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MessageOptions; + + /** + * Decodes a MessageOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MessageOptions; + + /** + * Verifies a MessageOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MessageOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MessageOptions; + + /** + * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. + * @param message MessageOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MessageOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MessageOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MessageOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FieldOptions. */ + interface IFieldOptions { + + /** FieldOptions ctype */ + ctype?: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType|null); + + /** FieldOptions packed */ + packed?: (boolean|null); + + /** FieldOptions jstype */ + jstype?: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType|null); + + /** FieldOptions lazy */ + lazy?: (boolean|null); + + /** FieldOptions unverifiedLazy */ + unverifiedLazy?: (boolean|null); + + /** FieldOptions deprecated */ + deprecated?: (boolean|null); + + /** FieldOptions weak */ + weak?: (boolean|null); + + /** FieldOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** FieldOptions .google.api.fieldBehavior */ + ".google.api.fieldBehavior"?: (google.api.FieldBehavior[]|null); + + /** FieldOptions .google.api.resourceReference */ + ".google.api.resourceReference"?: (google.api.IResourceReference|null); + } + + /** Represents a FieldOptions. */ + class FieldOptions implements IFieldOptions { + + /** + * Constructs a new FieldOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldOptions); + + /** FieldOptions ctype. */ + public ctype: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType); + + /** FieldOptions packed. */ + public packed: boolean; + + /** FieldOptions jstype. */ + public jstype: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType); + + /** FieldOptions lazy. */ + public lazy: boolean; + + /** FieldOptions unverifiedLazy. */ + public unverifiedLazy: boolean; + + /** FieldOptions deprecated. */ + public deprecated: boolean; + + /** FieldOptions weak. */ + public weak: boolean; + + /** FieldOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new FieldOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldOptions instance + */ + public static create(properties?: google.protobuf.IFieldOptions): google.protobuf.FieldOptions; + + /** + * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @param message FieldOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @param message FieldOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldOptions; + + /** + * Decodes a FieldOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldOptions; + + /** + * Verifies a FieldOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions; + + /** + * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. + * @param message FieldOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FieldOptions { + + /** CType enum. */ + enum CType { + STRING = 0, + CORD = 1, + STRING_PIECE = 2 + } + + /** JSType enum. */ + enum JSType { + JS_NORMAL = 0, + JS_STRING = 1, + JS_NUMBER = 2 + } + } + + /** Properties of an OneofOptions. */ + interface IOneofOptions { + + /** OneofOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an OneofOptions. */ + class OneofOptions implements IOneofOptions { + + /** + * Constructs a new OneofOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IOneofOptions); + + /** OneofOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new OneofOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns OneofOptions instance + */ + public static create(properties?: google.protobuf.IOneofOptions): google.protobuf.OneofOptions; + + /** + * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @param message OneofOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @param message OneofOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OneofOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofOptions; + + /** + * Decodes an OneofOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofOptions; + + /** + * Verifies an OneofOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OneofOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.OneofOptions; + + /** + * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. + * @param message OneofOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.OneofOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OneofOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OneofOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnumOptions. */ + interface IEnumOptions { + + /** EnumOptions allowAlias */ + allowAlias?: (boolean|null); + + /** EnumOptions deprecated */ + deprecated?: (boolean|null); + + /** EnumOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an EnumOptions. */ + class EnumOptions implements IEnumOptions { + + /** + * Constructs a new EnumOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumOptions); + + /** EnumOptions allowAlias. */ + public allowAlias: boolean; + + /** EnumOptions deprecated. */ + public deprecated: boolean; + + /** EnumOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new EnumOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumOptions instance + */ + public static create(properties?: google.protobuf.IEnumOptions): google.protobuf.EnumOptions; + + /** + * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @param message EnumOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @param message EnumOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumOptions; + + /** + * Decodes an EnumOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumOptions; + + /** + * Verifies an EnumOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumOptions; + + /** + * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. + * @param message EnumOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnumValueOptions. */ + interface IEnumValueOptions { + + /** EnumValueOptions deprecated */ + deprecated?: (boolean|null); + + /** EnumValueOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an EnumValueOptions. */ + class EnumValueOptions implements IEnumValueOptions { + + /** + * Constructs a new EnumValueOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumValueOptions); + + /** EnumValueOptions deprecated. */ + public deprecated: boolean; + + /** EnumValueOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new EnumValueOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumValueOptions instance + */ + public static create(properties?: google.protobuf.IEnumValueOptions): google.protobuf.EnumValueOptions; + + /** + * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @param message EnumValueOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @param message EnumValueOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueOptions; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueOptions; + + /** + * Verifies an EnumValueOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumValueOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueOptions; + + /** + * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. + * @param message EnumValueOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumValueOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumValueOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumValueOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceOptions. */ + interface IServiceOptions { + + /** ServiceOptions deprecated */ + deprecated?: (boolean|null); + + /** ServiceOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** ServiceOptions .google.api.defaultHost */ + ".google.api.defaultHost"?: (string|null); + + /** ServiceOptions .google.api.oauthScopes */ + ".google.api.oauthScopes"?: (string|null); + } + + /** Represents a ServiceOptions. */ + class ServiceOptions implements IServiceOptions { + + /** + * Constructs a new ServiceOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceOptions); + + /** ServiceOptions deprecated. */ + public deprecated: boolean; + + /** ServiceOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new ServiceOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceOptions instance + */ + public static create(properties?: google.protobuf.IServiceOptions): google.protobuf.ServiceOptions; + + /** + * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @param message ServiceOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @param message ServiceOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceOptions; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceOptions; + + /** + * Verifies a ServiceOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceOptions; + + /** + * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. + * @param message ServiceOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ServiceOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ServiceOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MethodOptions. */ + interface IMethodOptions { + + /** MethodOptions deprecated */ + deprecated?: (boolean|null); + + /** MethodOptions idempotencyLevel */ + idempotencyLevel?: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel|null); + + /** MethodOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** MethodOptions .google.api.http */ + ".google.api.http"?: (google.api.IHttpRule|null); + + /** MethodOptions .google.api.methodSignature */ + ".google.api.methodSignature"?: (string[]|null); + + /** MethodOptions .google.longrunning.operationInfo */ + ".google.longrunning.operationInfo"?: (google.longrunning.IOperationInfo|null); + } + + /** Represents a MethodOptions. */ + class MethodOptions implements IMethodOptions { + + /** + * Constructs a new MethodOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMethodOptions); + + /** MethodOptions deprecated. */ + public deprecated: boolean; + + /** MethodOptions idempotencyLevel. */ + public idempotencyLevel: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel); + + /** MethodOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new MethodOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodOptions instance + */ + public static create(properties?: google.protobuf.IMethodOptions): google.protobuf.MethodOptions; + + /** + * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @param message MethodOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @param message MethodOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodOptions; + + /** + * Decodes a MethodOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodOptions; + + /** + * Verifies a MethodOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MethodOptions; + + /** + * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. + * @param message MethodOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MethodOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MethodOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace MethodOptions { + + /** IdempotencyLevel enum. */ + enum IdempotencyLevel { + IDEMPOTENCY_UNKNOWN = 0, + NO_SIDE_EFFECTS = 1, + IDEMPOTENT = 2 + } + } + + /** Properties of an UninterpretedOption. */ + interface IUninterpretedOption { + + /** UninterpretedOption name */ + name?: (google.protobuf.UninterpretedOption.INamePart[]|null); + + /** UninterpretedOption identifierValue */ + identifierValue?: (string|null); + + /** UninterpretedOption positiveIntValue */ + positiveIntValue?: (number|Long|string|null); + + /** UninterpretedOption negativeIntValue */ + negativeIntValue?: (number|Long|string|null); + + /** UninterpretedOption doubleValue */ + doubleValue?: (number|null); + + /** UninterpretedOption stringValue */ + stringValue?: (Uint8Array|string|null); + + /** UninterpretedOption aggregateValue */ + aggregateValue?: (string|null); + } + + /** Represents an UninterpretedOption. */ + class UninterpretedOption implements IUninterpretedOption { + + /** + * Constructs a new UninterpretedOption. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IUninterpretedOption); + + /** UninterpretedOption name. */ + public name: google.protobuf.UninterpretedOption.INamePart[]; + + /** UninterpretedOption identifierValue. */ + public identifierValue: string; + + /** UninterpretedOption positiveIntValue. */ + public positiveIntValue: (number|Long|string); + + /** UninterpretedOption negativeIntValue. */ + public negativeIntValue: (number|Long|string); + + /** UninterpretedOption doubleValue. */ + public doubleValue: number; + + /** UninterpretedOption stringValue. */ + public stringValue: (Uint8Array|string); + + /** UninterpretedOption aggregateValue. */ + public aggregateValue: string; + + /** + * Creates a new UninterpretedOption instance using the specified properties. + * @param [properties] Properties to set + * @returns UninterpretedOption instance + */ + public static create(properties?: google.protobuf.IUninterpretedOption): google.protobuf.UninterpretedOption; + + /** + * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @param message UninterpretedOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @param message UninterpretedOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption; + + /** + * Verifies an UninterpretedOption message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UninterpretedOption + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption; + + /** + * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. + * @param message UninterpretedOption + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UninterpretedOption, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UninterpretedOption to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UninterpretedOption + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace UninterpretedOption { + + /** Properties of a NamePart. */ + interface INamePart { + + /** NamePart namePart */ + namePart: string; + + /** NamePart isExtension */ + isExtension: boolean; + } + + /** Represents a NamePart. */ + class NamePart implements INamePart { + + /** + * Constructs a new NamePart. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.UninterpretedOption.INamePart); + + /** NamePart namePart. */ + public namePart: string; + + /** NamePart isExtension. */ + public isExtension: boolean; + + /** + * Creates a new NamePart instance using the specified properties. + * @param [properties] Properties to set + * @returns NamePart instance + */ + public static create(properties?: google.protobuf.UninterpretedOption.INamePart): google.protobuf.UninterpretedOption.NamePart; + + /** + * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @param message NamePart message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @param message NamePart message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NamePart message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption.NamePart; + + /** + * Decodes a NamePart message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption.NamePart; + + /** + * Verifies a NamePart message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NamePart message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NamePart + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption.NamePart; + + /** + * Creates a plain object from a NamePart message. Also converts values to other types if specified. + * @param message NamePart + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UninterpretedOption.NamePart, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NamePart to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NamePart + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a SourceCodeInfo. */ + interface ISourceCodeInfo { + + /** SourceCodeInfo location */ + location?: (google.protobuf.SourceCodeInfo.ILocation[]|null); + } + + /** Represents a SourceCodeInfo. */ + class SourceCodeInfo implements ISourceCodeInfo { + + /** + * Constructs a new SourceCodeInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ISourceCodeInfo); + + /** SourceCodeInfo location. */ + public location: google.protobuf.SourceCodeInfo.ILocation[]; + + /** + * Creates a new SourceCodeInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns SourceCodeInfo instance + */ + public static create(properties?: google.protobuf.ISourceCodeInfo): google.protobuf.SourceCodeInfo; + + /** + * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @param message SourceCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @param message SourceCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo; + + /** + * Verifies a SourceCodeInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SourceCodeInfo + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo; + + /** + * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. + * @param message SourceCodeInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.SourceCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SourceCodeInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SourceCodeInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SourceCodeInfo { + + /** Properties of a Location. */ + interface ILocation { + + /** Location path */ + path?: (number[]|null); + + /** Location span */ + span?: (number[]|null); + + /** Location leadingComments */ + leadingComments?: (string|null); + + /** Location trailingComments */ + trailingComments?: (string|null); + + /** Location leadingDetachedComments */ + leadingDetachedComments?: (string[]|null); + } + + /** Represents a Location. */ + class Location implements ILocation { + + /** + * Constructs a new Location. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.SourceCodeInfo.ILocation); + + /** Location path. */ + public path: number[]; + + /** Location span. */ + public span: number[]; + + /** Location leadingComments. */ + public leadingComments: string; + + /** Location trailingComments. */ + public trailingComments: string; + + /** Location leadingDetachedComments. */ + public leadingDetachedComments: string[]; + + /** + * Creates a new Location instance using the specified properties. + * @param [properties] Properties to set + * @returns Location instance + */ + public static create(properties?: google.protobuf.SourceCodeInfo.ILocation): google.protobuf.SourceCodeInfo.Location; + + /** + * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @param message Location message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @param message Location message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Location message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo.Location; + + /** + * Decodes a Location message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo.Location; + + /** + * Verifies a Location message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Location message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Location + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo.Location; + + /** + * Creates a plain object from a Location message. Also converts values to other types if specified. + * @param message Location + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.SourceCodeInfo.Location, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Location to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Location + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a GeneratedCodeInfo. */ + interface IGeneratedCodeInfo { + + /** GeneratedCodeInfo annotation */ + annotation?: (google.protobuf.GeneratedCodeInfo.IAnnotation[]|null); + } + + /** Represents a GeneratedCodeInfo. */ + class GeneratedCodeInfo implements IGeneratedCodeInfo { + + /** + * Constructs a new GeneratedCodeInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IGeneratedCodeInfo); + + /** GeneratedCodeInfo annotation. */ + public annotation: google.protobuf.GeneratedCodeInfo.IAnnotation[]; + + /** + * Creates a new GeneratedCodeInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns GeneratedCodeInfo instance + */ + public static create(properties?: google.protobuf.IGeneratedCodeInfo): google.protobuf.GeneratedCodeInfo; + + /** + * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @param message GeneratedCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @param message GeneratedCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo; + + /** + * Verifies a GeneratedCodeInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GeneratedCodeInfo + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo; + + /** + * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. + * @param message GeneratedCodeInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.GeneratedCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GeneratedCodeInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GeneratedCodeInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace GeneratedCodeInfo { + + /** Properties of an Annotation. */ + interface IAnnotation { + + /** Annotation path */ + path?: (number[]|null); + + /** Annotation sourceFile */ + sourceFile?: (string|null); + + /** Annotation begin */ + begin?: (number|null); + + /** Annotation end */ + end?: (number|null); + + /** Annotation semantic */ + semantic?: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null); + } + + /** Represents an Annotation. */ + class Annotation implements IAnnotation { + + /** + * Constructs a new Annotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation); + + /** Annotation path. */ + public path: number[]; + + /** Annotation sourceFile. */ + public sourceFile: string; + + /** Annotation begin. */ + public begin: number; + + /** Annotation end. */ + public end: number; + + /** Annotation semantic. */ + public semantic: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic); + + /** + * Creates a new Annotation instance using the specified properties. + * @param [properties] Properties to set + * @returns Annotation instance + */ + public static create(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @param message Annotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @param message Annotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Annotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Decodes an Annotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Verifies an Annotation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Annotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Annotation + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Creates a plain object from an Annotation message. Also converts values to other types if specified. + * @param message Annotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.GeneratedCodeInfo.Annotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Annotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Annotation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Annotation { + + /** Semantic enum. */ + enum Semantic { + NONE = 0, + SET = 1, + ALIAS = 2 + } + } + } + + /** Properties of an Any. */ + interface IAny { + + /** Any type_url */ + type_url?: (string|null); + + /** Any value */ + value?: (Uint8Array|string|null); + } + + /** Represents an Any. */ + class Any implements IAny { + + /** + * Constructs a new Any. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IAny); + + /** Any type_url. */ + public type_url: string; + + /** Any value. */ + public value: (Uint8Array|string); + + /** + * Creates a new Any instance using the specified properties. + * @param [properties] Properties to set + * @returns Any instance + */ + public static create(properties?: google.protobuf.IAny): google.protobuf.Any; + + /** + * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @param message Any message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @param message Any message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Any message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Any; + + /** + * Decodes an Any message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Any; + + /** + * Verifies an Any message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Any message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Any + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Any; + + /** + * Creates a plain object from an Any message. Also converts values to other types if specified. + * @param message Any + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Any, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Any to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Any + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Duration. */ + interface IDuration { + + /** Duration seconds */ + seconds?: (number|Long|string|null); + + /** Duration nanos */ + nanos?: (number|null); + } + + /** Represents a Duration. */ + class Duration implements IDuration { + + /** + * Constructs a new Duration. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IDuration); + + /** Duration seconds. */ + public seconds: (number|Long|string); + + /** Duration nanos. */ + public nanos: number; + + /** + * Creates a new Duration instance using the specified properties. + * @param [properties] Properties to set + * @returns Duration instance + */ + public static create(properties?: google.protobuf.IDuration): google.protobuf.Duration; + + /** + * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @param message Duration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @param message Duration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Duration; + + /** + * Decodes a Duration message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Duration; + + /** + * Verifies a Duration message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Duration message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Duration + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Duration; + + /** + * Creates a plain object from a Duration message. Also converts values to other types if specified. + * @param message Duration + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Duration, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Duration to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Duration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Empty. */ + interface IEmpty { + } + + /** Represents an Empty. */ + class Empty implements IEmpty { + + /** + * Constructs a new Empty. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEmpty); + + /** + * Creates a new Empty instance using the specified properties. + * @param [properties] Properties to set + * @returns Empty instance + */ + public static create(properties?: google.protobuf.IEmpty): google.protobuf.Empty; + + /** + * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @param message Empty message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @param message Empty message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Empty message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Empty; + + /** + * Decodes an Empty message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Empty; + + /** + * Verifies an Empty message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Empty message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Empty + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Empty; + + /** + * Creates a plain object from an Empty message. Also converts values to other types if specified. + * @param message Empty + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Empty, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Empty to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Empty + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FieldMask. */ + interface IFieldMask { + + /** FieldMask paths */ + paths?: (string[]|null); + } + + /** Represents a FieldMask. */ + class FieldMask implements IFieldMask { + + /** + * Constructs a new FieldMask. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldMask); + + /** FieldMask paths. */ + public paths: string[]; + + /** + * Creates a new FieldMask instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldMask instance + */ + public static create(properties?: google.protobuf.IFieldMask): google.protobuf.FieldMask; + + /** + * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @param message FieldMask message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldMask, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @param message FieldMask message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldMask, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldMask message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldMask; + + /** + * Decodes a FieldMask message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldMask; + + /** + * Verifies a FieldMask message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldMask message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldMask + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldMask; + + /** + * Creates a plain object from a FieldMask message. Also converts values to other types if specified. + * @param message FieldMask + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldMask, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldMask to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldMask + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Timestamp. */ + interface ITimestamp { + + /** Timestamp seconds */ + seconds?: (number|Long|string|null); + + /** Timestamp nanos */ + nanos?: (number|null); + } + + /** Represents a Timestamp. */ + class Timestamp implements ITimestamp { + + /** + * Constructs a new Timestamp. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ITimestamp); + + /** Timestamp seconds. */ + public seconds: (number|Long|string); + + /** Timestamp nanos. */ + public nanos: number; + + /** + * Creates a new Timestamp instance using the specified properties. + * @param [properties] Properties to set + * @returns Timestamp instance + */ + public static create(properties?: google.protobuf.ITimestamp): google.protobuf.Timestamp; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @param message Timestamp message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @param message Timestamp message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Timestamp; + + /** + * Decodes a Timestamp message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Timestamp; + + /** + * Verifies a Timestamp message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Timestamp + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Timestamp; + + /** + * Creates a plain object from a Timestamp message. Also converts values to other types if specified. + * @param message Timestamp + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Timestamp, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Timestamp to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Timestamp + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace longrunning. */ + namespace longrunning { + + /** Represents an Operations */ + class Operations extends $protobuf.rpc.Service { + + /** + * Constructs a new Operations service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new Operations service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): Operations; + + /** + * Calls ListOperations. + * @param request ListOperationsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListOperationsResponse + */ + public listOperations(request: google.longrunning.IListOperationsRequest, callback: google.longrunning.Operations.ListOperationsCallback): void; + + /** + * Calls ListOperations. + * @param request ListOperationsRequest message or plain object + * @returns Promise + */ + public listOperations(request: google.longrunning.IListOperationsRequest): Promise; + + /** + * Calls GetOperation. + * @param request GetOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public getOperation(request: google.longrunning.IGetOperationRequest, callback: google.longrunning.Operations.GetOperationCallback): void; + + /** + * Calls GetOperation. + * @param request GetOperationRequest message or plain object + * @returns Promise + */ + public getOperation(request: google.longrunning.IGetOperationRequest): Promise; + + /** + * Calls DeleteOperation. + * @param request DeleteOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteOperation(request: google.longrunning.IDeleteOperationRequest, callback: google.longrunning.Operations.DeleteOperationCallback): void; + + /** + * Calls DeleteOperation. + * @param request DeleteOperationRequest message or plain object + * @returns Promise + */ + public deleteOperation(request: google.longrunning.IDeleteOperationRequest): Promise; + + /** + * Calls CancelOperation. + * @param request CancelOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public cancelOperation(request: google.longrunning.ICancelOperationRequest, callback: google.longrunning.Operations.CancelOperationCallback): void; + + /** + * Calls CancelOperation. + * @param request CancelOperationRequest message or plain object + * @returns Promise + */ + public cancelOperation(request: google.longrunning.ICancelOperationRequest): Promise; + + /** + * Calls WaitOperation. + * @param request WaitOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public waitOperation(request: google.longrunning.IWaitOperationRequest, callback: google.longrunning.Operations.WaitOperationCallback): void; + + /** + * Calls WaitOperation. + * @param request WaitOperationRequest message or plain object + * @returns Promise + */ + public waitOperation(request: google.longrunning.IWaitOperationRequest): Promise; + } + + namespace Operations { + + /** + * Callback as used by {@link google.longrunning.Operations|listOperations}. + * @param error Error, if any + * @param [response] ListOperationsResponse + */ + type ListOperationsCallback = (error: (Error|null), response?: google.longrunning.ListOperationsResponse) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|getOperation}. + * @param error Error, if any + * @param [response] Operation + */ + type GetOperationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|deleteOperation}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteOperationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|cancelOperation}. + * @param error Error, if any + * @param [response] Empty + */ + type CancelOperationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|waitOperation}. + * @param error Error, if any + * @param [response] Operation + */ + type WaitOperationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + } + + /** Properties of an Operation. */ + interface IOperation { + + /** Operation name */ + name?: (string|null); + + /** Operation metadata */ + metadata?: (google.protobuf.IAny|null); + + /** Operation done */ + done?: (boolean|null); + + /** Operation error */ + error?: (google.rpc.IStatus|null); + + /** Operation response */ + response?: (google.protobuf.IAny|null); + } + + /** Represents an Operation. */ + class Operation implements IOperation { + + /** + * Constructs a new Operation. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IOperation); + + /** Operation name. */ + public name: string; + + /** Operation metadata. */ + public metadata?: (google.protobuf.IAny|null); + + /** Operation done. */ + public done: boolean; + + /** Operation error. */ + public error?: (google.rpc.IStatus|null); + + /** Operation response. */ + public response?: (google.protobuf.IAny|null); + + /** Operation result. */ + public result?: ("error"|"response"); + + /** + * Creates a new Operation instance using the specified properties. + * @param [properties] Properties to set + * @returns Operation instance + */ + public static create(properties?: google.longrunning.IOperation): google.longrunning.Operation; + + /** + * Encodes the specified Operation message. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @param message Operation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IOperation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Operation message, length delimited. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @param message Operation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IOperation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Operation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.Operation; + + /** + * Decodes an Operation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.Operation; + + /** + * Verifies an Operation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Operation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Operation + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.Operation; + + /** + * Creates a plain object from an Operation message. Also converts values to other types if specified. + * @param message Operation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.Operation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Operation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Operation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetOperationRequest. */ + interface IGetOperationRequest { + + /** GetOperationRequest name */ + name?: (string|null); + } + + /** Represents a GetOperationRequest. */ + class GetOperationRequest implements IGetOperationRequest { + + /** + * Constructs a new GetOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IGetOperationRequest); + + /** GetOperationRequest name. */ + public name: string; + + /** + * Creates a new GetOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetOperationRequest instance + */ + public static create(properties?: google.longrunning.IGetOperationRequest): google.longrunning.GetOperationRequest; + + /** + * Encodes the specified GetOperationRequest message. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @param message GetOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IGetOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @param message GetOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IGetOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.GetOperationRequest; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.GetOperationRequest; + + /** + * Verifies a GetOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.GetOperationRequest; + + /** + * Creates a plain object from a GetOperationRequest message. Also converts values to other types if specified. + * @param message GetOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.GetOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListOperationsRequest. */ + interface IListOperationsRequest { + + /** ListOperationsRequest name */ + name?: (string|null); + + /** ListOperationsRequest filter */ + filter?: (string|null); + + /** ListOperationsRequest pageSize */ + pageSize?: (number|null); + + /** ListOperationsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListOperationsRequest. */ + class ListOperationsRequest implements IListOperationsRequest { + + /** + * Constructs a new ListOperationsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IListOperationsRequest); + + /** ListOperationsRequest name. */ + public name: string; + + /** ListOperationsRequest filter. */ + public filter: string; + + /** ListOperationsRequest pageSize. */ + public pageSize: number; + + /** ListOperationsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListOperationsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListOperationsRequest instance + */ + public static create(properties?: google.longrunning.IListOperationsRequest): google.longrunning.ListOperationsRequest; + + /** + * Encodes the specified ListOperationsRequest message. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @param message ListOperationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IListOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListOperationsRequest message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @param message ListOperationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IListOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.ListOperationsRequest; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.ListOperationsRequest; + + /** + * Verifies a ListOperationsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListOperationsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListOperationsRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.ListOperationsRequest; + + /** + * Creates a plain object from a ListOperationsRequest message. Also converts values to other types if specified. + * @param message ListOperationsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.ListOperationsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListOperationsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListOperationsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListOperationsResponse. */ + interface IListOperationsResponse { + + /** ListOperationsResponse operations */ + operations?: (google.longrunning.IOperation[]|null); + + /** ListOperationsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListOperationsResponse. */ + class ListOperationsResponse implements IListOperationsResponse { + + /** + * Constructs a new ListOperationsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IListOperationsResponse); + + /** ListOperationsResponse operations. */ + public operations: google.longrunning.IOperation[]; + + /** ListOperationsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListOperationsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListOperationsResponse instance + */ + public static create(properties?: google.longrunning.IListOperationsResponse): google.longrunning.ListOperationsResponse; + + /** + * Encodes the specified ListOperationsResponse message. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @param message ListOperationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IListOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListOperationsResponse message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @param message ListOperationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IListOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.ListOperationsResponse; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.ListOperationsResponse; + + /** + * Verifies a ListOperationsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListOperationsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListOperationsResponse + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.ListOperationsResponse; + + /** + * Creates a plain object from a ListOperationsResponse message. Also converts values to other types if specified. + * @param message ListOperationsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.ListOperationsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListOperationsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListOperationsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CancelOperationRequest. */ + interface ICancelOperationRequest { + + /** CancelOperationRequest name */ + name?: (string|null); + } + + /** Represents a CancelOperationRequest. */ + class CancelOperationRequest implements ICancelOperationRequest { + + /** + * Constructs a new CancelOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.ICancelOperationRequest); + + /** CancelOperationRequest name. */ + public name: string; + + /** + * Creates a new CancelOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CancelOperationRequest instance + */ + public static create(properties?: google.longrunning.ICancelOperationRequest): google.longrunning.CancelOperationRequest; + + /** + * Encodes the specified CancelOperationRequest message. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @param message CancelOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.ICancelOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CancelOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @param message CancelOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.ICancelOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.CancelOperationRequest; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.CancelOperationRequest; + + /** + * Verifies a CancelOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CancelOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CancelOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.CancelOperationRequest; + + /** + * Creates a plain object from a CancelOperationRequest message. Also converts values to other types if specified. + * @param message CancelOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.CancelOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CancelOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CancelOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteOperationRequest. */ + interface IDeleteOperationRequest { + + /** DeleteOperationRequest name */ + name?: (string|null); + } + + /** Represents a DeleteOperationRequest. */ + class DeleteOperationRequest implements IDeleteOperationRequest { + + /** + * Constructs a new DeleteOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IDeleteOperationRequest); + + /** DeleteOperationRequest name. */ + public name: string; + + /** + * Creates a new DeleteOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteOperationRequest instance + */ + public static create(properties?: google.longrunning.IDeleteOperationRequest): google.longrunning.DeleteOperationRequest; + + /** + * Encodes the specified DeleteOperationRequest message. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @param message DeleteOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IDeleteOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @param message DeleteOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IDeleteOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.DeleteOperationRequest; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.DeleteOperationRequest; + + /** + * Verifies a DeleteOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.DeleteOperationRequest; + + /** + * Creates a plain object from a DeleteOperationRequest message. Also converts values to other types if specified. + * @param message DeleteOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.DeleteOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a WaitOperationRequest. */ + interface IWaitOperationRequest { + + /** WaitOperationRequest name */ + name?: (string|null); + + /** WaitOperationRequest timeout */ + timeout?: (google.protobuf.IDuration|null); + } + + /** Represents a WaitOperationRequest. */ + class WaitOperationRequest implements IWaitOperationRequest { + + /** + * Constructs a new WaitOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IWaitOperationRequest); + + /** WaitOperationRequest name. */ + public name: string; + + /** WaitOperationRequest timeout. */ + public timeout?: (google.protobuf.IDuration|null); + + /** + * Creates a new WaitOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns WaitOperationRequest instance + */ + public static create(properties?: google.longrunning.IWaitOperationRequest): google.longrunning.WaitOperationRequest; + + /** + * Encodes the specified WaitOperationRequest message. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @param message WaitOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IWaitOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WaitOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @param message WaitOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IWaitOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.WaitOperationRequest; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.WaitOperationRequest; + + /** + * Verifies a WaitOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WaitOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WaitOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.WaitOperationRequest; + + /** + * Creates a plain object from a WaitOperationRequest message. Also converts values to other types if specified. + * @param message WaitOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.WaitOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WaitOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WaitOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OperationInfo. */ + interface IOperationInfo { + + /** OperationInfo responseType */ + responseType?: (string|null); + + /** OperationInfo metadataType */ + metadataType?: (string|null); + } + + /** Represents an OperationInfo. */ + class OperationInfo implements IOperationInfo { + + /** + * Constructs a new OperationInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IOperationInfo); + + /** OperationInfo responseType. */ + public responseType: string; + + /** OperationInfo metadataType. */ + public metadataType: string; + + /** + * Creates a new OperationInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns OperationInfo instance + */ + public static create(properties?: google.longrunning.IOperationInfo): google.longrunning.OperationInfo; + + /** + * Encodes the specified OperationInfo message. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @param message OperationInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IOperationInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OperationInfo message, length delimited. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @param message OperationInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IOperationInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OperationInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.OperationInfo; + + /** + * Decodes an OperationInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.OperationInfo; + + /** + * Verifies an OperationInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OperationInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OperationInfo + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.OperationInfo; + + /** + * Creates a plain object from an OperationInfo message. Also converts values to other types if specified. + * @param message OperationInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.OperationInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OperationInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OperationInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace rpc. */ + namespace rpc { + + /** Properties of a Status. */ + interface IStatus { + + /** Status code */ + code?: (number|null); + + /** Status message */ + message?: (string|null); + + /** Status details */ + details?: (google.protobuf.IAny[]|null); + } + + /** Represents a Status. */ + class Status implements IStatus { + + /** + * Constructs a new Status. + * @param [properties] Properties to set + */ + constructor(properties?: google.rpc.IStatus); + + /** Status code. */ + public code: number; + + /** Status message. */ + public message: string; + + /** Status details. */ + public details: google.protobuf.IAny[]; + + /** + * Creates a new Status instance using the specified properties. + * @param [properties] Properties to set + * @returns Status instance + */ + public static create(properties?: google.rpc.IStatus): google.rpc.Status; + + /** + * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @param message Status message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @param message Status message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Status message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.rpc.Status; + + /** + * Decodes a Status message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.rpc.Status; + + /** + * Verifies a Status message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Status message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Status + */ + public static fromObject(object: { [k: string]: any }): google.rpc.Status; + + /** + * Creates a plain object from a Status message. Also converts values to other types if specified. + * @param message Status + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.rpc.Status, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Status to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Status + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RetryInfo. */ + interface IRetryInfo { + + /** RetryInfo retryDelay */ + retryDelay?: (google.protobuf.IDuration|null); + } + + /** Represents a RetryInfo. */ + class RetryInfo implements IRetryInfo { + + /** + * Constructs a new RetryInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.rpc.IRetryInfo); + + /** RetryInfo retryDelay. */ + public retryDelay?: (google.protobuf.IDuration|null); + + /** + * Creates a new RetryInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns RetryInfo instance + */ + public static create(properties?: google.rpc.IRetryInfo): google.rpc.RetryInfo; + + /** + * Encodes the specified RetryInfo message. Does not implicitly {@link google.rpc.RetryInfo.verify|verify} messages. + * @param message RetryInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.rpc.IRetryInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RetryInfo message, length delimited. Does not implicitly {@link google.rpc.RetryInfo.verify|verify} messages. + * @param message RetryInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.rpc.IRetryInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RetryInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RetryInfo + * @throws {Error} If the payload is not 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.RetryInfo; + + /** + * Decodes a RetryInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RetryInfo + * @throws {Error} If the payload 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.RetryInfo; + + /** + * Verifies a RetryInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RetryInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RetryInfo + */ + public static fromObject(object: { [k: string]: any }): google.rpc.RetryInfo; + + /** + * Creates a plain object from a RetryInfo message. Also converts values to other types if specified. + * @param message RetryInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.rpc.RetryInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RetryInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RetryInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DebugInfo. */ + interface IDebugInfo { + + /** DebugInfo stackEntries */ + stackEntries?: (string[]|null); + + /** DebugInfo detail */ + detail?: (string|null); + } + + /** Represents a DebugInfo. */ + class DebugInfo implements IDebugInfo { + + /** + * Constructs a new DebugInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.rpc.IDebugInfo); + + /** DebugInfo stackEntries. */ + public stackEntries: string[]; + + /** DebugInfo detail. */ + public detail: string; + + /** + * Creates a new DebugInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns DebugInfo instance + */ + public static create(properties?: google.rpc.IDebugInfo): google.rpc.DebugInfo; + + /** + * Encodes the specified DebugInfo message. Does not implicitly {@link google.rpc.DebugInfo.verify|verify} messages. + * @param message DebugInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.rpc.IDebugInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DebugInfo message, length delimited. Does not implicitly {@link google.rpc.DebugInfo.verify|verify} messages. + * @param message DebugInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.rpc.IDebugInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DebugInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DebugInfo + * @throws {Error} If the payload is not 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.DebugInfo; + + /** + * Decodes a DebugInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DebugInfo + * @throws {Error} If the payload 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.DebugInfo; + + /** + * Verifies a DebugInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DebugInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DebugInfo + */ + public static fromObject(object: { [k: string]: any }): google.rpc.DebugInfo; + + /** + * Creates a plain object from a DebugInfo message. Also converts values to other types if specified. + * @param message DebugInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.rpc.DebugInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DebugInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DebugInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a QuotaFailure. */ + interface IQuotaFailure { + + /** QuotaFailure violations */ + violations?: (google.rpc.QuotaFailure.IViolation[]|null); + } + + /** Represents a QuotaFailure. */ + class QuotaFailure implements IQuotaFailure { + + /** + * Constructs a new QuotaFailure. + * @param [properties] Properties to set + */ + constructor(properties?: google.rpc.IQuotaFailure); + + /** QuotaFailure violations. */ + public violations: google.rpc.QuotaFailure.IViolation[]; + + /** + * Creates a new QuotaFailure instance using the specified properties. + * @param [properties] Properties to set + * @returns QuotaFailure instance + */ + public static create(properties?: google.rpc.IQuotaFailure): google.rpc.QuotaFailure; + + /** + * Encodes the specified QuotaFailure message. Does not implicitly {@link google.rpc.QuotaFailure.verify|verify} messages. + * @param message QuotaFailure message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.rpc.IQuotaFailure, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified QuotaFailure message, length delimited. Does not implicitly {@link google.rpc.QuotaFailure.verify|verify} messages. + * @param message QuotaFailure message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.rpc.IQuotaFailure, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a QuotaFailure message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns QuotaFailure + * @throws {Error} If the payload is not 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.QuotaFailure; + + /** + * Decodes a QuotaFailure message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns QuotaFailure + * @throws {Error} If the payload 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.QuotaFailure; + + /** + * Verifies a QuotaFailure message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a QuotaFailure message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns QuotaFailure + */ + public static fromObject(object: { [k: string]: any }): google.rpc.QuotaFailure; + + /** + * Creates a plain object from a QuotaFailure message. Also converts values to other types if specified. + * @param message QuotaFailure + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.rpc.QuotaFailure, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this QuotaFailure to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for QuotaFailure + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace QuotaFailure { + + /** Properties of a Violation. */ + interface IViolation { + + /** Violation subject */ + subject?: (string|null); + + /** Violation description */ + description?: (string|null); + } + + /** Represents a Violation. */ + class Violation implements IViolation { + + /** + * Constructs a new Violation. + * @param [properties] Properties to set + */ + constructor(properties?: google.rpc.QuotaFailure.IViolation); + + /** Violation subject. */ + public subject: string; + + /** Violation description. */ + public description: string; + + /** + * Creates a new Violation instance using the specified properties. + * @param [properties] Properties to set + * @returns Violation instance + */ + public static create(properties?: google.rpc.QuotaFailure.IViolation): google.rpc.QuotaFailure.Violation; + + /** + * Encodes the specified Violation message. Does not implicitly {@link google.rpc.QuotaFailure.Violation.verify|verify} messages. + * @param message Violation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.rpc.QuotaFailure.IViolation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Violation message, length delimited. Does not implicitly {@link google.rpc.QuotaFailure.Violation.verify|verify} messages. + * @param message Violation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.rpc.QuotaFailure.IViolation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Violation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Violation + * @throws {Error} If the payload is not 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.QuotaFailure.Violation; + + /** + * Decodes a Violation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Violation + * @throws {Error} If the payload 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.QuotaFailure.Violation; + + /** + * Verifies a Violation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Violation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Violation + */ + public static fromObject(object: { [k: string]: any }): google.rpc.QuotaFailure.Violation; + + /** + * Creates a plain object from a Violation message. Also converts values to other types if specified. + * @param message Violation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.rpc.QuotaFailure.Violation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Violation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Violation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an ErrorInfo. */ + interface IErrorInfo { + + /** ErrorInfo reason */ + reason?: (string|null); + + /** ErrorInfo domain */ + domain?: (string|null); + + /** ErrorInfo metadata */ + metadata?: ({ [k: string]: string }|null); + } + + /** Represents an ErrorInfo. */ + class ErrorInfo implements IErrorInfo { + + /** + * Constructs a new ErrorInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.rpc.IErrorInfo); + + /** ErrorInfo reason. */ + public reason: string; + + /** ErrorInfo domain. */ + public domain: string; + + /** ErrorInfo metadata. */ + public metadata: { [k: string]: string }; + + /** + * Creates a new ErrorInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns ErrorInfo instance + */ + public static create(properties?: google.rpc.IErrorInfo): google.rpc.ErrorInfo; + + /** + * Encodes the specified ErrorInfo message. Does not implicitly {@link google.rpc.ErrorInfo.verify|verify} messages. + * @param message ErrorInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.rpc.IErrorInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ErrorInfo message, length delimited. Does not implicitly {@link google.rpc.ErrorInfo.verify|verify} messages. + * @param message ErrorInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.rpc.IErrorInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ErrorInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ErrorInfo + * @throws {Error} If the payload is not 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.ErrorInfo; + + /** + * Decodes an ErrorInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ErrorInfo + * @throws {Error} If the payload 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.ErrorInfo; + + /** + * Verifies an ErrorInfo message. + * @param message Plain 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 ErrorInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ErrorInfo + */ + public static fromObject(object: { [k: string]: any }): google.rpc.ErrorInfo; + + /** + * Creates a plain object from an ErrorInfo message. Also converts values to other types if specified. + * @param message ErrorInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.rpc.ErrorInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ErrorInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ErrorInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PreconditionFailure. */ + interface IPreconditionFailure { + + /** PreconditionFailure violations */ + violations?: (google.rpc.PreconditionFailure.IViolation[]|null); + } + + /** Represents a PreconditionFailure. */ + class PreconditionFailure implements IPreconditionFailure { + + /** + * Constructs a new PreconditionFailure. + * @param [properties] Properties to set + */ + constructor(properties?: google.rpc.IPreconditionFailure); + + /** PreconditionFailure violations. */ + public violations: google.rpc.PreconditionFailure.IViolation[]; + + /** + * Creates a new PreconditionFailure instance using the specified properties. + * @param [properties] Properties to set + * @returns PreconditionFailure instance + */ + public static create(properties?: google.rpc.IPreconditionFailure): google.rpc.PreconditionFailure; + + /** + * Encodes the specified PreconditionFailure message. Does not implicitly {@link google.rpc.PreconditionFailure.verify|verify} messages. + * @param message PreconditionFailure message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.rpc.IPreconditionFailure, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PreconditionFailure message, length delimited. Does not implicitly {@link google.rpc.PreconditionFailure.verify|verify} messages. + * @param message PreconditionFailure message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.rpc.IPreconditionFailure, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PreconditionFailure message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PreconditionFailure + * @throws {Error} If the payload is not 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.PreconditionFailure; + + /** + * Decodes a PreconditionFailure message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PreconditionFailure + * @throws {Error} If the payload 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.PreconditionFailure; + + /** + * Verifies a PreconditionFailure message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PreconditionFailure message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PreconditionFailure + */ + public static fromObject(object: { [k: string]: any }): google.rpc.PreconditionFailure; + + /** + * Creates a plain object from a PreconditionFailure message. Also converts values to other types if specified. + * @param message PreconditionFailure + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.rpc.PreconditionFailure, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PreconditionFailure to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PreconditionFailure + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace PreconditionFailure { + + /** Properties of a Violation. */ + interface IViolation { + + /** Violation type */ + type?: (string|null); + + /** Violation subject */ + subject?: (string|null); + + /** Violation description */ + description?: (string|null); + } + + /** Represents a Violation. */ + class Violation implements IViolation { + + /** + * Constructs a new Violation. + * @param [properties] Properties to set + */ + constructor(properties?: google.rpc.PreconditionFailure.IViolation); + + /** Violation type. */ + public type: string; + + /** Violation subject. */ + public subject: string; + + /** Violation description. */ + public description: string; + + /** + * Creates a new Violation instance using the specified properties. + * @param [properties] Properties to set + * @returns Violation instance + */ + public static create(properties?: google.rpc.PreconditionFailure.IViolation): google.rpc.PreconditionFailure.Violation; + + /** + * Encodes the specified Violation message. Does not implicitly {@link google.rpc.PreconditionFailure.Violation.verify|verify} messages. + * @param message Violation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.rpc.PreconditionFailure.IViolation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Violation message, length delimited. Does not implicitly {@link google.rpc.PreconditionFailure.Violation.verify|verify} messages. + * @param message Violation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.rpc.PreconditionFailure.IViolation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Violation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Violation + * @throws {Error} If the payload is not 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.PreconditionFailure.Violation; + + /** + * Decodes a Violation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Violation + * @throws {Error} If the payload 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.PreconditionFailure.Violation; + + /** + * Verifies a Violation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Violation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Violation + */ + public static fromObject(object: { [k: string]: any }): google.rpc.PreconditionFailure.Violation; + + /** + * Creates a plain object from a Violation message. Also converts values to other types if specified. + * @param message Violation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.rpc.PreconditionFailure.Violation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Violation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Violation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a BadRequest. */ + interface IBadRequest { + + /** BadRequest fieldViolations */ + fieldViolations?: (google.rpc.BadRequest.IFieldViolation[]|null); + } + + /** Represents a BadRequest. */ + class BadRequest implements IBadRequest { + + /** + * Constructs a new BadRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.rpc.IBadRequest); + + /** BadRequest fieldViolations. */ + public fieldViolations: google.rpc.BadRequest.IFieldViolation[]; + + /** + * Creates a new BadRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns BadRequest instance + */ + public static create(properties?: google.rpc.IBadRequest): google.rpc.BadRequest; + + /** + * Encodes the specified BadRequest message. Does not implicitly {@link google.rpc.BadRequest.verify|verify} messages. + * @param message BadRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.rpc.IBadRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BadRequest message, length delimited. Does not implicitly {@link google.rpc.BadRequest.verify|verify} messages. + * @param message BadRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.rpc.IBadRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BadRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BadRequest + * @throws {Error} If the payload is not 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.BadRequest; + + /** + * Decodes a BadRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BadRequest + * @throws {Error} If the payload 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.BadRequest; + + /** + * Verifies a BadRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BadRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BadRequest + */ + public static fromObject(object: { [k: string]: any }): google.rpc.BadRequest; + + /** + * Creates a plain object from a BadRequest message. Also converts values to other types if specified. + * @param message BadRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.rpc.BadRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BadRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BadRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace BadRequest { + + /** Properties of a FieldViolation. */ + interface IFieldViolation { + + /** FieldViolation field */ + field?: (string|null); + + /** FieldViolation description */ + description?: (string|null); + } + + /** Represents a FieldViolation. */ + class FieldViolation implements IFieldViolation { + + /** + * Constructs a new FieldViolation. + * @param [properties] Properties to set + */ + constructor(properties?: google.rpc.BadRequest.IFieldViolation); + + /** FieldViolation field. */ + public field: string; + + /** FieldViolation description. */ + public description: string; + + /** + * Creates a new FieldViolation instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldViolation instance + */ + public static create(properties?: google.rpc.BadRequest.IFieldViolation): google.rpc.BadRequest.FieldViolation; + + /** + * Encodes the specified FieldViolation message. Does not implicitly {@link google.rpc.BadRequest.FieldViolation.verify|verify} messages. + * @param message FieldViolation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.rpc.BadRequest.IFieldViolation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldViolation message, length delimited. Does not implicitly {@link google.rpc.BadRequest.FieldViolation.verify|verify} messages. + * @param message FieldViolation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.rpc.BadRequest.IFieldViolation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldViolation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldViolation + * @throws {Error} If the payload is not 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.BadRequest.FieldViolation; + + /** + * Decodes a FieldViolation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldViolation + * @throws {Error} If the payload 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.BadRequest.FieldViolation; + + /** + * Verifies a FieldViolation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldViolation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldViolation + */ + public static fromObject(object: { [k: string]: any }): google.rpc.BadRequest.FieldViolation; + + /** + * Creates a plain object from a FieldViolation message. Also converts values to other types if specified. + * @param message FieldViolation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.rpc.BadRequest.FieldViolation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldViolation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldViolation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a RequestInfo. */ + interface IRequestInfo { + + /** RequestInfo requestId */ + requestId?: (string|null); + + /** RequestInfo servingData */ + servingData?: (string|null); + } + + /** Represents a RequestInfo. */ + class RequestInfo implements IRequestInfo { + + /** + * Constructs a new RequestInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.rpc.IRequestInfo); + + /** RequestInfo requestId. */ + public requestId: string; + + /** RequestInfo servingData. */ + public servingData: string; + + /** + * Creates a new RequestInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns RequestInfo instance + */ + public static create(properties?: google.rpc.IRequestInfo): google.rpc.RequestInfo; + + /** + * Encodes the specified RequestInfo message. Does not implicitly {@link google.rpc.RequestInfo.verify|verify} messages. + * @param message RequestInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.rpc.IRequestInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RequestInfo message, length delimited. Does not implicitly {@link google.rpc.RequestInfo.verify|verify} messages. + * @param message RequestInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.rpc.IRequestInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RequestInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RequestInfo + * @throws {Error} If the payload is not 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.RequestInfo; + + /** + * Decodes a RequestInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RequestInfo + * @throws {Error} If the payload 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.RequestInfo; + + /** + * Verifies a RequestInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RequestInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RequestInfo + */ + public static fromObject(object: { [k: string]: any }): google.rpc.RequestInfo; + + /** + * Creates a plain object from a RequestInfo message. Also converts values to other types if specified. + * @param message RequestInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.rpc.RequestInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RequestInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RequestInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ResourceInfo. */ + interface IResourceInfo { + + /** ResourceInfo resourceType */ + resourceType?: (string|null); + + /** ResourceInfo resourceName */ + resourceName?: (string|null); + + /** ResourceInfo owner */ + owner?: (string|null); + + /** ResourceInfo description */ + description?: (string|null); + } + + /** Represents a ResourceInfo. */ + class ResourceInfo implements IResourceInfo { + + /** + * Constructs a new ResourceInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.rpc.IResourceInfo); + + /** ResourceInfo resourceType. */ + public resourceType: string; + + /** ResourceInfo resourceName. */ + public resourceName: string; + + /** ResourceInfo owner. */ + public owner: string; + + /** ResourceInfo description. */ + public description: string; + + /** + * Creates a new ResourceInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourceInfo instance + */ + public static create(properties?: google.rpc.IResourceInfo): google.rpc.ResourceInfo; + + /** + * Encodes the specified ResourceInfo message. Does not implicitly {@link google.rpc.ResourceInfo.verify|verify} messages. + * @param message ResourceInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.rpc.IResourceInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourceInfo message, length delimited. Does not implicitly {@link google.rpc.ResourceInfo.verify|verify} messages. + * @param message ResourceInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.rpc.IResourceInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourceInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourceInfo + * @throws {Error} If the payload is not 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.ResourceInfo; + + /** + * Decodes a ResourceInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourceInfo + * @throws {Error} If the payload 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.ResourceInfo; + + /** + * Verifies a ResourceInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResourceInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourceInfo + */ + public static fromObject(object: { [k: string]: any }): google.rpc.ResourceInfo; + + /** + * Creates a plain object from a ResourceInfo message. Also converts values to other types if specified. + * @param message ResourceInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.rpc.ResourceInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourceInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResourceInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Help. */ + interface IHelp { + + /** Help links */ + links?: (google.rpc.Help.ILink[]|null); + } + + /** Represents a Help. */ + class Help implements IHelp { + + /** + * Constructs a new Help. + * @param [properties] Properties to set + */ + constructor(properties?: google.rpc.IHelp); + + /** Help links. */ + public links: google.rpc.Help.ILink[]; + + /** + * Creates a new Help instance using the specified properties. + * @param [properties] Properties to set + * @returns Help instance + */ + public static create(properties?: google.rpc.IHelp): google.rpc.Help; + + /** + * Encodes the specified Help message. Does not implicitly {@link google.rpc.Help.verify|verify} messages. + * @param message Help message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.rpc.IHelp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Help message, length delimited. Does not implicitly {@link google.rpc.Help.verify|verify} messages. + * @param message Help message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.rpc.IHelp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Help message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Help + * @throws {Error} If the payload is not 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.Help; + + /** + * Decodes a Help message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Help + * @throws {Error} If the payload 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.Help; + + /** + * Verifies a Help message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Help message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Help + */ + public static fromObject(object: { [k: string]: any }): google.rpc.Help; + + /** + * Creates a plain object from a Help message. Also converts values to other types if specified. + * @param message Help + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.rpc.Help, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Help to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Help + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Help { + + /** Properties of a Link. */ + interface ILink { + + /** Link description */ + description?: (string|null); + + /** Link url */ + url?: (string|null); + } + + /** Represents a Link. */ + class Link implements ILink { + + /** + * Constructs a new Link. + * @param [properties] Properties to set + */ + constructor(properties?: google.rpc.Help.ILink); + + /** Link description. */ + public description: string; + + /** Link url. */ + public url: string; + + /** + * Creates a new Link instance using the specified properties. + * @param [properties] Properties to set + * @returns Link instance + */ + public static create(properties?: google.rpc.Help.ILink): google.rpc.Help.Link; + + /** + * Encodes the specified Link message. Does not implicitly {@link google.rpc.Help.Link.verify|verify} messages. + * @param message Link message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.rpc.Help.ILink, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Link message, length delimited. Does not implicitly {@link google.rpc.Help.Link.verify|verify} messages. + * @param message Link message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.rpc.Help.ILink, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Link message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Link + * @throws {Error} If the payload is not 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.Help.Link; + + /** + * Decodes a Link message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Link + * @throws {Error} If the payload 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.Help.Link; + + /** + * Verifies a Link message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Link message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Link + */ + public static fromObject(object: { [k: string]: any }): google.rpc.Help.Link; + + /** + * Creates a plain object from a Link message. Also converts values to other types if specified. + * @param message Link + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.rpc.Help.Link, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Link to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Link + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a LocalizedMessage. */ + interface ILocalizedMessage { + + /** LocalizedMessage locale */ + locale?: (string|null); + + /** LocalizedMessage message */ + message?: (string|null); + } + + /** Represents a LocalizedMessage. */ + class LocalizedMessage implements ILocalizedMessage { + + /** + * Constructs a new LocalizedMessage. + * @param [properties] Properties to set + */ + constructor(properties?: google.rpc.ILocalizedMessage); + + /** LocalizedMessage locale. */ + public locale: string; + + /** LocalizedMessage message. */ + public message: string; + + /** + * Creates a new LocalizedMessage instance using the specified properties. + * @param [properties] Properties to set + * @returns LocalizedMessage instance + */ + public static create(properties?: google.rpc.ILocalizedMessage): google.rpc.LocalizedMessage; + + /** + * Encodes the specified LocalizedMessage message. Does not implicitly {@link google.rpc.LocalizedMessage.verify|verify} messages. + * @param message LocalizedMessage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.rpc.ILocalizedMessage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LocalizedMessage message, length delimited. Does not implicitly {@link google.rpc.LocalizedMessage.verify|verify} messages. + * @param message LocalizedMessage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.rpc.ILocalizedMessage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LocalizedMessage message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LocalizedMessage + * @throws {Error} If the payload is not 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.LocalizedMessage; + + /** + * Decodes a LocalizedMessage message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LocalizedMessage + * @throws {Error} If the payload 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.LocalizedMessage; + + /** + * Verifies a LocalizedMessage message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LocalizedMessage message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LocalizedMessage + */ + public static fromObject(object: { [k: string]: any }): google.rpc.LocalizedMessage; + + /** + * Creates a plain object from a LocalizedMessage message. Also converts values to other types if specified. + * @param message LocalizedMessage + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.rpc.LocalizedMessage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LocalizedMessage to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LocalizedMessage + * @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-vmmigration/protos/protos.js b/packages/google-cloud-vmmigration/protos/protos.js new file mode 100644 index 00000000000..cad3d5430ae --- /dev/null +++ b/packages/google-cloud-vmmigration/protos/protos.js @@ -0,0 +1,45450 @@ +// 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_vmmigration_protos || ($protobuf.roots._google_cloud_vmmigration_protos = {}); + + $root.google = (function() { + + /** + * Namespace google. + * @exports google + * @namespace + */ + var google = {}; + + google.cloud = (function() { + + /** + * Namespace cloud. + * @memberof google + * @namespace + */ + var cloud = {}; + + cloud.vmmigration = (function() { + + /** + * Namespace vmmigration. + * @memberof google.cloud + * @namespace + */ + var vmmigration = {}; + + vmmigration.v1 = (function() { + + /** + * Namespace v1. + * @memberof google.cloud.vmmigration + * @namespace + */ + var v1 = {}; + + v1.VmMigration = (function() { + + /** + * Constructs a new VmMigration service. + * @memberof google.cloud.vmmigration.v1 + * @classdesc Represents a VmMigration + * @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 VmMigration(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (VmMigration.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = VmMigration; + + /** + * Creates new VmMigration service using the specified rpc implementation. + * @function create + * @memberof google.cloud.vmmigration.v1.VmMigration + * @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 {VmMigration} RPC service. Useful where requests and/or responses are streamed. + */ + VmMigration.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.vmmigration.v1.VmMigration|listSources}. + * @memberof google.cloud.vmmigration.v1.VmMigration + * @typedef ListSourcesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.vmmigration.v1.ListSourcesResponse} [response] ListSourcesResponse + */ + + /** + * Calls ListSources. + * @function listSources + * @memberof google.cloud.vmmigration.v1.VmMigration + * @instance + * @param {google.cloud.vmmigration.v1.IListSourcesRequest} request ListSourcesRequest message or plain object + * @param {google.cloud.vmmigration.v1.VmMigration.ListSourcesCallback} callback Node-style callback called with the error, if any, and ListSourcesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(VmMigration.prototype.listSources = function listSources(request, callback) { + return this.rpcCall(listSources, $root.google.cloud.vmmigration.v1.ListSourcesRequest, $root.google.cloud.vmmigration.v1.ListSourcesResponse, request, callback); + }, "name", { value: "ListSources" }); + + /** + * Calls ListSources. + * @function listSources + * @memberof google.cloud.vmmigration.v1.VmMigration + * @instance + * @param {google.cloud.vmmigration.v1.IListSourcesRequest} request ListSourcesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.vmmigration.v1.VmMigration|getSource}. + * @memberof google.cloud.vmmigration.v1.VmMigration + * @typedef GetSourceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.vmmigration.v1.Source} [response] Source + */ + + /** + * Calls GetSource. + * @function getSource + * @memberof google.cloud.vmmigration.v1.VmMigration + * @instance + * @param {google.cloud.vmmigration.v1.IGetSourceRequest} request GetSourceRequest message or plain object + * @param {google.cloud.vmmigration.v1.VmMigration.GetSourceCallback} callback Node-style callback called with the error, if any, and Source + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(VmMigration.prototype.getSource = function getSource(request, callback) { + return this.rpcCall(getSource, $root.google.cloud.vmmigration.v1.GetSourceRequest, $root.google.cloud.vmmigration.v1.Source, request, callback); + }, "name", { value: "GetSource" }); + + /** + * Calls GetSource. + * @function getSource + * @memberof google.cloud.vmmigration.v1.VmMigration + * @instance + * @param {google.cloud.vmmigration.v1.IGetSourceRequest} request GetSourceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.vmmigration.v1.VmMigration|createSource}. + * @memberof google.cloud.vmmigration.v1.VmMigration + * @typedef CreateSourceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateSource. + * @function createSource + * @memberof google.cloud.vmmigration.v1.VmMigration + * @instance + * @param {google.cloud.vmmigration.v1.ICreateSourceRequest} request CreateSourceRequest message or plain object + * @param {google.cloud.vmmigration.v1.VmMigration.CreateSourceCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(VmMigration.prototype.createSource = function createSource(request, callback) { + return this.rpcCall(createSource, $root.google.cloud.vmmigration.v1.CreateSourceRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateSource" }); + + /** + * Calls CreateSource. + * @function createSource + * @memberof google.cloud.vmmigration.v1.VmMigration + * @instance + * @param {google.cloud.vmmigration.v1.ICreateSourceRequest} request CreateSourceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.vmmigration.v1.VmMigration|updateSource}. + * @memberof google.cloud.vmmigration.v1.VmMigration + * @typedef UpdateSourceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateSource. + * @function updateSource + * @memberof google.cloud.vmmigration.v1.VmMigration + * @instance + * @param {google.cloud.vmmigration.v1.IUpdateSourceRequest} request UpdateSourceRequest message or plain object + * @param {google.cloud.vmmigration.v1.VmMigration.UpdateSourceCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(VmMigration.prototype.updateSource = function updateSource(request, callback) { + return this.rpcCall(updateSource, $root.google.cloud.vmmigration.v1.UpdateSourceRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateSource" }); + + /** + * Calls UpdateSource. + * @function updateSource + * @memberof google.cloud.vmmigration.v1.VmMigration + * @instance + * @param {google.cloud.vmmigration.v1.IUpdateSourceRequest} request UpdateSourceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.vmmigration.v1.VmMigration|deleteSource}. + * @memberof google.cloud.vmmigration.v1.VmMigration + * @typedef DeleteSourceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteSource. + * @function deleteSource + * @memberof google.cloud.vmmigration.v1.VmMigration + * @instance + * @param {google.cloud.vmmigration.v1.IDeleteSourceRequest} request DeleteSourceRequest message or plain object + * @param {google.cloud.vmmigration.v1.VmMigration.DeleteSourceCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(VmMigration.prototype.deleteSource = function deleteSource(request, callback) { + return this.rpcCall(deleteSource, $root.google.cloud.vmmigration.v1.DeleteSourceRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteSource" }); + + /** + * Calls DeleteSource. + * @function deleteSource + * @memberof google.cloud.vmmigration.v1.VmMigration + * @instance + * @param {google.cloud.vmmigration.v1.IDeleteSourceRequest} request DeleteSourceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.vmmigration.v1.VmMigration|fetchInventory}. + * @memberof google.cloud.vmmigration.v1.VmMigration + * @typedef FetchInventoryCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.vmmigration.v1.FetchInventoryResponse} [response] FetchInventoryResponse + */ + + /** + * Calls FetchInventory. + * @function fetchInventory + * @memberof google.cloud.vmmigration.v1.VmMigration + * @instance + * @param {google.cloud.vmmigration.v1.IFetchInventoryRequest} request FetchInventoryRequest message or plain object + * @param {google.cloud.vmmigration.v1.VmMigration.FetchInventoryCallback} callback Node-style callback called with the error, if any, and FetchInventoryResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(VmMigration.prototype.fetchInventory = function fetchInventory(request, callback) { + return this.rpcCall(fetchInventory, $root.google.cloud.vmmigration.v1.FetchInventoryRequest, $root.google.cloud.vmmigration.v1.FetchInventoryResponse, request, callback); + }, "name", { value: "FetchInventory" }); + + /** + * Calls FetchInventory. + * @function fetchInventory + * @memberof google.cloud.vmmigration.v1.VmMigration + * @instance + * @param {google.cloud.vmmigration.v1.IFetchInventoryRequest} request FetchInventoryRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.vmmigration.v1.VmMigration|listUtilizationReports}. + * @memberof google.cloud.vmmigration.v1.VmMigration + * @typedef ListUtilizationReportsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.vmmigration.v1.ListUtilizationReportsResponse} [response] ListUtilizationReportsResponse + */ + + /** + * Calls ListUtilizationReports. + * @function listUtilizationReports + * @memberof google.cloud.vmmigration.v1.VmMigration + * @instance + * @param {google.cloud.vmmigration.v1.IListUtilizationReportsRequest} request ListUtilizationReportsRequest message or plain object + * @param {google.cloud.vmmigration.v1.VmMigration.ListUtilizationReportsCallback} callback Node-style callback called with the error, if any, and ListUtilizationReportsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(VmMigration.prototype.listUtilizationReports = function listUtilizationReports(request, callback) { + return this.rpcCall(listUtilizationReports, $root.google.cloud.vmmigration.v1.ListUtilizationReportsRequest, $root.google.cloud.vmmigration.v1.ListUtilizationReportsResponse, request, callback); + }, "name", { value: "ListUtilizationReports" }); + + /** + * Calls ListUtilizationReports. + * @function listUtilizationReports + * @memberof google.cloud.vmmigration.v1.VmMigration + * @instance + * @param {google.cloud.vmmigration.v1.IListUtilizationReportsRequest} request ListUtilizationReportsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.vmmigration.v1.VmMigration|getUtilizationReport}. + * @memberof google.cloud.vmmigration.v1.VmMigration + * @typedef GetUtilizationReportCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.vmmigration.v1.UtilizationReport} [response] UtilizationReport + */ + + /** + * Calls GetUtilizationReport. + * @function getUtilizationReport + * @memberof google.cloud.vmmigration.v1.VmMigration + * @instance + * @param {google.cloud.vmmigration.v1.IGetUtilizationReportRequest} request GetUtilizationReportRequest message or plain object + * @param {google.cloud.vmmigration.v1.VmMigration.GetUtilizationReportCallback} callback Node-style callback called with the error, if any, and UtilizationReport + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(VmMigration.prototype.getUtilizationReport = function getUtilizationReport(request, callback) { + return this.rpcCall(getUtilizationReport, $root.google.cloud.vmmigration.v1.GetUtilizationReportRequest, $root.google.cloud.vmmigration.v1.UtilizationReport, request, callback); + }, "name", { value: "GetUtilizationReport" }); + + /** + * Calls GetUtilizationReport. + * @function getUtilizationReport + * @memberof google.cloud.vmmigration.v1.VmMigration + * @instance + * @param {google.cloud.vmmigration.v1.IGetUtilizationReportRequest} request GetUtilizationReportRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.vmmigration.v1.VmMigration|createUtilizationReport}. + * @memberof google.cloud.vmmigration.v1.VmMigration + * @typedef CreateUtilizationReportCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateUtilizationReport. + * @function createUtilizationReport + * @memberof google.cloud.vmmigration.v1.VmMigration + * @instance + * @param {google.cloud.vmmigration.v1.ICreateUtilizationReportRequest} request CreateUtilizationReportRequest message or plain object + * @param {google.cloud.vmmigration.v1.VmMigration.CreateUtilizationReportCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(VmMigration.prototype.createUtilizationReport = function createUtilizationReport(request, callback) { + return this.rpcCall(createUtilizationReport, $root.google.cloud.vmmigration.v1.CreateUtilizationReportRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateUtilizationReport" }); + + /** + * Calls CreateUtilizationReport. + * @function createUtilizationReport + * @memberof google.cloud.vmmigration.v1.VmMigration + * @instance + * @param {google.cloud.vmmigration.v1.ICreateUtilizationReportRequest} request CreateUtilizationReportRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.vmmigration.v1.VmMigration|deleteUtilizationReport}. + * @memberof google.cloud.vmmigration.v1.VmMigration + * @typedef DeleteUtilizationReportCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteUtilizationReport. + * @function deleteUtilizationReport + * @memberof google.cloud.vmmigration.v1.VmMigration + * @instance + * @param {google.cloud.vmmigration.v1.IDeleteUtilizationReportRequest} request DeleteUtilizationReportRequest message or plain object + * @param {google.cloud.vmmigration.v1.VmMigration.DeleteUtilizationReportCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(VmMigration.prototype.deleteUtilizationReport = function deleteUtilizationReport(request, callback) { + return this.rpcCall(deleteUtilizationReport, $root.google.cloud.vmmigration.v1.DeleteUtilizationReportRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteUtilizationReport" }); + + /** + * Calls DeleteUtilizationReport. + * @function deleteUtilizationReport + * @memberof google.cloud.vmmigration.v1.VmMigration + * @instance + * @param {google.cloud.vmmigration.v1.IDeleteUtilizationReportRequest} request DeleteUtilizationReportRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.vmmigration.v1.VmMigration|listDatacenterConnectors}. + * @memberof google.cloud.vmmigration.v1.VmMigration + * @typedef ListDatacenterConnectorsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.vmmigration.v1.ListDatacenterConnectorsResponse} [response] ListDatacenterConnectorsResponse + */ + + /** + * Calls ListDatacenterConnectors. + * @function listDatacenterConnectors + * @memberof google.cloud.vmmigration.v1.VmMigration + * @instance + * @param {google.cloud.vmmigration.v1.IListDatacenterConnectorsRequest} request ListDatacenterConnectorsRequest message or plain object + * @param {google.cloud.vmmigration.v1.VmMigration.ListDatacenterConnectorsCallback} callback Node-style callback called with the error, if any, and ListDatacenterConnectorsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(VmMigration.prototype.listDatacenterConnectors = function listDatacenterConnectors(request, callback) { + return this.rpcCall(listDatacenterConnectors, $root.google.cloud.vmmigration.v1.ListDatacenterConnectorsRequest, $root.google.cloud.vmmigration.v1.ListDatacenterConnectorsResponse, request, callback); + }, "name", { value: "ListDatacenterConnectors" }); + + /** + * Calls ListDatacenterConnectors. + * @function listDatacenterConnectors + * @memberof google.cloud.vmmigration.v1.VmMigration + * @instance + * @param {google.cloud.vmmigration.v1.IListDatacenterConnectorsRequest} request ListDatacenterConnectorsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.vmmigration.v1.VmMigration|getDatacenterConnector}. + * @memberof google.cloud.vmmigration.v1.VmMigration + * @typedef GetDatacenterConnectorCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.vmmigration.v1.DatacenterConnector} [response] DatacenterConnector + */ + + /** + * Calls GetDatacenterConnector. + * @function getDatacenterConnector + * @memberof google.cloud.vmmigration.v1.VmMigration + * @instance + * @param {google.cloud.vmmigration.v1.IGetDatacenterConnectorRequest} request GetDatacenterConnectorRequest message or plain object + * @param {google.cloud.vmmigration.v1.VmMigration.GetDatacenterConnectorCallback} callback Node-style callback called with the error, if any, and DatacenterConnector + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(VmMigration.prototype.getDatacenterConnector = function getDatacenterConnector(request, callback) { + return this.rpcCall(getDatacenterConnector, $root.google.cloud.vmmigration.v1.GetDatacenterConnectorRequest, $root.google.cloud.vmmigration.v1.DatacenterConnector, request, callback); + }, "name", { value: "GetDatacenterConnector" }); + + /** + * Calls GetDatacenterConnector. + * @function getDatacenterConnector + * @memberof google.cloud.vmmigration.v1.VmMigration + * @instance + * @param {google.cloud.vmmigration.v1.IGetDatacenterConnectorRequest} request GetDatacenterConnectorRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.vmmigration.v1.VmMigration|createDatacenterConnector}. + * @memberof google.cloud.vmmigration.v1.VmMigration + * @typedef CreateDatacenterConnectorCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateDatacenterConnector. + * @function createDatacenterConnector + * @memberof google.cloud.vmmigration.v1.VmMigration + * @instance + * @param {google.cloud.vmmigration.v1.ICreateDatacenterConnectorRequest} request CreateDatacenterConnectorRequest message or plain object + * @param {google.cloud.vmmigration.v1.VmMigration.CreateDatacenterConnectorCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(VmMigration.prototype.createDatacenterConnector = function createDatacenterConnector(request, callback) { + return this.rpcCall(createDatacenterConnector, $root.google.cloud.vmmigration.v1.CreateDatacenterConnectorRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateDatacenterConnector" }); + + /** + * Calls CreateDatacenterConnector. + * @function createDatacenterConnector + * @memberof google.cloud.vmmigration.v1.VmMigration + * @instance + * @param {google.cloud.vmmigration.v1.ICreateDatacenterConnectorRequest} request CreateDatacenterConnectorRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.vmmigration.v1.VmMigration|deleteDatacenterConnector}. + * @memberof google.cloud.vmmigration.v1.VmMigration + * @typedef DeleteDatacenterConnectorCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteDatacenterConnector. + * @function deleteDatacenterConnector + * @memberof google.cloud.vmmigration.v1.VmMigration + * @instance + * @param {google.cloud.vmmigration.v1.IDeleteDatacenterConnectorRequest} request DeleteDatacenterConnectorRequest message or plain object + * @param {google.cloud.vmmigration.v1.VmMigration.DeleteDatacenterConnectorCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(VmMigration.prototype.deleteDatacenterConnector = function deleteDatacenterConnector(request, callback) { + return this.rpcCall(deleteDatacenterConnector, $root.google.cloud.vmmigration.v1.DeleteDatacenterConnectorRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteDatacenterConnector" }); + + /** + * Calls DeleteDatacenterConnector. + * @function deleteDatacenterConnector + * @memberof google.cloud.vmmigration.v1.VmMigration + * @instance + * @param {google.cloud.vmmigration.v1.IDeleteDatacenterConnectorRequest} request DeleteDatacenterConnectorRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.vmmigration.v1.VmMigration|upgradeAppliance}. + * @memberof google.cloud.vmmigration.v1.VmMigration + * @typedef UpgradeApplianceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpgradeAppliance. + * @function upgradeAppliance + * @memberof google.cloud.vmmigration.v1.VmMigration + * @instance + * @param {google.cloud.vmmigration.v1.IUpgradeApplianceRequest} request UpgradeApplianceRequest message or plain object + * @param {google.cloud.vmmigration.v1.VmMigration.UpgradeApplianceCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(VmMigration.prototype.upgradeAppliance = function upgradeAppliance(request, callback) { + return this.rpcCall(upgradeAppliance, $root.google.cloud.vmmigration.v1.UpgradeApplianceRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpgradeAppliance" }); + + /** + * Calls UpgradeAppliance. + * @function upgradeAppliance + * @memberof google.cloud.vmmigration.v1.VmMigration + * @instance + * @param {google.cloud.vmmigration.v1.IUpgradeApplianceRequest} request UpgradeApplianceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.vmmigration.v1.VmMigration|createMigratingVm}. + * @memberof google.cloud.vmmigration.v1.VmMigration + * @typedef CreateMigratingVmCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateMigratingVm. + * @function createMigratingVm + * @memberof google.cloud.vmmigration.v1.VmMigration + * @instance + * @param {google.cloud.vmmigration.v1.ICreateMigratingVmRequest} request CreateMigratingVmRequest message or plain object + * @param {google.cloud.vmmigration.v1.VmMigration.CreateMigratingVmCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(VmMigration.prototype.createMigratingVm = function createMigratingVm(request, callback) { + return this.rpcCall(createMigratingVm, $root.google.cloud.vmmigration.v1.CreateMigratingVmRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateMigratingVm" }); + + /** + * Calls CreateMigratingVm. + * @function createMigratingVm + * @memberof google.cloud.vmmigration.v1.VmMigration + * @instance + * @param {google.cloud.vmmigration.v1.ICreateMigratingVmRequest} request CreateMigratingVmRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.vmmigration.v1.VmMigration|listMigratingVms}. + * @memberof google.cloud.vmmigration.v1.VmMigration + * @typedef ListMigratingVmsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.vmmigration.v1.ListMigratingVmsResponse} [response] ListMigratingVmsResponse + */ + + /** + * Calls ListMigratingVms. + * @function listMigratingVms + * @memberof google.cloud.vmmigration.v1.VmMigration + * @instance + * @param {google.cloud.vmmigration.v1.IListMigratingVmsRequest} request ListMigratingVmsRequest message or plain object + * @param {google.cloud.vmmigration.v1.VmMigration.ListMigratingVmsCallback} callback Node-style callback called with the error, if any, and ListMigratingVmsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(VmMigration.prototype.listMigratingVms = function listMigratingVms(request, callback) { + return this.rpcCall(listMigratingVms, $root.google.cloud.vmmigration.v1.ListMigratingVmsRequest, $root.google.cloud.vmmigration.v1.ListMigratingVmsResponse, request, callback); + }, "name", { value: "ListMigratingVms" }); + + /** + * Calls ListMigratingVms. + * @function listMigratingVms + * @memberof google.cloud.vmmigration.v1.VmMigration + * @instance + * @param {google.cloud.vmmigration.v1.IListMigratingVmsRequest} request ListMigratingVmsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.vmmigration.v1.VmMigration|getMigratingVm}. + * @memberof google.cloud.vmmigration.v1.VmMigration + * @typedef GetMigratingVmCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.vmmigration.v1.MigratingVm} [response] MigratingVm + */ + + /** + * Calls GetMigratingVm. + * @function getMigratingVm + * @memberof google.cloud.vmmigration.v1.VmMigration + * @instance + * @param {google.cloud.vmmigration.v1.IGetMigratingVmRequest} request GetMigratingVmRequest message or plain object + * @param {google.cloud.vmmigration.v1.VmMigration.GetMigratingVmCallback} callback Node-style callback called with the error, if any, and MigratingVm + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(VmMigration.prototype.getMigratingVm = function getMigratingVm(request, callback) { + return this.rpcCall(getMigratingVm, $root.google.cloud.vmmigration.v1.GetMigratingVmRequest, $root.google.cloud.vmmigration.v1.MigratingVm, request, callback); + }, "name", { value: "GetMigratingVm" }); + + /** + * Calls GetMigratingVm. + * @function getMigratingVm + * @memberof google.cloud.vmmigration.v1.VmMigration + * @instance + * @param {google.cloud.vmmigration.v1.IGetMigratingVmRequest} request GetMigratingVmRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.vmmigration.v1.VmMigration|updateMigratingVm}. + * @memberof google.cloud.vmmigration.v1.VmMigration + * @typedef UpdateMigratingVmCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateMigratingVm. + * @function updateMigratingVm + * @memberof google.cloud.vmmigration.v1.VmMigration + * @instance + * @param {google.cloud.vmmigration.v1.IUpdateMigratingVmRequest} request UpdateMigratingVmRequest message or plain object + * @param {google.cloud.vmmigration.v1.VmMigration.UpdateMigratingVmCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(VmMigration.prototype.updateMigratingVm = function updateMigratingVm(request, callback) { + return this.rpcCall(updateMigratingVm, $root.google.cloud.vmmigration.v1.UpdateMigratingVmRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateMigratingVm" }); + + /** + * Calls UpdateMigratingVm. + * @function updateMigratingVm + * @memberof google.cloud.vmmigration.v1.VmMigration + * @instance + * @param {google.cloud.vmmigration.v1.IUpdateMigratingVmRequest} request UpdateMigratingVmRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.vmmigration.v1.VmMigration|deleteMigratingVm}. + * @memberof google.cloud.vmmigration.v1.VmMigration + * @typedef DeleteMigratingVmCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteMigratingVm. + * @function deleteMigratingVm + * @memberof google.cloud.vmmigration.v1.VmMigration + * @instance + * @param {google.cloud.vmmigration.v1.IDeleteMigratingVmRequest} request DeleteMigratingVmRequest message or plain object + * @param {google.cloud.vmmigration.v1.VmMigration.DeleteMigratingVmCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(VmMigration.prototype.deleteMigratingVm = function deleteMigratingVm(request, callback) { + return this.rpcCall(deleteMigratingVm, $root.google.cloud.vmmigration.v1.DeleteMigratingVmRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteMigratingVm" }); + + /** + * Calls DeleteMigratingVm. + * @function deleteMigratingVm + * @memberof google.cloud.vmmigration.v1.VmMigration + * @instance + * @param {google.cloud.vmmigration.v1.IDeleteMigratingVmRequest} request DeleteMigratingVmRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.vmmigration.v1.VmMigration|startMigration}. + * @memberof google.cloud.vmmigration.v1.VmMigration + * @typedef StartMigrationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls StartMigration. + * @function startMigration + * @memberof google.cloud.vmmigration.v1.VmMigration + * @instance + * @param {google.cloud.vmmigration.v1.IStartMigrationRequest} request StartMigrationRequest message or plain object + * @param {google.cloud.vmmigration.v1.VmMigration.StartMigrationCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(VmMigration.prototype.startMigration = function startMigration(request, callback) { + return this.rpcCall(startMigration, $root.google.cloud.vmmigration.v1.StartMigrationRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "StartMigration" }); + + /** + * Calls StartMigration. + * @function startMigration + * @memberof google.cloud.vmmigration.v1.VmMigration + * @instance + * @param {google.cloud.vmmigration.v1.IStartMigrationRequest} request StartMigrationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.vmmigration.v1.VmMigration|resumeMigration}. + * @memberof google.cloud.vmmigration.v1.VmMigration + * @typedef ResumeMigrationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls ResumeMigration. + * @function resumeMigration + * @memberof google.cloud.vmmigration.v1.VmMigration + * @instance + * @param {google.cloud.vmmigration.v1.IResumeMigrationRequest} request ResumeMigrationRequest message or plain object + * @param {google.cloud.vmmigration.v1.VmMigration.ResumeMigrationCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(VmMigration.prototype.resumeMigration = function resumeMigration(request, callback) { + return this.rpcCall(resumeMigration, $root.google.cloud.vmmigration.v1.ResumeMigrationRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "ResumeMigration" }); + + /** + * Calls ResumeMigration. + * @function resumeMigration + * @memberof google.cloud.vmmigration.v1.VmMigration + * @instance + * @param {google.cloud.vmmigration.v1.IResumeMigrationRequest} request ResumeMigrationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.vmmigration.v1.VmMigration|pauseMigration}. + * @memberof google.cloud.vmmigration.v1.VmMigration + * @typedef PauseMigrationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls PauseMigration. + * @function pauseMigration + * @memberof google.cloud.vmmigration.v1.VmMigration + * @instance + * @param {google.cloud.vmmigration.v1.IPauseMigrationRequest} request PauseMigrationRequest message or plain object + * @param {google.cloud.vmmigration.v1.VmMigration.PauseMigrationCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(VmMigration.prototype.pauseMigration = function pauseMigration(request, callback) { + return this.rpcCall(pauseMigration, $root.google.cloud.vmmigration.v1.PauseMigrationRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "PauseMigration" }); + + /** + * Calls PauseMigration. + * @function pauseMigration + * @memberof google.cloud.vmmigration.v1.VmMigration + * @instance + * @param {google.cloud.vmmigration.v1.IPauseMigrationRequest} request PauseMigrationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.vmmigration.v1.VmMigration|finalizeMigration}. + * @memberof google.cloud.vmmigration.v1.VmMigration + * @typedef FinalizeMigrationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls FinalizeMigration. + * @function finalizeMigration + * @memberof google.cloud.vmmigration.v1.VmMigration + * @instance + * @param {google.cloud.vmmigration.v1.IFinalizeMigrationRequest} request FinalizeMigrationRequest message or plain object + * @param {google.cloud.vmmigration.v1.VmMigration.FinalizeMigrationCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(VmMigration.prototype.finalizeMigration = function finalizeMigration(request, callback) { + return this.rpcCall(finalizeMigration, $root.google.cloud.vmmigration.v1.FinalizeMigrationRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "FinalizeMigration" }); + + /** + * Calls FinalizeMigration. + * @function finalizeMigration + * @memberof google.cloud.vmmigration.v1.VmMigration + * @instance + * @param {google.cloud.vmmigration.v1.IFinalizeMigrationRequest} request FinalizeMigrationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.vmmigration.v1.VmMigration|createCloneJob}. + * @memberof google.cloud.vmmigration.v1.VmMigration + * @typedef CreateCloneJobCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateCloneJob. + * @function createCloneJob + * @memberof google.cloud.vmmigration.v1.VmMigration + * @instance + * @param {google.cloud.vmmigration.v1.ICreateCloneJobRequest} request CreateCloneJobRequest message or plain object + * @param {google.cloud.vmmigration.v1.VmMigration.CreateCloneJobCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(VmMigration.prototype.createCloneJob = function createCloneJob(request, callback) { + return this.rpcCall(createCloneJob, $root.google.cloud.vmmigration.v1.CreateCloneJobRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateCloneJob" }); + + /** + * Calls CreateCloneJob. + * @function createCloneJob + * @memberof google.cloud.vmmigration.v1.VmMigration + * @instance + * @param {google.cloud.vmmigration.v1.ICreateCloneJobRequest} request CreateCloneJobRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.vmmigration.v1.VmMigration|cancelCloneJob}. + * @memberof google.cloud.vmmigration.v1.VmMigration + * @typedef CancelCloneJobCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CancelCloneJob. + * @function cancelCloneJob + * @memberof google.cloud.vmmigration.v1.VmMigration + * @instance + * @param {google.cloud.vmmigration.v1.ICancelCloneJobRequest} request CancelCloneJobRequest message or plain object + * @param {google.cloud.vmmigration.v1.VmMigration.CancelCloneJobCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(VmMigration.prototype.cancelCloneJob = function cancelCloneJob(request, callback) { + return this.rpcCall(cancelCloneJob, $root.google.cloud.vmmigration.v1.CancelCloneJobRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CancelCloneJob" }); + + /** + * Calls CancelCloneJob. + * @function cancelCloneJob + * @memberof google.cloud.vmmigration.v1.VmMigration + * @instance + * @param {google.cloud.vmmigration.v1.ICancelCloneJobRequest} request CancelCloneJobRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.vmmigration.v1.VmMigration|listCloneJobs}. + * @memberof google.cloud.vmmigration.v1.VmMigration + * @typedef ListCloneJobsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.vmmigration.v1.ListCloneJobsResponse} [response] ListCloneJobsResponse + */ + + /** + * Calls ListCloneJobs. + * @function listCloneJobs + * @memberof google.cloud.vmmigration.v1.VmMigration + * @instance + * @param {google.cloud.vmmigration.v1.IListCloneJobsRequest} request ListCloneJobsRequest message or plain object + * @param {google.cloud.vmmigration.v1.VmMigration.ListCloneJobsCallback} callback Node-style callback called with the error, if any, and ListCloneJobsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(VmMigration.prototype.listCloneJobs = function listCloneJobs(request, callback) { + return this.rpcCall(listCloneJobs, $root.google.cloud.vmmigration.v1.ListCloneJobsRequest, $root.google.cloud.vmmigration.v1.ListCloneJobsResponse, request, callback); + }, "name", { value: "ListCloneJobs" }); + + /** + * Calls ListCloneJobs. + * @function listCloneJobs + * @memberof google.cloud.vmmigration.v1.VmMigration + * @instance + * @param {google.cloud.vmmigration.v1.IListCloneJobsRequest} request ListCloneJobsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.vmmigration.v1.VmMigration|getCloneJob}. + * @memberof google.cloud.vmmigration.v1.VmMigration + * @typedef GetCloneJobCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.vmmigration.v1.CloneJob} [response] CloneJob + */ + + /** + * Calls GetCloneJob. + * @function getCloneJob + * @memberof google.cloud.vmmigration.v1.VmMigration + * @instance + * @param {google.cloud.vmmigration.v1.IGetCloneJobRequest} request GetCloneJobRequest message or plain object + * @param {google.cloud.vmmigration.v1.VmMigration.GetCloneJobCallback} callback Node-style callback called with the error, if any, and CloneJob + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(VmMigration.prototype.getCloneJob = function getCloneJob(request, callback) { + return this.rpcCall(getCloneJob, $root.google.cloud.vmmigration.v1.GetCloneJobRequest, $root.google.cloud.vmmigration.v1.CloneJob, request, callback); + }, "name", { value: "GetCloneJob" }); + + /** + * Calls GetCloneJob. + * @function getCloneJob + * @memberof google.cloud.vmmigration.v1.VmMigration + * @instance + * @param {google.cloud.vmmigration.v1.IGetCloneJobRequest} request GetCloneJobRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.vmmigration.v1.VmMigration|createCutoverJob}. + * @memberof google.cloud.vmmigration.v1.VmMigration + * @typedef CreateCutoverJobCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateCutoverJob. + * @function createCutoverJob + * @memberof google.cloud.vmmigration.v1.VmMigration + * @instance + * @param {google.cloud.vmmigration.v1.ICreateCutoverJobRequest} request CreateCutoverJobRequest message or plain object + * @param {google.cloud.vmmigration.v1.VmMigration.CreateCutoverJobCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(VmMigration.prototype.createCutoverJob = function createCutoverJob(request, callback) { + return this.rpcCall(createCutoverJob, $root.google.cloud.vmmigration.v1.CreateCutoverJobRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateCutoverJob" }); + + /** + * Calls CreateCutoverJob. + * @function createCutoverJob + * @memberof google.cloud.vmmigration.v1.VmMigration + * @instance + * @param {google.cloud.vmmigration.v1.ICreateCutoverJobRequest} request CreateCutoverJobRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.vmmigration.v1.VmMigration|cancelCutoverJob}. + * @memberof google.cloud.vmmigration.v1.VmMigration + * @typedef CancelCutoverJobCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CancelCutoverJob. + * @function cancelCutoverJob + * @memberof google.cloud.vmmigration.v1.VmMigration + * @instance + * @param {google.cloud.vmmigration.v1.ICancelCutoverJobRequest} request CancelCutoverJobRequest message or plain object + * @param {google.cloud.vmmigration.v1.VmMigration.CancelCutoverJobCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(VmMigration.prototype.cancelCutoverJob = function cancelCutoverJob(request, callback) { + return this.rpcCall(cancelCutoverJob, $root.google.cloud.vmmigration.v1.CancelCutoverJobRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CancelCutoverJob" }); + + /** + * Calls CancelCutoverJob. + * @function cancelCutoverJob + * @memberof google.cloud.vmmigration.v1.VmMigration + * @instance + * @param {google.cloud.vmmigration.v1.ICancelCutoverJobRequest} request CancelCutoverJobRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.vmmigration.v1.VmMigration|listCutoverJobs}. + * @memberof google.cloud.vmmigration.v1.VmMigration + * @typedef ListCutoverJobsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.vmmigration.v1.ListCutoverJobsResponse} [response] ListCutoverJobsResponse + */ + + /** + * Calls ListCutoverJobs. + * @function listCutoverJobs + * @memberof google.cloud.vmmigration.v1.VmMigration + * @instance + * @param {google.cloud.vmmigration.v1.IListCutoverJobsRequest} request ListCutoverJobsRequest message or plain object + * @param {google.cloud.vmmigration.v1.VmMigration.ListCutoverJobsCallback} callback Node-style callback called with the error, if any, and ListCutoverJobsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(VmMigration.prototype.listCutoverJobs = function listCutoverJobs(request, callback) { + return this.rpcCall(listCutoverJobs, $root.google.cloud.vmmigration.v1.ListCutoverJobsRequest, $root.google.cloud.vmmigration.v1.ListCutoverJobsResponse, request, callback); + }, "name", { value: "ListCutoverJobs" }); + + /** + * Calls ListCutoverJobs. + * @function listCutoverJobs + * @memberof google.cloud.vmmigration.v1.VmMigration + * @instance + * @param {google.cloud.vmmigration.v1.IListCutoverJobsRequest} request ListCutoverJobsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.vmmigration.v1.VmMigration|getCutoverJob}. + * @memberof google.cloud.vmmigration.v1.VmMigration + * @typedef GetCutoverJobCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.vmmigration.v1.CutoverJob} [response] CutoverJob + */ + + /** + * Calls GetCutoverJob. + * @function getCutoverJob + * @memberof google.cloud.vmmigration.v1.VmMigration + * @instance + * @param {google.cloud.vmmigration.v1.IGetCutoverJobRequest} request GetCutoverJobRequest message or plain object + * @param {google.cloud.vmmigration.v1.VmMigration.GetCutoverJobCallback} callback Node-style callback called with the error, if any, and CutoverJob + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(VmMigration.prototype.getCutoverJob = function getCutoverJob(request, callback) { + return this.rpcCall(getCutoverJob, $root.google.cloud.vmmigration.v1.GetCutoverJobRequest, $root.google.cloud.vmmigration.v1.CutoverJob, request, callback); + }, "name", { value: "GetCutoverJob" }); + + /** + * Calls GetCutoverJob. + * @function getCutoverJob + * @memberof google.cloud.vmmigration.v1.VmMigration + * @instance + * @param {google.cloud.vmmigration.v1.IGetCutoverJobRequest} request GetCutoverJobRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.vmmigration.v1.VmMigration|listGroups}. + * @memberof google.cloud.vmmigration.v1.VmMigration + * @typedef ListGroupsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.vmmigration.v1.ListGroupsResponse} [response] ListGroupsResponse + */ + + /** + * Calls ListGroups. + * @function listGroups + * @memberof google.cloud.vmmigration.v1.VmMigration + * @instance + * @param {google.cloud.vmmigration.v1.IListGroupsRequest} request ListGroupsRequest message or plain object + * @param {google.cloud.vmmigration.v1.VmMigration.ListGroupsCallback} callback Node-style callback called with the error, if any, and ListGroupsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(VmMigration.prototype.listGroups = function listGroups(request, callback) { + return this.rpcCall(listGroups, $root.google.cloud.vmmigration.v1.ListGroupsRequest, $root.google.cloud.vmmigration.v1.ListGroupsResponse, request, callback); + }, "name", { value: "ListGroups" }); + + /** + * Calls ListGroups. + * @function listGroups + * @memberof google.cloud.vmmigration.v1.VmMigration + * @instance + * @param {google.cloud.vmmigration.v1.IListGroupsRequest} request ListGroupsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.vmmigration.v1.VmMigration|getGroup}. + * @memberof google.cloud.vmmigration.v1.VmMigration + * @typedef GetGroupCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.vmmigration.v1.Group} [response] Group + */ + + /** + * Calls GetGroup. + * @function getGroup + * @memberof google.cloud.vmmigration.v1.VmMigration + * @instance + * @param {google.cloud.vmmigration.v1.IGetGroupRequest} request GetGroupRequest message or plain object + * @param {google.cloud.vmmigration.v1.VmMigration.GetGroupCallback} callback Node-style callback called with the error, if any, and Group + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(VmMigration.prototype.getGroup = function getGroup(request, callback) { + return this.rpcCall(getGroup, $root.google.cloud.vmmigration.v1.GetGroupRequest, $root.google.cloud.vmmigration.v1.Group, request, callback); + }, "name", { value: "GetGroup" }); + + /** + * Calls GetGroup. + * @function getGroup + * @memberof google.cloud.vmmigration.v1.VmMigration + * @instance + * @param {google.cloud.vmmigration.v1.IGetGroupRequest} request GetGroupRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.vmmigration.v1.VmMigration|createGroup}. + * @memberof google.cloud.vmmigration.v1.VmMigration + * @typedef CreateGroupCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateGroup. + * @function createGroup + * @memberof google.cloud.vmmigration.v1.VmMigration + * @instance + * @param {google.cloud.vmmigration.v1.ICreateGroupRequest} request CreateGroupRequest message or plain object + * @param {google.cloud.vmmigration.v1.VmMigration.CreateGroupCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(VmMigration.prototype.createGroup = function createGroup(request, callback) { + return this.rpcCall(createGroup, $root.google.cloud.vmmigration.v1.CreateGroupRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateGroup" }); + + /** + * Calls CreateGroup. + * @function createGroup + * @memberof google.cloud.vmmigration.v1.VmMigration + * @instance + * @param {google.cloud.vmmigration.v1.ICreateGroupRequest} request CreateGroupRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.vmmigration.v1.VmMigration|updateGroup}. + * @memberof google.cloud.vmmigration.v1.VmMigration + * @typedef UpdateGroupCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateGroup. + * @function updateGroup + * @memberof google.cloud.vmmigration.v1.VmMigration + * @instance + * @param {google.cloud.vmmigration.v1.IUpdateGroupRequest} request UpdateGroupRequest message or plain object + * @param {google.cloud.vmmigration.v1.VmMigration.UpdateGroupCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(VmMigration.prototype.updateGroup = function updateGroup(request, callback) { + return this.rpcCall(updateGroup, $root.google.cloud.vmmigration.v1.UpdateGroupRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateGroup" }); + + /** + * Calls UpdateGroup. + * @function updateGroup + * @memberof google.cloud.vmmigration.v1.VmMigration + * @instance + * @param {google.cloud.vmmigration.v1.IUpdateGroupRequest} request UpdateGroupRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.vmmigration.v1.VmMigration|deleteGroup}. + * @memberof google.cloud.vmmigration.v1.VmMigration + * @typedef DeleteGroupCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteGroup. + * @function deleteGroup + * @memberof google.cloud.vmmigration.v1.VmMigration + * @instance + * @param {google.cloud.vmmigration.v1.IDeleteGroupRequest} request DeleteGroupRequest message or plain object + * @param {google.cloud.vmmigration.v1.VmMigration.DeleteGroupCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(VmMigration.prototype.deleteGroup = function deleteGroup(request, callback) { + return this.rpcCall(deleteGroup, $root.google.cloud.vmmigration.v1.DeleteGroupRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteGroup" }); + + /** + * Calls DeleteGroup. + * @function deleteGroup + * @memberof google.cloud.vmmigration.v1.VmMigration + * @instance + * @param {google.cloud.vmmigration.v1.IDeleteGroupRequest} request DeleteGroupRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.vmmigration.v1.VmMigration|addGroupMigration}. + * @memberof google.cloud.vmmigration.v1.VmMigration + * @typedef AddGroupMigrationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls AddGroupMigration. + * @function addGroupMigration + * @memberof google.cloud.vmmigration.v1.VmMigration + * @instance + * @param {google.cloud.vmmigration.v1.IAddGroupMigrationRequest} request AddGroupMigrationRequest message or plain object + * @param {google.cloud.vmmigration.v1.VmMigration.AddGroupMigrationCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(VmMigration.prototype.addGroupMigration = function addGroupMigration(request, callback) { + return this.rpcCall(addGroupMigration, $root.google.cloud.vmmigration.v1.AddGroupMigrationRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "AddGroupMigration" }); + + /** + * Calls AddGroupMigration. + * @function addGroupMigration + * @memberof google.cloud.vmmigration.v1.VmMigration + * @instance + * @param {google.cloud.vmmigration.v1.IAddGroupMigrationRequest} request AddGroupMigrationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.vmmigration.v1.VmMigration|removeGroupMigration}. + * @memberof google.cloud.vmmigration.v1.VmMigration + * @typedef RemoveGroupMigrationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls RemoveGroupMigration. + * @function removeGroupMigration + * @memberof google.cloud.vmmigration.v1.VmMigration + * @instance + * @param {google.cloud.vmmigration.v1.IRemoveGroupMigrationRequest} request RemoveGroupMigrationRequest message or plain object + * @param {google.cloud.vmmigration.v1.VmMigration.RemoveGroupMigrationCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(VmMigration.prototype.removeGroupMigration = function removeGroupMigration(request, callback) { + return this.rpcCall(removeGroupMigration, $root.google.cloud.vmmigration.v1.RemoveGroupMigrationRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "RemoveGroupMigration" }); + + /** + * Calls RemoveGroupMigration. + * @function removeGroupMigration + * @memberof google.cloud.vmmigration.v1.VmMigration + * @instance + * @param {google.cloud.vmmigration.v1.IRemoveGroupMigrationRequest} request RemoveGroupMigrationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.vmmigration.v1.VmMigration|listTargetProjects}. + * @memberof google.cloud.vmmigration.v1.VmMigration + * @typedef ListTargetProjectsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.vmmigration.v1.ListTargetProjectsResponse} [response] ListTargetProjectsResponse + */ + + /** + * Calls ListTargetProjects. + * @function listTargetProjects + * @memberof google.cloud.vmmigration.v1.VmMigration + * @instance + * @param {google.cloud.vmmigration.v1.IListTargetProjectsRequest} request ListTargetProjectsRequest message or plain object + * @param {google.cloud.vmmigration.v1.VmMigration.ListTargetProjectsCallback} callback Node-style callback called with the error, if any, and ListTargetProjectsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(VmMigration.prototype.listTargetProjects = function listTargetProjects(request, callback) { + return this.rpcCall(listTargetProjects, $root.google.cloud.vmmigration.v1.ListTargetProjectsRequest, $root.google.cloud.vmmigration.v1.ListTargetProjectsResponse, request, callback); + }, "name", { value: "ListTargetProjects" }); + + /** + * Calls ListTargetProjects. + * @function listTargetProjects + * @memberof google.cloud.vmmigration.v1.VmMigration + * @instance + * @param {google.cloud.vmmigration.v1.IListTargetProjectsRequest} request ListTargetProjectsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.vmmigration.v1.VmMigration|getTargetProject}. + * @memberof google.cloud.vmmigration.v1.VmMigration + * @typedef GetTargetProjectCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.vmmigration.v1.TargetProject} [response] TargetProject + */ + + /** + * Calls GetTargetProject. + * @function getTargetProject + * @memberof google.cloud.vmmigration.v1.VmMigration + * @instance + * @param {google.cloud.vmmigration.v1.IGetTargetProjectRequest} request GetTargetProjectRequest message or plain object + * @param {google.cloud.vmmigration.v1.VmMigration.GetTargetProjectCallback} callback Node-style callback called with the error, if any, and TargetProject + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(VmMigration.prototype.getTargetProject = function getTargetProject(request, callback) { + return this.rpcCall(getTargetProject, $root.google.cloud.vmmigration.v1.GetTargetProjectRequest, $root.google.cloud.vmmigration.v1.TargetProject, request, callback); + }, "name", { value: "GetTargetProject" }); + + /** + * Calls GetTargetProject. + * @function getTargetProject + * @memberof google.cloud.vmmigration.v1.VmMigration + * @instance + * @param {google.cloud.vmmigration.v1.IGetTargetProjectRequest} request GetTargetProjectRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.vmmigration.v1.VmMigration|createTargetProject}. + * @memberof google.cloud.vmmigration.v1.VmMigration + * @typedef CreateTargetProjectCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateTargetProject. + * @function createTargetProject + * @memberof google.cloud.vmmigration.v1.VmMigration + * @instance + * @param {google.cloud.vmmigration.v1.ICreateTargetProjectRequest} request CreateTargetProjectRequest message or plain object + * @param {google.cloud.vmmigration.v1.VmMigration.CreateTargetProjectCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(VmMigration.prototype.createTargetProject = function createTargetProject(request, callback) { + return this.rpcCall(createTargetProject, $root.google.cloud.vmmigration.v1.CreateTargetProjectRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateTargetProject" }); + + /** + * Calls CreateTargetProject. + * @function createTargetProject + * @memberof google.cloud.vmmigration.v1.VmMigration + * @instance + * @param {google.cloud.vmmigration.v1.ICreateTargetProjectRequest} request CreateTargetProjectRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.vmmigration.v1.VmMigration|updateTargetProject}. + * @memberof google.cloud.vmmigration.v1.VmMigration + * @typedef UpdateTargetProjectCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateTargetProject. + * @function updateTargetProject + * @memberof google.cloud.vmmigration.v1.VmMigration + * @instance + * @param {google.cloud.vmmigration.v1.IUpdateTargetProjectRequest} request UpdateTargetProjectRequest message or plain object + * @param {google.cloud.vmmigration.v1.VmMigration.UpdateTargetProjectCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(VmMigration.prototype.updateTargetProject = function updateTargetProject(request, callback) { + return this.rpcCall(updateTargetProject, $root.google.cloud.vmmigration.v1.UpdateTargetProjectRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateTargetProject" }); + + /** + * Calls UpdateTargetProject. + * @function updateTargetProject + * @memberof google.cloud.vmmigration.v1.VmMigration + * @instance + * @param {google.cloud.vmmigration.v1.IUpdateTargetProjectRequest} request UpdateTargetProjectRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.vmmigration.v1.VmMigration|deleteTargetProject}. + * @memberof google.cloud.vmmigration.v1.VmMigration + * @typedef DeleteTargetProjectCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteTargetProject. + * @function deleteTargetProject + * @memberof google.cloud.vmmigration.v1.VmMigration + * @instance + * @param {google.cloud.vmmigration.v1.IDeleteTargetProjectRequest} request DeleteTargetProjectRequest message or plain object + * @param {google.cloud.vmmigration.v1.VmMigration.DeleteTargetProjectCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(VmMigration.prototype.deleteTargetProject = function deleteTargetProject(request, callback) { + return this.rpcCall(deleteTargetProject, $root.google.cloud.vmmigration.v1.DeleteTargetProjectRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteTargetProject" }); + + /** + * Calls DeleteTargetProject. + * @function deleteTargetProject + * @memberof google.cloud.vmmigration.v1.VmMigration + * @instance + * @param {google.cloud.vmmigration.v1.IDeleteTargetProjectRequest} request DeleteTargetProjectRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return VmMigration; + })(); + + /** + * UtilizationReportView enum. + * @name google.cloud.vmmigration.v1.UtilizationReportView + * @enum {number} + * @property {number} UTILIZATION_REPORT_VIEW_UNSPECIFIED=0 UTILIZATION_REPORT_VIEW_UNSPECIFIED value + * @property {number} BASIC=1 BASIC value + * @property {number} FULL=2 FULL value + */ + v1.UtilizationReportView = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UTILIZATION_REPORT_VIEW_UNSPECIFIED"] = 0; + values[valuesById[1] = "BASIC"] = 1; + values[valuesById[2] = "FULL"] = 2; + return values; + })(); + + /** + * MigratingVmView enum. + * @name google.cloud.vmmigration.v1.MigratingVmView + * @enum {number} + * @property {number} MIGRATING_VM_VIEW_UNSPECIFIED=0 MIGRATING_VM_VIEW_UNSPECIFIED value + * @property {number} MIGRATING_VM_VIEW_BASIC=1 MIGRATING_VM_VIEW_BASIC value + * @property {number} MIGRATING_VM_VIEW_FULL=2 MIGRATING_VM_VIEW_FULL value + */ + v1.MigratingVmView = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MIGRATING_VM_VIEW_UNSPECIFIED"] = 0; + values[valuesById[1] = "MIGRATING_VM_VIEW_BASIC"] = 1; + values[valuesById[2] = "MIGRATING_VM_VIEW_FULL"] = 2; + return values; + })(); + + /** + * ComputeEngineDiskType enum. + * @name google.cloud.vmmigration.v1.ComputeEngineDiskType + * @enum {number} + * @property {number} COMPUTE_ENGINE_DISK_TYPE_UNSPECIFIED=0 COMPUTE_ENGINE_DISK_TYPE_UNSPECIFIED value + * @property {number} COMPUTE_ENGINE_DISK_TYPE_STANDARD=1 COMPUTE_ENGINE_DISK_TYPE_STANDARD value + * @property {number} COMPUTE_ENGINE_DISK_TYPE_SSD=2 COMPUTE_ENGINE_DISK_TYPE_SSD value + * @property {number} COMPUTE_ENGINE_DISK_TYPE_BALANCED=3 COMPUTE_ENGINE_DISK_TYPE_BALANCED value + */ + v1.ComputeEngineDiskType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "COMPUTE_ENGINE_DISK_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "COMPUTE_ENGINE_DISK_TYPE_STANDARD"] = 1; + values[valuesById[2] = "COMPUTE_ENGINE_DISK_TYPE_SSD"] = 2; + values[valuesById[3] = "COMPUTE_ENGINE_DISK_TYPE_BALANCED"] = 3; + return values; + })(); + + /** + * ComputeEngineLicenseType enum. + * @name google.cloud.vmmigration.v1.ComputeEngineLicenseType + * @enum {number} + * @property {number} COMPUTE_ENGINE_LICENSE_TYPE_DEFAULT=0 COMPUTE_ENGINE_LICENSE_TYPE_DEFAULT value + * @property {number} COMPUTE_ENGINE_LICENSE_TYPE_PAYG=1 COMPUTE_ENGINE_LICENSE_TYPE_PAYG value + * @property {number} COMPUTE_ENGINE_LICENSE_TYPE_BYOL=2 COMPUTE_ENGINE_LICENSE_TYPE_BYOL value + */ + v1.ComputeEngineLicenseType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "COMPUTE_ENGINE_LICENSE_TYPE_DEFAULT"] = 0; + values[valuesById[1] = "COMPUTE_ENGINE_LICENSE_TYPE_PAYG"] = 1; + values[valuesById[2] = "COMPUTE_ENGINE_LICENSE_TYPE_BYOL"] = 2; + return values; + })(); + + /** + * ComputeEngineBootOption enum. + * @name google.cloud.vmmigration.v1.ComputeEngineBootOption + * @enum {number} + * @property {number} COMPUTE_ENGINE_BOOT_OPTION_UNSPECIFIED=0 COMPUTE_ENGINE_BOOT_OPTION_UNSPECIFIED value + * @property {number} COMPUTE_ENGINE_BOOT_OPTION_EFI=1 COMPUTE_ENGINE_BOOT_OPTION_EFI value + * @property {number} COMPUTE_ENGINE_BOOT_OPTION_BIOS=2 COMPUTE_ENGINE_BOOT_OPTION_BIOS value + */ + v1.ComputeEngineBootOption = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "COMPUTE_ENGINE_BOOT_OPTION_UNSPECIFIED"] = 0; + values[valuesById[1] = "COMPUTE_ENGINE_BOOT_OPTION_EFI"] = 1; + values[valuesById[2] = "COMPUTE_ENGINE_BOOT_OPTION_BIOS"] = 2; + return values; + })(); + + v1.ReplicationCycle = (function() { + + /** + * Properties of a ReplicationCycle. + * @memberof google.cloud.vmmigration.v1 + * @interface IReplicationCycle + * @property {google.protobuf.ITimestamp|null} [startTime] ReplicationCycle startTime + * @property {number|null} [progressPercent] ReplicationCycle progressPercent + */ + + /** + * Constructs a new ReplicationCycle. + * @memberof google.cloud.vmmigration.v1 + * @classdesc Represents a ReplicationCycle. + * @implements IReplicationCycle + * @constructor + * @param {google.cloud.vmmigration.v1.IReplicationCycle=} [properties] Properties to set + */ + function ReplicationCycle(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReplicationCycle startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.cloud.vmmigration.v1.ReplicationCycle + * @instance + */ + ReplicationCycle.prototype.startTime = null; + + /** + * ReplicationCycle progressPercent. + * @member {number} progressPercent + * @memberof google.cloud.vmmigration.v1.ReplicationCycle + * @instance + */ + ReplicationCycle.prototype.progressPercent = 0; + + /** + * Creates a new ReplicationCycle instance using the specified properties. + * @function create + * @memberof google.cloud.vmmigration.v1.ReplicationCycle + * @static + * @param {google.cloud.vmmigration.v1.IReplicationCycle=} [properties] Properties to set + * @returns {google.cloud.vmmigration.v1.ReplicationCycle} ReplicationCycle instance + */ + ReplicationCycle.create = function create(properties) { + return new ReplicationCycle(properties); + }; + + /** + * Encodes the specified ReplicationCycle message. Does not implicitly {@link google.cloud.vmmigration.v1.ReplicationCycle.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmmigration.v1.ReplicationCycle + * @static + * @param {google.cloud.vmmigration.v1.IReplicationCycle} message ReplicationCycle message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReplicationCycle.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.progressPercent != null && Object.hasOwnProperty.call(message, "progressPercent")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.progressPercent); + return writer; + }; + + /** + * Encodes the specified ReplicationCycle message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.ReplicationCycle.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmmigration.v1.ReplicationCycle + * @static + * @param {google.cloud.vmmigration.v1.IReplicationCycle} message ReplicationCycle message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReplicationCycle.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReplicationCycle message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmmigration.v1.ReplicationCycle + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmmigration.v1.ReplicationCycle} ReplicationCycle + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReplicationCycle.decode = function 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.vmmigration.v1.ReplicationCycle(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.progressPercent = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReplicationCycle message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmmigration.v1.ReplicationCycle + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmmigration.v1.ReplicationCycle} ReplicationCycle + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReplicationCycle.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReplicationCycle message. + * @function verify + * @memberof google.cloud.vmmigration.v1.ReplicationCycle + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReplicationCycle.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (error) + return "startTime." + error; + } + if (message.progressPercent != null && message.hasOwnProperty("progressPercent")) + if (!$util.isInteger(message.progressPercent)) + return "progressPercent: integer expected"; + return null; + }; + + /** + * Creates a ReplicationCycle message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmmigration.v1.ReplicationCycle + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmmigration.v1.ReplicationCycle} ReplicationCycle + */ + ReplicationCycle.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmmigration.v1.ReplicationCycle) + return object; + var message = new $root.google.cloud.vmmigration.v1.ReplicationCycle(); + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.cloud.vmmigration.v1.ReplicationCycle.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + if (object.progressPercent != null) + message.progressPercent = object.progressPercent | 0; + return message; + }; + + /** + * Creates a plain object from a ReplicationCycle message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmmigration.v1.ReplicationCycle + * @static + * @param {google.cloud.vmmigration.v1.ReplicationCycle} message ReplicationCycle + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReplicationCycle.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.startTime = null; + object.progressPercent = 0; + } + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + if (message.progressPercent != null && message.hasOwnProperty("progressPercent")) + object.progressPercent = message.progressPercent; + return object; + }; + + /** + * Converts this ReplicationCycle to JSON. + * @function toJSON + * @memberof google.cloud.vmmigration.v1.ReplicationCycle + * @instance + * @returns {Object.} JSON object + */ + ReplicationCycle.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReplicationCycle + * @function getTypeUrl + * @memberof google.cloud.vmmigration.v1.ReplicationCycle + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReplicationCycle.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmmigration.v1.ReplicationCycle"; + }; + + return ReplicationCycle; + })(); + + v1.ReplicationSync = (function() { + + /** + * Properties of a ReplicationSync. + * @memberof google.cloud.vmmigration.v1 + * @interface IReplicationSync + * @property {google.protobuf.ITimestamp|null} [lastSyncTime] ReplicationSync lastSyncTime + */ + + /** + * Constructs a new ReplicationSync. + * @memberof google.cloud.vmmigration.v1 + * @classdesc Represents a ReplicationSync. + * @implements IReplicationSync + * @constructor + * @param {google.cloud.vmmigration.v1.IReplicationSync=} [properties] Properties to set + */ + function ReplicationSync(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReplicationSync lastSyncTime. + * @member {google.protobuf.ITimestamp|null|undefined} lastSyncTime + * @memberof google.cloud.vmmigration.v1.ReplicationSync + * @instance + */ + ReplicationSync.prototype.lastSyncTime = null; + + /** + * Creates a new ReplicationSync instance using the specified properties. + * @function create + * @memberof google.cloud.vmmigration.v1.ReplicationSync + * @static + * @param {google.cloud.vmmigration.v1.IReplicationSync=} [properties] Properties to set + * @returns {google.cloud.vmmigration.v1.ReplicationSync} ReplicationSync instance + */ + ReplicationSync.create = function create(properties) { + return new ReplicationSync(properties); + }; + + /** + * Encodes the specified ReplicationSync message. Does not implicitly {@link google.cloud.vmmigration.v1.ReplicationSync.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmmigration.v1.ReplicationSync + * @static + * @param {google.cloud.vmmigration.v1.IReplicationSync} message ReplicationSync message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReplicationSync.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.lastSyncTime != null && Object.hasOwnProperty.call(message, "lastSyncTime")) + $root.google.protobuf.Timestamp.encode(message.lastSyncTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ReplicationSync message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.ReplicationSync.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmmigration.v1.ReplicationSync + * @static + * @param {google.cloud.vmmigration.v1.IReplicationSync} message ReplicationSync message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReplicationSync.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReplicationSync message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmmigration.v1.ReplicationSync + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmmigration.v1.ReplicationSync} ReplicationSync + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReplicationSync.decode = function 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.vmmigration.v1.ReplicationSync(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.lastSyncTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReplicationSync message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmmigration.v1.ReplicationSync + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmmigration.v1.ReplicationSync} ReplicationSync + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReplicationSync.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReplicationSync message. + * @function verify + * @memberof google.cloud.vmmigration.v1.ReplicationSync + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReplicationSync.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.lastSyncTime != null && message.hasOwnProperty("lastSyncTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.lastSyncTime); + if (error) + return "lastSyncTime." + error; + } + return null; + }; + + /** + * Creates a ReplicationSync message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmmigration.v1.ReplicationSync + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmmigration.v1.ReplicationSync} ReplicationSync + */ + ReplicationSync.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmmigration.v1.ReplicationSync) + return object; + var message = new $root.google.cloud.vmmigration.v1.ReplicationSync(); + if (object.lastSyncTime != null) { + if (typeof object.lastSyncTime !== "object") + throw TypeError(".google.cloud.vmmigration.v1.ReplicationSync.lastSyncTime: object expected"); + message.lastSyncTime = $root.google.protobuf.Timestamp.fromObject(object.lastSyncTime); + } + return message; + }; + + /** + * Creates a plain object from a ReplicationSync message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmmigration.v1.ReplicationSync + * @static + * @param {google.cloud.vmmigration.v1.ReplicationSync} message ReplicationSync + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReplicationSync.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.lastSyncTime = null; + if (message.lastSyncTime != null && message.hasOwnProperty("lastSyncTime")) + object.lastSyncTime = $root.google.protobuf.Timestamp.toObject(message.lastSyncTime, options); + return object; + }; + + /** + * Converts this ReplicationSync to JSON. + * @function toJSON + * @memberof google.cloud.vmmigration.v1.ReplicationSync + * @instance + * @returns {Object.} JSON object + */ + ReplicationSync.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReplicationSync + * @function getTypeUrl + * @memberof google.cloud.vmmigration.v1.ReplicationSync + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReplicationSync.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmmigration.v1.ReplicationSync"; + }; + + return ReplicationSync; + })(); + + v1.MigratingVm = (function() { + + /** + * Properties of a MigratingVm. + * @memberof google.cloud.vmmigration.v1 + * @interface IMigratingVm + * @property {google.cloud.vmmigration.v1.IComputeEngineTargetDefaults|null} [computeEngineTargetDefaults] MigratingVm computeEngineTargetDefaults + * @property {string|null} [name] MigratingVm name + * @property {string|null} [sourceVmId] MigratingVm sourceVmId + * @property {string|null} [displayName] MigratingVm displayName + * @property {string|null} [description] MigratingVm description + * @property {google.cloud.vmmigration.v1.ISchedulePolicy|null} [policy] MigratingVm policy + * @property {google.protobuf.ITimestamp|null} [createTime] MigratingVm createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] MigratingVm updateTime + * @property {google.cloud.vmmigration.v1.IReplicationSync|null} [lastSync] MigratingVm lastSync + * @property {google.cloud.vmmigration.v1.MigratingVm.State|null} [state] MigratingVm state + * @property {google.protobuf.ITimestamp|null} [stateTime] MigratingVm stateTime + * @property {google.cloud.vmmigration.v1.IReplicationCycle|null} [currentSyncInfo] MigratingVm currentSyncInfo + * @property {string|null} [group] MigratingVm group + * @property {Object.|null} [labels] MigratingVm labels + * @property {Array.|null} [recentCloneJobs] MigratingVm recentCloneJobs + * @property {google.rpc.IStatus|null} [error] MigratingVm error + * @property {Array.|null} [recentCutoverJobs] MigratingVm recentCutoverJobs + */ + + /** + * Constructs a new MigratingVm. + * @memberof google.cloud.vmmigration.v1 + * @classdesc Represents a MigratingVm. + * @implements IMigratingVm + * @constructor + * @param {google.cloud.vmmigration.v1.IMigratingVm=} [properties] Properties to set + */ + function MigratingVm(properties) { + this.labels = {}; + this.recentCloneJobs = []; + this.recentCutoverJobs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MigratingVm computeEngineTargetDefaults. + * @member {google.cloud.vmmigration.v1.IComputeEngineTargetDefaults|null|undefined} computeEngineTargetDefaults + * @memberof google.cloud.vmmigration.v1.MigratingVm + * @instance + */ + MigratingVm.prototype.computeEngineTargetDefaults = null; + + /** + * MigratingVm name. + * @member {string} name + * @memberof google.cloud.vmmigration.v1.MigratingVm + * @instance + */ + MigratingVm.prototype.name = ""; + + /** + * MigratingVm sourceVmId. + * @member {string} sourceVmId + * @memberof google.cloud.vmmigration.v1.MigratingVm + * @instance + */ + MigratingVm.prototype.sourceVmId = ""; + + /** + * MigratingVm displayName. + * @member {string} displayName + * @memberof google.cloud.vmmigration.v1.MigratingVm + * @instance + */ + MigratingVm.prototype.displayName = ""; + + /** + * MigratingVm description. + * @member {string} description + * @memberof google.cloud.vmmigration.v1.MigratingVm + * @instance + */ + MigratingVm.prototype.description = ""; + + /** + * MigratingVm policy. + * @member {google.cloud.vmmigration.v1.ISchedulePolicy|null|undefined} policy + * @memberof google.cloud.vmmigration.v1.MigratingVm + * @instance + */ + MigratingVm.prototype.policy = null; + + /** + * MigratingVm createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.vmmigration.v1.MigratingVm + * @instance + */ + MigratingVm.prototype.createTime = null; + + /** + * MigratingVm updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.vmmigration.v1.MigratingVm + * @instance + */ + MigratingVm.prototype.updateTime = null; + + /** + * MigratingVm lastSync. + * @member {google.cloud.vmmigration.v1.IReplicationSync|null|undefined} lastSync + * @memberof google.cloud.vmmigration.v1.MigratingVm + * @instance + */ + MigratingVm.prototype.lastSync = null; + + /** + * MigratingVm state. + * @member {google.cloud.vmmigration.v1.MigratingVm.State} state + * @memberof google.cloud.vmmigration.v1.MigratingVm + * @instance + */ + MigratingVm.prototype.state = 0; + + /** + * MigratingVm stateTime. + * @member {google.protobuf.ITimestamp|null|undefined} stateTime + * @memberof google.cloud.vmmigration.v1.MigratingVm + * @instance + */ + MigratingVm.prototype.stateTime = null; + + /** + * MigratingVm currentSyncInfo. + * @member {google.cloud.vmmigration.v1.IReplicationCycle|null|undefined} currentSyncInfo + * @memberof google.cloud.vmmigration.v1.MigratingVm + * @instance + */ + MigratingVm.prototype.currentSyncInfo = null; + + /** + * MigratingVm group. + * @member {string} group + * @memberof google.cloud.vmmigration.v1.MigratingVm + * @instance + */ + MigratingVm.prototype.group = ""; + + /** + * MigratingVm labels. + * @member {Object.} labels + * @memberof google.cloud.vmmigration.v1.MigratingVm + * @instance + */ + MigratingVm.prototype.labels = $util.emptyObject; + + /** + * MigratingVm recentCloneJobs. + * @member {Array.} recentCloneJobs + * @memberof google.cloud.vmmigration.v1.MigratingVm + * @instance + */ + MigratingVm.prototype.recentCloneJobs = $util.emptyArray; + + /** + * MigratingVm error. + * @member {google.rpc.IStatus|null|undefined} error + * @memberof google.cloud.vmmigration.v1.MigratingVm + * @instance + */ + MigratingVm.prototype.error = null; + + /** + * MigratingVm recentCutoverJobs. + * @member {Array.} recentCutoverJobs + * @memberof google.cloud.vmmigration.v1.MigratingVm + * @instance + */ + MigratingVm.prototype.recentCutoverJobs = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * MigratingVm targetVmDefaults. + * @member {"computeEngineTargetDefaults"|undefined} targetVmDefaults + * @memberof google.cloud.vmmigration.v1.MigratingVm + * @instance + */ + Object.defineProperty(MigratingVm.prototype, "targetVmDefaults", { + get: $util.oneOfGetter($oneOfFields = ["computeEngineTargetDefaults"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new MigratingVm instance using the specified properties. + * @function create + * @memberof google.cloud.vmmigration.v1.MigratingVm + * @static + * @param {google.cloud.vmmigration.v1.IMigratingVm=} [properties] Properties to set + * @returns {google.cloud.vmmigration.v1.MigratingVm} MigratingVm instance + */ + MigratingVm.create = function create(properties) { + return new MigratingVm(properties); + }; + + /** + * Encodes the specified MigratingVm message. Does not implicitly {@link google.cloud.vmmigration.v1.MigratingVm.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmmigration.v1.MigratingVm + * @static + * @param {google.cloud.vmmigration.v1.IMigratingVm} message MigratingVm message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MigratingVm.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.sourceVmId != null && Object.hasOwnProperty.call(message, "sourceVmId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceVmId); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.policy != null && Object.hasOwnProperty.call(message, "policy")) + $root.google.cloud.vmmigration.v1.SchedulePolicy.encode(message.policy, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.lastSync != null && Object.hasOwnProperty.call(message, "lastSync")) + $root.google.cloud.vmmigration.v1.ReplicationSync.encode(message.lastSync, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.currentSyncInfo != null && Object.hasOwnProperty.call(message, "currentSyncInfo")) + $root.google.cloud.vmmigration.v1.ReplicationCycle.encode(message.currentSyncInfo, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.group != null && Object.hasOwnProperty.call(message, "group")) + writer.uint32(/* id 15, wireType 2 =*/122).string(message.group); + 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 16, wireType 2 =*/130).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.recentCloneJobs != null && message.recentCloneJobs.length) + for (var i = 0; i < message.recentCloneJobs.length; ++i) + $root.google.cloud.vmmigration.v1.CloneJob.encode(message.recentCloneJobs[i], writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 18, wireType 2 =*/146).string(message.displayName); + if (message.error != null && Object.hasOwnProperty.call(message, "error")) + $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); + if (message.recentCutoverJobs != null && message.recentCutoverJobs.length) + for (var i = 0; i < message.recentCutoverJobs.length; ++i) + $root.google.cloud.vmmigration.v1.CutoverJob.encode(message.recentCutoverJobs[i], writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); + if (message.stateTime != null && Object.hasOwnProperty.call(message, "stateTime")) + $root.google.protobuf.Timestamp.encode(message.stateTime, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 23, wireType 0 =*/184).int32(message.state); + if (message.computeEngineTargetDefaults != null && Object.hasOwnProperty.call(message, "computeEngineTargetDefaults")) + $root.google.cloud.vmmigration.v1.ComputeEngineTargetDefaults.encode(message.computeEngineTargetDefaults, writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MigratingVm message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.MigratingVm.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmmigration.v1.MigratingVm + * @static + * @param {google.cloud.vmmigration.v1.IMigratingVm} message MigratingVm message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MigratingVm.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MigratingVm message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmmigration.v1.MigratingVm + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmmigration.v1.MigratingVm} MigratingVm + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MigratingVm.decode = function 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.vmmigration.v1.MigratingVm(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 26: { + message.computeEngineTargetDefaults = $root.google.cloud.vmmigration.v1.ComputeEngineTargetDefaults.decode(reader, reader.uint32()); + break; + } + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.sourceVmId = reader.string(); + break; + } + case 18: { + message.displayName = reader.string(); + break; + } + case 3: { + message.description = reader.string(); + break; + } + case 8: { + message.policy = $root.google.cloud.vmmigration.v1.SchedulePolicy.decode(reader, reader.uint32()); + break; + } + case 9: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 10: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 11: { + message.lastSync = $root.google.cloud.vmmigration.v1.ReplicationSync.decode(reader, reader.uint32()); + break; + } + case 23: { + message.state = reader.int32(); + break; + } + case 22: { + message.stateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 13: { + message.currentSyncInfo = $root.google.cloud.vmmigration.v1.ReplicationCycle.decode(reader, reader.uint32()); + break; + } + case 15: { + message.group = reader.string(); + break; + } + case 16: { + 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 17: { + if (!(message.recentCloneJobs && message.recentCloneJobs.length)) + message.recentCloneJobs = []; + message.recentCloneJobs.push($root.google.cloud.vmmigration.v1.CloneJob.decode(reader, reader.uint32())); + break; + } + case 19: { + message.error = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + } + case 20: { + if (!(message.recentCutoverJobs && message.recentCutoverJobs.length)) + message.recentCutoverJobs = []; + message.recentCutoverJobs.push($root.google.cloud.vmmigration.v1.CutoverJob.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MigratingVm message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmmigration.v1.MigratingVm + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmmigration.v1.MigratingVm} MigratingVm + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MigratingVm.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MigratingVm message. + * @function verify + * @memberof google.cloud.vmmigration.v1.MigratingVm + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MigratingVm.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.computeEngineTargetDefaults != null && message.hasOwnProperty("computeEngineTargetDefaults")) { + properties.targetVmDefaults = 1; + { + var error = $root.google.cloud.vmmigration.v1.ComputeEngineTargetDefaults.verify(message.computeEngineTargetDefaults); + if (error) + return "computeEngineTargetDefaults." + error; + } + } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.sourceVmId != null && message.hasOwnProperty("sourceVmId")) + if (!$util.isString(message.sourceVmId)) + return "sourceVmId: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.policy != null && message.hasOwnProperty("policy")) { + var error = $root.google.cloud.vmmigration.v1.SchedulePolicy.verify(message.policy); + if (error) + return "policy." + error; + } + 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.lastSync != null && message.hasOwnProperty("lastSync")) { + var error = $root.google.cloud.vmmigration.v1.ReplicationSync.verify(message.lastSync); + if (error) + return "lastSync." + error; + } + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + break; + } + if (message.stateTime != null && message.hasOwnProperty("stateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.stateTime); + if (error) + return "stateTime." + error; + } + if (message.currentSyncInfo != null && message.hasOwnProperty("currentSyncInfo")) { + var error = $root.google.cloud.vmmigration.v1.ReplicationCycle.verify(message.currentSyncInfo); + if (error) + return "currentSyncInfo." + error; + } + if (message.group != null && message.hasOwnProperty("group")) + if (!$util.isString(message.group)) + return "group: string expected"; + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.recentCloneJobs != null && message.hasOwnProperty("recentCloneJobs")) { + if (!Array.isArray(message.recentCloneJobs)) + return "recentCloneJobs: array expected"; + for (var i = 0; i < message.recentCloneJobs.length; ++i) { + var error = $root.google.cloud.vmmigration.v1.CloneJob.verify(message.recentCloneJobs[i]); + if (error) + return "recentCloneJobs." + error; + } + } + if (message.error != null && message.hasOwnProperty("error")) { + var error = $root.google.rpc.Status.verify(message.error); + if (error) + return "error." + error; + } + if (message.recentCutoverJobs != null && message.hasOwnProperty("recentCutoverJobs")) { + if (!Array.isArray(message.recentCutoverJobs)) + return "recentCutoverJobs: array expected"; + for (var i = 0; i < message.recentCutoverJobs.length; ++i) { + var error = $root.google.cloud.vmmigration.v1.CutoverJob.verify(message.recentCutoverJobs[i]); + if (error) + return "recentCutoverJobs." + error; + } + } + return null; + }; + + /** + * Creates a MigratingVm message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmmigration.v1.MigratingVm + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmmigration.v1.MigratingVm} MigratingVm + */ + MigratingVm.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmmigration.v1.MigratingVm) + return object; + var message = new $root.google.cloud.vmmigration.v1.MigratingVm(); + if (object.computeEngineTargetDefaults != null) { + if (typeof object.computeEngineTargetDefaults !== "object") + throw TypeError(".google.cloud.vmmigration.v1.MigratingVm.computeEngineTargetDefaults: object expected"); + message.computeEngineTargetDefaults = $root.google.cloud.vmmigration.v1.ComputeEngineTargetDefaults.fromObject(object.computeEngineTargetDefaults); + } + if (object.name != null) + message.name = String(object.name); + if (object.sourceVmId != null) + message.sourceVmId = String(object.sourceVmId); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.description != null) + message.description = String(object.description); + if (object.policy != null) { + if (typeof object.policy !== "object") + throw TypeError(".google.cloud.vmmigration.v1.MigratingVm.policy: object expected"); + message.policy = $root.google.cloud.vmmigration.v1.SchedulePolicy.fromObject(object.policy); + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.vmmigration.v1.MigratingVm.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.vmmigration.v1.MigratingVm.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.lastSync != null) { + if (typeof object.lastSync !== "object") + throw TypeError(".google.cloud.vmmigration.v1.MigratingVm.lastSync: object expected"); + message.lastSync = $root.google.cloud.vmmigration.v1.ReplicationSync.fromObject(object.lastSync); + } + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "PENDING": + case 1: + message.state = 1; + break; + case "READY": + case 2: + message.state = 2; + break; + case "FIRST_SYNC": + case 3: + message.state = 3; + break; + case "ACTIVE": + case 4: + message.state = 4; + break; + case "CUTTING_OVER": + case 7: + message.state = 7; + break; + case "CUTOVER": + case 8: + message.state = 8; + break; + case "FINAL_SYNC": + case 9: + message.state = 9; + break; + case "PAUSED": + case 10: + message.state = 10; + break; + case "FINALIZING": + case 11: + message.state = 11; + break; + case "FINALIZED": + case 12: + message.state = 12; + break; + case "ERROR": + case 13: + message.state = 13; + break; + } + if (object.stateTime != null) { + if (typeof object.stateTime !== "object") + throw TypeError(".google.cloud.vmmigration.v1.MigratingVm.stateTime: object expected"); + message.stateTime = $root.google.protobuf.Timestamp.fromObject(object.stateTime); + } + if (object.currentSyncInfo != null) { + if (typeof object.currentSyncInfo !== "object") + throw TypeError(".google.cloud.vmmigration.v1.MigratingVm.currentSyncInfo: object expected"); + message.currentSyncInfo = $root.google.cloud.vmmigration.v1.ReplicationCycle.fromObject(object.currentSyncInfo); + } + if (object.group != null) + message.group = String(object.group); + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.vmmigration.v1.MigratingVm.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.recentCloneJobs) { + if (!Array.isArray(object.recentCloneJobs)) + throw TypeError(".google.cloud.vmmigration.v1.MigratingVm.recentCloneJobs: array expected"); + message.recentCloneJobs = []; + for (var i = 0; i < object.recentCloneJobs.length; ++i) { + if (typeof object.recentCloneJobs[i] !== "object") + throw TypeError(".google.cloud.vmmigration.v1.MigratingVm.recentCloneJobs: object expected"); + message.recentCloneJobs[i] = $root.google.cloud.vmmigration.v1.CloneJob.fromObject(object.recentCloneJobs[i]); + } + } + if (object.error != null) { + if (typeof object.error !== "object") + throw TypeError(".google.cloud.vmmigration.v1.MigratingVm.error: object expected"); + message.error = $root.google.rpc.Status.fromObject(object.error); + } + if (object.recentCutoverJobs) { + if (!Array.isArray(object.recentCutoverJobs)) + throw TypeError(".google.cloud.vmmigration.v1.MigratingVm.recentCutoverJobs: array expected"); + message.recentCutoverJobs = []; + for (var i = 0; i < object.recentCutoverJobs.length; ++i) { + if (typeof object.recentCutoverJobs[i] !== "object") + throw TypeError(".google.cloud.vmmigration.v1.MigratingVm.recentCutoverJobs: object expected"); + message.recentCutoverJobs[i] = $root.google.cloud.vmmigration.v1.CutoverJob.fromObject(object.recentCutoverJobs[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a MigratingVm message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmmigration.v1.MigratingVm + * @static + * @param {google.cloud.vmmigration.v1.MigratingVm} message MigratingVm + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MigratingVm.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.recentCloneJobs = []; + object.recentCutoverJobs = []; + } + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.sourceVmId = ""; + object.description = ""; + object.policy = null; + object.createTime = null; + object.updateTime = null; + object.lastSync = null; + object.currentSyncInfo = null; + object.group = ""; + object.displayName = ""; + object.error = null; + object.stateTime = null; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.sourceVmId != null && message.hasOwnProperty("sourceVmId")) + object.sourceVmId = message.sourceVmId; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.policy != null && message.hasOwnProperty("policy")) + object.policy = $root.google.cloud.vmmigration.v1.SchedulePolicy.toObject(message.policy, options); + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.lastSync != null && message.hasOwnProperty("lastSync")) + object.lastSync = $root.google.cloud.vmmigration.v1.ReplicationSync.toObject(message.lastSync, options); + if (message.currentSyncInfo != null && message.hasOwnProperty("currentSyncInfo")) + object.currentSyncInfo = $root.google.cloud.vmmigration.v1.ReplicationCycle.toObject(message.currentSyncInfo, options); + if (message.group != null && message.hasOwnProperty("group")) + object.group = message.group; + 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.recentCloneJobs && message.recentCloneJobs.length) { + object.recentCloneJobs = []; + for (var j = 0; j < message.recentCloneJobs.length; ++j) + object.recentCloneJobs[j] = $root.google.cloud.vmmigration.v1.CloneJob.toObject(message.recentCloneJobs[j], options); + } + 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.recentCutoverJobs && message.recentCutoverJobs.length) { + object.recentCutoverJobs = []; + for (var j = 0; j < message.recentCutoverJobs.length; ++j) + object.recentCutoverJobs[j] = $root.google.cloud.vmmigration.v1.CutoverJob.toObject(message.recentCutoverJobs[j], options); + } + if (message.stateTime != null && message.hasOwnProperty("stateTime")) + object.stateTime = $root.google.protobuf.Timestamp.toObject(message.stateTime, options); + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.vmmigration.v1.MigratingVm.State[message.state] === undefined ? message.state : $root.google.cloud.vmmigration.v1.MigratingVm.State[message.state] : message.state; + if (message.computeEngineTargetDefaults != null && message.hasOwnProperty("computeEngineTargetDefaults")) { + object.computeEngineTargetDefaults = $root.google.cloud.vmmigration.v1.ComputeEngineTargetDefaults.toObject(message.computeEngineTargetDefaults, options); + if (options.oneofs) + object.targetVmDefaults = "computeEngineTargetDefaults"; + } + return object; + }; + + /** + * Converts this MigratingVm to JSON. + * @function toJSON + * @memberof google.cloud.vmmigration.v1.MigratingVm + * @instance + * @returns {Object.} JSON object + */ + MigratingVm.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MigratingVm + * @function getTypeUrl + * @memberof google.cloud.vmmigration.v1.MigratingVm + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MigratingVm.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmmigration.v1.MigratingVm"; + }; + + /** + * State enum. + * @name google.cloud.vmmigration.v1.MigratingVm.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} PENDING=1 PENDING value + * @property {number} READY=2 READY value + * @property {number} FIRST_SYNC=3 FIRST_SYNC value + * @property {number} ACTIVE=4 ACTIVE value + * @property {number} CUTTING_OVER=7 CUTTING_OVER value + * @property {number} CUTOVER=8 CUTOVER value + * @property {number} FINAL_SYNC=9 FINAL_SYNC value + * @property {number} PAUSED=10 PAUSED value + * @property {number} FINALIZING=11 FINALIZING value + * @property {number} FINALIZED=12 FINALIZED value + * @property {number} ERROR=13 ERROR value + */ + MigratingVm.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "PENDING"] = 1; + values[valuesById[2] = "READY"] = 2; + values[valuesById[3] = "FIRST_SYNC"] = 3; + values[valuesById[4] = "ACTIVE"] = 4; + values[valuesById[7] = "CUTTING_OVER"] = 7; + values[valuesById[8] = "CUTOVER"] = 8; + values[valuesById[9] = "FINAL_SYNC"] = 9; + values[valuesById[10] = "PAUSED"] = 10; + values[valuesById[11] = "FINALIZING"] = 11; + values[valuesById[12] = "FINALIZED"] = 12; + values[valuesById[13] = "ERROR"] = 13; + return values; + })(); + + return MigratingVm; + })(); + + v1.CloneJob = (function() { + + /** + * Properties of a CloneJob. + * @memberof google.cloud.vmmigration.v1 + * @interface ICloneJob + * @property {google.cloud.vmmigration.v1.IComputeEngineTargetDetails|null} [computeEngineTargetDetails] CloneJob computeEngineTargetDetails + * @property {google.protobuf.ITimestamp|null} [createTime] CloneJob createTime + * @property {google.protobuf.ITimestamp|null} [endTime] CloneJob endTime + * @property {string|null} [name] CloneJob name + * @property {google.cloud.vmmigration.v1.CloneJob.State|null} [state] CloneJob state + * @property {google.protobuf.ITimestamp|null} [stateTime] CloneJob stateTime + * @property {google.rpc.IStatus|null} [error] CloneJob error + */ + + /** + * Constructs a new CloneJob. + * @memberof google.cloud.vmmigration.v1 + * @classdesc Represents a CloneJob. + * @implements ICloneJob + * @constructor + * @param {google.cloud.vmmigration.v1.ICloneJob=} [properties] Properties to set + */ + function CloneJob(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CloneJob computeEngineTargetDetails. + * @member {google.cloud.vmmigration.v1.IComputeEngineTargetDetails|null|undefined} computeEngineTargetDetails + * @memberof google.cloud.vmmigration.v1.CloneJob + * @instance + */ + CloneJob.prototype.computeEngineTargetDetails = null; + + /** + * CloneJob createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.vmmigration.v1.CloneJob + * @instance + */ + CloneJob.prototype.createTime = null; + + /** + * CloneJob endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.vmmigration.v1.CloneJob + * @instance + */ + CloneJob.prototype.endTime = null; + + /** + * CloneJob name. + * @member {string} name + * @memberof google.cloud.vmmigration.v1.CloneJob + * @instance + */ + CloneJob.prototype.name = ""; + + /** + * CloneJob state. + * @member {google.cloud.vmmigration.v1.CloneJob.State} state + * @memberof google.cloud.vmmigration.v1.CloneJob + * @instance + */ + CloneJob.prototype.state = 0; + + /** + * CloneJob stateTime. + * @member {google.protobuf.ITimestamp|null|undefined} stateTime + * @memberof google.cloud.vmmigration.v1.CloneJob + * @instance + */ + CloneJob.prototype.stateTime = null; + + /** + * CloneJob error. + * @member {google.rpc.IStatus|null|undefined} error + * @memberof google.cloud.vmmigration.v1.CloneJob + * @instance + */ + CloneJob.prototype.error = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * CloneJob targetVmDetails. + * @member {"computeEngineTargetDetails"|undefined} targetVmDetails + * @memberof google.cloud.vmmigration.v1.CloneJob + * @instance + */ + Object.defineProperty(CloneJob.prototype, "targetVmDetails", { + get: $util.oneOfGetter($oneOfFields = ["computeEngineTargetDetails"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new CloneJob instance using the specified properties. + * @function create + * @memberof google.cloud.vmmigration.v1.CloneJob + * @static + * @param {google.cloud.vmmigration.v1.ICloneJob=} [properties] Properties to set + * @returns {google.cloud.vmmigration.v1.CloneJob} CloneJob instance + */ + CloneJob.create = function create(properties) { + return new CloneJob(properties); + }; + + /** + * Encodes the specified CloneJob message. Does not implicitly {@link google.cloud.vmmigration.v1.CloneJob.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmmigration.v1.CloneJob + * @static + * @param {google.cloud.vmmigration.v1.ICloneJob} message CloneJob message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloneJob.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.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.name); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 12, wireType 0 =*/96).int32(message.state); + if (message.stateTime != null && Object.hasOwnProperty.call(message, "stateTime")) + $root.google.protobuf.Timestamp.encode(message.stateTime, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + if (message.error != null && Object.hasOwnProperty.call(message, "error")) + $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); + if (message.computeEngineTargetDetails != null && Object.hasOwnProperty.call(message, "computeEngineTargetDetails")) + $root.google.cloud.vmmigration.v1.ComputeEngineTargetDetails.encode(message.computeEngineTargetDetails, writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CloneJob message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.CloneJob.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmmigration.v1.CloneJob + * @static + * @param {google.cloud.vmmigration.v1.ICloneJob} message CloneJob message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloneJob.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CloneJob message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmmigration.v1.CloneJob + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmmigration.v1.CloneJob} CloneJob + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloneJob.decode = function 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.vmmigration.v1.CloneJob(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 20: { + message.computeEngineTargetDetails = $root.google.cloud.vmmigration.v1.ComputeEngineTargetDetails.decode(reader, reader.uint32()); + break; + } + case 1: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 22: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.name = reader.string(); + break; + } + case 12: { + message.state = reader.int32(); + break; + } + case 14: { + message.stateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 17: { + message.error = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CloneJob message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmmigration.v1.CloneJob + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmmigration.v1.CloneJob} CloneJob + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloneJob.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CloneJob message. + * @function verify + * @memberof google.cloud.vmmigration.v1.CloneJob + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CloneJob.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.computeEngineTargetDetails != null && message.hasOwnProperty("computeEngineTargetDetails")) { + properties.targetVmDetails = 1; + { + var error = $root.google.cloud.vmmigration.v1.ComputeEngineTargetDetails.verify(message.computeEngineTargetDetails); + if (error) + return "computeEngineTargetDetails." + error; + } + } + 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.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: 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.stateTime != null && message.hasOwnProperty("stateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.stateTime); + if (error) + return "stateTime." + error; + } + if (message.error != null && message.hasOwnProperty("error")) { + var error = $root.google.rpc.Status.verify(message.error); + if (error) + return "error." + error; + } + return null; + }; + + /** + * Creates a CloneJob message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmmigration.v1.CloneJob + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmmigration.v1.CloneJob} CloneJob + */ + CloneJob.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmmigration.v1.CloneJob) + return object; + var message = new $root.google.cloud.vmmigration.v1.CloneJob(); + if (object.computeEngineTargetDetails != null) { + if (typeof object.computeEngineTargetDetails !== "object") + throw TypeError(".google.cloud.vmmigration.v1.CloneJob.computeEngineTargetDetails: object expected"); + message.computeEngineTargetDetails = $root.google.cloud.vmmigration.v1.ComputeEngineTargetDetails.fromObject(object.computeEngineTargetDetails); + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.vmmigration.v1.CloneJob.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.vmmigration.v1.CloneJob.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + if (object.name != null) + message.name = String(object.name); + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "PENDING": + case 1: + message.state = 1; + break; + case "ACTIVE": + case 2: + message.state = 2; + break; + case "FAILED": + case 3: + message.state = 3; + break; + case "SUCCEEDED": + case 4: + message.state = 4; + break; + case "CANCELLED": + case 5: + message.state = 5; + break; + case "CANCELLING": + case 6: + message.state = 6; + break; + case "ADAPTING_OS": + case 7: + message.state = 7; + break; + } + if (object.stateTime != null) { + if (typeof object.stateTime !== "object") + throw TypeError(".google.cloud.vmmigration.v1.CloneJob.stateTime: object expected"); + message.stateTime = $root.google.protobuf.Timestamp.fromObject(object.stateTime); + } + if (object.error != null) { + if (typeof object.error !== "object") + throw TypeError(".google.cloud.vmmigration.v1.CloneJob.error: object expected"); + message.error = $root.google.rpc.Status.fromObject(object.error); + } + return message; + }; + + /** + * Creates a plain object from a CloneJob message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmmigration.v1.CloneJob + * @static + * @param {google.cloud.vmmigration.v1.CloneJob} message CloneJob + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CloneJob.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.createTime = null; + object.name = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.stateTime = null; + object.error = null; + object.endTime = null; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.vmmigration.v1.CloneJob.State[message.state] === undefined ? message.state : $root.google.cloud.vmmigration.v1.CloneJob.State[message.state] : message.state; + if (message.stateTime != null && message.hasOwnProperty("stateTime")) + object.stateTime = $root.google.protobuf.Timestamp.toObject(message.stateTime, options); + if (message.error != null && message.hasOwnProperty("error")) + object.error = $root.google.rpc.Status.toObject(message.error, options); + if (message.computeEngineTargetDetails != null && message.hasOwnProperty("computeEngineTargetDetails")) { + object.computeEngineTargetDetails = $root.google.cloud.vmmigration.v1.ComputeEngineTargetDetails.toObject(message.computeEngineTargetDetails, options); + if (options.oneofs) + object.targetVmDetails = "computeEngineTargetDetails"; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + return object; + }; + + /** + * Converts this CloneJob to JSON. + * @function toJSON + * @memberof google.cloud.vmmigration.v1.CloneJob + * @instance + * @returns {Object.} JSON object + */ + CloneJob.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CloneJob + * @function getTypeUrl + * @memberof google.cloud.vmmigration.v1.CloneJob + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CloneJob.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmmigration.v1.CloneJob"; + }; + + /** + * State enum. + * @name google.cloud.vmmigration.v1.CloneJob.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} PENDING=1 PENDING value + * @property {number} ACTIVE=2 ACTIVE value + * @property {number} FAILED=3 FAILED value + * @property {number} SUCCEEDED=4 SUCCEEDED value + * @property {number} CANCELLED=5 CANCELLED value + * @property {number} CANCELLING=6 CANCELLING value + * @property {number} ADAPTING_OS=7 ADAPTING_OS value + */ + CloneJob.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "PENDING"] = 1; + values[valuesById[2] = "ACTIVE"] = 2; + values[valuesById[3] = "FAILED"] = 3; + values[valuesById[4] = "SUCCEEDED"] = 4; + values[valuesById[5] = "CANCELLED"] = 5; + values[valuesById[6] = "CANCELLING"] = 6; + values[valuesById[7] = "ADAPTING_OS"] = 7; + return values; + })(); + + return CloneJob; + })(); + + v1.CutoverJob = (function() { + + /** + * Properties of a CutoverJob. + * @memberof google.cloud.vmmigration.v1 + * @interface ICutoverJob + * @property {google.cloud.vmmigration.v1.IComputeEngineTargetDetails|null} [computeEngineTargetDetails] CutoverJob computeEngineTargetDetails + * @property {google.protobuf.ITimestamp|null} [createTime] CutoverJob createTime + * @property {google.protobuf.ITimestamp|null} [endTime] CutoverJob endTime + * @property {string|null} [name] CutoverJob name + * @property {google.cloud.vmmigration.v1.CutoverJob.State|null} [state] CutoverJob state + * @property {google.protobuf.ITimestamp|null} [stateTime] CutoverJob stateTime + * @property {number|null} [progressPercent] CutoverJob progressPercent + * @property {google.rpc.IStatus|null} [error] CutoverJob error + * @property {string|null} [stateMessage] CutoverJob stateMessage + */ + + /** + * Constructs a new CutoverJob. + * @memberof google.cloud.vmmigration.v1 + * @classdesc Represents a CutoverJob. + * @implements ICutoverJob + * @constructor + * @param {google.cloud.vmmigration.v1.ICutoverJob=} [properties] Properties to set + */ + function CutoverJob(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CutoverJob computeEngineTargetDetails. + * @member {google.cloud.vmmigration.v1.IComputeEngineTargetDetails|null|undefined} computeEngineTargetDetails + * @memberof google.cloud.vmmigration.v1.CutoverJob + * @instance + */ + CutoverJob.prototype.computeEngineTargetDetails = null; + + /** + * CutoverJob createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.vmmigration.v1.CutoverJob + * @instance + */ + CutoverJob.prototype.createTime = null; + + /** + * CutoverJob endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.vmmigration.v1.CutoverJob + * @instance + */ + CutoverJob.prototype.endTime = null; + + /** + * CutoverJob name. + * @member {string} name + * @memberof google.cloud.vmmigration.v1.CutoverJob + * @instance + */ + CutoverJob.prototype.name = ""; + + /** + * CutoverJob state. + * @member {google.cloud.vmmigration.v1.CutoverJob.State} state + * @memberof google.cloud.vmmigration.v1.CutoverJob + * @instance + */ + CutoverJob.prototype.state = 0; + + /** + * CutoverJob stateTime. + * @member {google.protobuf.ITimestamp|null|undefined} stateTime + * @memberof google.cloud.vmmigration.v1.CutoverJob + * @instance + */ + CutoverJob.prototype.stateTime = null; + + /** + * CutoverJob progressPercent. + * @member {number} progressPercent + * @memberof google.cloud.vmmigration.v1.CutoverJob + * @instance + */ + CutoverJob.prototype.progressPercent = 0; + + /** + * CutoverJob error. + * @member {google.rpc.IStatus|null|undefined} error + * @memberof google.cloud.vmmigration.v1.CutoverJob + * @instance + */ + CutoverJob.prototype.error = null; + + /** + * CutoverJob stateMessage. + * @member {string} stateMessage + * @memberof google.cloud.vmmigration.v1.CutoverJob + * @instance + */ + CutoverJob.prototype.stateMessage = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * CutoverJob targetVmDetails. + * @member {"computeEngineTargetDetails"|undefined} targetVmDetails + * @memberof google.cloud.vmmigration.v1.CutoverJob + * @instance + */ + Object.defineProperty(CutoverJob.prototype, "targetVmDetails", { + get: $util.oneOfGetter($oneOfFields = ["computeEngineTargetDetails"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new CutoverJob instance using the specified properties. + * @function create + * @memberof google.cloud.vmmigration.v1.CutoverJob + * @static + * @param {google.cloud.vmmigration.v1.ICutoverJob=} [properties] Properties to set + * @returns {google.cloud.vmmigration.v1.CutoverJob} CutoverJob instance + */ + CutoverJob.create = function create(properties) { + return new CutoverJob(properties); + }; + + /** + * Encodes the specified CutoverJob message. Does not implicitly {@link google.cloud.vmmigration.v1.CutoverJob.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmmigration.v1.CutoverJob + * @static + * @param {google.cloud.vmmigration.v1.ICutoverJob} message CutoverJob message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CutoverJob.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.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.name); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.state); + if (message.stateTime != null && Object.hasOwnProperty.call(message, "stateTime")) + $root.google.protobuf.Timestamp.encode(message.stateTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.error != null && Object.hasOwnProperty.call(message, "error")) + $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.stateMessage != null && Object.hasOwnProperty.call(message, "stateMessage")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.stateMessage); + if (message.progressPercent != null && Object.hasOwnProperty.call(message, "progressPercent")) + writer.uint32(/* id 13, wireType 0 =*/104).int32(message.progressPercent); + if (message.computeEngineTargetDetails != null && Object.hasOwnProperty.call(message, "computeEngineTargetDetails")) + $root.google.cloud.vmmigration.v1.ComputeEngineTargetDetails.encode(message.computeEngineTargetDetails, writer.uint32(/* id 14, wireType 2 =*/114).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(); + return writer; + }; + + /** + * Encodes the specified CutoverJob message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.CutoverJob.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmmigration.v1.CutoverJob + * @static + * @param {google.cloud.vmmigration.v1.ICutoverJob} message CutoverJob message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CutoverJob.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CutoverJob message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmmigration.v1.CutoverJob + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmmigration.v1.CutoverJob} CutoverJob + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CutoverJob.decode = function 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.vmmigration.v1.CutoverJob(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 14: { + message.computeEngineTargetDetails = $root.google.cloud.vmmigration.v1.ComputeEngineTargetDetails.decode(reader, reader.uint32()); + break; + } + case 1: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 16: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.name = reader.string(); + break; + } + case 5: { + message.state = reader.int32(); + break; + } + case 6: { + message.stateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 13: { + message.progressPercent = reader.int32(); + break; + } + case 9: { + message.error = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + } + case 10: { + message.stateMessage = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CutoverJob message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmmigration.v1.CutoverJob + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmmigration.v1.CutoverJob} CutoverJob + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CutoverJob.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CutoverJob message. + * @function verify + * @memberof google.cloud.vmmigration.v1.CutoverJob + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CutoverJob.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.computeEngineTargetDetails != null && message.hasOwnProperty("computeEngineTargetDetails")) { + properties.targetVmDetails = 1; + { + var error = $root.google.cloud.vmmigration.v1.ComputeEngineTargetDetails.verify(message.computeEngineTargetDetails); + if (error) + return "computeEngineTargetDetails." + error; + } + } + 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.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: 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.stateTime != null && message.hasOwnProperty("stateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.stateTime); + if (error) + return "stateTime." + error; + } + if (message.progressPercent != null && message.hasOwnProperty("progressPercent")) + if (!$util.isInteger(message.progressPercent)) + return "progressPercent: integer expected"; + if (message.error != null && message.hasOwnProperty("error")) { + var error = $root.google.rpc.Status.verify(message.error); + if (error) + return "error." + error; + } + if (message.stateMessage != null && message.hasOwnProperty("stateMessage")) + if (!$util.isString(message.stateMessage)) + return "stateMessage: string expected"; + return null; + }; + + /** + * Creates a CutoverJob message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmmigration.v1.CutoverJob + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmmigration.v1.CutoverJob} CutoverJob + */ + CutoverJob.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmmigration.v1.CutoverJob) + return object; + var message = new $root.google.cloud.vmmigration.v1.CutoverJob(); + if (object.computeEngineTargetDetails != null) { + if (typeof object.computeEngineTargetDetails !== "object") + throw TypeError(".google.cloud.vmmigration.v1.CutoverJob.computeEngineTargetDetails: object expected"); + message.computeEngineTargetDetails = $root.google.cloud.vmmigration.v1.ComputeEngineTargetDetails.fromObject(object.computeEngineTargetDetails); + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.vmmigration.v1.CutoverJob.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.vmmigration.v1.CutoverJob.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + if (object.name != null) + message.name = String(object.name); + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "PENDING": + case 1: + message.state = 1; + break; + case "FAILED": + case 2: + message.state = 2; + break; + case "SUCCEEDED": + case 3: + message.state = 3; + break; + case "CANCELLED": + case 4: + message.state = 4; + break; + case "CANCELLING": + case 5: + message.state = 5; + break; + case "ACTIVE": + case 6: + message.state = 6; + break; + case "ADAPTING_OS": + case 7: + message.state = 7; + break; + } + if (object.stateTime != null) { + if (typeof object.stateTime !== "object") + throw TypeError(".google.cloud.vmmigration.v1.CutoverJob.stateTime: object expected"); + message.stateTime = $root.google.protobuf.Timestamp.fromObject(object.stateTime); + } + if (object.progressPercent != null) + message.progressPercent = object.progressPercent | 0; + if (object.error != null) { + if (typeof object.error !== "object") + throw TypeError(".google.cloud.vmmigration.v1.CutoverJob.error: object expected"); + message.error = $root.google.rpc.Status.fromObject(object.error); + } + if (object.stateMessage != null) + message.stateMessage = String(object.stateMessage); + return message; + }; + + /** + * Creates a plain object from a CutoverJob message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmmigration.v1.CutoverJob + * @static + * @param {google.cloud.vmmigration.v1.CutoverJob} message CutoverJob + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CutoverJob.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.createTime = null; + object.name = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.stateTime = null; + object.error = null; + object.stateMessage = ""; + object.progressPercent = 0; + object.endTime = null; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.vmmigration.v1.CutoverJob.State[message.state] === undefined ? message.state : $root.google.cloud.vmmigration.v1.CutoverJob.State[message.state] : message.state; + if (message.stateTime != null && message.hasOwnProperty("stateTime")) + object.stateTime = $root.google.protobuf.Timestamp.toObject(message.stateTime, options); + if (message.error != null && message.hasOwnProperty("error")) + object.error = $root.google.rpc.Status.toObject(message.error, options); + if (message.stateMessage != null && message.hasOwnProperty("stateMessage")) + object.stateMessage = message.stateMessage; + if (message.progressPercent != null && message.hasOwnProperty("progressPercent")) + object.progressPercent = message.progressPercent; + if (message.computeEngineTargetDetails != null && message.hasOwnProperty("computeEngineTargetDetails")) { + object.computeEngineTargetDetails = $root.google.cloud.vmmigration.v1.ComputeEngineTargetDetails.toObject(message.computeEngineTargetDetails, options); + if (options.oneofs) + object.targetVmDetails = "computeEngineTargetDetails"; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + return object; + }; + + /** + * Converts this CutoverJob to JSON. + * @function toJSON + * @memberof google.cloud.vmmigration.v1.CutoverJob + * @instance + * @returns {Object.} JSON object + */ + CutoverJob.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CutoverJob + * @function getTypeUrl + * @memberof google.cloud.vmmigration.v1.CutoverJob + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CutoverJob.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmmigration.v1.CutoverJob"; + }; + + /** + * State enum. + * @name google.cloud.vmmigration.v1.CutoverJob.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} PENDING=1 PENDING value + * @property {number} FAILED=2 FAILED value + * @property {number} SUCCEEDED=3 SUCCEEDED value + * @property {number} CANCELLED=4 CANCELLED value + * @property {number} CANCELLING=5 CANCELLING value + * @property {number} ACTIVE=6 ACTIVE value + * @property {number} ADAPTING_OS=7 ADAPTING_OS value + */ + CutoverJob.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "PENDING"] = 1; + values[valuesById[2] = "FAILED"] = 2; + values[valuesById[3] = "SUCCEEDED"] = 3; + values[valuesById[4] = "CANCELLED"] = 4; + values[valuesById[5] = "CANCELLING"] = 5; + values[valuesById[6] = "ACTIVE"] = 6; + values[valuesById[7] = "ADAPTING_OS"] = 7; + return values; + })(); + + return CutoverJob; + })(); + + v1.CreateCloneJobRequest = (function() { + + /** + * Properties of a CreateCloneJobRequest. + * @memberof google.cloud.vmmigration.v1 + * @interface ICreateCloneJobRequest + * @property {string|null} [parent] CreateCloneJobRequest parent + * @property {string|null} [cloneJobId] CreateCloneJobRequest cloneJobId + * @property {google.cloud.vmmigration.v1.ICloneJob|null} [cloneJob] CreateCloneJobRequest cloneJob + * @property {string|null} [requestId] CreateCloneJobRequest requestId + */ + + /** + * Constructs a new CreateCloneJobRequest. + * @memberof google.cloud.vmmigration.v1 + * @classdesc Represents a CreateCloneJobRequest. + * @implements ICreateCloneJobRequest + * @constructor + * @param {google.cloud.vmmigration.v1.ICreateCloneJobRequest=} [properties] Properties to set + */ + function CreateCloneJobRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateCloneJobRequest parent. + * @member {string} parent + * @memberof google.cloud.vmmigration.v1.CreateCloneJobRequest + * @instance + */ + CreateCloneJobRequest.prototype.parent = ""; + + /** + * CreateCloneJobRequest cloneJobId. + * @member {string} cloneJobId + * @memberof google.cloud.vmmigration.v1.CreateCloneJobRequest + * @instance + */ + CreateCloneJobRequest.prototype.cloneJobId = ""; + + /** + * CreateCloneJobRequest cloneJob. + * @member {google.cloud.vmmigration.v1.ICloneJob|null|undefined} cloneJob + * @memberof google.cloud.vmmigration.v1.CreateCloneJobRequest + * @instance + */ + CreateCloneJobRequest.prototype.cloneJob = null; + + /** + * CreateCloneJobRequest requestId. + * @member {string} requestId + * @memberof google.cloud.vmmigration.v1.CreateCloneJobRequest + * @instance + */ + CreateCloneJobRequest.prototype.requestId = ""; + + /** + * Creates a new CreateCloneJobRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vmmigration.v1.CreateCloneJobRequest + * @static + * @param {google.cloud.vmmigration.v1.ICreateCloneJobRequest=} [properties] Properties to set + * @returns {google.cloud.vmmigration.v1.CreateCloneJobRequest} CreateCloneJobRequest instance + */ + CreateCloneJobRequest.create = function create(properties) { + return new CreateCloneJobRequest(properties); + }; + + /** + * Encodes the specified CreateCloneJobRequest message. Does not implicitly {@link google.cloud.vmmigration.v1.CreateCloneJobRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmmigration.v1.CreateCloneJobRequest + * @static + * @param {google.cloud.vmmigration.v1.ICreateCloneJobRequest} message CreateCloneJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateCloneJobRequest.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.cloneJobId != null && Object.hasOwnProperty.call(message, "cloneJobId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.cloneJobId); + if (message.cloneJob != null && Object.hasOwnProperty.call(message, "cloneJob")) + $root.google.cloud.vmmigration.v1.CloneJob.encode(message.cloneJob, 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 CreateCloneJobRequest message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.CreateCloneJobRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmmigration.v1.CreateCloneJobRequest + * @static + * @param {google.cloud.vmmigration.v1.ICreateCloneJobRequest} message CreateCloneJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateCloneJobRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateCloneJobRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmmigration.v1.CreateCloneJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmmigration.v1.CreateCloneJobRequest} CreateCloneJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateCloneJobRequest.decode = function 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.vmmigration.v1.CreateCloneJobRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.cloneJobId = reader.string(); + break; + } + case 3: { + message.cloneJob = $root.google.cloud.vmmigration.v1.CloneJob.decode(reader, reader.uint32()); + break; + } + case 4: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateCloneJobRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmmigration.v1.CreateCloneJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmmigration.v1.CreateCloneJobRequest} CreateCloneJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateCloneJobRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateCloneJobRequest message. + * @function verify + * @memberof google.cloud.vmmigration.v1.CreateCloneJobRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateCloneJobRequest.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.cloneJobId != null && message.hasOwnProperty("cloneJobId")) + if (!$util.isString(message.cloneJobId)) + return "cloneJobId: string expected"; + if (message.cloneJob != null && message.hasOwnProperty("cloneJob")) { + var error = $root.google.cloud.vmmigration.v1.CloneJob.verify(message.cloneJob); + if (error) + return "cloneJob." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a CreateCloneJobRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmmigration.v1.CreateCloneJobRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmmigration.v1.CreateCloneJobRequest} CreateCloneJobRequest + */ + CreateCloneJobRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmmigration.v1.CreateCloneJobRequest) + return object; + var message = new $root.google.cloud.vmmigration.v1.CreateCloneJobRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.cloneJobId != null) + message.cloneJobId = String(object.cloneJobId); + if (object.cloneJob != null) { + if (typeof object.cloneJob !== "object") + throw TypeError(".google.cloud.vmmigration.v1.CreateCloneJobRequest.cloneJob: object expected"); + message.cloneJob = $root.google.cloud.vmmigration.v1.CloneJob.fromObject(object.cloneJob); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a CreateCloneJobRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmmigration.v1.CreateCloneJobRequest + * @static + * @param {google.cloud.vmmigration.v1.CreateCloneJobRequest} message CreateCloneJobRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateCloneJobRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.cloneJobId = ""; + object.cloneJob = null; + object.requestId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.cloneJobId != null && message.hasOwnProperty("cloneJobId")) + object.cloneJobId = message.cloneJobId; + if (message.cloneJob != null && message.hasOwnProperty("cloneJob")) + object.cloneJob = $root.google.cloud.vmmigration.v1.CloneJob.toObject(message.cloneJob, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this CreateCloneJobRequest to JSON. + * @function toJSON + * @memberof google.cloud.vmmigration.v1.CreateCloneJobRequest + * @instance + * @returns {Object.} JSON object + */ + CreateCloneJobRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateCloneJobRequest + * @function getTypeUrl + * @memberof google.cloud.vmmigration.v1.CreateCloneJobRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateCloneJobRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmmigration.v1.CreateCloneJobRequest"; + }; + + return CreateCloneJobRequest; + })(); + + v1.CancelCloneJobRequest = (function() { + + /** + * Properties of a CancelCloneJobRequest. + * @memberof google.cloud.vmmigration.v1 + * @interface ICancelCloneJobRequest + * @property {string|null} [name] CancelCloneJobRequest name + */ + + /** + * Constructs a new CancelCloneJobRequest. + * @memberof google.cloud.vmmigration.v1 + * @classdesc Represents a CancelCloneJobRequest. + * @implements ICancelCloneJobRequest + * @constructor + * @param {google.cloud.vmmigration.v1.ICancelCloneJobRequest=} [properties] Properties to set + */ + function CancelCloneJobRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CancelCloneJobRequest name. + * @member {string} name + * @memberof google.cloud.vmmigration.v1.CancelCloneJobRequest + * @instance + */ + CancelCloneJobRequest.prototype.name = ""; + + /** + * Creates a new CancelCloneJobRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vmmigration.v1.CancelCloneJobRequest + * @static + * @param {google.cloud.vmmigration.v1.ICancelCloneJobRequest=} [properties] Properties to set + * @returns {google.cloud.vmmigration.v1.CancelCloneJobRequest} CancelCloneJobRequest instance + */ + CancelCloneJobRequest.create = function create(properties) { + return new CancelCloneJobRequest(properties); + }; + + /** + * Encodes the specified CancelCloneJobRequest message. Does not implicitly {@link google.cloud.vmmigration.v1.CancelCloneJobRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmmigration.v1.CancelCloneJobRequest + * @static + * @param {google.cloud.vmmigration.v1.ICancelCloneJobRequest} message CancelCloneJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CancelCloneJobRequest.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 CancelCloneJobRequest message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.CancelCloneJobRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmmigration.v1.CancelCloneJobRequest + * @static + * @param {google.cloud.vmmigration.v1.ICancelCloneJobRequest} message CancelCloneJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CancelCloneJobRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CancelCloneJobRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmmigration.v1.CancelCloneJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmmigration.v1.CancelCloneJobRequest} CancelCloneJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CancelCloneJobRequest.decode = function 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.vmmigration.v1.CancelCloneJobRequest(); + 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 CancelCloneJobRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmmigration.v1.CancelCloneJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmmigration.v1.CancelCloneJobRequest} CancelCloneJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CancelCloneJobRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CancelCloneJobRequest message. + * @function verify + * @memberof google.cloud.vmmigration.v1.CancelCloneJobRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CancelCloneJobRequest.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 CancelCloneJobRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmmigration.v1.CancelCloneJobRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmmigration.v1.CancelCloneJobRequest} CancelCloneJobRequest + */ + CancelCloneJobRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmmigration.v1.CancelCloneJobRequest) + return object; + var message = new $root.google.cloud.vmmigration.v1.CancelCloneJobRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a CancelCloneJobRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmmigration.v1.CancelCloneJobRequest + * @static + * @param {google.cloud.vmmigration.v1.CancelCloneJobRequest} message CancelCloneJobRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CancelCloneJobRequest.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 CancelCloneJobRequest to JSON. + * @function toJSON + * @memberof google.cloud.vmmigration.v1.CancelCloneJobRequest + * @instance + * @returns {Object.} JSON object + */ + CancelCloneJobRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CancelCloneJobRequest + * @function getTypeUrl + * @memberof google.cloud.vmmigration.v1.CancelCloneJobRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CancelCloneJobRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmmigration.v1.CancelCloneJobRequest"; + }; + + return CancelCloneJobRequest; + })(); + + v1.CancelCloneJobResponse = (function() { + + /** + * Properties of a CancelCloneJobResponse. + * @memberof google.cloud.vmmigration.v1 + * @interface ICancelCloneJobResponse + */ + + /** + * Constructs a new CancelCloneJobResponse. + * @memberof google.cloud.vmmigration.v1 + * @classdesc Represents a CancelCloneJobResponse. + * @implements ICancelCloneJobResponse + * @constructor + * @param {google.cloud.vmmigration.v1.ICancelCloneJobResponse=} [properties] Properties to set + */ + function CancelCloneJobResponse(properties) { + if (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 CancelCloneJobResponse instance using the specified properties. + * @function create + * @memberof google.cloud.vmmigration.v1.CancelCloneJobResponse + * @static + * @param {google.cloud.vmmigration.v1.ICancelCloneJobResponse=} [properties] Properties to set + * @returns {google.cloud.vmmigration.v1.CancelCloneJobResponse} CancelCloneJobResponse instance + */ + CancelCloneJobResponse.create = function create(properties) { + return new CancelCloneJobResponse(properties); + }; + + /** + * Encodes the specified CancelCloneJobResponse message. Does not implicitly {@link google.cloud.vmmigration.v1.CancelCloneJobResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmmigration.v1.CancelCloneJobResponse + * @static + * @param {google.cloud.vmmigration.v1.ICancelCloneJobResponse} message CancelCloneJobResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CancelCloneJobResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified CancelCloneJobResponse message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.CancelCloneJobResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmmigration.v1.CancelCloneJobResponse + * @static + * @param {google.cloud.vmmigration.v1.ICancelCloneJobResponse} message CancelCloneJobResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CancelCloneJobResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CancelCloneJobResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmmigration.v1.CancelCloneJobResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmmigration.v1.CancelCloneJobResponse} CancelCloneJobResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CancelCloneJobResponse.decode = function 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.vmmigration.v1.CancelCloneJobResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CancelCloneJobResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmmigration.v1.CancelCloneJobResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmmigration.v1.CancelCloneJobResponse} CancelCloneJobResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CancelCloneJobResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CancelCloneJobResponse message. + * @function verify + * @memberof google.cloud.vmmigration.v1.CancelCloneJobResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CancelCloneJobResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a CancelCloneJobResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmmigration.v1.CancelCloneJobResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmmigration.v1.CancelCloneJobResponse} CancelCloneJobResponse + */ + CancelCloneJobResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmmigration.v1.CancelCloneJobResponse) + return object; + return new $root.google.cloud.vmmigration.v1.CancelCloneJobResponse(); + }; + + /** + * Creates a plain object from a CancelCloneJobResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmmigration.v1.CancelCloneJobResponse + * @static + * @param {google.cloud.vmmigration.v1.CancelCloneJobResponse} message CancelCloneJobResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CancelCloneJobResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this CancelCloneJobResponse to JSON. + * @function toJSON + * @memberof google.cloud.vmmigration.v1.CancelCloneJobResponse + * @instance + * @returns {Object.} JSON object + */ + CancelCloneJobResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CancelCloneJobResponse + * @function getTypeUrl + * @memberof google.cloud.vmmigration.v1.CancelCloneJobResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CancelCloneJobResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmmigration.v1.CancelCloneJobResponse"; + }; + + return CancelCloneJobResponse; + })(); + + v1.ListCloneJobsRequest = (function() { + + /** + * Properties of a ListCloneJobsRequest. + * @memberof google.cloud.vmmigration.v1 + * @interface IListCloneJobsRequest + * @property {string|null} [parent] ListCloneJobsRequest parent + * @property {number|null} [pageSize] ListCloneJobsRequest pageSize + * @property {string|null} [pageToken] ListCloneJobsRequest pageToken + * @property {string|null} [filter] ListCloneJobsRequest filter + * @property {string|null} [orderBy] ListCloneJobsRequest orderBy + */ + + /** + * Constructs a new ListCloneJobsRequest. + * @memberof google.cloud.vmmigration.v1 + * @classdesc Represents a ListCloneJobsRequest. + * @implements IListCloneJobsRequest + * @constructor + * @param {google.cloud.vmmigration.v1.IListCloneJobsRequest=} [properties] Properties to set + */ + function ListCloneJobsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListCloneJobsRequest parent. + * @member {string} parent + * @memberof google.cloud.vmmigration.v1.ListCloneJobsRequest + * @instance + */ + ListCloneJobsRequest.prototype.parent = ""; + + /** + * ListCloneJobsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.vmmigration.v1.ListCloneJobsRequest + * @instance + */ + ListCloneJobsRequest.prototype.pageSize = 0; + + /** + * ListCloneJobsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.vmmigration.v1.ListCloneJobsRequest + * @instance + */ + ListCloneJobsRequest.prototype.pageToken = ""; + + /** + * ListCloneJobsRequest filter. + * @member {string} filter + * @memberof google.cloud.vmmigration.v1.ListCloneJobsRequest + * @instance + */ + ListCloneJobsRequest.prototype.filter = ""; + + /** + * ListCloneJobsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.vmmigration.v1.ListCloneJobsRequest + * @instance + */ + ListCloneJobsRequest.prototype.orderBy = ""; + + /** + * Creates a new ListCloneJobsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vmmigration.v1.ListCloneJobsRequest + * @static + * @param {google.cloud.vmmigration.v1.IListCloneJobsRequest=} [properties] Properties to set + * @returns {google.cloud.vmmigration.v1.ListCloneJobsRequest} ListCloneJobsRequest instance + */ + ListCloneJobsRequest.create = function create(properties) { + return new ListCloneJobsRequest(properties); + }; + + /** + * Encodes the specified ListCloneJobsRequest message. Does not implicitly {@link google.cloud.vmmigration.v1.ListCloneJobsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmmigration.v1.ListCloneJobsRequest + * @static + * @param {google.cloud.vmmigration.v1.IListCloneJobsRequest} message ListCloneJobsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCloneJobsRequest.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 ListCloneJobsRequest message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.ListCloneJobsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmmigration.v1.ListCloneJobsRequest + * @static + * @param {google.cloud.vmmigration.v1.IListCloneJobsRequest} message ListCloneJobsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCloneJobsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListCloneJobsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmmigration.v1.ListCloneJobsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmmigration.v1.ListCloneJobsRequest} ListCloneJobsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCloneJobsRequest.decode = function 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.vmmigration.v1.ListCloneJobsRequest(); + 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 ListCloneJobsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmmigration.v1.ListCloneJobsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmmigration.v1.ListCloneJobsRequest} ListCloneJobsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCloneJobsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListCloneJobsRequest message. + * @function verify + * @memberof google.cloud.vmmigration.v1.ListCloneJobsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListCloneJobsRequest.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 ListCloneJobsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmmigration.v1.ListCloneJobsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmmigration.v1.ListCloneJobsRequest} ListCloneJobsRequest + */ + ListCloneJobsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmmigration.v1.ListCloneJobsRequest) + return object; + var message = new $root.google.cloud.vmmigration.v1.ListCloneJobsRequest(); + 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 ListCloneJobsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmmigration.v1.ListCloneJobsRequest + * @static + * @param {google.cloud.vmmigration.v1.ListCloneJobsRequest} message ListCloneJobsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListCloneJobsRequest.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 ListCloneJobsRequest to JSON. + * @function toJSON + * @memberof google.cloud.vmmigration.v1.ListCloneJobsRequest + * @instance + * @returns {Object.} JSON object + */ + ListCloneJobsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListCloneJobsRequest + * @function getTypeUrl + * @memberof google.cloud.vmmigration.v1.ListCloneJobsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListCloneJobsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmmigration.v1.ListCloneJobsRequest"; + }; + + return ListCloneJobsRequest; + })(); + + v1.ListCloneJobsResponse = (function() { + + /** + * Properties of a ListCloneJobsResponse. + * @memberof google.cloud.vmmigration.v1 + * @interface IListCloneJobsResponse + * @property {Array.|null} [cloneJobs] ListCloneJobsResponse cloneJobs + * @property {string|null} [nextPageToken] ListCloneJobsResponse nextPageToken + * @property {Array.|null} [unreachable] ListCloneJobsResponse unreachable + */ + + /** + * Constructs a new ListCloneJobsResponse. + * @memberof google.cloud.vmmigration.v1 + * @classdesc Represents a ListCloneJobsResponse. + * @implements IListCloneJobsResponse + * @constructor + * @param {google.cloud.vmmigration.v1.IListCloneJobsResponse=} [properties] Properties to set + */ + function ListCloneJobsResponse(properties) { + this.cloneJobs = []; + 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]]; + } + + /** + * ListCloneJobsResponse cloneJobs. + * @member {Array.} cloneJobs + * @memberof google.cloud.vmmigration.v1.ListCloneJobsResponse + * @instance + */ + ListCloneJobsResponse.prototype.cloneJobs = $util.emptyArray; + + /** + * ListCloneJobsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.vmmigration.v1.ListCloneJobsResponse + * @instance + */ + ListCloneJobsResponse.prototype.nextPageToken = ""; + + /** + * ListCloneJobsResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.vmmigration.v1.ListCloneJobsResponse + * @instance + */ + ListCloneJobsResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListCloneJobsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.vmmigration.v1.ListCloneJobsResponse + * @static + * @param {google.cloud.vmmigration.v1.IListCloneJobsResponse=} [properties] Properties to set + * @returns {google.cloud.vmmigration.v1.ListCloneJobsResponse} ListCloneJobsResponse instance + */ + ListCloneJobsResponse.create = function create(properties) { + return new ListCloneJobsResponse(properties); + }; + + /** + * Encodes the specified ListCloneJobsResponse message. Does not implicitly {@link google.cloud.vmmigration.v1.ListCloneJobsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmmigration.v1.ListCloneJobsResponse + * @static + * @param {google.cloud.vmmigration.v1.IListCloneJobsResponse} message ListCloneJobsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCloneJobsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.cloneJobs != null && message.cloneJobs.length) + for (var i = 0; i < message.cloneJobs.length; ++i) + $root.google.cloud.vmmigration.v1.CloneJob.encode(message.cloneJobs[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 ListCloneJobsResponse message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.ListCloneJobsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmmigration.v1.ListCloneJobsResponse + * @static + * @param {google.cloud.vmmigration.v1.IListCloneJobsResponse} message ListCloneJobsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCloneJobsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListCloneJobsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmmigration.v1.ListCloneJobsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmmigration.v1.ListCloneJobsResponse} ListCloneJobsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCloneJobsResponse.decode = function 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.vmmigration.v1.ListCloneJobsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.cloneJobs && message.cloneJobs.length)) + message.cloneJobs = []; + message.cloneJobs.push($root.google.cloud.vmmigration.v1.CloneJob.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 ListCloneJobsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmmigration.v1.ListCloneJobsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmmigration.v1.ListCloneJobsResponse} ListCloneJobsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCloneJobsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListCloneJobsResponse message. + * @function verify + * @memberof google.cloud.vmmigration.v1.ListCloneJobsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListCloneJobsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.cloneJobs != null && message.hasOwnProperty("cloneJobs")) { + if (!Array.isArray(message.cloneJobs)) + return "cloneJobs: array expected"; + for (var i = 0; i < message.cloneJobs.length; ++i) { + var error = $root.google.cloud.vmmigration.v1.CloneJob.verify(message.cloneJobs[i]); + if (error) + return "cloneJobs." + 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 ListCloneJobsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmmigration.v1.ListCloneJobsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmmigration.v1.ListCloneJobsResponse} ListCloneJobsResponse + */ + ListCloneJobsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmmigration.v1.ListCloneJobsResponse) + return object; + var message = new $root.google.cloud.vmmigration.v1.ListCloneJobsResponse(); + if (object.cloneJobs) { + if (!Array.isArray(object.cloneJobs)) + throw TypeError(".google.cloud.vmmigration.v1.ListCloneJobsResponse.cloneJobs: array expected"); + message.cloneJobs = []; + for (var i = 0; i < object.cloneJobs.length; ++i) { + if (typeof object.cloneJobs[i] !== "object") + throw TypeError(".google.cloud.vmmigration.v1.ListCloneJobsResponse.cloneJobs: object expected"); + message.cloneJobs[i] = $root.google.cloud.vmmigration.v1.CloneJob.fromObject(object.cloneJobs[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.vmmigration.v1.ListCloneJobsResponse.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 ListCloneJobsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmmigration.v1.ListCloneJobsResponse + * @static + * @param {google.cloud.vmmigration.v1.ListCloneJobsResponse} message ListCloneJobsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListCloneJobsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.cloneJobs = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.cloneJobs && message.cloneJobs.length) { + object.cloneJobs = []; + for (var j = 0; j < message.cloneJobs.length; ++j) + object.cloneJobs[j] = $root.google.cloud.vmmigration.v1.CloneJob.toObject(message.cloneJobs[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 ListCloneJobsResponse to JSON. + * @function toJSON + * @memberof google.cloud.vmmigration.v1.ListCloneJobsResponse + * @instance + * @returns {Object.} JSON object + */ + ListCloneJobsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListCloneJobsResponse + * @function getTypeUrl + * @memberof google.cloud.vmmigration.v1.ListCloneJobsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListCloneJobsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmmigration.v1.ListCloneJobsResponse"; + }; + + return ListCloneJobsResponse; + })(); + + v1.GetCloneJobRequest = (function() { + + /** + * Properties of a GetCloneJobRequest. + * @memberof google.cloud.vmmigration.v1 + * @interface IGetCloneJobRequest + * @property {string|null} [name] GetCloneJobRequest name + */ + + /** + * Constructs a new GetCloneJobRequest. + * @memberof google.cloud.vmmigration.v1 + * @classdesc Represents a GetCloneJobRequest. + * @implements IGetCloneJobRequest + * @constructor + * @param {google.cloud.vmmigration.v1.IGetCloneJobRequest=} [properties] Properties to set + */ + function GetCloneJobRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetCloneJobRequest name. + * @member {string} name + * @memberof google.cloud.vmmigration.v1.GetCloneJobRequest + * @instance + */ + GetCloneJobRequest.prototype.name = ""; + + /** + * Creates a new GetCloneJobRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vmmigration.v1.GetCloneJobRequest + * @static + * @param {google.cloud.vmmigration.v1.IGetCloneJobRequest=} [properties] Properties to set + * @returns {google.cloud.vmmigration.v1.GetCloneJobRequest} GetCloneJobRequest instance + */ + GetCloneJobRequest.create = function create(properties) { + return new GetCloneJobRequest(properties); + }; + + /** + * Encodes the specified GetCloneJobRequest message. Does not implicitly {@link google.cloud.vmmigration.v1.GetCloneJobRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmmigration.v1.GetCloneJobRequest + * @static + * @param {google.cloud.vmmigration.v1.IGetCloneJobRequest} message GetCloneJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetCloneJobRequest.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 GetCloneJobRequest message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.GetCloneJobRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmmigration.v1.GetCloneJobRequest + * @static + * @param {google.cloud.vmmigration.v1.IGetCloneJobRequest} message GetCloneJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetCloneJobRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetCloneJobRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmmigration.v1.GetCloneJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmmigration.v1.GetCloneJobRequest} GetCloneJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetCloneJobRequest.decode = function 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.vmmigration.v1.GetCloneJobRequest(); + 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 GetCloneJobRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmmigration.v1.GetCloneJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmmigration.v1.GetCloneJobRequest} GetCloneJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetCloneJobRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetCloneJobRequest message. + * @function verify + * @memberof google.cloud.vmmigration.v1.GetCloneJobRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetCloneJobRequest.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 GetCloneJobRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmmigration.v1.GetCloneJobRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmmigration.v1.GetCloneJobRequest} GetCloneJobRequest + */ + GetCloneJobRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmmigration.v1.GetCloneJobRequest) + return object; + var message = new $root.google.cloud.vmmigration.v1.GetCloneJobRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetCloneJobRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmmigration.v1.GetCloneJobRequest + * @static + * @param {google.cloud.vmmigration.v1.GetCloneJobRequest} message GetCloneJobRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetCloneJobRequest.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 GetCloneJobRequest to JSON. + * @function toJSON + * @memberof google.cloud.vmmigration.v1.GetCloneJobRequest + * @instance + * @returns {Object.} JSON object + */ + GetCloneJobRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetCloneJobRequest + * @function getTypeUrl + * @memberof google.cloud.vmmigration.v1.GetCloneJobRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetCloneJobRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmmigration.v1.GetCloneJobRequest"; + }; + + return GetCloneJobRequest; + })(); + + v1.Source = (function() { + + /** + * Properties of a Source. + * @memberof google.cloud.vmmigration.v1 + * @interface ISource + * @property {google.cloud.vmmigration.v1.IVmwareSourceDetails|null} [vmware] Source vmware + * @property {string|null} [name] Source name + * @property {google.protobuf.ITimestamp|null} [createTime] Source createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Source updateTime + * @property {Object.|null} [labels] Source labels + * @property {string|null} [description] Source description + */ + + /** + * Constructs a new Source. + * @memberof google.cloud.vmmigration.v1 + * @classdesc Represents a Source. + * @implements ISource + * @constructor + * @param {google.cloud.vmmigration.v1.ISource=} [properties] Properties to set + */ + function Source(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]]; + } + + /** + * Source vmware. + * @member {google.cloud.vmmigration.v1.IVmwareSourceDetails|null|undefined} vmware + * @memberof google.cloud.vmmigration.v1.Source + * @instance + */ + Source.prototype.vmware = null; + + /** + * Source name. + * @member {string} name + * @memberof google.cloud.vmmigration.v1.Source + * @instance + */ + Source.prototype.name = ""; + + /** + * Source createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.vmmigration.v1.Source + * @instance + */ + Source.prototype.createTime = null; + + /** + * Source updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.vmmigration.v1.Source + * @instance + */ + Source.prototype.updateTime = null; + + /** + * Source labels. + * @member {Object.} labels + * @memberof google.cloud.vmmigration.v1.Source + * @instance + */ + Source.prototype.labels = $util.emptyObject; + + /** + * Source description. + * @member {string} description + * @memberof google.cloud.vmmigration.v1.Source + * @instance + */ + Source.prototype.description = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Source sourceDetails. + * @member {"vmware"|undefined} sourceDetails + * @memberof google.cloud.vmmigration.v1.Source + * @instance + */ + Object.defineProperty(Source.prototype, "sourceDetails", { + get: $util.oneOfGetter($oneOfFields = ["vmware"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Source instance using the specified properties. + * @function create + * @memberof google.cloud.vmmigration.v1.Source + * @static + * @param {google.cloud.vmmigration.v1.ISource=} [properties] Properties to set + * @returns {google.cloud.vmmigration.v1.Source} Source instance + */ + Source.create = function create(properties) { + return new Source(properties); + }; + + /** + * Encodes the specified Source message. Does not implicitly {@link google.cloud.vmmigration.v1.Source.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmmigration.v1.Source + * @static + * @param {google.cloud.vmmigration.v1.ISource} message Source message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Source.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.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.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.description); + if (message.vmware != null && Object.hasOwnProperty.call(message, "vmware")) + $root.google.cloud.vmmigration.v1.VmwareSourceDetails.encode(message.vmware, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Source message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.Source.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmmigration.v1.Source + * @static + * @param {google.cloud.vmmigration.v1.ISource} message Source message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Source.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Source message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmmigration.v1.Source + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmmigration.v1.Source} Source + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Source.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.vmmigration.v1.Source(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 10: { + message.vmware = $root.google.cloud.vmmigration.v1.VmwareSourceDetails.decode(reader, reader.uint32()); + break; + } + 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 6: { + message.description = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Source message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmmigration.v1.Source + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmmigration.v1.Source} Source + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Source.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Source message. + * @function verify + * @memberof google.cloud.vmmigration.v1.Source + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Source.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.vmware != null && message.hasOwnProperty("vmware")) { + properties.sourceDetails = 1; + { + var error = $root.google.cloud.vmmigration.v1.VmwareSourceDetails.verify(message.vmware); + if (error) + return "vmware." + error; + } + } + 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.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + return null; + }; + + /** + * Creates a Source message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmmigration.v1.Source + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmmigration.v1.Source} Source + */ + Source.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmmigration.v1.Source) + return object; + var message = new $root.google.cloud.vmmigration.v1.Source(); + if (object.vmware != null) { + if (typeof object.vmware !== "object") + throw TypeError(".google.cloud.vmmigration.v1.Source.vmware: object expected"); + message.vmware = $root.google.cloud.vmmigration.v1.VmwareSourceDetails.fromObject(object.vmware); + } + if (object.name != null) + message.name = String(object.name); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.vmmigration.v1.Source.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.vmmigration.v1.Source.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.vmmigration.v1.Source.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.description != null) + message.description = String(object.description); + return message; + }; + + /** + * Creates a plain object from a Source message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmmigration.v1.Source + * @static + * @param {google.cloud.vmmigration.v1.Source} message Source + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Source.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.createTime = null; + object.updateTime = null; + object.description = ""; + } + 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.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.vmware != null && message.hasOwnProperty("vmware")) { + object.vmware = $root.google.cloud.vmmigration.v1.VmwareSourceDetails.toObject(message.vmware, options); + if (options.oneofs) + object.sourceDetails = "vmware"; + } + return object; + }; + + /** + * Converts this Source to JSON. + * @function toJSON + * @memberof google.cloud.vmmigration.v1.Source + * @instance + * @returns {Object.} JSON object + */ + Source.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Source + * @function getTypeUrl + * @memberof google.cloud.vmmigration.v1.Source + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Source.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmmigration.v1.Source"; + }; + + return Source; + })(); + + v1.VmwareSourceDetails = (function() { + + /** + * Properties of a VmwareSourceDetails. + * @memberof google.cloud.vmmigration.v1 + * @interface IVmwareSourceDetails + * @property {string|null} [username] VmwareSourceDetails username + * @property {string|null} [password] VmwareSourceDetails password + * @property {string|null} [vcenterIp] VmwareSourceDetails vcenterIp + * @property {string|null} [thumbprint] VmwareSourceDetails thumbprint + */ + + /** + * Constructs a new VmwareSourceDetails. + * @memberof google.cloud.vmmigration.v1 + * @classdesc Represents a VmwareSourceDetails. + * @implements IVmwareSourceDetails + * @constructor + * @param {google.cloud.vmmigration.v1.IVmwareSourceDetails=} [properties] Properties to set + */ + function VmwareSourceDetails(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * VmwareSourceDetails username. + * @member {string} username + * @memberof google.cloud.vmmigration.v1.VmwareSourceDetails + * @instance + */ + VmwareSourceDetails.prototype.username = ""; + + /** + * VmwareSourceDetails password. + * @member {string} password + * @memberof google.cloud.vmmigration.v1.VmwareSourceDetails + * @instance + */ + VmwareSourceDetails.prototype.password = ""; + + /** + * VmwareSourceDetails vcenterIp. + * @member {string} vcenterIp + * @memberof google.cloud.vmmigration.v1.VmwareSourceDetails + * @instance + */ + VmwareSourceDetails.prototype.vcenterIp = ""; + + /** + * VmwareSourceDetails thumbprint. + * @member {string} thumbprint + * @memberof google.cloud.vmmigration.v1.VmwareSourceDetails + * @instance + */ + VmwareSourceDetails.prototype.thumbprint = ""; + + /** + * Creates a new VmwareSourceDetails instance using the specified properties. + * @function create + * @memberof google.cloud.vmmigration.v1.VmwareSourceDetails + * @static + * @param {google.cloud.vmmigration.v1.IVmwareSourceDetails=} [properties] Properties to set + * @returns {google.cloud.vmmigration.v1.VmwareSourceDetails} VmwareSourceDetails instance + */ + VmwareSourceDetails.create = function create(properties) { + return new VmwareSourceDetails(properties); + }; + + /** + * Encodes the specified VmwareSourceDetails message. Does not implicitly {@link google.cloud.vmmigration.v1.VmwareSourceDetails.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmmigration.v1.VmwareSourceDetails + * @static + * @param {google.cloud.vmmigration.v1.IVmwareSourceDetails} message VmwareSourceDetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VmwareSourceDetails.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.username != null && Object.hasOwnProperty.call(message, "username")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.username); + if (message.password != null && Object.hasOwnProperty.call(message, "password")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.password); + if (message.vcenterIp != null && Object.hasOwnProperty.call(message, "vcenterIp")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.vcenterIp); + if (message.thumbprint != null && Object.hasOwnProperty.call(message, "thumbprint")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.thumbprint); + return writer; + }; + + /** + * Encodes the specified VmwareSourceDetails message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.VmwareSourceDetails.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmmigration.v1.VmwareSourceDetails + * @static + * @param {google.cloud.vmmigration.v1.IVmwareSourceDetails} message VmwareSourceDetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VmwareSourceDetails.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VmwareSourceDetails message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmmigration.v1.VmwareSourceDetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmmigration.v1.VmwareSourceDetails} VmwareSourceDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VmwareSourceDetails.decode = function 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.vmmigration.v1.VmwareSourceDetails(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.username = reader.string(); + break; + } + case 2: { + message.password = reader.string(); + break; + } + case 3: { + message.vcenterIp = reader.string(); + break; + } + case 4: { + message.thumbprint = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VmwareSourceDetails message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmmigration.v1.VmwareSourceDetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmmigration.v1.VmwareSourceDetails} VmwareSourceDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VmwareSourceDetails.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VmwareSourceDetails message. + * @function verify + * @memberof google.cloud.vmmigration.v1.VmwareSourceDetails + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VmwareSourceDetails.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.username != null && message.hasOwnProperty("username")) + if (!$util.isString(message.username)) + return "username: string expected"; + if (message.password != null && message.hasOwnProperty("password")) + if (!$util.isString(message.password)) + return "password: string expected"; + if (message.vcenterIp != null && message.hasOwnProperty("vcenterIp")) + if (!$util.isString(message.vcenterIp)) + return "vcenterIp: string expected"; + if (message.thumbprint != null && message.hasOwnProperty("thumbprint")) + if (!$util.isString(message.thumbprint)) + return "thumbprint: string expected"; + return null; + }; + + /** + * Creates a VmwareSourceDetails message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmmigration.v1.VmwareSourceDetails + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmmigration.v1.VmwareSourceDetails} VmwareSourceDetails + */ + VmwareSourceDetails.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmmigration.v1.VmwareSourceDetails) + return object; + var message = new $root.google.cloud.vmmigration.v1.VmwareSourceDetails(); + if (object.username != null) + message.username = String(object.username); + if (object.password != null) + message.password = String(object.password); + if (object.vcenterIp != null) + message.vcenterIp = String(object.vcenterIp); + if (object.thumbprint != null) + message.thumbprint = String(object.thumbprint); + return message; + }; + + /** + * Creates a plain object from a VmwareSourceDetails message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmmigration.v1.VmwareSourceDetails + * @static + * @param {google.cloud.vmmigration.v1.VmwareSourceDetails} message VmwareSourceDetails + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VmwareSourceDetails.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.username = ""; + object.password = ""; + object.vcenterIp = ""; + object.thumbprint = ""; + } + if (message.username != null && message.hasOwnProperty("username")) + object.username = message.username; + if (message.password != null && message.hasOwnProperty("password")) + object.password = message.password; + if (message.vcenterIp != null && message.hasOwnProperty("vcenterIp")) + object.vcenterIp = message.vcenterIp; + if (message.thumbprint != null && message.hasOwnProperty("thumbprint")) + object.thumbprint = message.thumbprint; + return object; + }; + + /** + * Converts this VmwareSourceDetails to JSON. + * @function toJSON + * @memberof google.cloud.vmmigration.v1.VmwareSourceDetails + * @instance + * @returns {Object.} JSON object + */ + VmwareSourceDetails.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VmwareSourceDetails + * @function getTypeUrl + * @memberof google.cloud.vmmigration.v1.VmwareSourceDetails + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VmwareSourceDetails.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmmigration.v1.VmwareSourceDetails"; + }; + + return VmwareSourceDetails; + })(); + + v1.DatacenterConnector = (function() { + + /** + * Properties of a DatacenterConnector. + * @memberof google.cloud.vmmigration.v1 + * @interface IDatacenterConnector + * @property {google.protobuf.ITimestamp|null} [createTime] DatacenterConnector createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] DatacenterConnector updateTime + * @property {string|null} [name] DatacenterConnector name + * @property {string|null} [registrationId] DatacenterConnector registrationId + * @property {string|null} [serviceAccount] DatacenterConnector serviceAccount + * @property {string|null} [version] DatacenterConnector version + * @property {string|null} [bucket] DatacenterConnector bucket + * @property {google.cloud.vmmigration.v1.DatacenterConnector.State|null} [state] DatacenterConnector state + * @property {google.protobuf.ITimestamp|null} [stateTime] DatacenterConnector stateTime + * @property {google.rpc.IStatus|null} [error] DatacenterConnector error + * @property {string|null} [applianceInfrastructureVersion] DatacenterConnector applianceInfrastructureVersion + * @property {string|null} [applianceSoftwareVersion] DatacenterConnector applianceSoftwareVersion + * @property {google.cloud.vmmigration.v1.IAvailableUpdates|null} [availableVersions] DatacenterConnector availableVersions + * @property {google.cloud.vmmigration.v1.IUpgradeStatus|null} [upgradeStatus] DatacenterConnector upgradeStatus + */ + + /** + * Constructs a new DatacenterConnector. + * @memberof google.cloud.vmmigration.v1 + * @classdesc Represents a DatacenterConnector. + * @implements IDatacenterConnector + * @constructor + * @param {google.cloud.vmmigration.v1.IDatacenterConnector=} [properties] Properties to set + */ + function DatacenterConnector(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DatacenterConnector createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.vmmigration.v1.DatacenterConnector + * @instance + */ + DatacenterConnector.prototype.createTime = null; + + /** + * DatacenterConnector updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.vmmigration.v1.DatacenterConnector + * @instance + */ + DatacenterConnector.prototype.updateTime = null; + + /** + * DatacenterConnector name. + * @member {string} name + * @memberof google.cloud.vmmigration.v1.DatacenterConnector + * @instance + */ + DatacenterConnector.prototype.name = ""; + + /** + * DatacenterConnector registrationId. + * @member {string} registrationId + * @memberof google.cloud.vmmigration.v1.DatacenterConnector + * @instance + */ + DatacenterConnector.prototype.registrationId = ""; + + /** + * DatacenterConnector serviceAccount. + * @member {string} serviceAccount + * @memberof google.cloud.vmmigration.v1.DatacenterConnector + * @instance + */ + DatacenterConnector.prototype.serviceAccount = ""; + + /** + * DatacenterConnector version. + * @member {string} version + * @memberof google.cloud.vmmigration.v1.DatacenterConnector + * @instance + */ + DatacenterConnector.prototype.version = ""; + + /** + * DatacenterConnector bucket. + * @member {string} bucket + * @memberof google.cloud.vmmigration.v1.DatacenterConnector + * @instance + */ + DatacenterConnector.prototype.bucket = ""; + + /** + * DatacenterConnector state. + * @member {google.cloud.vmmigration.v1.DatacenterConnector.State} state + * @memberof google.cloud.vmmigration.v1.DatacenterConnector + * @instance + */ + DatacenterConnector.prototype.state = 0; + + /** + * DatacenterConnector stateTime. + * @member {google.protobuf.ITimestamp|null|undefined} stateTime + * @memberof google.cloud.vmmigration.v1.DatacenterConnector + * @instance + */ + DatacenterConnector.prototype.stateTime = null; + + /** + * DatacenterConnector error. + * @member {google.rpc.IStatus|null|undefined} error + * @memberof google.cloud.vmmigration.v1.DatacenterConnector + * @instance + */ + DatacenterConnector.prototype.error = null; + + /** + * DatacenterConnector applianceInfrastructureVersion. + * @member {string} applianceInfrastructureVersion + * @memberof google.cloud.vmmigration.v1.DatacenterConnector + * @instance + */ + DatacenterConnector.prototype.applianceInfrastructureVersion = ""; + + /** + * DatacenterConnector applianceSoftwareVersion. + * @member {string} applianceSoftwareVersion + * @memberof google.cloud.vmmigration.v1.DatacenterConnector + * @instance + */ + DatacenterConnector.prototype.applianceSoftwareVersion = ""; + + /** + * DatacenterConnector availableVersions. + * @member {google.cloud.vmmigration.v1.IAvailableUpdates|null|undefined} availableVersions + * @memberof google.cloud.vmmigration.v1.DatacenterConnector + * @instance + */ + DatacenterConnector.prototype.availableVersions = null; + + /** + * DatacenterConnector upgradeStatus. + * @member {google.cloud.vmmigration.v1.IUpgradeStatus|null|undefined} upgradeStatus + * @memberof google.cloud.vmmigration.v1.DatacenterConnector + * @instance + */ + DatacenterConnector.prototype.upgradeStatus = null; + + /** + * Creates a new DatacenterConnector instance using the specified properties. + * @function create + * @memberof google.cloud.vmmigration.v1.DatacenterConnector + * @static + * @param {google.cloud.vmmigration.v1.IDatacenterConnector=} [properties] Properties to set + * @returns {google.cloud.vmmigration.v1.DatacenterConnector} DatacenterConnector instance + */ + DatacenterConnector.create = function create(properties) { + return new DatacenterConnector(properties); + }; + + /** + * Encodes the specified DatacenterConnector message. Does not implicitly {@link google.cloud.vmmigration.v1.DatacenterConnector.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmmigration.v1.DatacenterConnector + * @static + * @param {google.cloud.vmmigration.v1.IDatacenterConnector} message DatacenterConnector message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DatacenterConnector.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.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.name); + if (message.serviceAccount != null && Object.hasOwnProperty.call(message, "serviceAccount")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.serviceAccount); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.version); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.state); + if (message.stateTime != null && Object.hasOwnProperty.call(message, "stateTime")) + $root.google.protobuf.Timestamp.encode(message.stateTime, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.bucket != null && Object.hasOwnProperty.call(message, "bucket")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.bucket); + if (message.error != null && Object.hasOwnProperty.call(message, "error")) + $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.registrationId != null && Object.hasOwnProperty.call(message, "registrationId")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.registrationId); + if (message.applianceInfrastructureVersion != null && Object.hasOwnProperty.call(message, "applianceInfrastructureVersion")) + writer.uint32(/* id 13, wireType 2 =*/106).string(message.applianceInfrastructureVersion); + if (message.applianceSoftwareVersion != null && Object.hasOwnProperty.call(message, "applianceSoftwareVersion")) + writer.uint32(/* id 14, wireType 2 =*/114).string(message.applianceSoftwareVersion); + if (message.availableVersions != null && Object.hasOwnProperty.call(message, "availableVersions")) + $root.google.cloud.vmmigration.v1.AvailableUpdates.encode(message.availableVersions, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); + if (message.upgradeStatus != null && Object.hasOwnProperty.call(message, "upgradeStatus")) + $root.google.cloud.vmmigration.v1.UpgradeStatus.encode(message.upgradeStatus, writer.uint32(/* id 16, wireType 2 =*/130).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DatacenterConnector message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.DatacenterConnector.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmmigration.v1.DatacenterConnector + * @static + * @param {google.cloud.vmmigration.v1.IDatacenterConnector} message DatacenterConnector message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DatacenterConnector.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DatacenterConnector message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmmigration.v1.DatacenterConnector + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmmigration.v1.DatacenterConnector} DatacenterConnector + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DatacenterConnector.decode = function 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.vmmigration.v1.DatacenterConnector(); + 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.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.name = reader.string(); + break; + } + case 12: { + message.registrationId = reader.string(); + break; + } + case 5: { + message.serviceAccount = reader.string(); + break; + } + case 6: { + message.version = reader.string(); + break; + } + case 10: { + message.bucket = reader.string(); + break; + } + case 7: { + message.state = reader.int32(); + break; + } + case 8: { + message.stateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 11: { + message.error = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + } + case 13: { + message.applianceInfrastructureVersion = reader.string(); + break; + } + case 14: { + message.applianceSoftwareVersion = reader.string(); + break; + } + case 15: { + message.availableVersions = $root.google.cloud.vmmigration.v1.AvailableUpdates.decode(reader, reader.uint32()); + break; + } + case 16: { + message.upgradeStatus = $root.google.cloud.vmmigration.v1.UpgradeStatus.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DatacenterConnector message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmmigration.v1.DatacenterConnector + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmmigration.v1.DatacenterConnector} DatacenterConnector + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DatacenterConnector.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DatacenterConnector message. + * @function verify + * @memberof google.cloud.vmmigration.v1.DatacenterConnector + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DatacenterConnector.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.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.registrationId != null && message.hasOwnProperty("registrationId")) + if (!$util.isString(message.registrationId)) + return "registrationId: string expected"; + if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) + if (!$util.isString(message.serviceAccount)) + return "serviceAccount: string expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isString(message.version)) + return "version: string expected"; + if (message.bucket != null && message.hasOwnProperty("bucket")) + if (!$util.isString(message.bucket)) + return "bucket: string expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.stateTime != null && message.hasOwnProperty("stateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.stateTime); + if (error) + return "stateTime." + error; + } + if (message.error != null && message.hasOwnProperty("error")) { + var error = $root.google.rpc.Status.verify(message.error); + if (error) + return "error." + error; + } + if (message.applianceInfrastructureVersion != null && message.hasOwnProperty("applianceInfrastructureVersion")) + if (!$util.isString(message.applianceInfrastructureVersion)) + return "applianceInfrastructureVersion: string expected"; + if (message.applianceSoftwareVersion != null && message.hasOwnProperty("applianceSoftwareVersion")) + if (!$util.isString(message.applianceSoftwareVersion)) + return "applianceSoftwareVersion: string expected"; + if (message.availableVersions != null && message.hasOwnProperty("availableVersions")) { + var error = $root.google.cloud.vmmigration.v1.AvailableUpdates.verify(message.availableVersions); + if (error) + return "availableVersions." + error; + } + if (message.upgradeStatus != null && message.hasOwnProperty("upgradeStatus")) { + var error = $root.google.cloud.vmmigration.v1.UpgradeStatus.verify(message.upgradeStatus); + if (error) + return "upgradeStatus." + error; + } + return null; + }; + + /** + * Creates a DatacenterConnector message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmmigration.v1.DatacenterConnector + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmmigration.v1.DatacenterConnector} DatacenterConnector + */ + DatacenterConnector.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmmigration.v1.DatacenterConnector) + return object; + var message = new $root.google.cloud.vmmigration.v1.DatacenterConnector(); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.vmmigration.v1.DatacenterConnector.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.vmmigration.v1.DatacenterConnector.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.name != null) + message.name = String(object.name); + if (object.registrationId != null) + message.registrationId = String(object.registrationId); + if (object.serviceAccount != null) + message.serviceAccount = String(object.serviceAccount); + if (object.version != null) + message.version = String(object.version); + if (object.bucket != null) + message.bucket = String(object.bucket); + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "PENDING": + case 1: + message.state = 1; + break; + case "OFFLINE": + case 2: + message.state = 2; + break; + case "FAILED": + case 3: + message.state = 3; + break; + case "ACTIVE": + case 4: + message.state = 4; + break; + } + if (object.stateTime != null) { + if (typeof object.stateTime !== "object") + throw TypeError(".google.cloud.vmmigration.v1.DatacenterConnector.stateTime: object expected"); + message.stateTime = $root.google.protobuf.Timestamp.fromObject(object.stateTime); + } + if (object.error != null) { + if (typeof object.error !== "object") + throw TypeError(".google.cloud.vmmigration.v1.DatacenterConnector.error: object expected"); + message.error = $root.google.rpc.Status.fromObject(object.error); + } + if (object.applianceInfrastructureVersion != null) + message.applianceInfrastructureVersion = String(object.applianceInfrastructureVersion); + if (object.applianceSoftwareVersion != null) + message.applianceSoftwareVersion = String(object.applianceSoftwareVersion); + if (object.availableVersions != null) { + if (typeof object.availableVersions !== "object") + throw TypeError(".google.cloud.vmmigration.v1.DatacenterConnector.availableVersions: object expected"); + message.availableVersions = $root.google.cloud.vmmigration.v1.AvailableUpdates.fromObject(object.availableVersions); + } + if (object.upgradeStatus != null) { + if (typeof object.upgradeStatus !== "object") + throw TypeError(".google.cloud.vmmigration.v1.DatacenterConnector.upgradeStatus: object expected"); + message.upgradeStatus = $root.google.cloud.vmmigration.v1.UpgradeStatus.fromObject(object.upgradeStatus); + } + return message; + }; + + /** + * Creates a plain object from a DatacenterConnector message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmmigration.v1.DatacenterConnector + * @static + * @param {google.cloud.vmmigration.v1.DatacenterConnector} message DatacenterConnector + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DatacenterConnector.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.createTime = null; + object.updateTime = null; + object.name = ""; + object.serviceAccount = ""; + object.version = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.stateTime = null; + object.bucket = ""; + object.error = null; + object.registrationId = ""; + object.applianceInfrastructureVersion = ""; + object.applianceSoftwareVersion = ""; + object.availableVersions = null; + object.upgradeStatus = null; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) + object.serviceAccount = message.serviceAccount; + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.vmmigration.v1.DatacenterConnector.State[message.state] === undefined ? message.state : $root.google.cloud.vmmigration.v1.DatacenterConnector.State[message.state] : message.state; + if (message.stateTime != null && message.hasOwnProperty("stateTime")) + object.stateTime = $root.google.protobuf.Timestamp.toObject(message.stateTime, options); + if (message.bucket != null && message.hasOwnProperty("bucket")) + object.bucket = message.bucket; + if (message.error != null && message.hasOwnProperty("error")) + object.error = $root.google.rpc.Status.toObject(message.error, options); + if (message.registrationId != null && message.hasOwnProperty("registrationId")) + object.registrationId = message.registrationId; + if (message.applianceInfrastructureVersion != null && message.hasOwnProperty("applianceInfrastructureVersion")) + object.applianceInfrastructureVersion = message.applianceInfrastructureVersion; + if (message.applianceSoftwareVersion != null && message.hasOwnProperty("applianceSoftwareVersion")) + object.applianceSoftwareVersion = message.applianceSoftwareVersion; + if (message.availableVersions != null && message.hasOwnProperty("availableVersions")) + object.availableVersions = $root.google.cloud.vmmigration.v1.AvailableUpdates.toObject(message.availableVersions, options); + if (message.upgradeStatus != null && message.hasOwnProperty("upgradeStatus")) + object.upgradeStatus = $root.google.cloud.vmmigration.v1.UpgradeStatus.toObject(message.upgradeStatus, options); + return object; + }; + + /** + * Converts this DatacenterConnector to JSON. + * @function toJSON + * @memberof google.cloud.vmmigration.v1.DatacenterConnector + * @instance + * @returns {Object.} JSON object + */ + DatacenterConnector.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DatacenterConnector + * @function getTypeUrl + * @memberof google.cloud.vmmigration.v1.DatacenterConnector + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DatacenterConnector.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmmigration.v1.DatacenterConnector"; + }; + + /** + * State enum. + * @name google.cloud.vmmigration.v1.DatacenterConnector.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} PENDING=1 PENDING value + * @property {number} OFFLINE=2 OFFLINE value + * @property {number} FAILED=3 FAILED value + * @property {number} ACTIVE=4 ACTIVE value + */ + DatacenterConnector.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "PENDING"] = 1; + values[valuesById[2] = "OFFLINE"] = 2; + values[valuesById[3] = "FAILED"] = 3; + values[valuesById[4] = "ACTIVE"] = 4; + return values; + })(); + + return DatacenterConnector; + })(); + + v1.UpgradeStatus = (function() { + + /** + * Properties of an UpgradeStatus. + * @memberof google.cloud.vmmigration.v1 + * @interface IUpgradeStatus + * @property {string|null} [version] UpgradeStatus version + * @property {google.cloud.vmmigration.v1.UpgradeStatus.State|null} [state] UpgradeStatus state + * @property {google.rpc.IStatus|null} [error] UpgradeStatus error + * @property {google.protobuf.ITimestamp|null} [startTime] UpgradeStatus startTime + * @property {string|null} [previousVersion] UpgradeStatus previousVersion + */ + + /** + * Constructs a new UpgradeStatus. + * @memberof google.cloud.vmmigration.v1 + * @classdesc Represents an UpgradeStatus. + * @implements IUpgradeStatus + * @constructor + * @param {google.cloud.vmmigration.v1.IUpgradeStatus=} [properties] Properties to set + */ + function UpgradeStatus(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpgradeStatus version. + * @member {string} version + * @memberof google.cloud.vmmigration.v1.UpgradeStatus + * @instance + */ + UpgradeStatus.prototype.version = ""; + + /** + * UpgradeStatus state. + * @member {google.cloud.vmmigration.v1.UpgradeStatus.State} state + * @memberof google.cloud.vmmigration.v1.UpgradeStatus + * @instance + */ + UpgradeStatus.prototype.state = 0; + + /** + * UpgradeStatus error. + * @member {google.rpc.IStatus|null|undefined} error + * @memberof google.cloud.vmmigration.v1.UpgradeStatus + * @instance + */ + UpgradeStatus.prototype.error = null; + + /** + * UpgradeStatus startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.cloud.vmmigration.v1.UpgradeStatus + * @instance + */ + UpgradeStatus.prototype.startTime = null; + + /** + * UpgradeStatus previousVersion. + * @member {string} previousVersion + * @memberof google.cloud.vmmigration.v1.UpgradeStatus + * @instance + */ + UpgradeStatus.prototype.previousVersion = ""; + + /** + * Creates a new UpgradeStatus instance using the specified properties. + * @function create + * @memberof google.cloud.vmmigration.v1.UpgradeStatus + * @static + * @param {google.cloud.vmmigration.v1.IUpgradeStatus=} [properties] Properties to set + * @returns {google.cloud.vmmigration.v1.UpgradeStatus} UpgradeStatus instance + */ + UpgradeStatus.create = function create(properties) { + return new UpgradeStatus(properties); + }; + + /** + * Encodes the specified UpgradeStatus message. Does not implicitly {@link google.cloud.vmmigration.v1.UpgradeStatus.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmmigration.v1.UpgradeStatus + * @static + * @param {google.cloud.vmmigration.v1.IUpgradeStatus} message UpgradeStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpgradeStatus.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.version); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.state); + if (message.error != null && Object.hasOwnProperty.call(message, "error")) + $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.previousVersion != null && Object.hasOwnProperty.call(message, "previousVersion")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.previousVersion); + return writer; + }; + + /** + * Encodes the specified UpgradeStatus message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.UpgradeStatus.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmmigration.v1.UpgradeStatus + * @static + * @param {google.cloud.vmmigration.v1.IUpgradeStatus} message UpgradeStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpgradeStatus.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpgradeStatus message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmmigration.v1.UpgradeStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmmigration.v1.UpgradeStatus} UpgradeStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpgradeStatus.decode = function 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.vmmigration.v1.UpgradeStatus(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.version = reader.string(); + break; + } + case 2: { + message.state = reader.int32(); + break; + } + case 3: { + message.error = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + } + case 4: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.previousVersion = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpgradeStatus message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmmigration.v1.UpgradeStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmmigration.v1.UpgradeStatus} UpgradeStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpgradeStatus.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpgradeStatus message. + * @function verify + * @memberof google.cloud.vmmigration.v1.UpgradeStatus + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpgradeStatus.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isString(message.version)) + return "version: string expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.error != null && message.hasOwnProperty("error")) { + var error = $root.google.rpc.Status.verify(message.error); + if (error) + return "error." + error; + } + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (error) + return "startTime." + error; + } + if (message.previousVersion != null && message.hasOwnProperty("previousVersion")) + if (!$util.isString(message.previousVersion)) + return "previousVersion: string expected"; + return null; + }; + + /** + * Creates an UpgradeStatus message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmmigration.v1.UpgradeStatus + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmmigration.v1.UpgradeStatus} UpgradeStatus + */ + UpgradeStatus.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmmigration.v1.UpgradeStatus) + return object; + var message = new $root.google.cloud.vmmigration.v1.UpgradeStatus(); + if (object.version != null) + message.version = String(object.version); + 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 "RUNNING": + case 1: + message.state = 1; + break; + case "FAILED": + case 2: + message.state = 2; + break; + case "SUCCEEDED": + case 3: + message.state = 3; + break; + } + if (object.error != null) { + if (typeof object.error !== "object") + throw TypeError(".google.cloud.vmmigration.v1.UpgradeStatus.error: object expected"); + message.error = $root.google.rpc.Status.fromObject(object.error); + } + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.cloud.vmmigration.v1.UpgradeStatus.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + if (object.previousVersion != null) + message.previousVersion = String(object.previousVersion); + return message; + }; + + /** + * Creates a plain object from an UpgradeStatus message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmmigration.v1.UpgradeStatus + * @static + * @param {google.cloud.vmmigration.v1.UpgradeStatus} message UpgradeStatus + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpgradeStatus.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.version = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.error = null; + object.startTime = null; + object.previousVersion = ""; + } + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.vmmigration.v1.UpgradeStatus.State[message.state] === undefined ? message.state : $root.google.cloud.vmmigration.v1.UpgradeStatus.State[message.state] : message.state; + if (message.error != null && message.hasOwnProperty("error")) + object.error = $root.google.rpc.Status.toObject(message.error, options); + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + if (message.previousVersion != null && message.hasOwnProperty("previousVersion")) + object.previousVersion = message.previousVersion; + return object; + }; + + /** + * Converts this UpgradeStatus to JSON. + * @function toJSON + * @memberof google.cloud.vmmigration.v1.UpgradeStatus + * @instance + * @returns {Object.} JSON object + */ + UpgradeStatus.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpgradeStatus + * @function getTypeUrl + * @memberof google.cloud.vmmigration.v1.UpgradeStatus + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpgradeStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmmigration.v1.UpgradeStatus"; + }; + + /** + * State enum. + * @name google.cloud.vmmigration.v1.UpgradeStatus.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} RUNNING=1 RUNNING value + * @property {number} FAILED=2 FAILED value + * @property {number} SUCCEEDED=3 SUCCEEDED value + */ + UpgradeStatus.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "RUNNING"] = 1; + values[valuesById[2] = "FAILED"] = 2; + values[valuesById[3] = "SUCCEEDED"] = 3; + return values; + })(); + + return UpgradeStatus; + })(); + + v1.AvailableUpdates = (function() { + + /** + * Properties of an AvailableUpdates. + * @memberof google.cloud.vmmigration.v1 + * @interface IAvailableUpdates + * @property {google.cloud.vmmigration.v1.IApplianceVersion|null} [newDeployableAppliance] AvailableUpdates newDeployableAppliance + * @property {google.cloud.vmmigration.v1.IApplianceVersion|null} [inPlaceUpdate] AvailableUpdates inPlaceUpdate + */ + + /** + * Constructs a new AvailableUpdates. + * @memberof google.cloud.vmmigration.v1 + * @classdesc Represents an AvailableUpdates. + * @implements IAvailableUpdates + * @constructor + * @param {google.cloud.vmmigration.v1.IAvailableUpdates=} [properties] Properties to set + */ + function AvailableUpdates(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AvailableUpdates newDeployableAppliance. + * @member {google.cloud.vmmigration.v1.IApplianceVersion|null|undefined} newDeployableAppliance + * @memberof google.cloud.vmmigration.v1.AvailableUpdates + * @instance + */ + AvailableUpdates.prototype.newDeployableAppliance = null; + + /** + * AvailableUpdates inPlaceUpdate. + * @member {google.cloud.vmmigration.v1.IApplianceVersion|null|undefined} inPlaceUpdate + * @memberof google.cloud.vmmigration.v1.AvailableUpdates + * @instance + */ + AvailableUpdates.prototype.inPlaceUpdate = null; + + /** + * Creates a new AvailableUpdates instance using the specified properties. + * @function create + * @memberof google.cloud.vmmigration.v1.AvailableUpdates + * @static + * @param {google.cloud.vmmigration.v1.IAvailableUpdates=} [properties] Properties to set + * @returns {google.cloud.vmmigration.v1.AvailableUpdates} AvailableUpdates instance + */ + AvailableUpdates.create = function create(properties) { + return new AvailableUpdates(properties); + }; + + /** + * Encodes the specified AvailableUpdates message. Does not implicitly {@link google.cloud.vmmigration.v1.AvailableUpdates.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmmigration.v1.AvailableUpdates + * @static + * @param {google.cloud.vmmigration.v1.IAvailableUpdates} message AvailableUpdates message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AvailableUpdates.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.newDeployableAppliance != null && Object.hasOwnProperty.call(message, "newDeployableAppliance")) + $root.google.cloud.vmmigration.v1.ApplianceVersion.encode(message.newDeployableAppliance, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.inPlaceUpdate != null && Object.hasOwnProperty.call(message, "inPlaceUpdate")) + $root.google.cloud.vmmigration.v1.ApplianceVersion.encode(message.inPlaceUpdate, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AvailableUpdates message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.AvailableUpdates.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmmigration.v1.AvailableUpdates + * @static + * @param {google.cloud.vmmigration.v1.IAvailableUpdates} message AvailableUpdates message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AvailableUpdates.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AvailableUpdates message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmmigration.v1.AvailableUpdates + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmmigration.v1.AvailableUpdates} AvailableUpdates + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AvailableUpdates.decode = function 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.vmmigration.v1.AvailableUpdates(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.newDeployableAppliance = $root.google.cloud.vmmigration.v1.ApplianceVersion.decode(reader, reader.uint32()); + break; + } + case 2: { + message.inPlaceUpdate = $root.google.cloud.vmmigration.v1.ApplianceVersion.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AvailableUpdates message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmmigration.v1.AvailableUpdates + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmmigration.v1.AvailableUpdates} AvailableUpdates + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AvailableUpdates.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AvailableUpdates message. + * @function verify + * @memberof google.cloud.vmmigration.v1.AvailableUpdates + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AvailableUpdates.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.newDeployableAppliance != null && message.hasOwnProperty("newDeployableAppliance")) { + var error = $root.google.cloud.vmmigration.v1.ApplianceVersion.verify(message.newDeployableAppliance); + if (error) + return "newDeployableAppliance." + error; + } + if (message.inPlaceUpdate != null && message.hasOwnProperty("inPlaceUpdate")) { + var error = $root.google.cloud.vmmigration.v1.ApplianceVersion.verify(message.inPlaceUpdate); + if (error) + return "inPlaceUpdate." + error; + } + return null; + }; + + /** + * Creates an AvailableUpdates message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmmigration.v1.AvailableUpdates + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmmigration.v1.AvailableUpdates} AvailableUpdates + */ + AvailableUpdates.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmmigration.v1.AvailableUpdates) + return object; + var message = new $root.google.cloud.vmmigration.v1.AvailableUpdates(); + if (object.newDeployableAppliance != null) { + if (typeof object.newDeployableAppliance !== "object") + throw TypeError(".google.cloud.vmmigration.v1.AvailableUpdates.newDeployableAppliance: object expected"); + message.newDeployableAppliance = $root.google.cloud.vmmigration.v1.ApplianceVersion.fromObject(object.newDeployableAppliance); + } + if (object.inPlaceUpdate != null) { + if (typeof object.inPlaceUpdate !== "object") + throw TypeError(".google.cloud.vmmigration.v1.AvailableUpdates.inPlaceUpdate: object expected"); + message.inPlaceUpdate = $root.google.cloud.vmmigration.v1.ApplianceVersion.fromObject(object.inPlaceUpdate); + } + return message; + }; + + /** + * Creates a plain object from an AvailableUpdates message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmmigration.v1.AvailableUpdates + * @static + * @param {google.cloud.vmmigration.v1.AvailableUpdates} message AvailableUpdates + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AvailableUpdates.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.newDeployableAppliance = null; + object.inPlaceUpdate = null; + } + if (message.newDeployableAppliance != null && message.hasOwnProperty("newDeployableAppliance")) + object.newDeployableAppliance = $root.google.cloud.vmmigration.v1.ApplianceVersion.toObject(message.newDeployableAppliance, options); + if (message.inPlaceUpdate != null && message.hasOwnProperty("inPlaceUpdate")) + object.inPlaceUpdate = $root.google.cloud.vmmigration.v1.ApplianceVersion.toObject(message.inPlaceUpdate, options); + return object; + }; + + /** + * Converts this AvailableUpdates to JSON. + * @function toJSON + * @memberof google.cloud.vmmigration.v1.AvailableUpdates + * @instance + * @returns {Object.} JSON object + */ + AvailableUpdates.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AvailableUpdates + * @function getTypeUrl + * @memberof google.cloud.vmmigration.v1.AvailableUpdates + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AvailableUpdates.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmmigration.v1.AvailableUpdates"; + }; + + return AvailableUpdates; + })(); + + v1.ApplianceVersion = (function() { + + /** + * Properties of an ApplianceVersion. + * @memberof google.cloud.vmmigration.v1 + * @interface IApplianceVersion + * @property {string|null} [version] ApplianceVersion version + * @property {string|null} [uri] ApplianceVersion uri + * @property {boolean|null} [critical] ApplianceVersion critical + * @property {string|null} [releaseNotesUri] ApplianceVersion releaseNotesUri + */ + + /** + * Constructs a new ApplianceVersion. + * @memberof google.cloud.vmmigration.v1 + * @classdesc Represents an ApplianceVersion. + * @implements IApplianceVersion + * @constructor + * @param {google.cloud.vmmigration.v1.IApplianceVersion=} [properties] Properties to set + */ + function ApplianceVersion(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ApplianceVersion version. + * @member {string} version + * @memberof google.cloud.vmmigration.v1.ApplianceVersion + * @instance + */ + ApplianceVersion.prototype.version = ""; + + /** + * ApplianceVersion uri. + * @member {string} uri + * @memberof google.cloud.vmmigration.v1.ApplianceVersion + * @instance + */ + ApplianceVersion.prototype.uri = ""; + + /** + * ApplianceVersion critical. + * @member {boolean} critical + * @memberof google.cloud.vmmigration.v1.ApplianceVersion + * @instance + */ + ApplianceVersion.prototype.critical = false; + + /** + * ApplianceVersion releaseNotesUri. + * @member {string} releaseNotesUri + * @memberof google.cloud.vmmigration.v1.ApplianceVersion + * @instance + */ + ApplianceVersion.prototype.releaseNotesUri = ""; + + /** + * Creates a new ApplianceVersion instance using the specified properties. + * @function create + * @memberof google.cloud.vmmigration.v1.ApplianceVersion + * @static + * @param {google.cloud.vmmigration.v1.IApplianceVersion=} [properties] Properties to set + * @returns {google.cloud.vmmigration.v1.ApplianceVersion} ApplianceVersion instance + */ + ApplianceVersion.create = function create(properties) { + return new ApplianceVersion(properties); + }; + + /** + * Encodes the specified ApplianceVersion message. Does not implicitly {@link google.cloud.vmmigration.v1.ApplianceVersion.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmmigration.v1.ApplianceVersion + * @static + * @param {google.cloud.vmmigration.v1.IApplianceVersion} message ApplianceVersion message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ApplianceVersion.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.version); + if (message.uri != null && Object.hasOwnProperty.call(message, "uri")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.uri); + if (message.critical != null && Object.hasOwnProperty.call(message, "critical")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.critical); + if (message.releaseNotesUri != null && Object.hasOwnProperty.call(message, "releaseNotesUri")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.releaseNotesUri); + return writer; + }; + + /** + * Encodes the specified ApplianceVersion message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.ApplianceVersion.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmmigration.v1.ApplianceVersion + * @static + * @param {google.cloud.vmmigration.v1.IApplianceVersion} message ApplianceVersion message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ApplianceVersion.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ApplianceVersion message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmmigration.v1.ApplianceVersion + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmmigration.v1.ApplianceVersion} ApplianceVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ApplianceVersion.decode = function 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.vmmigration.v1.ApplianceVersion(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.version = reader.string(); + break; + } + case 2: { + message.uri = reader.string(); + break; + } + case 3: { + message.critical = reader.bool(); + break; + } + case 4: { + message.releaseNotesUri = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ApplianceVersion message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmmigration.v1.ApplianceVersion + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmmigration.v1.ApplianceVersion} ApplianceVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ApplianceVersion.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ApplianceVersion message. + * @function verify + * @memberof google.cloud.vmmigration.v1.ApplianceVersion + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ApplianceVersion.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isString(message.version)) + return "version: string expected"; + if (message.uri != null && message.hasOwnProperty("uri")) + if (!$util.isString(message.uri)) + return "uri: string expected"; + if (message.critical != null && message.hasOwnProperty("critical")) + if (typeof message.critical !== "boolean") + return "critical: boolean expected"; + if (message.releaseNotesUri != null && message.hasOwnProperty("releaseNotesUri")) + if (!$util.isString(message.releaseNotesUri)) + return "releaseNotesUri: string expected"; + return null; + }; + + /** + * Creates an ApplianceVersion message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmmigration.v1.ApplianceVersion + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmmigration.v1.ApplianceVersion} ApplianceVersion + */ + ApplianceVersion.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmmigration.v1.ApplianceVersion) + return object; + var message = new $root.google.cloud.vmmigration.v1.ApplianceVersion(); + if (object.version != null) + message.version = String(object.version); + if (object.uri != null) + message.uri = String(object.uri); + if (object.critical != null) + message.critical = Boolean(object.critical); + if (object.releaseNotesUri != null) + message.releaseNotesUri = String(object.releaseNotesUri); + return message; + }; + + /** + * Creates a plain object from an ApplianceVersion message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmmigration.v1.ApplianceVersion + * @static + * @param {google.cloud.vmmigration.v1.ApplianceVersion} message ApplianceVersion + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ApplianceVersion.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.version = ""; + object.uri = ""; + object.critical = false; + object.releaseNotesUri = ""; + } + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + if (message.uri != null && message.hasOwnProperty("uri")) + object.uri = message.uri; + if (message.critical != null && message.hasOwnProperty("critical")) + object.critical = message.critical; + if (message.releaseNotesUri != null && message.hasOwnProperty("releaseNotesUri")) + object.releaseNotesUri = message.releaseNotesUri; + return object; + }; + + /** + * Converts this ApplianceVersion to JSON. + * @function toJSON + * @memberof google.cloud.vmmigration.v1.ApplianceVersion + * @instance + * @returns {Object.} JSON object + */ + ApplianceVersion.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ApplianceVersion + * @function getTypeUrl + * @memberof google.cloud.vmmigration.v1.ApplianceVersion + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ApplianceVersion.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmmigration.v1.ApplianceVersion"; + }; + + return ApplianceVersion; + })(); + + v1.ListSourcesRequest = (function() { + + /** + * Properties of a ListSourcesRequest. + * @memberof google.cloud.vmmigration.v1 + * @interface IListSourcesRequest + * @property {string|null} [parent] ListSourcesRequest parent + * @property {number|null} [pageSize] ListSourcesRequest pageSize + * @property {string|null} [pageToken] ListSourcesRequest pageToken + * @property {string|null} [filter] ListSourcesRequest filter + * @property {string|null} [orderBy] ListSourcesRequest orderBy + */ + + /** + * Constructs a new ListSourcesRequest. + * @memberof google.cloud.vmmigration.v1 + * @classdesc Represents a ListSourcesRequest. + * @implements IListSourcesRequest + * @constructor + * @param {google.cloud.vmmigration.v1.IListSourcesRequest=} [properties] Properties to set + */ + function ListSourcesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListSourcesRequest parent. + * @member {string} parent + * @memberof google.cloud.vmmigration.v1.ListSourcesRequest + * @instance + */ + ListSourcesRequest.prototype.parent = ""; + + /** + * ListSourcesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.vmmigration.v1.ListSourcesRequest + * @instance + */ + ListSourcesRequest.prototype.pageSize = 0; + + /** + * ListSourcesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.vmmigration.v1.ListSourcesRequest + * @instance + */ + ListSourcesRequest.prototype.pageToken = ""; + + /** + * ListSourcesRequest filter. + * @member {string} filter + * @memberof google.cloud.vmmigration.v1.ListSourcesRequest + * @instance + */ + ListSourcesRequest.prototype.filter = ""; + + /** + * ListSourcesRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.vmmigration.v1.ListSourcesRequest + * @instance + */ + ListSourcesRequest.prototype.orderBy = ""; + + /** + * Creates a new ListSourcesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vmmigration.v1.ListSourcesRequest + * @static + * @param {google.cloud.vmmigration.v1.IListSourcesRequest=} [properties] Properties to set + * @returns {google.cloud.vmmigration.v1.ListSourcesRequest} ListSourcesRequest instance + */ + ListSourcesRequest.create = function create(properties) { + return new ListSourcesRequest(properties); + }; + + /** + * Encodes the specified ListSourcesRequest message. Does not implicitly {@link google.cloud.vmmigration.v1.ListSourcesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmmigration.v1.ListSourcesRequest + * @static + * @param {google.cloud.vmmigration.v1.IListSourcesRequest} message ListSourcesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSourcesRequest.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 ListSourcesRequest message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.ListSourcesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmmigration.v1.ListSourcesRequest + * @static + * @param {google.cloud.vmmigration.v1.IListSourcesRequest} message ListSourcesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSourcesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListSourcesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmmigration.v1.ListSourcesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmmigration.v1.ListSourcesRequest} ListSourcesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSourcesRequest.decode = function 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.vmmigration.v1.ListSourcesRequest(); + 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 ListSourcesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmmigration.v1.ListSourcesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmmigration.v1.ListSourcesRequest} ListSourcesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSourcesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListSourcesRequest message. + * @function verify + * @memberof google.cloud.vmmigration.v1.ListSourcesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListSourcesRequest.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 ListSourcesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmmigration.v1.ListSourcesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmmigration.v1.ListSourcesRequest} ListSourcesRequest + */ + ListSourcesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmmigration.v1.ListSourcesRequest) + return object; + var message = new $root.google.cloud.vmmigration.v1.ListSourcesRequest(); + 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 ListSourcesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmmigration.v1.ListSourcesRequest + * @static + * @param {google.cloud.vmmigration.v1.ListSourcesRequest} message ListSourcesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListSourcesRequest.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 ListSourcesRequest to JSON. + * @function toJSON + * @memberof google.cloud.vmmigration.v1.ListSourcesRequest + * @instance + * @returns {Object.} JSON object + */ + ListSourcesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListSourcesRequest + * @function getTypeUrl + * @memberof google.cloud.vmmigration.v1.ListSourcesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListSourcesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmmigration.v1.ListSourcesRequest"; + }; + + return ListSourcesRequest; + })(); + + v1.ListSourcesResponse = (function() { + + /** + * Properties of a ListSourcesResponse. + * @memberof google.cloud.vmmigration.v1 + * @interface IListSourcesResponse + * @property {Array.|null} [sources] ListSourcesResponse sources + * @property {string|null} [nextPageToken] ListSourcesResponse nextPageToken + * @property {Array.|null} [unreachable] ListSourcesResponse unreachable + */ + + /** + * Constructs a new ListSourcesResponse. + * @memberof google.cloud.vmmigration.v1 + * @classdesc Represents a ListSourcesResponse. + * @implements IListSourcesResponse + * @constructor + * @param {google.cloud.vmmigration.v1.IListSourcesResponse=} [properties] Properties to set + */ + function ListSourcesResponse(properties) { + this.sources = []; + 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]]; + } + + /** + * ListSourcesResponse sources. + * @member {Array.} sources + * @memberof google.cloud.vmmigration.v1.ListSourcesResponse + * @instance + */ + ListSourcesResponse.prototype.sources = $util.emptyArray; + + /** + * ListSourcesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.vmmigration.v1.ListSourcesResponse + * @instance + */ + ListSourcesResponse.prototype.nextPageToken = ""; + + /** + * ListSourcesResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.vmmigration.v1.ListSourcesResponse + * @instance + */ + ListSourcesResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListSourcesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.vmmigration.v1.ListSourcesResponse + * @static + * @param {google.cloud.vmmigration.v1.IListSourcesResponse=} [properties] Properties to set + * @returns {google.cloud.vmmigration.v1.ListSourcesResponse} ListSourcesResponse instance + */ + ListSourcesResponse.create = function create(properties) { + return new ListSourcesResponse(properties); + }; + + /** + * Encodes the specified ListSourcesResponse message. Does not implicitly {@link google.cloud.vmmigration.v1.ListSourcesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmmigration.v1.ListSourcesResponse + * @static + * @param {google.cloud.vmmigration.v1.IListSourcesResponse} message ListSourcesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSourcesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sources != null && message.sources.length) + for (var i = 0; i < message.sources.length; ++i) + $root.google.cloud.vmmigration.v1.Source.encode(message.sources[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 ListSourcesResponse message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.ListSourcesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmmigration.v1.ListSourcesResponse + * @static + * @param {google.cloud.vmmigration.v1.IListSourcesResponse} message ListSourcesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSourcesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListSourcesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmmigration.v1.ListSourcesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmmigration.v1.ListSourcesResponse} ListSourcesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSourcesResponse.decode = function 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.vmmigration.v1.ListSourcesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.sources && message.sources.length)) + message.sources = []; + message.sources.push($root.google.cloud.vmmigration.v1.Source.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 ListSourcesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmmigration.v1.ListSourcesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmmigration.v1.ListSourcesResponse} ListSourcesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSourcesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListSourcesResponse message. + * @function verify + * @memberof google.cloud.vmmigration.v1.ListSourcesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListSourcesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.sources != null && message.hasOwnProperty("sources")) { + if (!Array.isArray(message.sources)) + return "sources: array expected"; + for (var i = 0; i < message.sources.length; ++i) { + var error = $root.google.cloud.vmmigration.v1.Source.verify(message.sources[i]); + if (error) + return "sources." + 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 ListSourcesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmmigration.v1.ListSourcesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmmigration.v1.ListSourcesResponse} ListSourcesResponse + */ + ListSourcesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmmigration.v1.ListSourcesResponse) + return object; + var message = new $root.google.cloud.vmmigration.v1.ListSourcesResponse(); + if (object.sources) { + if (!Array.isArray(object.sources)) + throw TypeError(".google.cloud.vmmigration.v1.ListSourcesResponse.sources: array expected"); + message.sources = []; + for (var i = 0; i < object.sources.length; ++i) { + if (typeof object.sources[i] !== "object") + throw TypeError(".google.cloud.vmmigration.v1.ListSourcesResponse.sources: object expected"); + message.sources[i] = $root.google.cloud.vmmigration.v1.Source.fromObject(object.sources[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.vmmigration.v1.ListSourcesResponse.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 ListSourcesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmmigration.v1.ListSourcesResponse + * @static + * @param {google.cloud.vmmigration.v1.ListSourcesResponse} message ListSourcesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListSourcesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.sources = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.sources && message.sources.length) { + object.sources = []; + for (var j = 0; j < message.sources.length; ++j) + object.sources[j] = $root.google.cloud.vmmigration.v1.Source.toObject(message.sources[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 ListSourcesResponse to JSON. + * @function toJSON + * @memberof google.cloud.vmmigration.v1.ListSourcesResponse + * @instance + * @returns {Object.} JSON object + */ + ListSourcesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListSourcesResponse + * @function getTypeUrl + * @memberof google.cloud.vmmigration.v1.ListSourcesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListSourcesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmmigration.v1.ListSourcesResponse"; + }; + + return ListSourcesResponse; + })(); + + v1.GetSourceRequest = (function() { + + /** + * Properties of a GetSourceRequest. + * @memberof google.cloud.vmmigration.v1 + * @interface IGetSourceRequest + * @property {string|null} [name] GetSourceRequest name + */ + + /** + * Constructs a new GetSourceRequest. + * @memberof google.cloud.vmmigration.v1 + * @classdesc Represents a GetSourceRequest. + * @implements IGetSourceRequest + * @constructor + * @param {google.cloud.vmmigration.v1.IGetSourceRequest=} [properties] Properties to set + */ + function GetSourceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetSourceRequest name. + * @member {string} name + * @memberof google.cloud.vmmigration.v1.GetSourceRequest + * @instance + */ + GetSourceRequest.prototype.name = ""; + + /** + * Creates a new GetSourceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vmmigration.v1.GetSourceRequest + * @static + * @param {google.cloud.vmmigration.v1.IGetSourceRequest=} [properties] Properties to set + * @returns {google.cloud.vmmigration.v1.GetSourceRequest} GetSourceRequest instance + */ + GetSourceRequest.create = function create(properties) { + return new GetSourceRequest(properties); + }; + + /** + * Encodes the specified GetSourceRequest message. Does not implicitly {@link google.cloud.vmmigration.v1.GetSourceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmmigration.v1.GetSourceRequest + * @static + * @param {google.cloud.vmmigration.v1.IGetSourceRequest} message GetSourceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetSourceRequest.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 GetSourceRequest message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.GetSourceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmmigration.v1.GetSourceRequest + * @static + * @param {google.cloud.vmmigration.v1.IGetSourceRequest} message GetSourceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetSourceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetSourceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmmigration.v1.GetSourceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmmigration.v1.GetSourceRequest} GetSourceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetSourceRequest.decode = function 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.vmmigration.v1.GetSourceRequest(); + 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 GetSourceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmmigration.v1.GetSourceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmmigration.v1.GetSourceRequest} GetSourceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetSourceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetSourceRequest message. + * @function verify + * @memberof google.cloud.vmmigration.v1.GetSourceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetSourceRequest.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 GetSourceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmmigration.v1.GetSourceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmmigration.v1.GetSourceRequest} GetSourceRequest + */ + GetSourceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmmigration.v1.GetSourceRequest) + return object; + var message = new $root.google.cloud.vmmigration.v1.GetSourceRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetSourceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmmigration.v1.GetSourceRequest + * @static + * @param {google.cloud.vmmigration.v1.GetSourceRequest} message GetSourceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetSourceRequest.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 GetSourceRequest to JSON. + * @function toJSON + * @memberof google.cloud.vmmigration.v1.GetSourceRequest + * @instance + * @returns {Object.} JSON object + */ + GetSourceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetSourceRequest + * @function getTypeUrl + * @memberof google.cloud.vmmigration.v1.GetSourceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetSourceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmmigration.v1.GetSourceRequest"; + }; + + return GetSourceRequest; + })(); + + v1.CreateSourceRequest = (function() { + + /** + * Properties of a CreateSourceRequest. + * @memberof google.cloud.vmmigration.v1 + * @interface ICreateSourceRequest + * @property {string|null} [parent] CreateSourceRequest parent + * @property {string|null} [sourceId] CreateSourceRequest sourceId + * @property {google.cloud.vmmigration.v1.ISource|null} [source] CreateSourceRequest source + * @property {string|null} [requestId] CreateSourceRequest requestId + */ + + /** + * Constructs a new CreateSourceRequest. + * @memberof google.cloud.vmmigration.v1 + * @classdesc Represents a CreateSourceRequest. + * @implements ICreateSourceRequest + * @constructor + * @param {google.cloud.vmmigration.v1.ICreateSourceRequest=} [properties] Properties to set + */ + function CreateSourceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateSourceRequest parent. + * @member {string} parent + * @memberof google.cloud.vmmigration.v1.CreateSourceRequest + * @instance + */ + CreateSourceRequest.prototype.parent = ""; + + /** + * CreateSourceRequest sourceId. + * @member {string} sourceId + * @memberof google.cloud.vmmigration.v1.CreateSourceRequest + * @instance + */ + CreateSourceRequest.prototype.sourceId = ""; + + /** + * CreateSourceRequest source. + * @member {google.cloud.vmmigration.v1.ISource|null|undefined} source + * @memberof google.cloud.vmmigration.v1.CreateSourceRequest + * @instance + */ + CreateSourceRequest.prototype.source = null; + + /** + * CreateSourceRequest requestId. + * @member {string} requestId + * @memberof google.cloud.vmmigration.v1.CreateSourceRequest + * @instance + */ + CreateSourceRequest.prototype.requestId = ""; + + /** + * Creates a new CreateSourceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vmmigration.v1.CreateSourceRequest + * @static + * @param {google.cloud.vmmigration.v1.ICreateSourceRequest=} [properties] Properties to set + * @returns {google.cloud.vmmigration.v1.CreateSourceRequest} CreateSourceRequest instance + */ + CreateSourceRequest.create = function create(properties) { + return new CreateSourceRequest(properties); + }; + + /** + * Encodes the specified CreateSourceRequest message. Does not implicitly {@link google.cloud.vmmigration.v1.CreateSourceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmmigration.v1.CreateSourceRequest + * @static + * @param {google.cloud.vmmigration.v1.ICreateSourceRequest} message CreateSourceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateSourceRequest.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.sourceId != null && Object.hasOwnProperty.call(message, "sourceId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceId); + if (message.source != null && Object.hasOwnProperty.call(message, "source")) + $root.google.cloud.vmmigration.v1.Source.encode(message.source, 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 CreateSourceRequest message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.CreateSourceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmmigration.v1.CreateSourceRequest + * @static + * @param {google.cloud.vmmigration.v1.ICreateSourceRequest} message CreateSourceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateSourceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateSourceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmmigration.v1.CreateSourceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmmigration.v1.CreateSourceRequest} CreateSourceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateSourceRequest.decode = function 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.vmmigration.v1.CreateSourceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.sourceId = reader.string(); + break; + } + case 3: { + message.source = $root.google.cloud.vmmigration.v1.Source.decode(reader, reader.uint32()); + break; + } + case 4: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateSourceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmmigration.v1.CreateSourceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmmigration.v1.CreateSourceRequest} CreateSourceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateSourceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateSourceRequest message. + * @function verify + * @memberof google.cloud.vmmigration.v1.CreateSourceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateSourceRequest.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.sourceId != null && message.hasOwnProperty("sourceId")) + if (!$util.isString(message.sourceId)) + return "sourceId: string expected"; + if (message.source != null && message.hasOwnProperty("source")) { + var error = $root.google.cloud.vmmigration.v1.Source.verify(message.source); + if (error) + return "source." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a CreateSourceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmmigration.v1.CreateSourceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmmigration.v1.CreateSourceRequest} CreateSourceRequest + */ + CreateSourceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmmigration.v1.CreateSourceRequest) + return object; + var message = new $root.google.cloud.vmmigration.v1.CreateSourceRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.sourceId != null) + message.sourceId = String(object.sourceId); + if (object.source != null) { + if (typeof object.source !== "object") + throw TypeError(".google.cloud.vmmigration.v1.CreateSourceRequest.source: object expected"); + message.source = $root.google.cloud.vmmigration.v1.Source.fromObject(object.source); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a CreateSourceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmmigration.v1.CreateSourceRequest + * @static + * @param {google.cloud.vmmigration.v1.CreateSourceRequest} message CreateSourceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateSourceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.sourceId = ""; + object.source = null; + object.requestId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.sourceId != null && message.hasOwnProperty("sourceId")) + object.sourceId = message.sourceId; + if (message.source != null && message.hasOwnProperty("source")) + object.source = $root.google.cloud.vmmigration.v1.Source.toObject(message.source, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this CreateSourceRequest to JSON. + * @function toJSON + * @memberof google.cloud.vmmigration.v1.CreateSourceRequest + * @instance + * @returns {Object.} JSON object + */ + CreateSourceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateSourceRequest + * @function getTypeUrl + * @memberof google.cloud.vmmigration.v1.CreateSourceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateSourceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmmigration.v1.CreateSourceRequest"; + }; + + return CreateSourceRequest; + })(); + + v1.UpdateSourceRequest = (function() { + + /** + * Properties of an UpdateSourceRequest. + * @memberof google.cloud.vmmigration.v1 + * @interface IUpdateSourceRequest + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateSourceRequest updateMask + * @property {google.cloud.vmmigration.v1.ISource|null} [source] UpdateSourceRequest source + * @property {string|null} [requestId] UpdateSourceRequest requestId + */ + + /** + * Constructs a new UpdateSourceRequest. + * @memberof google.cloud.vmmigration.v1 + * @classdesc Represents an UpdateSourceRequest. + * @implements IUpdateSourceRequest + * @constructor + * @param {google.cloud.vmmigration.v1.IUpdateSourceRequest=} [properties] Properties to set + */ + function UpdateSourceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateSourceRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.vmmigration.v1.UpdateSourceRequest + * @instance + */ + UpdateSourceRequest.prototype.updateMask = null; + + /** + * UpdateSourceRequest source. + * @member {google.cloud.vmmigration.v1.ISource|null|undefined} source + * @memberof google.cloud.vmmigration.v1.UpdateSourceRequest + * @instance + */ + UpdateSourceRequest.prototype.source = null; + + /** + * UpdateSourceRequest requestId. + * @member {string} requestId + * @memberof google.cloud.vmmigration.v1.UpdateSourceRequest + * @instance + */ + UpdateSourceRequest.prototype.requestId = ""; + + /** + * Creates a new UpdateSourceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vmmigration.v1.UpdateSourceRequest + * @static + * @param {google.cloud.vmmigration.v1.IUpdateSourceRequest=} [properties] Properties to set + * @returns {google.cloud.vmmigration.v1.UpdateSourceRequest} UpdateSourceRequest instance + */ + UpdateSourceRequest.create = function create(properties) { + return new UpdateSourceRequest(properties); + }; + + /** + * Encodes the specified UpdateSourceRequest message. Does not implicitly {@link google.cloud.vmmigration.v1.UpdateSourceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmmigration.v1.UpdateSourceRequest + * @static + * @param {google.cloud.vmmigration.v1.IUpdateSourceRequest} message UpdateSourceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateSourceRequest.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.source != null && Object.hasOwnProperty.call(message, "source")) + $root.google.cloud.vmmigration.v1.Source.encode(message.source, 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 UpdateSourceRequest message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.UpdateSourceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmmigration.v1.UpdateSourceRequest + * @static + * @param {google.cloud.vmmigration.v1.IUpdateSourceRequest} message UpdateSourceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateSourceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateSourceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmmigration.v1.UpdateSourceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmmigration.v1.UpdateSourceRequest} UpdateSourceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateSourceRequest.decode = function 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.vmmigration.v1.UpdateSourceRequest(); + 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.source = $root.google.cloud.vmmigration.v1.Source.decode(reader, reader.uint32()); + break; + } + case 3: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateSourceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmmigration.v1.UpdateSourceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmmigration.v1.UpdateSourceRequest} UpdateSourceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateSourceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateSourceRequest message. + * @function verify + * @memberof google.cloud.vmmigration.v1.UpdateSourceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateSourceRequest.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.source != null && message.hasOwnProperty("source")) { + var error = $root.google.cloud.vmmigration.v1.Source.verify(message.source); + if (error) + return "source." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates an UpdateSourceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmmigration.v1.UpdateSourceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmmigration.v1.UpdateSourceRequest} UpdateSourceRequest + */ + UpdateSourceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmmigration.v1.UpdateSourceRequest) + return object; + var message = new $root.google.cloud.vmmigration.v1.UpdateSourceRequest(); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.vmmigration.v1.UpdateSourceRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.source != null) { + if (typeof object.source !== "object") + throw TypeError(".google.cloud.vmmigration.v1.UpdateSourceRequest.source: object expected"); + message.source = $root.google.cloud.vmmigration.v1.Source.fromObject(object.source); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from an UpdateSourceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmmigration.v1.UpdateSourceRequest + * @static + * @param {google.cloud.vmmigration.v1.UpdateSourceRequest} message UpdateSourceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateSourceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.updateMask = null; + object.source = null; + object.requestId = ""; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.source != null && message.hasOwnProperty("source")) + object.source = $root.google.cloud.vmmigration.v1.Source.toObject(message.source, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this UpdateSourceRequest to JSON. + * @function toJSON + * @memberof google.cloud.vmmigration.v1.UpdateSourceRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateSourceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateSourceRequest + * @function getTypeUrl + * @memberof google.cloud.vmmigration.v1.UpdateSourceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateSourceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmmigration.v1.UpdateSourceRequest"; + }; + + return UpdateSourceRequest; + })(); + + v1.DeleteSourceRequest = (function() { + + /** + * Properties of a DeleteSourceRequest. + * @memberof google.cloud.vmmigration.v1 + * @interface IDeleteSourceRequest + * @property {string|null} [name] DeleteSourceRequest name + * @property {string|null} [requestId] DeleteSourceRequest requestId + */ + + /** + * Constructs a new DeleteSourceRequest. + * @memberof google.cloud.vmmigration.v1 + * @classdesc Represents a DeleteSourceRequest. + * @implements IDeleteSourceRequest + * @constructor + * @param {google.cloud.vmmigration.v1.IDeleteSourceRequest=} [properties] Properties to set + */ + function DeleteSourceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteSourceRequest name. + * @member {string} name + * @memberof google.cloud.vmmigration.v1.DeleteSourceRequest + * @instance + */ + DeleteSourceRequest.prototype.name = ""; + + /** + * DeleteSourceRequest requestId. + * @member {string} requestId + * @memberof google.cloud.vmmigration.v1.DeleteSourceRequest + * @instance + */ + DeleteSourceRequest.prototype.requestId = ""; + + /** + * Creates a new DeleteSourceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vmmigration.v1.DeleteSourceRequest + * @static + * @param {google.cloud.vmmigration.v1.IDeleteSourceRequest=} [properties] Properties to set + * @returns {google.cloud.vmmigration.v1.DeleteSourceRequest} DeleteSourceRequest instance + */ + DeleteSourceRequest.create = function create(properties) { + return new DeleteSourceRequest(properties); + }; + + /** + * Encodes the specified DeleteSourceRequest message. Does not implicitly {@link google.cloud.vmmigration.v1.DeleteSourceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmmigration.v1.DeleteSourceRequest + * @static + * @param {google.cloud.vmmigration.v1.IDeleteSourceRequest} message DeleteSourceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteSourceRequest.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); + return writer; + }; + + /** + * Encodes the specified DeleteSourceRequest message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.DeleteSourceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmmigration.v1.DeleteSourceRequest + * @static + * @param {google.cloud.vmmigration.v1.IDeleteSourceRequest} message DeleteSourceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteSourceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteSourceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmmigration.v1.DeleteSourceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmmigration.v1.DeleteSourceRequest} DeleteSourceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteSourceRequest.decode = function 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.vmmigration.v1.DeleteSourceRequest(); + 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; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteSourceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmmigration.v1.DeleteSourceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmmigration.v1.DeleteSourceRequest} DeleteSourceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteSourceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteSourceRequest message. + * @function verify + * @memberof google.cloud.vmmigration.v1.DeleteSourceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteSourceRequest.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"; + return null; + }; + + /** + * Creates a DeleteSourceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmmigration.v1.DeleteSourceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmmigration.v1.DeleteSourceRequest} DeleteSourceRequest + */ + DeleteSourceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmmigration.v1.DeleteSourceRequest) + return object; + var message = new $root.google.cloud.vmmigration.v1.DeleteSourceRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a DeleteSourceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmmigration.v1.DeleteSourceRequest + * @static + * @param {google.cloud.vmmigration.v1.DeleteSourceRequest} message DeleteSourceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteSourceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.requestId = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this DeleteSourceRequest to JSON. + * @function toJSON + * @memberof google.cloud.vmmigration.v1.DeleteSourceRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteSourceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteSourceRequest + * @function getTypeUrl + * @memberof google.cloud.vmmigration.v1.DeleteSourceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteSourceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmmigration.v1.DeleteSourceRequest"; + }; + + return DeleteSourceRequest; + })(); + + v1.FetchInventoryRequest = (function() { + + /** + * Properties of a FetchInventoryRequest. + * @memberof google.cloud.vmmigration.v1 + * @interface IFetchInventoryRequest + * @property {string|null} [source] FetchInventoryRequest source + * @property {boolean|null} [forceRefresh] FetchInventoryRequest forceRefresh + */ + + /** + * Constructs a new FetchInventoryRequest. + * @memberof google.cloud.vmmigration.v1 + * @classdesc Represents a FetchInventoryRequest. + * @implements IFetchInventoryRequest + * @constructor + * @param {google.cloud.vmmigration.v1.IFetchInventoryRequest=} [properties] Properties to set + */ + function FetchInventoryRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FetchInventoryRequest source. + * @member {string} source + * @memberof google.cloud.vmmigration.v1.FetchInventoryRequest + * @instance + */ + FetchInventoryRequest.prototype.source = ""; + + /** + * FetchInventoryRequest forceRefresh. + * @member {boolean} forceRefresh + * @memberof google.cloud.vmmigration.v1.FetchInventoryRequest + * @instance + */ + FetchInventoryRequest.prototype.forceRefresh = false; + + /** + * Creates a new FetchInventoryRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vmmigration.v1.FetchInventoryRequest + * @static + * @param {google.cloud.vmmigration.v1.IFetchInventoryRequest=} [properties] Properties to set + * @returns {google.cloud.vmmigration.v1.FetchInventoryRequest} FetchInventoryRequest instance + */ + FetchInventoryRequest.create = function create(properties) { + return new FetchInventoryRequest(properties); + }; + + /** + * Encodes the specified FetchInventoryRequest message. Does not implicitly {@link google.cloud.vmmigration.v1.FetchInventoryRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmmigration.v1.FetchInventoryRequest + * @static + * @param {google.cloud.vmmigration.v1.IFetchInventoryRequest} message FetchInventoryRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FetchInventoryRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.source != null && Object.hasOwnProperty.call(message, "source")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.source); + if (message.forceRefresh != null && Object.hasOwnProperty.call(message, "forceRefresh")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.forceRefresh); + return writer; + }; + + /** + * Encodes the specified FetchInventoryRequest message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.FetchInventoryRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmmigration.v1.FetchInventoryRequest + * @static + * @param {google.cloud.vmmigration.v1.IFetchInventoryRequest} message FetchInventoryRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FetchInventoryRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FetchInventoryRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmmigration.v1.FetchInventoryRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmmigration.v1.FetchInventoryRequest} FetchInventoryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FetchInventoryRequest.decode = function 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.vmmigration.v1.FetchInventoryRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.source = reader.string(); + break; + } + case 2: { + message.forceRefresh = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FetchInventoryRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmmigration.v1.FetchInventoryRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmmigration.v1.FetchInventoryRequest} FetchInventoryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FetchInventoryRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FetchInventoryRequest message. + * @function verify + * @memberof google.cloud.vmmigration.v1.FetchInventoryRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FetchInventoryRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.source != null && message.hasOwnProperty("source")) + if (!$util.isString(message.source)) + return "source: string expected"; + if (message.forceRefresh != null && message.hasOwnProperty("forceRefresh")) + if (typeof message.forceRefresh !== "boolean") + return "forceRefresh: boolean expected"; + return null; + }; + + /** + * Creates a FetchInventoryRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmmigration.v1.FetchInventoryRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmmigration.v1.FetchInventoryRequest} FetchInventoryRequest + */ + FetchInventoryRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmmigration.v1.FetchInventoryRequest) + return object; + var message = new $root.google.cloud.vmmigration.v1.FetchInventoryRequest(); + if (object.source != null) + message.source = String(object.source); + if (object.forceRefresh != null) + message.forceRefresh = Boolean(object.forceRefresh); + return message; + }; + + /** + * Creates a plain object from a FetchInventoryRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmmigration.v1.FetchInventoryRequest + * @static + * @param {google.cloud.vmmigration.v1.FetchInventoryRequest} message FetchInventoryRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FetchInventoryRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.source = ""; + object.forceRefresh = false; + } + if (message.source != null && message.hasOwnProperty("source")) + object.source = message.source; + if (message.forceRefresh != null && message.hasOwnProperty("forceRefresh")) + object.forceRefresh = message.forceRefresh; + return object; + }; + + /** + * Converts this FetchInventoryRequest to JSON. + * @function toJSON + * @memberof google.cloud.vmmigration.v1.FetchInventoryRequest + * @instance + * @returns {Object.} JSON object + */ + FetchInventoryRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FetchInventoryRequest + * @function getTypeUrl + * @memberof google.cloud.vmmigration.v1.FetchInventoryRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FetchInventoryRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmmigration.v1.FetchInventoryRequest"; + }; + + return FetchInventoryRequest; + })(); + + v1.VmwareVmDetails = (function() { + + /** + * Properties of a VmwareVmDetails. + * @memberof google.cloud.vmmigration.v1 + * @interface IVmwareVmDetails + * @property {string|null} [vmId] VmwareVmDetails vmId + * @property {string|null} [datacenterId] VmwareVmDetails datacenterId + * @property {string|null} [datacenterDescription] VmwareVmDetails datacenterDescription + * @property {string|null} [uuid] VmwareVmDetails uuid + * @property {string|null} [displayName] VmwareVmDetails displayName + * @property {google.cloud.vmmigration.v1.VmwareVmDetails.PowerState|null} [powerState] VmwareVmDetails powerState + * @property {number|null} [cpuCount] VmwareVmDetails cpuCount + * @property {number|null} [memoryMb] VmwareVmDetails memoryMb + * @property {number|null} [diskCount] VmwareVmDetails diskCount + * @property {number|Long|null} [committedStorageMb] VmwareVmDetails committedStorageMb + * @property {string|null} [guestDescription] VmwareVmDetails guestDescription + * @property {google.cloud.vmmigration.v1.VmwareVmDetails.BootOption|null} [bootOption] VmwareVmDetails bootOption + */ + + /** + * Constructs a new VmwareVmDetails. + * @memberof google.cloud.vmmigration.v1 + * @classdesc Represents a VmwareVmDetails. + * @implements IVmwareVmDetails + * @constructor + * @param {google.cloud.vmmigration.v1.IVmwareVmDetails=} [properties] Properties to set + */ + function VmwareVmDetails(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * VmwareVmDetails vmId. + * @member {string} vmId + * @memberof google.cloud.vmmigration.v1.VmwareVmDetails + * @instance + */ + VmwareVmDetails.prototype.vmId = ""; + + /** + * VmwareVmDetails datacenterId. + * @member {string} datacenterId + * @memberof google.cloud.vmmigration.v1.VmwareVmDetails + * @instance + */ + VmwareVmDetails.prototype.datacenterId = ""; + + /** + * VmwareVmDetails datacenterDescription. + * @member {string} datacenterDescription + * @memberof google.cloud.vmmigration.v1.VmwareVmDetails + * @instance + */ + VmwareVmDetails.prototype.datacenterDescription = ""; + + /** + * VmwareVmDetails uuid. + * @member {string} uuid + * @memberof google.cloud.vmmigration.v1.VmwareVmDetails + * @instance + */ + VmwareVmDetails.prototype.uuid = ""; + + /** + * VmwareVmDetails displayName. + * @member {string} displayName + * @memberof google.cloud.vmmigration.v1.VmwareVmDetails + * @instance + */ + VmwareVmDetails.prototype.displayName = ""; + + /** + * VmwareVmDetails powerState. + * @member {google.cloud.vmmigration.v1.VmwareVmDetails.PowerState} powerState + * @memberof google.cloud.vmmigration.v1.VmwareVmDetails + * @instance + */ + VmwareVmDetails.prototype.powerState = 0; + + /** + * VmwareVmDetails cpuCount. + * @member {number} cpuCount + * @memberof google.cloud.vmmigration.v1.VmwareVmDetails + * @instance + */ + VmwareVmDetails.prototype.cpuCount = 0; + + /** + * VmwareVmDetails memoryMb. + * @member {number} memoryMb + * @memberof google.cloud.vmmigration.v1.VmwareVmDetails + * @instance + */ + VmwareVmDetails.prototype.memoryMb = 0; + + /** + * VmwareVmDetails diskCount. + * @member {number} diskCount + * @memberof google.cloud.vmmigration.v1.VmwareVmDetails + * @instance + */ + VmwareVmDetails.prototype.diskCount = 0; + + /** + * VmwareVmDetails committedStorageMb. + * @member {number|Long} committedStorageMb + * @memberof google.cloud.vmmigration.v1.VmwareVmDetails + * @instance + */ + VmwareVmDetails.prototype.committedStorageMb = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * VmwareVmDetails guestDescription. + * @member {string} guestDescription + * @memberof google.cloud.vmmigration.v1.VmwareVmDetails + * @instance + */ + VmwareVmDetails.prototype.guestDescription = ""; + + /** + * VmwareVmDetails bootOption. + * @member {google.cloud.vmmigration.v1.VmwareVmDetails.BootOption} bootOption + * @memberof google.cloud.vmmigration.v1.VmwareVmDetails + * @instance + */ + VmwareVmDetails.prototype.bootOption = 0; + + /** + * Creates a new VmwareVmDetails instance using the specified properties. + * @function create + * @memberof google.cloud.vmmigration.v1.VmwareVmDetails + * @static + * @param {google.cloud.vmmigration.v1.IVmwareVmDetails=} [properties] Properties to set + * @returns {google.cloud.vmmigration.v1.VmwareVmDetails} VmwareVmDetails instance + */ + VmwareVmDetails.create = function create(properties) { + return new VmwareVmDetails(properties); + }; + + /** + * Encodes the specified VmwareVmDetails message. Does not implicitly {@link google.cloud.vmmigration.v1.VmwareVmDetails.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmmigration.v1.VmwareVmDetails + * @static + * @param {google.cloud.vmmigration.v1.IVmwareVmDetails} message VmwareVmDetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VmwareVmDetails.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.vmId != null && Object.hasOwnProperty.call(message, "vmId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.vmId); + if (message.datacenterId != null && Object.hasOwnProperty.call(message, "datacenterId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.datacenterId); + if (message.datacenterDescription != null && Object.hasOwnProperty.call(message, "datacenterDescription")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.datacenterDescription); + if (message.uuid != null && Object.hasOwnProperty.call(message, "uuid")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.uuid); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.displayName); + if (message.powerState != null && Object.hasOwnProperty.call(message, "powerState")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.powerState); + if (message.cpuCount != null && Object.hasOwnProperty.call(message, "cpuCount")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.cpuCount); + if (message.memoryMb != null && Object.hasOwnProperty.call(message, "memoryMb")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.memoryMb); + if (message.diskCount != null && Object.hasOwnProperty.call(message, "diskCount")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.diskCount); + if (message.guestDescription != null && Object.hasOwnProperty.call(message, "guestDescription")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.guestDescription); + if (message.committedStorageMb != null && Object.hasOwnProperty.call(message, "committedStorageMb")) + writer.uint32(/* id 12, wireType 0 =*/96).int64(message.committedStorageMb); + if (message.bootOption != null && Object.hasOwnProperty.call(message, "bootOption")) + writer.uint32(/* id 13, wireType 0 =*/104).int32(message.bootOption); + return writer; + }; + + /** + * Encodes the specified VmwareVmDetails message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.VmwareVmDetails.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmmigration.v1.VmwareVmDetails + * @static + * @param {google.cloud.vmmigration.v1.IVmwareVmDetails} message VmwareVmDetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VmwareVmDetails.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VmwareVmDetails message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmmigration.v1.VmwareVmDetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmmigration.v1.VmwareVmDetails} VmwareVmDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VmwareVmDetails.decode = function 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.vmmigration.v1.VmwareVmDetails(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.vmId = reader.string(); + break; + } + case 2: { + message.datacenterId = reader.string(); + break; + } + case 3: { + message.datacenterDescription = reader.string(); + break; + } + case 4: { + message.uuid = reader.string(); + break; + } + case 5: { + message.displayName = reader.string(); + break; + } + case 6: { + message.powerState = reader.int32(); + break; + } + case 7: { + message.cpuCount = reader.int32(); + break; + } + case 8: { + message.memoryMb = reader.int32(); + break; + } + case 9: { + message.diskCount = reader.int32(); + break; + } + case 12: { + message.committedStorageMb = reader.int64(); + break; + } + case 11: { + message.guestDescription = reader.string(); + break; + } + case 13: { + message.bootOption = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VmwareVmDetails message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmmigration.v1.VmwareVmDetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmmigration.v1.VmwareVmDetails} VmwareVmDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VmwareVmDetails.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VmwareVmDetails message. + * @function verify + * @memberof google.cloud.vmmigration.v1.VmwareVmDetails + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VmwareVmDetails.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.vmId != null && message.hasOwnProperty("vmId")) + if (!$util.isString(message.vmId)) + return "vmId: string expected"; + if (message.datacenterId != null && message.hasOwnProperty("datacenterId")) + if (!$util.isString(message.datacenterId)) + return "datacenterId: string expected"; + if (message.datacenterDescription != null && message.hasOwnProperty("datacenterDescription")) + if (!$util.isString(message.datacenterDescription)) + return "datacenterDescription: string expected"; + if (message.uuid != null && message.hasOwnProperty("uuid")) + if (!$util.isString(message.uuid)) + return "uuid: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.powerState != null && message.hasOwnProperty("powerState")) + switch (message.powerState) { + default: + return "powerState: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.cpuCount != null && message.hasOwnProperty("cpuCount")) + if (!$util.isInteger(message.cpuCount)) + return "cpuCount: integer expected"; + if (message.memoryMb != null && message.hasOwnProperty("memoryMb")) + if (!$util.isInteger(message.memoryMb)) + return "memoryMb: integer expected"; + if (message.diskCount != null && message.hasOwnProperty("diskCount")) + if (!$util.isInteger(message.diskCount)) + return "diskCount: integer expected"; + if (message.committedStorageMb != null && message.hasOwnProperty("committedStorageMb")) + if (!$util.isInteger(message.committedStorageMb) && !(message.committedStorageMb && $util.isInteger(message.committedStorageMb.low) && $util.isInteger(message.committedStorageMb.high))) + return "committedStorageMb: integer|Long expected"; + if (message.guestDescription != null && message.hasOwnProperty("guestDescription")) + if (!$util.isString(message.guestDescription)) + return "guestDescription: string expected"; + if (message.bootOption != null && message.hasOwnProperty("bootOption")) + switch (message.bootOption) { + default: + return "bootOption: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a VmwareVmDetails message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmmigration.v1.VmwareVmDetails + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmmigration.v1.VmwareVmDetails} VmwareVmDetails + */ + VmwareVmDetails.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmmigration.v1.VmwareVmDetails) + return object; + var message = new $root.google.cloud.vmmigration.v1.VmwareVmDetails(); + if (object.vmId != null) + message.vmId = String(object.vmId); + if (object.datacenterId != null) + message.datacenterId = String(object.datacenterId); + if (object.datacenterDescription != null) + message.datacenterDescription = String(object.datacenterDescription); + if (object.uuid != null) + message.uuid = String(object.uuid); + if (object.displayName != null) + message.displayName = String(object.displayName); + switch (object.powerState) { + default: + if (typeof object.powerState === "number") { + message.powerState = object.powerState; + break; + } + break; + case "POWER_STATE_UNSPECIFIED": + case 0: + message.powerState = 0; + break; + case "ON": + case 1: + message.powerState = 1; + break; + case "OFF": + case 2: + message.powerState = 2; + break; + case "SUSPENDED": + case 3: + message.powerState = 3; + break; + } + if (object.cpuCount != null) + message.cpuCount = object.cpuCount | 0; + if (object.memoryMb != null) + message.memoryMb = object.memoryMb | 0; + if (object.diskCount != null) + message.diskCount = object.diskCount | 0; + if (object.committedStorageMb != null) + if ($util.Long) + (message.committedStorageMb = $util.Long.fromValue(object.committedStorageMb)).unsigned = false; + else if (typeof object.committedStorageMb === "string") + message.committedStorageMb = parseInt(object.committedStorageMb, 10); + else if (typeof object.committedStorageMb === "number") + message.committedStorageMb = object.committedStorageMb; + else if (typeof object.committedStorageMb === "object") + message.committedStorageMb = new $util.LongBits(object.committedStorageMb.low >>> 0, object.committedStorageMb.high >>> 0).toNumber(); + if (object.guestDescription != null) + message.guestDescription = String(object.guestDescription); + switch (object.bootOption) { + default: + if (typeof object.bootOption === "number") { + message.bootOption = object.bootOption; + break; + } + break; + case "BOOT_OPTION_UNSPECIFIED": + case 0: + message.bootOption = 0; + break; + case "EFI": + case 1: + message.bootOption = 1; + break; + case "BIOS": + case 2: + message.bootOption = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a VmwareVmDetails message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmmigration.v1.VmwareVmDetails + * @static + * @param {google.cloud.vmmigration.v1.VmwareVmDetails} message VmwareVmDetails + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VmwareVmDetails.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.vmId = ""; + object.datacenterId = ""; + object.datacenterDescription = ""; + object.uuid = ""; + object.displayName = ""; + object.powerState = options.enums === String ? "POWER_STATE_UNSPECIFIED" : 0; + object.cpuCount = 0; + object.memoryMb = 0; + object.diskCount = 0; + object.guestDescription = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.committedStorageMb = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.committedStorageMb = options.longs === String ? "0" : 0; + object.bootOption = options.enums === String ? "BOOT_OPTION_UNSPECIFIED" : 0; + } + if (message.vmId != null && message.hasOwnProperty("vmId")) + object.vmId = message.vmId; + if (message.datacenterId != null && message.hasOwnProperty("datacenterId")) + object.datacenterId = message.datacenterId; + if (message.datacenterDescription != null && message.hasOwnProperty("datacenterDescription")) + object.datacenterDescription = message.datacenterDescription; + if (message.uuid != null && message.hasOwnProperty("uuid")) + object.uuid = message.uuid; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.powerState != null && message.hasOwnProperty("powerState")) + object.powerState = options.enums === String ? $root.google.cloud.vmmigration.v1.VmwareVmDetails.PowerState[message.powerState] === undefined ? message.powerState : $root.google.cloud.vmmigration.v1.VmwareVmDetails.PowerState[message.powerState] : message.powerState; + if (message.cpuCount != null && message.hasOwnProperty("cpuCount")) + object.cpuCount = message.cpuCount; + if (message.memoryMb != null && message.hasOwnProperty("memoryMb")) + object.memoryMb = message.memoryMb; + if (message.diskCount != null && message.hasOwnProperty("diskCount")) + object.diskCount = message.diskCount; + if (message.guestDescription != null && message.hasOwnProperty("guestDescription")) + object.guestDescription = message.guestDescription; + if (message.committedStorageMb != null && message.hasOwnProperty("committedStorageMb")) + if (typeof message.committedStorageMb === "number") + object.committedStorageMb = options.longs === String ? String(message.committedStorageMb) : message.committedStorageMb; + else + object.committedStorageMb = options.longs === String ? $util.Long.prototype.toString.call(message.committedStorageMb) : options.longs === Number ? new $util.LongBits(message.committedStorageMb.low >>> 0, message.committedStorageMb.high >>> 0).toNumber() : message.committedStorageMb; + if (message.bootOption != null && message.hasOwnProperty("bootOption")) + object.bootOption = options.enums === String ? $root.google.cloud.vmmigration.v1.VmwareVmDetails.BootOption[message.bootOption] === undefined ? message.bootOption : $root.google.cloud.vmmigration.v1.VmwareVmDetails.BootOption[message.bootOption] : message.bootOption; + return object; + }; + + /** + * Converts this VmwareVmDetails to JSON. + * @function toJSON + * @memberof google.cloud.vmmigration.v1.VmwareVmDetails + * @instance + * @returns {Object.} JSON object + */ + VmwareVmDetails.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VmwareVmDetails + * @function getTypeUrl + * @memberof google.cloud.vmmigration.v1.VmwareVmDetails + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VmwareVmDetails.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmmigration.v1.VmwareVmDetails"; + }; + + /** + * PowerState enum. + * @name google.cloud.vmmigration.v1.VmwareVmDetails.PowerState + * @enum {number} + * @property {number} POWER_STATE_UNSPECIFIED=0 POWER_STATE_UNSPECIFIED value + * @property {number} ON=1 ON value + * @property {number} OFF=2 OFF value + * @property {number} SUSPENDED=3 SUSPENDED value + */ + VmwareVmDetails.PowerState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "POWER_STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ON"] = 1; + values[valuesById[2] = "OFF"] = 2; + values[valuesById[3] = "SUSPENDED"] = 3; + return values; + })(); + + /** + * BootOption enum. + * @name google.cloud.vmmigration.v1.VmwareVmDetails.BootOption + * @enum {number} + * @property {number} BOOT_OPTION_UNSPECIFIED=0 BOOT_OPTION_UNSPECIFIED value + * @property {number} EFI=1 EFI value + * @property {number} BIOS=2 BIOS value + */ + VmwareVmDetails.BootOption = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "BOOT_OPTION_UNSPECIFIED"] = 0; + values[valuesById[1] = "EFI"] = 1; + values[valuesById[2] = "BIOS"] = 2; + return values; + })(); + + return VmwareVmDetails; + })(); + + v1.VmwareVmsDetails = (function() { + + /** + * Properties of a VmwareVmsDetails. + * @memberof google.cloud.vmmigration.v1 + * @interface IVmwareVmsDetails + * @property {Array.|null} [details] VmwareVmsDetails details + */ + + /** + * Constructs a new VmwareVmsDetails. + * @memberof google.cloud.vmmigration.v1 + * @classdesc Represents a VmwareVmsDetails. + * @implements IVmwareVmsDetails + * @constructor + * @param {google.cloud.vmmigration.v1.IVmwareVmsDetails=} [properties] Properties to set + */ + function VmwareVmsDetails(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]]; + } + + /** + * VmwareVmsDetails details. + * @member {Array.} details + * @memberof google.cloud.vmmigration.v1.VmwareVmsDetails + * @instance + */ + VmwareVmsDetails.prototype.details = $util.emptyArray; + + /** + * Creates a new VmwareVmsDetails instance using the specified properties. + * @function create + * @memberof google.cloud.vmmigration.v1.VmwareVmsDetails + * @static + * @param {google.cloud.vmmigration.v1.IVmwareVmsDetails=} [properties] Properties to set + * @returns {google.cloud.vmmigration.v1.VmwareVmsDetails} VmwareVmsDetails instance + */ + VmwareVmsDetails.create = function create(properties) { + return new VmwareVmsDetails(properties); + }; + + /** + * Encodes the specified VmwareVmsDetails message. Does not implicitly {@link google.cloud.vmmigration.v1.VmwareVmsDetails.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmmigration.v1.VmwareVmsDetails + * @static + * @param {google.cloud.vmmigration.v1.IVmwareVmsDetails} message VmwareVmsDetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VmwareVmsDetails.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.details != null && message.details.length) + for (var i = 0; i < message.details.length; ++i) + $root.google.cloud.vmmigration.v1.VmwareVmDetails.encode(message.details[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified VmwareVmsDetails message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.VmwareVmsDetails.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmmigration.v1.VmwareVmsDetails + * @static + * @param {google.cloud.vmmigration.v1.IVmwareVmsDetails} message VmwareVmsDetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VmwareVmsDetails.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VmwareVmsDetails message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmmigration.v1.VmwareVmsDetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmmigration.v1.VmwareVmsDetails} VmwareVmsDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VmwareVmsDetails.decode = function 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.vmmigration.v1.VmwareVmsDetails(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.details && message.details.length)) + message.details = []; + message.details.push($root.google.cloud.vmmigration.v1.VmwareVmDetails.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VmwareVmsDetails message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmmigration.v1.VmwareVmsDetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmmigration.v1.VmwareVmsDetails} VmwareVmsDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VmwareVmsDetails.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VmwareVmsDetails message. + * @function verify + * @memberof google.cloud.vmmigration.v1.VmwareVmsDetails + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VmwareVmsDetails.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object 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.cloud.vmmigration.v1.VmwareVmDetails.verify(message.details[i]); + if (error) + return "details." + error; + } + } + return null; + }; + + /** + * Creates a VmwareVmsDetails message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmmigration.v1.VmwareVmsDetails + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmmigration.v1.VmwareVmsDetails} VmwareVmsDetails + */ + VmwareVmsDetails.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmmigration.v1.VmwareVmsDetails) + return object; + var message = new $root.google.cloud.vmmigration.v1.VmwareVmsDetails(); + if (object.details) { + if (!Array.isArray(object.details)) + throw TypeError(".google.cloud.vmmigration.v1.VmwareVmsDetails.details: array expected"); + message.details = []; + for (var i = 0; i < object.details.length; ++i) { + if (typeof object.details[i] !== "object") + throw TypeError(".google.cloud.vmmigration.v1.VmwareVmsDetails.details: object expected"); + message.details[i] = $root.google.cloud.vmmigration.v1.VmwareVmDetails.fromObject(object.details[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a VmwareVmsDetails message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmmigration.v1.VmwareVmsDetails + * @static + * @param {google.cloud.vmmigration.v1.VmwareVmsDetails} message VmwareVmsDetails + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VmwareVmsDetails.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.details = []; + if (message.details && message.details.length) { + object.details = []; + for (var j = 0; j < message.details.length; ++j) + object.details[j] = $root.google.cloud.vmmigration.v1.VmwareVmDetails.toObject(message.details[j], options); + } + return object; + }; + + /** + * Converts this VmwareVmsDetails to JSON. + * @function toJSON + * @memberof google.cloud.vmmigration.v1.VmwareVmsDetails + * @instance + * @returns {Object.} JSON object + */ + VmwareVmsDetails.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VmwareVmsDetails + * @function getTypeUrl + * @memberof google.cloud.vmmigration.v1.VmwareVmsDetails + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VmwareVmsDetails.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmmigration.v1.VmwareVmsDetails"; + }; + + return VmwareVmsDetails; + })(); + + v1.FetchInventoryResponse = (function() { + + /** + * Properties of a FetchInventoryResponse. + * @memberof google.cloud.vmmigration.v1 + * @interface IFetchInventoryResponse + * @property {google.cloud.vmmigration.v1.IVmwareVmsDetails|null} [vmwareVms] FetchInventoryResponse vmwareVms + * @property {google.protobuf.ITimestamp|null} [updateTime] FetchInventoryResponse updateTime + */ + + /** + * Constructs a new FetchInventoryResponse. + * @memberof google.cloud.vmmigration.v1 + * @classdesc Represents a FetchInventoryResponse. + * @implements IFetchInventoryResponse + * @constructor + * @param {google.cloud.vmmigration.v1.IFetchInventoryResponse=} [properties] Properties to set + */ + function FetchInventoryResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FetchInventoryResponse vmwareVms. + * @member {google.cloud.vmmigration.v1.IVmwareVmsDetails|null|undefined} vmwareVms + * @memberof google.cloud.vmmigration.v1.FetchInventoryResponse + * @instance + */ + FetchInventoryResponse.prototype.vmwareVms = null; + + /** + * FetchInventoryResponse updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.vmmigration.v1.FetchInventoryResponse + * @instance + */ + FetchInventoryResponse.prototype.updateTime = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * FetchInventoryResponse SourceVms. + * @member {"vmwareVms"|undefined} SourceVms + * @memberof google.cloud.vmmigration.v1.FetchInventoryResponse + * @instance + */ + Object.defineProperty(FetchInventoryResponse.prototype, "SourceVms", { + get: $util.oneOfGetter($oneOfFields = ["vmwareVms"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new FetchInventoryResponse instance using the specified properties. + * @function create + * @memberof google.cloud.vmmigration.v1.FetchInventoryResponse + * @static + * @param {google.cloud.vmmigration.v1.IFetchInventoryResponse=} [properties] Properties to set + * @returns {google.cloud.vmmigration.v1.FetchInventoryResponse} FetchInventoryResponse instance + */ + FetchInventoryResponse.create = function create(properties) { + return new FetchInventoryResponse(properties); + }; + + /** + * Encodes the specified FetchInventoryResponse message. Does not implicitly {@link google.cloud.vmmigration.v1.FetchInventoryResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmmigration.v1.FetchInventoryResponse + * @static + * @param {google.cloud.vmmigration.v1.IFetchInventoryResponse} message FetchInventoryResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FetchInventoryResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.vmwareVms != null && Object.hasOwnProperty.call(message, "vmwareVms")) + $root.google.cloud.vmmigration.v1.VmwareVmsDetails.encode(message.vmwareVms, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FetchInventoryResponse message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.FetchInventoryResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmmigration.v1.FetchInventoryResponse + * @static + * @param {google.cloud.vmmigration.v1.IFetchInventoryResponse} message FetchInventoryResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FetchInventoryResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FetchInventoryResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmmigration.v1.FetchInventoryResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmmigration.v1.FetchInventoryResponse} FetchInventoryResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FetchInventoryResponse.decode = function 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.vmmigration.v1.FetchInventoryResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.vmwareVms = $root.google.cloud.vmmigration.v1.VmwareVmsDetails.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FetchInventoryResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmmigration.v1.FetchInventoryResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmmigration.v1.FetchInventoryResponse} FetchInventoryResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FetchInventoryResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FetchInventoryResponse message. + * @function verify + * @memberof google.cloud.vmmigration.v1.FetchInventoryResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FetchInventoryResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.vmwareVms != null && message.hasOwnProperty("vmwareVms")) { + properties.SourceVms = 1; + { + var error = $root.google.cloud.vmmigration.v1.VmwareVmsDetails.verify(message.vmwareVms); + if (error) + return "vmwareVms." + error; + } + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + return null; + }; + + /** + * Creates a FetchInventoryResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmmigration.v1.FetchInventoryResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmmigration.v1.FetchInventoryResponse} FetchInventoryResponse + */ + FetchInventoryResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmmigration.v1.FetchInventoryResponse) + return object; + var message = new $root.google.cloud.vmmigration.v1.FetchInventoryResponse(); + if (object.vmwareVms != null) { + if (typeof object.vmwareVms !== "object") + throw TypeError(".google.cloud.vmmigration.v1.FetchInventoryResponse.vmwareVms: object expected"); + message.vmwareVms = $root.google.cloud.vmmigration.v1.VmwareVmsDetails.fromObject(object.vmwareVms); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.vmmigration.v1.FetchInventoryResponse.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + return message; + }; + + /** + * Creates a plain object from a FetchInventoryResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmmigration.v1.FetchInventoryResponse + * @static + * @param {google.cloud.vmmigration.v1.FetchInventoryResponse} message FetchInventoryResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FetchInventoryResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.updateTime = null; + if (message.vmwareVms != null && message.hasOwnProperty("vmwareVms")) { + object.vmwareVms = $root.google.cloud.vmmigration.v1.VmwareVmsDetails.toObject(message.vmwareVms, options); + if (options.oneofs) + object.SourceVms = "vmwareVms"; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + return object; + }; + + /** + * Converts this FetchInventoryResponse to JSON. + * @function toJSON + * @memberof google.cloud.vmmigration.v1.FetchInventoryResponse + * @instance + * @returns {Object.} JSON object + */ + FetchInventoryResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FetchInventoryResponse + * @function getTypeUrl + * @memberof google.cloud.vmmigration.v1.FetchInventoryResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FetchInventoryResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmmigration.v1.FetchInventoryResponse"; + }; + + return FetchInventoryResponse; + })(); + + v1.UtilizationReport = (function() { + + /** + * Properties of an UtilizationReport. + * @memberof google.cloud.vmmigration.v1 + * @interface IUtilizationReport + * @property {string|null} [name] UtilizationReport name + * @property {string|null} [displayName] UtilizationReport displayName + * @property {google.cloud.vmmigration.v1.UtilizationReport.State|null} [state] UtilizationReport state + * @property {google.protobuf.ITimestamp|null} [stateTime] UtilizationReport stateTime + * @property {google.rpc.IStatus|null} [error] UtilizationReport error + * @property {google.protobuf.ITimestamp|null} [createTime] UtilizationReport createTime + * @property {google.cloud.vmmigration.v1.UtilizationReport.TimeFrame|null} [timeFrame] UtilizationReport timeFrame + * @property {google.protobuf.ITimestamp|null} [frameEndTime] UtilizationReport frameEndTime + * @property {number|null} [vmCount] UtilizationReport vmCount + * @property {Array.|null} [vms] UtilizationReport vms + */ + + /** + * Constructs a new UtilizationReport. + * @memberof google.cloud.vmmigration.v1 + * @classdesc Represents an UtilizationReport. + * @implements IUtilizationReport + * @constructor + * @param {google.cloud.vmmigration.v1.IUtilizationReport=} [properties] Properties to set + */ + function UtilizationReport(properties) { + this.vms = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UtilizationReport name. + * @member {string} name + * @memberof google.cloud.vmmigration.v1.UtilizationReport + * @instance + */ + UtilizationReport.prototype.name = ""; + + /** + * UtilizationReport displayName. + * @member {string} displayName + * @memberof google.cloud.vmmigration.v1.UtilizationReport + * @instance + */ + UtilizationReport.prototype.displayName = ""; + + /** + * UtilizationReport state. + * @member {google.cloud.vmmigration.v1.UtilizationReport.State} state + * @memberof google.cloud.vmmigration.v1.UtilizationReport + * @instance + */ + UtilizationReport.prototype.state = 0; + + /** + * UtilizationReport stateTime. + * @member {google.protobuf.ITimestamp|null|undefined} stateTime + * @memberof google.cloud.vmmigration.v1.UtilizationReport + * @instance + */ + UtilizationReport.prototype.stateTime = null; + + /** + * UtilizationReport error. + * @member {google.rpc.IStatus|null|undefined} error + * @memberof google.cloud.vmmigration.v1.UtilizationReport + * @instance + */ + UtilizationReport.prototype.error = null; + + /** + * UtilizationReport createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.vmmigration.v1.UtilizationReport + * @instance + */ + UtilizationReport.prototype.createTime = null; + + /** + * UtilizationReport timeFrame. + * @member {google.cloud.vmmigration.v1.UtilizationReport.TimeFrame} timeFrame + * @memberof google.cloud.vmmigration.v1.UtilizationReport + * @instance + */ + UtilizationReport.prototype.timeFrame = 0; + + /** + * UtilizationReport frameEndTime. + * @member {google.protobuf.ITimestamp|null|undefined} frameEndTime + * @memberof google.cloud.vmmigration.v1.UtilizationReport + * @instance + */ + UtilizationReport.prototype.frameEndTime = null; + + /** + * UtilizationReport vmCount. + * @member {number} vmCount + * @memberof google.cloud.vmmigration.v1.UtilizationReport + * @instance + */ + UtilizationReport.prototype.vmCount = 0; + + /** + * UtilizationReport vms. + * @member {Array.} vms + * @memberof google.cloud.vmmigration.v1.UtilizationReport + * @instance + */ + UtilizationReport.prototype.vms = $util.emptyArray; + + /** + * Creates a new UtilizationReport instance using the specified properties. + * @function create + * @memberof google.cloud.vmmigration.v1.UtilizationReport + * @static + * @param {google.cloud.vmmigration.v1.IUtilizationReport=} [properties] Properties to set + * @returns {google.cloud.vmmigration.v1.UtilizationReport} UtilizationReport instance + */ + UtilizationReport.create = function create(properties) { + return new UtilizationReport(properties); + }; + + /** + * Encodes the specified UtilizationReport message. Does not implicitly {@link google.cloud.vmmigration.v1.UtilizationReport.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmmigration.v1.UtilizationReport + * @static + * @param {google.cloud.vmmigration.v1.IUtilizationReport} message UtilizationReport message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UtilizationReport.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.state); + if (message.stateTime != null && Object.hasOwnProperty.call(message, "stateTime")) + $root.google.protobuf.Timestamp.encode(message.stateTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.error != null && Object.hasOwnProperty.call(message, "error")) + $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.timeFrame != null && Object.hasOwnProperty.call(message, "timeFrame")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.timeFrame); + if (message.frameEndTime != null && Object.hasOwnProperty.call(message, "frameEndTime")) + $root.google.protobuf.Timestamp.encode(message.frameEndTime, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.vmCount != null && Object.hasOwnProperty.call(message, "vmCount")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.vmCount); + if (message.vms != null && message.vms.length) + for (var i = 0; i < message.vms.length; ++i) + $root.google.cloud.vmmigration.v1.VmUtilizationInfo.encode(message.vms[i], writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UtilizationReport message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.UtilizationReport.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmmigration.v1.UtilizationReport + * @static + * @param {google.cloud.vmmigration.v1.IUtilizationReport} message UtilizationReport message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UtilizationReport.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UtilizationReport message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmmigration.v1.UtilizationReport + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmmigration.v1.UtilizationReport} UtilizationReport + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UtilizationReport.decode = function 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.vmmigration.v1.UtilizationReport(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + message.state = reader.int32(); + break; + } + case 4: { + message.stateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.error = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + } + case 6: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 7: { + message.timeFrame = reader.int32(); + break; + } + case 8: { + message.frameEndTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 9: { + message.vmCount = reader.int32(); + break; + } + case 10: { + if (!(message.vms && message.vms.length)) + message.vms = []; + message.vms.push($root.google.cloud.vmmigration.v1.VmUtilizationInfo.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UtilizationReport message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmmigration.v1.UtilizationReport + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmmigration.v1.UtilizationReport} UtilizationReport + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UtilizationReport.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UtilizationReport message. + * @function verify + * @memberof google.cloud.vmmigration.v1.UtilizationReport + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UtilizationReport.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.stateTime != null && message.hasOwnProperty("stateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.stateTime); + if (error) + return "stateTime." + error; + } + if (message.error != null && message.hasOwnProperty("error")) { + var error = $root.google.rpc.Status.verify(message.error); + if (error) + return "error." + error; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.timeFrame != null && message.hasOwnProperty("timeFrame")) + switch (message.timeFrame) { + default: + return "timeFrame: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.frameEndTime != null && message.hasOwnProperty("frameEndTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.frameEndTime); + if (error) + return "frameEndTime." + error; + } + if (message.vmCount != null && message.hasOwnProperty("vmCount")) + if (!$util.isInteger(message.vmCount)) + return "vmCount: integer expected"; + if (message.vms != null && message.hasOwnProperty("vms")) { + if (!Array.isArray(message.vms)) + return "vms: array expected"; + for (var i = 0; i < message.vms.length; ++i) { + var error = $root.google.cloud.vmmigration.v1.VmUtilizationInfo.verify(message.vms[i]); + if (error) + return "vms." + error; + } + } + return null; + }; + + /** + * Creates an UtilizationReport message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmmigration.v1.UtilizationReport + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmmigration.v1.UtilizationReport} UtilizationReport + */ + UtilizationReport.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmmigration.v1.UtilizationReport) + return object; + var message = new $root.google.cloud.vmmigration.v1.UtilizationReport(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "CREATING": + case 1: + message.state = 1; + break; + case "SUCCEEDED": + case 2: + message.state = 2; + break; + case "FAILED": + case 3: + message.state = 3; + break; + } + if (object.stateTime != null) { + if (typeof object.stateTime !== "object") + throw TypeError(".google.cloud.vmmigration.v1.UtilizationReport.stateTime: object expected"); + message.stateTime = $root.google.protobuf.Timestamp.fromObject(object.stateTime); + } + if (object.error != null) { + if (typeof object.error !== "object") + throw TypeError(".google.cloud.vmmigration.v1.UtilizationReport.error: object expected"); + message.error = $root.google.rpc.Status.fromObject(object.error); + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.vmmigration.v1.UtilizationReport.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + switch (object.timeFrame) { + default: + if (typeof object.timeFrame === "number") { + message.timeFrame = object.timeFrame; + break; + } + break; + case "TIME_FRAME_UNSPECIFIED": + case 0: + message.timeFrame = 0; + break; + case "WEEK": + case 1: + message.timeFrame = 1; + break; + case "MONTH": + case 2: + message.timeFrame = 2; + break; + case "YEAR": + case 3: + message.timeFrame = 3; + break; + } + if (object.frameEndTime != null) { + if (typeof object.frameEndTime !== "object") + throw TypeError(".google.cloud.vmmigration.v1.UtilizationReport.frameEndTime: object expected"); + message.frameEndTime = $root.google.protobuf.Timestamp.fromObject(object.frameEndTime); + } + if (object.vmCount != null) + message.vmCount = object.vmCount | 0; + if (object.vms) { + if (!Array.isArray(object.vms)) + throw TypeError(".google.cloud.vmmigration.v1.UtilizationReport.vms: array expected"); + message.vms = []; + for (var i = 0; i < object.vms.length; ++i) { + if (typeof object.vms[i] !== "object") + throw TypeError(".google.cloud.vmmigration.v1.UtilizationReport.vms: object expected"); + message.vms[i] = $root.google.cloud.vmmigration.v1.VmUtilizationInfo.fromObject(object.vms[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an UtilizationReport message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmmigration.v1.UtilizationReport + * @static + * @param {google.cloud.vmmigration.v1.UtilizationReport} message UtilizationReport + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UtilizationReport.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.vms = []; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.stateTime = null; + object.error = null; + object.createTime = null; + object.timeFrame = options.enums === String ? "TIME_FRAME_UNSPECIFIED" : 0; + object.frameEndTime = null; + object.vmCount = 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.vmmigration.v1.UtilizationReport.State[message.state] === undefined ? message.state : $root.google.cloud.vmmigration.v1.UtilizationReport.State[message.state] : message.state; + if (message.stateTime != null && message.hasOwnProperty("stateTime")) + object.stateTime = $root.google.protobuf.Timestamp.toObject(message.stateTime, options); + if (message.error != null && message.hasOwnProperty("error")) + object.error = $root.google.rpc.Status.toObject(message.error, options); + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.timeFrame != null && message.hasOwnProperty("timeFrame")) + object.timeFrame = options.enums === String ? $root.google.cloud.vmmigration.v1.UtilizationReport.TimeFrame[message.timeFrame] === undefined ? message.timeFrame : $root.google.cloud.vmmigration.v1.UtilizationReport.TimeFrame[message.timeFrame] : message.timeFrame; + if (message.frameEndTime != null && message.hasOwnProperty("frameEndTime")) + object.frameEndTime = $root.google.protobuf.Timestamp.toObject(message.frameEndTime, options); + if (message.vmCount != null && message.hasOwnProperty("vmCount")) + object.vmCount = message.vmCount; + if (message.vms && message.vms.length) { + object.vms = []; + for (var j = 0; j < message.vms.length; ++j) + object.vms[j] = $root.google.cloud.vmmigration.v1.VmUtilizationInfo.toObject(message.vms[j], options); + } + return object; + }; + + /** + * Converts this UtilizationReport to JSON. + * @function toJSON + * @memberof google.cloud.vmmigration.v1.UtilizationReport + * @instance + * @returns {Object.} JSON object + */ + UtilizationReport.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UtilizationReport + * @function getTypeUrl + * @memberof google.cloud.vmmigration.v1.UtilizationReport + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UtilizationReport.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmmigration.v1.UtilizationReport"; + }; + + /** + * State enum. + * @name google.cloud.vmmigration.v1.UtilizationReport.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} CREATING=1 CREATING value + * @property {number} SUCCEEDED=2 SUCCEEDED value + * @property {number} FAILED=3 FAILED value + */ + UtilizationReport.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "CREATING"] = 1; + values[valuesById[2] = "SUCCEEDED"] = 2; + values[valuesById[3] = "FAILED"] = 3; + return values; + })(); + + /** + * TimeFrame enum. + * @name google.cloud.vmmigration.v1.UtilizationReport.TimeFrame + * @enum {number} + * @property {number} TIME_FRAME_UNSPECIFIED=0 TIME_FRAME_UNSPECIFIED value + * @property {number} WEEK=1 WEEK value + * @property {number} MONTH=2 MONTH value + * @property {number} YEAR=3 YEAR value + */ + UtilizationReport.TimeFrame = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TIME_FRAME_UNSPECIFIED"] = 0; + values[valuesById[1] = "WEEK"] = 1; + values[valuesById[2] = "MONTH"] = 2; + values[valuesById[3] = "YEAR"] = 3; + return values; + })(); + + return UtilizationReport; + })(); + + v1.VmUtilizationInfo = (function() { + + /** + * Properties of a VmUtilizationInfo. + * @memberof google.cloud.vmmigration.v1 + * @interface IVmUtilizationInfo + * @property {google.cloud.vmmigration.v1.IVmwareVmDetails|null} [vmwareVmDetails] VmUtilizationInfo vmwareVmDetails + * @property {string|null} [vmId] VmUtilizationInfo vmId + * @property {google.cloud.vmmigration.v1.IVmUtilizationMetrics|null} [utilization] VmUtilizationInfo utilization + */ + + /** + * Constructs a new VmUtilizationInfo. + * @memberof google.cloud.vmmigration.v1 + * @classdesc Represents a VmUtilizationInfo. + * @implements IVmUtilizationInfo + * @constructor + * @param {google.cloud.vmmigration.v1.IVmUtilizationInfo=} [properties] Properties to set + */ + function VmUtilizationInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * VmUtilizationInfo vmwareVmDetails. + * @member {google.cloud.vmmigration.v1.IVmwareVmDetails|null|undefined} vmwareVmDetails + * @memberof google.cloud.vmmigration.v1.VmUtilizationInfo + * @instance + */ + VmUtilizationInfo.prototype.vmwareVmDetails = null; + + /** + * VmUtilizationInfo vmId. + * @member {string} vmId + * @memberof google.cloud.vmmigration.v1.VmUtilizationInfo + * @instance + */ + VmUtilizationInfo.prototype.vmId = ""; + + /** + * VmUtilizationInfo utilization. + * @member {google.cloud.vmmigration.v1.IVmUtilizationMetrics|null|undefined} utilization + * @memberof google.cloud.vmmigration.v1.VmUtilizationInfo + * @instance + */ + VmUtilizationInfo.prototype.utilization = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * VmUtilizationInfo VmDetails. + * @member {"vmwareVmDetails"|undefined} VmDetails + * @memberof google.cloud.vmmigration.v1.VmUtilizationInfo + * @instance + */ + Object.defineProperty(VmUtilizationInfo.prototype, "VmDetails", { + get: $util.oneOfGetter($oneOfFields = ["vmwareVmDetails"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new VmUtilizationInfo instance using the specified properties. + * @function create + * @memberof google.cloud.vmmigration.v1.VmUtilizationInfo + * @static + * @param {google.cloud.vmmigration.v1.IVmUtilizationInfo=} [properties] Properties to set + * @returns {google.cloud.vmmigration.v1.VmUtilizationInfo} VmUtilizationInfo instance + */ + VmUtilizationInfo.create = function create(properties) { + return new VmUtilizationInfo(properties); + }; + + /** + * Encodes the specified VmUtilizationInfo message. Does not implicitly {@link google.cloud.vmmigration.v1.VmUtilizationInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmmigration.v1.VmUtilizationInfo + * @static + * @param {google.cloud.vmmigration.v1.IVmUtilizationInfo} message VmUtilizationInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VmUtilizationInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.vmwareVmDetails != null && Object.hasOwnProperty.call(message, "vmwareVmDetails")) + $root.google.cloud.vmmigration.v1.VmwareVmDetails.encode(message.vmwareVmDetails, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.utilization != null && Object.hasOwnProperty.call(message, "utilization")) + $root.google.cloud.vmmigration.v1.VmUtilizationMetrics.encode(message.utilization, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.vmId != null && Object.hasOwnProperty.call(message, "vmId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.vmId); + return writer; + }; + + /** + * Encodes the specified VmUtilizationInfo message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.VmUtilizationInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmmigration.v1.VmUtilizationInfo + * @static + * @param {google.cloud.vmmigration.v1.IVmUtilizationInfo} message VmUtilizationInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VmUtilizationInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VmUtilizationInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmmigration.v1.VmUtilizationInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmmigration.v1.VmUtilizationInfo} VmUtilizationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VmUtilizationInfo.decode = function 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.vmmigration.v1.VmUtilizationInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.vmwareVmDetails = $root.google.cloud.vmmigration.v1.VmwareVmDetails.decode(reader, reader.uint32()); + break; + } + case 3: { + message.vmId = reader.string(); + break; + } + case 2: { + message.utilization = $root.google.cloud.vmmigration.v1.VmUtilizationMetrics.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VmUtilizationInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmmigration.v1.VmUtilizationInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmmigration.v1.VmUtilizationInfo} VmUtilizationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VmUtilizationInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VmUtilizationInfo message. + * @function verify + * @memberof google.cloud.vmmigration.v1.VmUtilizationInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VmUtilizationInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.vmwareVmDetails != null && message.hasOwnProperty("vmwareVmDetails")) { + properties.VmDetails = 1; + { + var error = $root.google.cloud.vmmigration.v1.VmwareVmDetails.verify(message.vmwareVmDetails); + if (error) + return "vmwareVmDetails." + error; + } + } + if (message.vmId != null && message.hasOwnProperty("vmId")) + if (!$util.isString(message.vmId)) + return "vmId: string expected"; + if (message.utilization != null && message.hasOwnProperty("utilization")) { + var error = $root.google.cloud.vmmigration.v1.VmUtilizationMetrics.verify(message.utilization); + if (error) + return "utilization." + error; + } + return null; + }; + + /** + * Creates a VmUtilizationInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmmigration.v1.VmUtilizationInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmmigration.v1.VmUtilizationInfo} VmUtilizationInfo + */ + VmUtilizationInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmmigration.v1.VmUtilizationInfo) + return object; + var message = new $root.google.cloud.vmmigration.v1.VmUtilizationInfo(); + if (object.vmwareVmDetails != null) { + if (typeof object.vmwareVmDetails !== "object") + throw TypeError(".google.cloud.vmmigration.v1.VmUtilizationInfo.vmwareVmDetails: object expected"); + message.vmwareVmDetails = $root.google.cloud.vmmigration.v1.VmwareVmDetails.fromObject(object.vmwareVmDetails); + } + if (object.vmId != null) + message.vmId = String(object.vmId); + if (object.utilization != null) { + if (typeof object.utilization !== "object") + throw TypeError(".google.cloud.vmmigration.v1.VmUtilizationInfo.utilization: object expected"); + message.utilization = $root.google.cloud.vmmigration.v1.VmUtilizationMetrics.fromObject(object.utilization); + } + return message; + }; + + /** + * Creates a plain object from a VmUtilizationInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmmigration.v1.VmUtilizationInfo + * @static + * @param {google.cloud.vmmigration.v1.VmUtilizationInfo} message VmUtilizationInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VmUtilizationInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.utilization = null; + object.vmId = ""; + } + if (message.vmwareVmDetails != null && message.hasOwnProperty("vmwareVmDetails")) { + object.vmwareVmDetails = $root.google.cloud.vmmigration.v1.VmwareVmDetails.toObject(message.vmwareVmDetails, options); + if (options.oneofs) + object.VmDetails = "vmwareVmDetails"; + } + if (message.utilization != null && message.hasOwnProperty("utilization")) + object.utilization = $root.google.cloud.vmmigration.v1.VmUtilizationMetrics.toObject(message.utilization, options); + if (message.vmId != null && message.hasOwnProperty("vmId")) + object.vmId = message.vmId; + return object; + }; + + /** + * Converts this VmUtilizationInfo to JSON. + * @function toJSON + * @memberof google.cloud.vmmigration.v1.VmUtilizationInfo + * @instance + * @returns {Object.} JSON object + */ + VmUtilizationInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VmUtilizationInfo + * @function getTypeUrl + * @memberof google.cloud.vmmigration.v1.VmUtilizationInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VmUtilizationInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmmigration.v1.VmUtilizationInfo"; + }; + + return VmUtilizationInfo; + })(); + + v1.VmUtilizationMetrics = (function() { + + /** + * Properties of a VmUtilizationMetrics. + * @memberof google.cloud.vmmigration.v1 + * @interface IVmUtilizationMetrics + * @property {number|null} [cpuMaxPercent] VmUtilizationMetrics cpuMaxPercent + * @property {number|null} [cpuAveragePercent] VmUtilizationMetrics cpuAveragePercent + * @property {number|null} [memoryMaxPercent] VmUtilizationMetrics memoryMaxPercent + * @property {number|null} [memoryAveragePercent] VmUtilizationMetrics memoryAveragePercent + * @property {number|Long|null} [diskIoRateMaxKbps] VmUtilizationMetrics diskIoRateMaxKbps + * @property {number|Long|null} [diskIoRateAverageKbps] VmUtilizationMetrics diskIoRateAverageKbps + * @property {number|Long|null} [networkThroughputMaxKbps] VmUtilizationMetrics networkThroughputMaxKbps + * @property {number|Long|null} [networkThroughputAverageKbps] VmUtilizationMetrics networkThroughputAverageKbps + */ + + /** + * Constructs a new VmUtilizationMetrics. + * @memberof google.cloud.vmmigration.v1 + * @classdesc Represents a VmUtilizationMetrics. + * @implements IVmUtilizationMetrics + * @constructor + * @param {google.cloud.vmmigration.v1.IVmUtilizationMetrics=} [properties] Properties to set + */ + function VmUtilizationMetrics(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * VmUtilizationMetrics cpuMaxPercent. + * @member {number} cpuMaxPercent + * @memberof google.cloud.vmmigration.v1.VmUtilizationMetrics + * @instance + */ + VmUtilizationMetrics.prototype.cpuMaxPercent = 0; + + /** + * VmUtilizationMetrics cpuAveragePercent. + * @member {number} cpuAveragePercent + * @memberof google.cloud.vmmigration.v1.VmUtilizationMetrics + * @instance + */ + VmUtilizationMetrics.prototype.cpuAveragePercent = 0; + + /** + * VmUtilizationMetrics memoryMaxPercent. + * @member {number} memoryMaxPercent + * @memberof google.cloud.vmmigration.v1.VmUtilizationMetrics + * @instance + */ + VmUtilizationMetrics.prototype.memoryMaxPercent = 0; + + /** + * VmUtilizationMetrics memoryAveragePercent. + * @member {number} memoryAveragePercent + * @memberof google.cloud.vmmigration.v1.VmUtilizationMetrics + * @instance + */ + VmUtilizationMetrics.prototype.memoryAveragePercent = 0; + + /** + * VmUtilizationMetrics diskIoRateMaxKbps. + * @member {number|Long} diskIoRateMaxKbps + * @memberof google.cloud.vmmigration.v1.VmUtilizationMetrics + * @instance + */ + VmUtilizationMetrics.prototype.diskIoRateMaxKbps = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * VmUtilizationMetrics diskIoRateAverageKbps. + * @member {number|Long} diskIoRateAverageKbps + * @memberof google.cloud.vmmigration.v1.VmUtilizationMetrics + * @instance + */ + VmUtilizationMetrics.prototype.diskIoRateAverageKbps = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * VmUtilizationMetrics networkThroughputMaxKbps. + * @member {number|Long} networkThroughputMaxKbps + * @memberof google.cloud.vmmigration.v1.VmUtilizationMetrics + * @instance + */ + VmUtilizationMetrics.prototype.networkThroughputMaxKbps = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * VmUtilizationMetrics networkThroughputAverageKbps. + * @member {number|Long} networkThroughputAverageKbps + * @memberof google.cloud.vmmigration.v1.VmUtilizationMetrics + * @instance + */ + VmUtilizationMetrics.prototype.networkThroughputAverageKbps = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new VmUtilizationMetrics instance using the specified properties. + * @function create + * @memberof google.cloud.vmmigration.v1.VmUtilizationMetrics + * @static + * @param {google.cloud.vmmigration.v1.IVmUtilizationMetrics=} [properties] Properties to set + * @returns {google.cloud.vmmigration.v1.VmUtilizationMetrics} VmUtilizationMetrics instance + */ + VmUtilizationMetrics.create = function create(properties) { + return new VmUtilizationMetrics(properties); + }; + + /** + * Encodes the specified VmUtilizationMetrics message. Does not implicitly {@link google.cloud.vmmigration.v1.VmUtilizationMetrics.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmmigration.v1.VmUtilizationMetrics + * @static + * @param {google.cloud.vmmigration.v1.IVmUtilizationMetrics} message VmUtilizationMetrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VmUtilizationMetrics.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.cpuMaxPercent != null && Object.hasOwnProperty.call(message, "cpuMaxPercent")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.cpuMaxPercent); + if (message.cpuAveragePercent != null && Object.hasOwnProperty.call(message, "cpuAveragePercent")) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.cpuAveragePercent); + if (message.memoryMaxPercent != null && Object.hasOwnProperty.call(message, "memoryMaxPercent")) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.memoryMaxPercent); + if (message.memoryAveragePercent != null && Object.hasOwnProperty.call(message, "memoryAveragePercent")) + writer.uint32(/* id 12, wireType 0 =*/96).int32(message.memoryAveragePercent); + if (message.diskIoRateMaxKbps != null && Object.hasOwnProperty.call(message, "diskIoRateMaxKbps")) + writer.uint32(/* id 13, wireType 0 =*/104).int64(message.diskIoRateMaxKbps); + if (message.diskIoRateAverageKbps != null && Object.hasOwnProperty.call(message, "diskIoRateAverageKbps")) + writer.uint32(/* id 14, wireType 0 =*/112).int64(message.diskIoRateAverageKbps); + if (message.networkThroughputMaxKbps != null && Object.hasOwnProperty.call(message, "networkThroughputMaxKbps")) + writer.uint32(/* id 15, wireType 0 =*/120).int64(message.networkThroughputMaxKbps); + if (message.networkThroughputAverageKbps != null && Object.hasOwnProperty.call(message, "networkThroughputAverageKbps")) + writer.uint32(/* id 16, wireType 0 =*/128).int64(message.networkThroughputAverageKbps); + return writer; + }; + + /** + * Encodes the specified VmUtilizationMetrics message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.VmUtilizationMetrics.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmmigration.v1.VmUtilizationMetrics + * @static + * @param {google.cloud.vmmigration.v1.IVmUtilizationMetrics} message VmUtilizationMetrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VmUtilizationMetrics.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VmUtilizationMetrics message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmmigration.v1.VmUtilizationMetrics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmmigration.v1.VmUtilizationMetrics} VmUtilizationMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VmUtilizationMetrics.decode = function 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.vmmigration.v1.VmUtilizationMetrics(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 9: { + message.cpuMaxPercent = reader.int32(); + break; + } + case 10: { + message.cpuAveragePercent = reader.int32(); + break; + } + case 11: { + message.memoryMaxPercent = reader.int32(); + break; + } + case 12: { + message.memoryAveragePercent = reader.int32(); + break; + } + case 13: { + message.diskIoRateMaxKbps = reader.int64(); + break; + } + case 14: { + message.diskIoRateAverageKbps = reader.int64(); + break; + } + case 15: { + message.networkThroughputMaxKbps = reader.int64(); + break; + } + case 16: { + message.networkThroughputAverageKbps = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VmUtilizationMetrics message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmmigration.v1.VmUtilizationMetrics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmmigration.v1.VmUtilizationMetrics} VmUtilizationMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VmUtilizationMetrics.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VmUtilizationMetrics message. + * @function verify + * @memberof google.cloud.vmmigration.v1.VmUtilizationMetrics + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VmUtilizationMetrics.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.cpuMaxPercent != null && message.hasOwnProperty("cpuMaxPercent")) + if (!$util.isInteger(message.cpuMaxPercent)) + return "cpuMaxPercent: integer expected"; + if (message.cpuAveragePercent != null && message.hasOwnProperty("cpuAveragePercent")) + if (!$util.isInteger(message.cpuAveragePercent)) + return "cpuAveragePercent: integer expected"; + if (message.memoryMaxPercent != null && message.hasOwnProperty("memoryMaxPercent")) + if (!$util.isInteger(message.memoryMaxPercent)) + return "memoryMaxPercent: integer expected"; + if (message.memoryAveragePercent != null && message.hasOwnProperty("memoryAveragePercent")) + if (!$util.isInteger(message.memoryAveragePercent)) + return "memoryAveragePercent: integer expected"; + if (message.diskIoRateMaxKbps != null && message.hasOwnProperty("diskIoRateMaxKbps")) + if (!$util.isInteger(message.diskIoRateMaxKbps) && !(message.diskIoRateMaxKbps && $util.isInteger(message.diskIoRateMaxKbps.low) && $util.isInteger(message.diskIoRateMaxKbps.high))) + return "diskIoRateMaxKbps: integer|Long expected"; + if (message.diskIoRateAverageKbps != null && message.hasOwnProperty("diskIoRateAverageKbps")) + if (!$util.isInteger(message.diskIoRateAverageKbps) && !(message.diskIoRateAverageKbps && $util.isInteger(message.diskIoRateAverageKbps.low) && $util.isInteger(message.diskIoRateAverageKbps.high))) + return "diskIoRateAverageKbps: integer|Long expected"; + if (message.networkThroughputMaxKbps != null && message.hasOwnProperty("networkThroughputMaxKbps")) + if (!$util.isInteger(message.networkThroughputMaxKbps) && !(message.networkThroughputMaxKbps && $util.isInteger(message.networkThroughputMaxKbps.low) && $util.isInteger(message.networkThroughputMaxKbps.high))) + return "networkThroughputMaxKbps: integer|Long expected"; + if (message.networkThroughputAverageKbps != null && message.hasOwnProperty("networkThroughputAverageKbps")) + if (!$util.isInteger(message.networkThroughputAverageKbps) && !(message.networkThroughputAverageKbps && $util.isInteger(message.networkThroughputAverageKbps.low) && $util.isInteger(message.networkThroughputAverageKbps.high))) + return "networkThroughputAverageKbps: integer|Long expected"; + return null; + }; + + /** + * Creates a VmUtilizationMetrics message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmmigration.v1.VmUtilizationMetrics + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmmigration.v1.VmUtilizationMetrics} VmUtilizationMetrics + */ + VmUtilizationMetrics.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmmigration.v1.VmUtilizationMetrics) + return object; + var message = new $root.google.cloud.vmmigration.v1.VmUtilizationMetrics(); + if (object.cpuMaxPercent != null) + message.cpuMaxPercent = object.cpuMaxPercent | 0; + if (object.cpuAveragePercent != null) + message.cpuAveragePercent = object.cpuAveragePercent | 0; + if (object.memoryMaxPercent != null) + message.memoryMaxPercent = object.memoryMaxPercent | 0; + if (object.memoryAveragePercent != null) + message.memoryAveragePercent = object.memoryAveragePercent | 0; + if (object.diskIoRateMaxKbps != null) + if ($util.Long) + (message.diskIoRateMaxKbps = $util.Long.fromValue(object.diskIoRateMaxKbps)).unsigned = false; + else if (typeof object.diskIoRateMaxKbps === "string") + message.diskIoRateMaxKbps = parseInt(object.diskIoRateMaxKbps, 10); + else if (typeof object.diskIoRateMaxKbps === "number") + message.diskIoRateMaxKbps = object.diskIoRateMaxKbps; + else if (typeof object.diskIoRateMaxKbps === "object") + message.diskIoRateMaxKbps = new $util.LongBits(object.diskIoRateMaxKbps.low >>> 0, object.diskIoRateMaxKbps.high >>> 0).toNumber(); + if (object.diskIoRateAverageKbps != null) + if ($util.Long) + (message.diskIoRateAverageKbps = $util.Long.fromValue(object.diskIoRateAverageKbps)).unsigned = false; + else if (typeof object.diskIoRateAverageKbps === "string") + message.diskIoRateAverageKbps = parseInt(object.diskIoRateAverageKbps, 10); + else if (typeof object.diskIoRateAverageKbps === "number") + message.diskIoRateAverageKbps = object.diskIoRateAverageKbps; + else if (typeof object.diskIoRateAverageKbps === "object") + message.diskIoRateAverageKbps = new $util.LongBits(object.diskIoRateAverageKbps.low >>> 0, object.diskIoRateAverageKbps.high >>> 0).toNumber(); + if (object.networkThroughputMaxKbps != null) + if ($util.Long) + (message.networkThroughputMaxKbps = $util.Long.fromValue(object.networkThroughputMaxKbps)).unsigned = false; + else if (typeof object.networkThroughputMaxKbps === "string") + message.networkThroughputMaxKbps = parseInt(object.networkThroughputMaxKbps, 10); + else if (typeof object.networkThroughputMaxKbps === "number") + message.networkThroughputMaxKbps = object.networkThroughputMaxKbps; + else if (typeof object.networkThroughputMaxKbps === "object") + message.networkThroughputMaxKbps = new $util.LongBits(object.networkThroughputMaxKbps.low >>> 0, object.networkThroughputMaxKbps.high >>> 0).toNumber(); + if (object.networkThroughputAverageKbps != null) + if ($util.Long) + (message.networkThroughputAverageKbps = $util.Long.fromValue(object.networkThroughputAverageKbps)).unsigned = false; + else if (typeof object.networkThroughputAverageKbps === "string") + message.networkThroughputAverageKbps = parseInt(object.networkThroughputAverageKbps, 10); + else if (typeof object.networkThroughputAverageKbps === "number") + message.networkThroughputAverageKbps = object.networkThroughputAverageKbps; + else if (typeof object.networkThroughputAverageKbps === "object") + message.networkThroughputAverageKbps = new $util.LongBits(object.networkThroughputAverageKbps.low >>> 0, object.networkThroughputAverageKbps.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a VmUtilizationMetrics message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmmigration.v1.VmUtilizationMetrics + * @static + * @param {google.cloud.vmmigration.v1.VmUtilizationMetrics} message VmUtilizationMetrics + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VmUtilizationMetrics.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.cpuMaxPercent = 0; + object.cpuAveragePercent = 0; + object.memoryMaxPercent = 0; + object.memoryAveragePercent = 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.diskIoRateMaxKbps = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.diskIoRateMaxKbps = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.diskIoRateAverageKbps = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.diskIoRateAverageKbps = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.networkThroughputMaxKbps = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.networkThroughputMaxKbps = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.networkThroughputAverageKbps = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.networkThroughputAverageKbps = options.longs === String ? "0" : 0; + } + if (message.cpuMaxPercent != null && message.hasOwnProperty("cpuMaxPercent")) + object.cpuMaxPercent = message.cpuMaxPercent; + if (message.cpuAveragePercent != null && message.hasOwnProperty("cpuAveragePercent")) + object.cpuAveragePercent = message.cpuAveragePercent; + if (message.memoryMaxPercent != null && message.hasOwnProperty("memoryMaxPercent")) + object.memoryMaxPercent = message.memoryMaxPercent; + if (message.memoryAveragePercent != null && message.hasOwnProperty("memoryAveragePercent")) + object.memoryAveragePercent = message.memoryAveragePercent; + if (message.diskIoRateMaxKbps != null && message.hasOwnProperty("diskIoRateMaxKbps")) + if (typeof message.diskIoRateMaxKbps === "number") + object.diskIoRateMaxKbps = options.longs === String ? String(message.diskIoRateMaxKbps) : message.diskIoRateMaxKbps; + else + object.diskIoRateMaxKbps = options.longs === String ? $util.Long.prototype.toString.call(message.diskIoRateMaxKbps) : options.longs === Number ? new $util.LongBits(message.diskIoRateMaxKbps.low >>> 0, message.diskIoRateMaxKbps.high >>> 0).toNumber() : message.diskIoRateMaxKbps; + if (message.diskIoRateAverageKbps != null && message.hasOwnProperty("diskIoRateAverageKbps")) + if (typeof message.diskIoRateAverageKbps === "number") + object.diskIoRateAverageKbps = options.longs === String ? String(message.diskIoRateAverageKbps) : message.diskIoRateAverageKbps; + else + object.diskIoRateAverageKbps = options.longs === String ? $util.Long.prototype.toString.call(message.diskIoRateAverageKbps) : options.longs === Number ? new $util.LongBits(message.diskIoRateAverageKbps.low >>> 0, message.diskIoRateAverageKbps.high >>> 0).toNumber() : message.diskIoRateAverageKbps; + if (message.networkThroughputMaxKbps != null && message.hasOwnProperty("networkThroughputMaxKbps")) + if (typeof message.networkThroughputMaxKbps === "number") + object.networkThroughputMaxKbps = options.longs === String ? String(message.networkThroughputMaxKbps) : message.networkThroughputMaxKbps; + else + object.networkThroughputMaxKbps = options.longs === String ? $util.Long.prototype.toString.call(message.networkThroughputMaxKbps) : options.longs === Number ? new $util.LongBits(message.networkThroughputMaxKbps.low >>> 0, message.networkThroughputMaxKbps.high >>> 0).toNumber() : message.networkThroughputMaxKbps; + if (message.networkThroughputAverageKbps != null && message.hasOwnProperty("networkThroughputAverageKbps")) + if (typeof message.networkThroughputAverageKbps === "number") + object.networkThroughputAverageKbps = options.longs === String ? String(message.networkThroughputAverageKbps) : message.networkThroughputAverageKbps; + else + object.networkThroughputAverageKbps = options.longs === String ? $util.Long.prototype.toString.call(message.networkThroughputAverageKbps) : options.longs === Number ? new $util.LongBits(message.networkThroughputAverageKbps.low >>> 0, message.networkThroughputAverageKbps.high >>> 0).toNumber() : message.networkThroughputAverageKbps; + return object; + }; + + /** + * Converts this VmUtilizationMetrics to JSON. + * @function toJSON + * @memberof google.cloud.vmmigration.v1.VmUtilizationMetrics + * @instance + * @returns {Object.} JSON object + */ + VmUtilizationMetrics.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VmUtilizationMetrics + * @function getTypeUrl + * @memberof google.cloud.vmmigration.v1.VmUtilizationMetrics + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VmUtilizationMetrics.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmmigration.v1.VmUtilizationMetrics"; + }; + + return VmUtilizationMetrics; + })(); + + v1.ListUtilizationReportsRequest = (function() { + + /** + * Properties of a ListUtilizationReportsRequest. + * @memberof google.cloud.vmmigration.v1 + * @interface IListUtilizationReportsRequest + * @property {string|null} [parent] ListUtilizationReportsRequest parent + * @property {google.cloud.vmmigration.v1.UtilizationReportView|null} [view] ListUtilizationReportsRequest view + * @property {number|null} [pageSize] ListUtilizationReportsRequest pageSize + * @property {string|null} [pageToken] ListUtilizationReportsRequest pageToken + * @property {string|null} [filter] ListUtilizationReportsRequest filter + * @property {string|null} [orderBy] ListUtilizationReportsRequest orderBy + */ + + /** + * Constructs a new ListUtilizationReportsRequest. + * @memberof google.cloud.vmmigration.v1 + * @classdesc Represents a ListUtilizationReportsRequest. + * @implements IListUtilizationReportsRequest + * @constructor + * @param {google.cloud.vmmigration.v1.IListUtilizationReportsRequest=} [properties] Properties to set + */ + function ListUtilizationReportsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListUtilizationReportsRequest parent. + * @member {string} parent + * @memberof google.cloud.vmmigration.v1.ListUtilizationReportsRequest + * @instance + */ + ListUtilizationReportsRequest.prototype.parent = ""; + + /** + * ListUtilizationReportsRequest view. + * @member {google.cloud.vmmigration.v1.UtilizationReportView} view + * @memberof google.cloud.vmmigration.v1.ListUtilizationReportsRequest + * @instance + */ + ListUtilizationReportsRequest.prototype.view = 0; + + /** + * ListUtilizationReportsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.vmmigration.v1.ListUtilizationReportsRequest + * @instance + */ + ListUtilizationReportsRequest.prototype.pageSize = 0; + + /** + * ListUtilizationReportsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.vmmigration.v1.ListUtilizationReportsRequest + * @instance + */ + ListUtilizationReportsRequest.prototype.pageToken = ""; + + /** + * ListUtilizationReportsRequest filter. + * @member {string} filter + * @memberof google.cloud.vmmigration.v1.ListUtilizationReportsRequest + * @instance + */ + ListUtilizationReportsRequest.prototype.filter = ""; + + /** + * ListUtilizationReportsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.vmmigration.v1.ListUtilizationReportsRequest + * @instance + */ + ListUtilizationReportsRequest.prototype.orderBy = ""; + + /** + * Creates a new ListUtilizationReportsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vmmigration.v1.ListUtilizationReportsRequest + * @static + * @param {google.cloud.vmmigration.v1.IListUtilizationReportsRequest=} [properties] Properties to set + * @returns {google.cloud.vmmigration.v1.ListUtilizationReportsRequest} ListUtilizationReportsRequest instance + */ + ListUtilizationReportsRequest.create = function create(properties) { + return new ListUtilizationReportsRequest(properties); + }; + + /** + * Encodes the specified ListUtilizationReportsRequest message. Does not implicitly {@link google.cloud.vmmigration.v1.ListUtilizationReportsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmmigration.v1.ListUtilizationReportsRequest + * @static + * @param {google.cloud.vmmigration.v1.IListUtilizationReportsRequest} message ListUtilizationReportsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListUtilizationReportsRequest.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.view != null && Object.hasOwnProperty.call(message, "view")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.view); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.filter); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.orderBy); + return writer; + }; + + /** + * Encodes the specified ListUtilizationReportsRequest message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.ListUtilizationReportsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmmigration.v1.ListUtilizationReportsRequest + * @static + * @param {google.cloud.vmmigration.v1.IListUtilizationReportsRequest} message ListUtilizationReportsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListUtilizationReportsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListUtilizationReportsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmmigration.v1.ListUtilizationReportsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmmigration.v1.ListUtilizationReportsRequest} ListUtilizationReportsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListUtilizationReportsRequest.decode = function 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.vmmigration.v1.ListUtilizationReportsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.view = reader.int32(); + break; + } + case 3: { + message.pageSize = reader.int32(); + break; + } + case 4: { + message.pageToken = reader.string(); + break; + } + case 5: { + message.filter = reader.string(); + break; + } + case 6: { + message.orderBy = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListUtilizationReportsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmmigration.v1.ListUtilizationReportsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmmigration.v1.ListUtilizationReportsRequest} ListUtilizationReportsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListUtilizationReportsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListUtilizationReportsRequest message. + * @function verify + * @memberof google.cloud.vmmigration.v1.ListUtilizationReportsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListUtilizationReportsRequest.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.view != null && message.hasOwnProperty("view")) + switch (message.view) { + default: + return "view: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.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 ListUtilizationReportsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmmigration.v1.ListUtilizationReportsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmmigration.v1.ListUtilizationReportsRequest} ListUtilizationReportsRequest + */ + ListUtilizationReportsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmmigration.v1.ListUtilizationReportsRequest) + return object; + var message = new $root.google.cloud.vmmigration.v1.ListUtilizationReportsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + switch (object.view) { + default: + if (typeof object.view === "number") { + message.view = object.view; + break; + } + break; + case "UTILIZATION_REPORT_VIEW_UNSPECIFIED": + case 0: + message.view = 0; + break; + case "BASIC": + case 1: + message.view = 1; + break; + case "FULL": + case 2: + message.view = 2; + break; + } + 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 ListUtilizationReportsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmmigration.v1.ListUtilizationReportsRequest + * @static + * @param {google.cloud.vmmigration.v1.ListUtilizationReportsRequest} message ListUtilizationReportsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListUtilizationReportsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.view = options.enums === String ? "UTILIZATION_REPORT_VIEW_UNSPECIFIED" : 0; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.orderBy = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.view != null && message.hasOwnProperty("view")) + object.view = options.enums === String ? $root.google.cloud.vmmigration.v1.UtilizationReportView[message.view] === undefined ? message.view : $root.google.cloud.vmmigration.v1.UtilizationReportView[message.view] : message.view; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + return object; + }; + + /** + * Converts this ListUtilizationReportsRequest to JSON. + * @function toJSON + * @memberof google.cloud.vmmigration.v1.ListUtilizationReportsRequest + * @instance + * @returns {Object.} JSON object + */ + ListUtilizationReportsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListUtilizationReportsRequest + * @function getTypeUrl + * @memberof google.cloud.vmmigration.v1.ListUtilizationReportsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListUtilizationReportsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmmigration.v1.ListUtilizationReportsRequest"; + }; + + return ListUtilizationReportsRequest; + })(); + + v1.ListUtilizationReportsResponse = (function() { + + /** + * Properties of a ListUtilizationReportsResponse. + * @memberof google.cloud.vmmigration.v1 + * @interface IListUtilizationReportsResponse + * @property {Array.|null} [utilizationReports] ListUtilizationReportsResponse utilizationReports + * @property {string|null} [nextPageToken] ListUtilizationReportsResponse nextPageToken + * @property {Array.|null} [unreachable] ListUtilizationReportsResponse unreachable + */ + + /** + * Constructs a new ListUtilizationReportsResponse. + * @memberof google.cloud.vmmigration.v1 + * @classdesc Represents a ListUtilizationReportsResponse. + * @implements IListUtilizationReportsResponse + * @constructor + * @param {google.cloud.vmmigration.v1.IListUtilizationReportsResponse=} [properties] Properties to set + */ + function ListUtilizationReportsResponse(properties) { + this.utilizationReports = []; + 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]]; + } + + /** + * ListUtilizationReportsResponse utilizationReports. + * @member {Array.} utilizationReports + * @memberof google.cloud.vmmigration.v1.ListUtilizationReportsResponse + * @instance + */ + ListUtilizationReportsResponse.prototype.utilizationReports = $util.emptyArray; + + /** + * ListUtilizationReportsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.vmmigration.v1.ListUtilizationReportsResponse + * @instance + */ + ListUtilizationReportsResponse.prototype.nextPageToken = ""; + + /** + * ListUtilizationReportsResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.vmmigration.v1.ListUtilizationReportsResponse + * @instance + */ + ListUtilizationReportsResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListUtilizationReportsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.vmmigration.v1.ListUtilizationReportsResponse + * @static + * @param {google.cloud.vmmigration.v1.IListUtilizationReportsResponse=} [properties] Properties to set + * @returns {google.cloud.vmmigration.v1.ListUtilizationReportsResponse} ListUtilizationReportsResponse instance + */ + ListUtilizationReportsResponse.create = function create(properties) { + return new ListUtilizationReportsResponse(properties); + }; + + /** + * Encodes the specified ListUtilizationReportsResponse message. Does not implicitly {@link google.cloud.vmmigration.v1.ListUtilizationReportsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmmigration.v1.ListUtilizationReportsResponse + * @static + * @param {google.cloud.vmmigration.v1.IListUtilizationReportsResponse} message ListUtilizationReportsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListUtilizationReportsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.utilizationReports != null && message.utilizationReports.length) + for (var i = 0; i < message.utilizationReports.length; ++i) + $root.google.cloud.vmmigration.v1.UtilizationReport.encode(message.utilizationReports[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 ListUtilizationReportsResponse message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.ListUtilizationReportsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmmigration.v1.ListUtilizationReportsResponse + * @static + * @param {google.cloud.vmmigration.v1.IListUtilizationReportsResponse} message ListUtilizationReportsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListUtilizationReportsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListUtilizationReportsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmmigration.v1.ListUtilizationReportsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmmigration.v1.ListUtilizationReportsResponse} ListUtilizationReportsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListUtilizationReportsResponse.decode = function 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.vmmigration.v1.ListUtilizationReportsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.utilizationReports && message.utilizationReports.length)) + message.utilizationReports = []; + message.utilizationReports.push($root.google.cloud.vmmigration.v1.UtilizationReport.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 ListUtilizationReportsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmmigration.v1.ListUtilizationReportsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmmigration.v1.ListUtilizationReportsResponse} ListUtilizationReportsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListUtilizationReportsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListUtilizationReportsResponse message. + * @function verify + * @memberof google.cloud.vmmigration.v1.ListUtilizationReportsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListUtilizationReportsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.utilizationReports != null && message.hasOwnProperty("utilizationReports")) { + if (!Array.isArray(message.utilizationReports)) + return "utilizationReports: array expected"; + for (var i = 0; i < message.utilizationReports.length; ++i) { + var error = $root.google.cloud.vmmigration.v1.UtilizationReport.verify(message.utilizationReports[i]); + if (error) + return "utilizationReports." + 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 ListUtilizationReportsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmmigration.v1.ListUtilizationReportsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmmigration.v1.ListUtilizationReportsResponse} ListUtilizationReportsResponse + */ + ListUtilizationReportsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmmigration.v1.ListUtilizationReportsResponse) + return object; + var message = new $root.google.cloud.vmmigration.v1.ListUtilizationReportsResponse(); + if (object.utilizationReports) { + if (!Array.isArray(object.utilizationReports)) + throw TypeError(".google.cloud.vmmigration.v1.ListUtilizationReportsResponse.utilizationReports: array expected"); + message.utilizationReports = []; + for (var i = 0; i < object.utilizationReports.length; ++i) { + if (typeof object.utilizationReports[i] !== "object") + throw TypeError(".google.cloud.vmmigration.v1.ListUtilizationReportsResponse.utilizationReports: object expected"); + message.utilizationReports[i] = $root.google.cloud.vmmigration.v1.UtilizationReport.fromObject(object.utilizationReports[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.vmmigration.v1.ListUtilizationReportsResponse.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 ListUtilizationReportsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmmigration.v1.ListUtilizationReportsResponse + * @static + * @param {google.cloud.vmmigration.v1.ListUtilizationReportsResponse} message ListUtilizationReportsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListUtilizationReportsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.utilizationReports = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.utilizationReports && message.utilizationReports.length) { + object.utilizationReports = []; + for (var j = 0; j < message.utilizationReports.length; ++j) + object.utilizationReports[j] = $root.google.cloud.vmmigration.v1.UtilizationReport.toObject(message.utilizationReports[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 ListUtilizationReportsResponse to JSON. + * @function toJSON + * @memberof google.cloud.vmmigration.v1.ListUtilizationReportsResponse + * @instance + * @returns {Object.} JSON object + */ + ListUtilizationReportsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListUtilizationReportsResponse + * @function getTypeUrl + * @memberof google.cloud.vmmigration.v1.ListUtilizationReportsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListUtilizationReportsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmmigration.v1.ListUtilizationReportsResponse"; + }; + + return ListUtilizationReportsResponse; + })(); + + v1.GetUtilizationReportRequest = (function() { + + /** + * Properties of a GetUtilizationReportRequest. + * @memberof google.cloud.vmmigration.v1 + * @interface IGetUtilizationReportRequest + * @property {string|null} [name] GetUtilizationReportRequest name + * @property {google.cloud.vmmigration.v1.UtilizationReportView|null} [view] GetUtilizationReportRequest view + */ + + /** + * Constructs a new GetUtilizationReportRequest. + * @memberof google.cloud.vmmigration.v1 + * @classdesc Represents a GetUtilizationReportRequest. + * @implements IGetUtilizationReportRequest + * @constructor + * @param {google.cloud.vmmigration.v1.IGetUtilizationReportRequest=} [properties] Properties to set + */ + function GetUtilizationReportRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetUtilizationReportRequest name. + * @member {string} name + * @memberof google.cloud.vmmigration.v1.GetUtilizationReportRequest + * @instance + */ + GetUtilizationReportRequest.prototype.name = ""; + + /** + * GetUtilizationReportRequest view. + * @member {google.cloud.vmmigration.v1.UtilizationReportView} view + * @memberof google.cloud.vmmigration.v1.GetUtilizationReportRequest + * @instance + */ + GetUtilizationReportRequest.prototype.view = 0; + + /** + * Creates a new GetUtilizationReportRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vmmigration.v1.GetUtilizationReportRequest + * @static + * @param {google.cloud.vmmigration.v1.IGetUtilizationReportRequest=} [properties] Properties to set + * @returns {google.cloud.vmmigration.v1.GetUtilizationReportRequest} GetUtilizationReportRequest instance + */ + GetUtilizationReportRequest.create = function create(properties) { + return new GetUtilizationReportRequest(properties); + }; + + /** + * Encodes the specified GetUtilizationReportRequest message. Does not implicitly {@link google.cloud.vmmigration.v1.GetUtilizationReportRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmmigration.v1.GetUtilizationReportRequest + * @static + * @param {google.cloud.vmmigration.v1.IGetUtilizationReportRequest} message GetUtilizationReportRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetUtilizationReportRequest.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.view != null && Object.hasOwnProperty.call(message, "view")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.view); + return writer; + }; + + /** + * Encodes the specified GetUtilizationReportRequest message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.GetUtilizationReportRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmmigration.v1.GetUtilizationReportRequest + * @static + * @param {google.cloud.vmmigration.v1.IGetUtilizationReportRequest} message GetUtilizationReportRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetUtilizationReportRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetUtilizationReportRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmmigration.v1.GetUtilizationReportRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmmigration.v1.GetUtilizationReportRequest} GetUtilizationReportRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetUtilizationReportRequest.decode = function 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.vmmigration.v1.GetUtilizationReportRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.view = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetUtilizationReportRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmmigration.v1.GetUtilizationReportRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmmigration.v1.GetUtilizationReportRequest} GetUtilizationReportRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetUtilizationReportRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetUtilizationReportRequest message. + * @function verify + * @memberof google.cloud.vmmigration.v1.GetUtilizationReportRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetUtilizationReportRequest.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.view != null && message.hasOwnProperty("view")) + switch (message.view) { + default: + return "view: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a GetUtilizationReportRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmmigration.v1.GetUtilizationReportRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmmigration.v1.GetUtilizationReportRequest} GetUtilizationReportRequest + */ + GetUtilizationReportRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmmigration.v1.GetUtilizationReportRequest) + return object; + var message = new $root.google.cloud.vmmigration.v1.GetUtilizationReportRequest(); + if (object.name != null) + message.name = String(object.name); + switch (object.view) { + default: + if (typeof object.view === "number") { + message.view = object.view; + break; + } + break; + case "UTILIZATION_REPORT_VIEW_UNSPECIFIED": + case 0: + message.view = 0; + break; + case "BASIC": + case 1: + message.view = 1; + break; + case "FULL": + case 2: + message.view = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a GetUtilizationReportRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmmigration.v1.GetUtilizationReportRequest + * @static + * @param {google.cloud.vmmigration.v1.GetUtilizationReportRequest} message GetUtilizationReportRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetUtilizationReportRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.view = options.enums === String ? "UTILIZATION_REPORT_VIEW_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.view != null && message.hasOwnProperty("view")) + object.view = options.enums === String ? $root.google.cloud.vmmigration.v1.UtilizationReportView[message.view] === undefined ? message.view : $root.google.cloud.vmmigration.v1.UtilizationReportView[message.view] : message.view; + return object; + }; + + /** + * Converts this GetUtilizationReportRequest to JSON. + * @function toJSON + * @memberof google.cloud.vmmigration.v1.GetUtilizationReportRequest + * @instance + * @returns {Object.} JSON object + */ + GetUtilizationReportRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetUtilizationReportRequest + * @function getTypeUrl + * @memberof google.cloud.vmmigration.v1.GetUtilizationReportRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetUtilizationReportRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmmigration.v1.GetUtilizationReportRequest"; + }; + + return GetUtilizationReportRequest; + })(); + + v1.CreateUtilizationReportRequest = (function() { + + /** + * Properties of a CreateUtilizationReportRequest. + * @memberof google.cloud.vmmigration.v1 + * @interface ICreateUtilizationReportRequest + * @property {string|null} [parent] CreateUtilizationReportRequest parent + * @property {google.cloud.vmmigration.v1.IUtilizationReport|null} [utilizationReport] CreateUtilizationReportRequest utilizationReport + * @property {string|null} [utilizationReportId] CreateUtilizationReportRequest utilizationReportId + * @property {string|null} [requestId] CreateUtilizationReportRequest requestId + */ + + /** + * Constructs a new CreateUtilizationReportRequest. + * @memberof google.cloud.vmmigration.v1 + * @classdesc Represents a CreateUtilizationReportRequest. + * @implements ICreateUtilizationReportRequest + * @constructor + * @param {google.cloud.vmmigration.v1.ICreateUtilizationReportRequest=} [properties] Properties to set + */ + function CreateUtilizationReportRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateUtilizationReportRequest parent. + * @member {string} parent + * @memberof google.cloud.vmmigration.v1.CreateUtilizationReportRequest + * @instance + */ + CreateUtilizationReportRequest.prototype.parent = ""; + + /** + * CreateUtilizationReportRequest utilizationReport. + * @member {google.cloud.vmmigration.v1.IUtilizationReport|null|undefined} utilizationReport + * @memberof google.cloud.vmmigration.v1.CreateUtilizationReportRequest + * @instance + */ + CreateUtilizationReportRequest.prototype.utilizationReport = null; + + /** + * CreateUtilizationReportRequest utilizationReportId. + * @member {string} utilizationReportId + * @memberof google.cloud.vmmigration.v1.CreateUtilizationReportRequest + * @instance + */ + CreateUtilizationReportRequest.prototype.utilizationReportId = ""; + + /** + * CreateUtilizationReportRequest requestId. + * @member {string} requestId + * @memberof google.cloud.vmmigration.v1.CreateUtilizationReportRequest + * @instance + */ + CreateUtilizationReportRequest.prototype.requestId = ""; + + /** + * Creates a new CreateUtilizationReportRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vmmigration.v1.CreateUtilizationReportRequest + * @static + * @param {google.cloud.vmmigration.v1.ICreateUtilizationReportRequest=} [properties] Properties to set + * @returns {google.cloud.vmmigration.v1.CreateUtilizationReportRequest} CreateUtilizationReportRequest instance + */ + CreateUtilizationReportRequest.create = function create(properties) { + return new CreateUtilizationReportRequest(properties); + }; + + /** + * Encodes the specified CreateUtilizationReportRequest message. Does not implicitly {@link google.cloud.vmmigration.v1.CreateUtilizationReportRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmmigration.v1.CreateUtilizationReportRequest + * @static + * @param {google.cloud.vmmigration.v1.ICreateUtilizationReportRequest} message CreateUtilizationReportRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateUtilizationReportRequest.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.utilizationReport != null && Object.hasOwnProperty.call(message, "utilizationReport")) + $root.google.cloud.vmmigration.v1.UtilizationReport.encode(message.utilizationReport, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.utilizationReportId != null && Object.hasOwnProperty.call(message, "utilizationReportId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.utilizationReportId); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified CreateUtilizationReportRequest message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.CreateUtilizationReportRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmmigration.v1.CreateUtilizationReportRequest + * @static + * @param {google.cloud.vmmigration.v1.ICreateUtilizationReportRequest} message CreateUtilizationReportRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateUtilizationReportRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateUtilizationReportRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmmigration.v1.CreateUtilizationReportRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmmigration.v1.CreateUtilizationReportRequest} CreateUtilizationReportRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateUtilizationReportRequest.decode = function 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.vmmigration.v1.CreateUtilizationReportRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.utilizationReport = $root.google.cloud.vmmigration.v1.UtilizationReport.decode(reader, reader.uint32()); + break; + } + case 3: { + message.utilizationReportId = reader.string(); + break; + } + case 4: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateUtilizationReportRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmmigration.v1.CreateUtilizationReportRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmmigration.v1.CreateUtilizationReportRequest} CreateUtilizationReportRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateUtilizationReportRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateUtilizationReportRequest message. + * @function verify + * @memberof google.cloud.vmmigration.v1.CreateUtilizationReportRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateUtilizationReportRequest.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.utilizationReport != null && message.hasOwnProperty("utilizationReport")) { + var error = $root.google.cloud.vmmigration.v1.UtilizationReport.verify(message.utilizationReport); + if (error) + return "utilizationReport." + error; + } + if (message.utilizationReportId != null && message.hasOwnProperty("utilizationReportId")) + if (!$util.isString(message.utilizationReportId)) + return "utilizationReportId: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a CreateUtilizationReportRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmmigration.v1.CreateUtilizationReportRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmmigration.v1.CreateUtilizationReportRequest} CreateUtilizationReportRequest + */ + CreateUtilizationReportRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmmigration.v1.CreateUtilizationReportRequest) + return object; + var message = new $root.google.cloud.vmmigration.v1.CreateUtilizationReportRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.utilizationReport != null) { + if (typeof object.utilizationReport !== "object") + throw TypeError(".google.cloud.vmmigration.v1.CreateUtilizationReportRequest.utilizationReport: object expected"); + message.utilizationReport = $root.google.cloud.vmmigration.v1.UtilizationReport.fromObject(object.utilizationReport); + } + if (object.utilizationReportId != null) + message.utilizationReportId = String(object.utilizationReportId); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a CreateUtilizationReportRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmmigration.v1.CreateUtilizationReportRequest + * @static + * @param {google.cloud.vmmigration.v1.CreateUtilizationReportRequest} message CreateUtilizationReportRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateUtilizationReportRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.utilizationReport = null; + object.utilizationReportId = ""; + object.requestId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.utilizationReport != null && message.hasOwnProperty("utilizationReport")) + object.utilizationReport = $root.google.cloud.vmmigration.v1.UtilizationReport.toObject(message.utilizationReport, options); + if (message.utilizationReportId != null && message.hasOwnProperty("utilizationReportId")) + object.utilizationReportId = message.utilizationReportId; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this CreateUtilizationReportRequest to JSON. + * @function toJSON + * @memberof google.cloud.vmmigration.v1.CreateUtilizationReportRequest + * @instance + * @returns {Object.} JSON object + */ + CreateUtilizationReportRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateUtilizationReportRequest + * @function getTypeUrl + * @memberof google.cloud.vmmigration.v1.CreateUtilizationReportRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateUtilizationReportRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmmigration.v1.CreateUtilizationReportRequest"; + }; + + return CreateUtilizationReportRequest; + })(); + + v1.DeleteUtilizationReportRequest = (function() { + + /** + * Properties of a DeleteUtilizationReportRequest. + * @memberof google.cloud.vmmigration.v1 + * @interface IDeleteUtilizationReportRequest + * @property {string|null} [name] DeleteUtilizationReportRequest name + * @property {string|null} [requestId] DeleteUtilizationReportRequest requestId + */ + + /** + * Constructs a new DeleteUtilizationReportRequest. + * @memberof google.cloud.vmmigration.v1 + * @classdesc Represents a DeleteUtilizationReportRequest. + * @implements IDeleteUtilizationReportRequest + * @constructor + * @param {google.cloud.vmmigration.v1.IDeleteUtilizationReportRequest=} [properties] Properties to set + */ + function DeleteUtilizationReportRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteUtilizationReportRequest name. + * @member {string} name + * @memberof google.cloud.vmmigration.v1.DeleteUtilizationReportRequest + * @instance + */ + DeleteUtilizationReportRequest.prototype.name = ""; + + /** + * DeleteUtilizationReportRequest requestId. + * @member {string} requestId + * @memberof google.cloud.vmmigration.v1.DeleteUtilizationReportRequest + * @instance + */ + DeleteUtilizationReportRequest.prototype.requestId = ""; + + /** + * Creates a new DeleteUtilizationReportRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vmmigration.v1.DeleteUtilizationReportRequest + * @static + * @param {google.cloud.vmmigration.v1.IDeleteUtilizationReportRequest=} [properties] Properties to set + * @returns {google.cloud.vmmigration.v1.DeleteUtilizationReportRequest} DeleteUtilizationReportRequest instance + */ + DeleteUtilizationReportRequest.create = function create(properties) { + return new DeleteUtilizationReportRequest(properties); + }; + + /** + * Encodes the specified DeleteUtilizationReportRequest message. Does not implicitly {@link google.cloud.vmmigration.v1.DeleteUtilizationReportRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmmigration.v1.DeleteUtilizationReportRequest + * @static + * @param {google.cloud.vmmigration.v1.IDeleteUtilizationReportRequest} message DeleteUtilizationReportRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteUtilizationReportRequest.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); + return writer; + }; + + /** + * Encodes the specified DeleteUtilizationReportRequest message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.DeleteUtilizationReportRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmmigration.v1.DeleteUtilizationReportRequest + * @static + * @param {google.cloud.vmmigration.v1.IDeleteUtilizationReportRequest} message DeleteUtilizationReportRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteUtilizationReportRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteUtilizationReportRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmmigration.v1.DeleteUtilizationReportRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmmigration.v1.DeleteUtilizationReportRequest} DeleteUtilizationReportRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteUtilizationReportRequest.decode = function 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.vmmigration.v1.DeleteUtilizationReportRequest(); + 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; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteUtilizationReportRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmmigration.v1.DeleteUtilizationReportRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmmigration.v1.DeleteUtilizationReportRequest} DeleteUtilizationReportRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteUtilizationReportRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteUtilizationReportRequest message. + * @function verify + * @memberof google.cloud.vmmigration.v1.DeleteUtilizationReportRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteUtilizationReportRequest.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"; + return null; + }; + + /** + * Creates a DeleteUtilizationReportRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmmigration.v1.DeleteUtilizationReportRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmmigration.v1.DeleteUtilizationReportRequest} DeleteUtilizationReportRequest + */ + DeleteUtilizationReportRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmmigration.v1.DeleteUtilizationReportRequest) + return object; + var message = new $root.google.cloud.vmmigration.v1.DeleteUtilizationReportRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a DeleteUtilizationReportRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmmigration.v1.DeleteUtilizationReportRequest + * @static + * @param {google.cloud.vmmigration.v1.DeleteUtilizationReportRequest} message DeleteUtilizationReportRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteUtilizationReportRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.requestId = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this DeleteUtilizationReportRequest to JSON. + * @function toJSON + * @memberof google.cloud.vmmigration.v1.DeleteUtilizationReportRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteUtilizationReportRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteUtilizationReportRequest + * @function getTypeUrl + * @memberof google.cloud.vmmigration.v1.DeleteUtilizationReportRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteUtilizationReportRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmmigration.v1.DeleteUtilizationReportRequest"; + }; + + return DeleteUtilizationReportRequest; + })(); + + v1.ListDatacenterConnectorsResponse = (function() { + + /** + * Properties of a ListDatacenterConnectorsResponse. + * @memberof google.cloud.vmmigration.v1 + * @interface IListDatacenterConnectorsResponse + * @property {Array.|null} [datacenterConnectors] ListDatacenterConnectorsResponse datacenterConnectors + * @property {string|null} [nextPageToken] ListDatacenterConnectorsResponse nextPageToken + * @property {Array.|null} [unreachable] ListDatacenterConnectorsResponse unreachable + */ + + /** + * Constructs a new ListDatacenterConnectorsResponse. + * @memberof google.cloud.vmmigration.v1 + * @classdesc Represents a ListDatacenterConnectorsResponse. + * @implements IListDatacenterConnectorsResponse + * @constructor + * @param {google.cloud.vmmigration.v1.IListDatacenterConnectorsResponse=} [properties] Properties to set + */ + function ListDatacenterConnectorsResponse(properties) { + this.datacenterConnectors = []; + 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]]; + } + + /** + * ListDatacenterConnectorsResponse datacenterConnectors. + * @member {Array.} datacenterConnectors + * @memberof google.cloud.vmmigration.v1.ListDatacenterConnectorsResponse + * @instance + */ + ListDatacenterConnectorsResponse.prototype.datacenterConnectors = $util.emptyArray; + + /** + * ListDatacenterConnectorsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.vmmigration.v1.ListDatacenterConnectorsResponse + * @instance + */ + ListDatacenterConnectorsResponse.prototype.nextPageToken = ""; + + /** + * ListDatacenterConnectorsResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.vmmigration.v1.ListDatacenterConnectorsResponse + * @instance + */ + ListDatacenterConnectorsResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListDatacenterConnectorsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.vmmigration.v1.ListDatacenterConnectorsResponse + * @static + * @param {google.cloud.vmmigration.v1.IListDatacenterConnectorsResponse=} [properties] Properties to set + * @returns {google.cloud.vmmigration.v1.ListDatacenterConnectorsResponse} ListDatacenterConnectorsResponse instance + */ + ListDatacenterConnectorsResponse.create = function create(properties) { + return new ListDatacenterConnectorsResponse(properties); + }; + + /** + * Encodes the specified ListDatacenterConnectorsResponse message. Does not implicitly {@link google.cloud.vmmigration.v1.ListDatacenterConnectorsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmmigration.v1.ListDatacenterConnectorsResponse + * @static + * @param {google.cloud.vmmigration.v1.IListDatacenterConnectorsResponse} message ListDatacenterConnectorsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDatacenterConnectorsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.datacenterConnectors != null && message.datacenterConnectors.length) + for (var i = 0; i < message.datacenterConnectors.length; ++i) + $root.google.cloud.vmmigration.v1.DatacenterConnector.encode(message.datacenterConnectors[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 ListDatacenterConnectorsResponse message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.ListDatacenterConnectorsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmmigration.v1.ListDatacenterConnectorsResponse + * @static + * @param {google.cloud.vmmigration.v1.IListDatacenterConnectorsResponse} message ListDatacenterConnectorsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDatacenterConnectorsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListDatacenterConnectorsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmmigration.v1.ListDatacenterConnectorsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmmigration.v1.ListDatacenterConnectorsResponse} ListDatacenterConnectorsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDatacenterConnectorsResponse.decode = function 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.vmmigration.v1.ListDatacenterConnectorsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.datacenterConnectors && message.datacenterConnectors.length)) + message.datacenterConnectors = []; + message.datacenterConnectors.push($root.google.cloud.vmmigration.v1.DatacenterConnector.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 ListDatacenterConnectorsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmmigration.v1.ListDatacenterConnectorsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmmigration.v1.ListDatacenterConnectorsResponse} ListDatacenterConnectorsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDatacenterConnectorsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListDatacenterConnectorsResponse message. + * @function verify + * @memberof google.cloud.vmmigration.v1.ListDatacenterConnectorsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListDatacenterConnectorsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.datacenterConnectors != null && message.hasOwnProperty("datacenterConnectors")) { + if (!Array.isArray(message.datacenterConnectors)) + return "datacenterConnectors: array expected"; + for (var i = 0; i < message.datacenterConnectors.length; ++i) { + var error = $root.google.cloud.vmmigration.v1.DatacenterConnector.verify(message.datacenterConnectors[i]); + if (error) + return "datacenterConnectors." + 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 ListDatacenterConnectorsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmmigration.v1.ListDatacenterConnectorsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmmigration.v1.ListDatacenterConnectorsResponse} ListDatacenterConnectorsResponse + */ + ListDatacenterConnectorsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmmigration.v1.ListDatacenterConnectorsResponse) + return object; + var message = new $root.google.cloud.vmmigration.v1.ListDatacenterConnectorsResponse(); + if (object.datacenterConnectors) { + if (!Array.isArray(object.datacenterConnectors)) + throw TypeError(".google.cloud.vmmigration.v1.ListDatacenterConnectorsResponse.datacenterConnectors: array expected"); + message.datacenterConnectors = []; + for (var i = 0; i < object.datacenterConnectors.length; ++i) { + if (typeof object.datacenterConnectors[i] !== "object") + throw TypeError(".google.cloud.vmmigration.v1.ListDatacenterConnectorsResponse.datacenterConnectors: object expected"); + message.datacenterConnectors[i] = $root.google.cloud.vmmigration.v1.DatacenterConnector.fromObject(object.datacenterConnectors[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.vmmigration.v1.ListDatacenterConnectorsResponse.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 ListDatacenterConnectorsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmmigration.v1.ListDatacenterConnectorsResponse + * @static + * @param {google.cloud.vmmigration.v1.ListDatacenterConnectorsResponse} message ListDatacenterConnectorsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListDatacenterConnectorsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.datacenterConnectors = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.datacenterConnectors && message.datacenterConnectors.length) { + object.datacenterConnectors = []; + for (var j = 0; j < message.datacenterConnectors.length; ++j) + object.datacenterConnectors[j] = $root.google.cloud.vmmigration.v1.DatacenterConnector.toObject(message.datacenterConnectors[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 ListDatacenterConnectorsResponse to JSON. + * @function toJSON + * @memberof google.cloud.vmmigration.v1.ListDatacenterConnectorsResponse + * @instance + * @returns {Object.} JSON object + */ + ListDatacenterConnectorsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListDatacenterConnectorsResponse + * @function getTypeUrl + * @memberof google.cloud.vmmigration.v1.ListDatacenterConnectorsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListDatacenterConnectorsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmmigration.v1.ListDatacenterConnectorsResponse"; + }; + + return ListDatacenterConnectorsResponse; + })(); + + v1.GetDatacenterConnectorRequest = (function() { + + /** + * Properties of a GetDatacenterConnectorRequest. + * @memberof google.cloud.vmmigration.v1 + * @interface IGetDatacenterConnectorRequest + * @property {string|null} [name] GetDatacenterConnectorRequest name + */ + + /** + * Constructs a new GetDatacenterConnectorRequest. + * @memberof google.cloud.vmmigration.v1 + * @classdesc Represents a GetDatacenterConnectorRequest. + * @implements IGetDatacenterConnectorRequest + * @constructor + * @param {google.cloud.vmmigration.v1.IGetDatacenterConnectorRequest=} [properties] Properties to set + */ + function GetDatacenterConnectorRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetDatacenterConnectorRequest name. + * @member {string} name + * @memberof google.cloud.vmmigration.v1.GetDatacenterConnectorRequest + * @instance + */ + GetDatacenterConnectorRequest.prototype.name = ""; + + /** + * Creates a new GetDatacenterConnectorRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vmmigration.v1.GetDatacenterConnectorRequest + * @static + * @param {google.cloud.vmmigration.v1.IGetDatacenterConnectorRequest=} [properties] Properties to set + * @returns {google.cloud.vmmigration.v1.GetDatacenterConnectorRequest} GetDatacenterConnectorRequest instance + */ + GetDatacenterConnectorRequest.create = function create(properties) { + return new GetDatacenterConnectorRequest(properties); + }; + + /** + * Encodes the specified GetDatacenterConnectorRequest message. Does not implicitly {@link google.cloud.vmmigration.v1.GetDatacenterConnectorRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmmigration.v1.GetDatacenterConnectorRequest + * @static + * @param {google.cloud.vmmigration.v1.IGetDatacenterConnectorRequest} message GetDatacenterConnectorRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDatacenterConnectorRequest.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 GetDatacenterConnectorRequest message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.GetDatacenterConnectorRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmmigration.v1.GetDatacenterConnectorRequest + * @static + * @param {google.cloud.vmmigration.v1.IGetDatacenterConnectorRequest} message GetDatacenterConnectorRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDatacenterConnectorRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetDatacenterConnectorRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmmigration.v1.GetDatacenterConnectorRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmmigration.v1.GetDatacenterConnectorRequest} GetDatacenterConnectorRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDatacenterConnectorRequest.decode = function 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.vmmigration.v1.GetDatacenterConnectorRequest(); + 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 GetDatacenterConnectorRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmmigration.v1.GetDatacenterConnectorRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmmigration.v1.GetDatacenterConnectorRequest} GetDatacenterConnectorRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDatacenterConnectorRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetDatacenterConnectorRequest message. + * @function verify + * @memberof google.cloud.vmmigration.v1.GetDatacenterConnectorRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetDatacenterConnectorRequest.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 GetDatacenterConnectorRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmmigration.v1.GetDatacenterConnectorRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmmigration.v1.GetDatacenterConnectorRequest} GetDatacenterConnectorRequest + */ + GetDatacenterConnectorRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmmigration.v1.GetDatacenterConnectorRequest) + return object; + var message = new $root.google.cloud.vmmigration.v1.GetDatacenterConnectorRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetDatacenterConnectorRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmmigration.v1.GetDatacenterConnectorRequest + * @static + * @param {google.cloud.vmmigration.v1.GetDatacenterConnectorRequest} message GetDatacenterConnectorRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetDatacenterConnectorRequest.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 GetDatacenterConnectorRequest to JSON. + * @function toJSON + * @memberof google.cloud.vmmigration.v1.GetDatacenterConnectorRequest + * @instance + * @returns {Object.} JSON object + */ + GetDatacenterConnectorRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetDatacenterConnectorRequest + * @function getTypeUrl + * @memberof google.cloud.vmmigration.v1.GetDatacenterConnectorRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetDatacenterConnectorRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmmigration.v1.GetDatacenterConnectorRequest"; + }; + + return GetDatacenterConnectorRequest; + })(); + + v1.CreateDatacenterConnectorRequest = (function() { + + /** + * Properties of a CreateDatacenterConnectorRequest. + * @memberof google.cloud.vmmigration.v1 + * @interface ICreateDatacenterConnectorRequest + * @property {string|null} [parent] CreateDatacenterConnectorRequest parent + * @property {string|null} [datacenterConnectorId] CreateDatacenterConnectorRequest datacenterConnectorId + * @property {google.cloud.vmmigration.v1.IDatacenterConnector|null} [datacenterConnector] CreateDatacenterConnectorRequest datacenterConnector + * @property {string|null} [requestId] CreateDatacenterConnectorRequest requestId + */ + + /** + * Constructs a new CreateDatacenterConnectorRequest. + * @memberof google.cloud.vmmigration.v1 + * @classdesc Represents a CreateDatacenterConnectorRequest. + * @implements ICreateDatacenterConnectorRequest + * @constructor + * @param {google.cloud.vmmigration.v1.ICreateDatacenterConnectorRequest=} [properties] Properties to set + */ + function CreateDatacenterConnectorRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateDatacenterConnectorRequest parent. + * @member {string} parent + * @memberof google.cloud.vmmigration.v1.CreateDatacenterConnectorRequest + * @instance + */ + CreateDatacenterConnectorRequest.prototype.parent = ""; + + /** + * CreateDatacenterConnectorRequest datacenterConnectorId. + * @member {string} datacenterConnectorId + * @memberof google.cloud.vmmigration.v1.CreateDatacenterConnectorRequest + * @instance + */ + CreateDatacenterConnectorRequest.prototype.datacenterConnectorId = ""; + + /** + * CreateDatacenterConnectorRequest datacenterConnector. + * @member {google.cloud.vmmigration.v1.IDatacenterConnector|null|undefined} datacenterConnector + * @memberof google.cloud.vmmigration.v1.CreateDatacenterConnectorRequest + * @instance + */ + CreateDatacenterConnectorRequest.prototype.datacenterConnector = null; + + /** + * CreateDatacenterConnectorRequest requestId. + * @member {string} requestId + * @memberof google.cloud.vmmigration.v1.CreateDatacenterConnectorRequest + * @instance + */ + CreateDatacenterConnectorRequest.prototype.requestId = ""; + + /** + * Creates a new CreateDatacenterConnectorRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vmmigration.v1.CreateDatacenterConnectorRequest + * @static + * @param {google.cloud.vmmigration.v1.ICreateDatacenterConnectorRequest=} [properties] Properties to set + * @returns {google.cloud.vmmigration.v1.CreateDatacenterConnectorRequest} CreateDatacenterConnectorRequest instance + */ + CreateDatacenterConnectorRequest.create = function create(properties) { + return new CreateDatacenterConnectorRequest(properties); + }; + + /** + * Encodes the specified CreateDatacenterConnectorRequest message. Does not implicitly {@link google.cloud.vmmigration.v1.CreateDatacenterConnectorRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmmigration.v1.CreateDatacenterConnectorRequest + * @static + * @param {google.cloud.vmmigration.v1.ICreateDatacenterConnectorRequest} message CreateDatacenterConnectorRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateDatacenterConnectorRequest.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.datacenterConnectorId != null && Object.hasOwnProperty.call(message, "datacenterConnectorId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.datacenterConnectorId); + if (message.datacenterConnector != null && Object.hasOwnProperty.call(message, "datacenterConnector")) + $root.google.cloud.vmmigration.v1.DatacenterConnector.encode(message.datacenterConnector, 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 CreateDatacenterConnectorRequest message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.CreateDatacenterConnectorRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmmigration.v1.CreateDatacenterConnectorRequest + * @static + * @param {google.cloud.vmmigration.v1.ICreateDatacenterConnectorRequest} message CreateDatacenterConnectorRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateDatacenterConnectorRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateDatacenterConnectorRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmmigration.v1.CreateDatacenterConnectorRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmmigration.v1.CreateDatacenterConnectorRequest} CreateDatacenterConnectorRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateDatacenterConnectorRequest.decode = function 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.vmmigration.v1.CreateDatacenterConnectorRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.datacenterConnectorId = reader.string(); + break; + } + case 3: { + message.datacenterConnector = $root.google.cloud.vmmigration.v1.DatacenterConnector.decode(reader, reader.uint32()); + break; + } + case 4: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateDatacenterConnectorRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmmigration.v1.CreateDatacenterConnectorRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmmigration.v1.CreateDatacenterConnectorRequest} CreateDatacenterConnectorRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateDatacenterConnectorRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateDatacenterConnectorRequest message. + * @function verify + * @memberof google.cloud.vmmigration.v1.CreateDatacenterConnectorRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateDatacenterConnectorRequest.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.datacenterConnectorId != null && message.hasOwnProperty("datacenterConnectorId")) + if (!$util.isString(message.datacenterConnectorId)) + return "datacenterConnectorId: string expected"; + if (message.datacenterConnector != null && message.hasOwnProperty("datacenterConnector")) { + var error = $root.google.cloud.vmmigration.v1.DatacenterConnector.verify(message.datacenterConnector); + if (error) + return "datacenterConnector." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a CreateDatacenterConnectorRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmmigration.v1.CreateDatacenterConnectorRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmmigration.v1.CreateDatacenterConnectorRequest} CreateDatacenterConnectorRequest + */ + CreateDatacenterConnectorRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmmigration.v1.CreateDatacenterConnectorRequest) + return object; + var message = new $root.google.cloud.vmmigration.v1.CreateDatacenterConnectorRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.datacenterConnectorId != null) + message.datacenterConnectorId = String(object.datacenterConnectorId); + if (object.datacenterConnector != null) { + if (typeof object.datacenterConnector !== "object") + throw TypeError(".google.cloud.vmmigration.v1.CreateDatacenterConnectorRequest.datacenterConnector: object expected"); + message.datacenterConnector = $root.google.cloud.vmmigration.v1.DatacenterConnector.fromObject(object.datacenterConnector); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a CreateDatacenterConnectorRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmmigration.v1.CreateDatacenterConnectorRequest + * @static + * @param {google.cloud.vmmigration.v1.CreateDatacenterConnectorRequest} message CreateDatacenterConnectorRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateDatacenterConnectorRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.datacenterConnectorId = ""; + object.datacenterConnector = null; + object.requestId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.datacenterConnectorId != null && message.hasOwnProperty("datacenterConnectorId")) + object.datacenterConnectorId = message.datacenterConnectorId; + if (message.datacenterConnector != null && message.hasOwnProperty("datacenterConnector")) + object.datacenterConnector = $root.google.cloud.vmmigration.v1.DatacenterConnector.toObject(message.datacenterConnector, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this CreateDatacenterConnectorRequest to JSON. + * @function toJSON + * @memberof google.cloud.vmmigration.v1.CreateDatacenterConnectorRequest + * @instance + * @returns {Object.} JSON object + */ + CreateDatacenterConnectorRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateDatacenterConnectorRequest + * @function getTypeUrl + * @memberof google.cloud.vmmigration.v1.CreateDatacenterConnectorRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateDatacenterConnectorRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmmigration.v1.CreateDatacenterConnectorRequest"; + }; + + return CreateDatacenterConnectorRequest; + })(); + + v1.DeleteDatacenterConnectorRequest = (function() { + + /** + * Properties of a DeleteDatacenterConnectorRequest. + * @memberof google.cloud.vmmigration.v1 + * @interface IDeleteDatacenterConnectorRequest + * @property {string|null} [name] DeleteDatacenterConnectorRequest name + * @property {string|null} [requestId] DeleteDatacenterConnectorRequest requestId + */ + + /** + * Constructs a new DeleteDatacenterConnectorRequest. + * @memberof google.cloud.vmmigration.v1 + * @classdesc Represents a DeleteDatacenterConnectorRequest. + * @implements IDeleteDatacenterConnectorRequest + * @constructor + * @param {google.cloud.vmmigration.v1.IDeleteDatacenterConnectorRequest=} [properties] Properties to set + */ + function DeleteDatacenterConnectorRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteDatacenterConnectorRequest name. + * @member {string} name + * @memberof google.cloud.vmmigration.v1.DeleteDatacenterConnectorRequest + * @instance + */ + DeleteDatacenterConnectorRequest.prototype.name = ""; + + /** + * DeleteDatacenterConnectorRequest requestId. + * @member {string} requestId + * @memberof google.cloud.vmmigration.v1.DeleteDatacenterConnectorRequest + * @instance + */ + DeleteDatacenterConnectorRequest.prototype.requestId = ""; + + /** + * Creates a new DeleteDatacenterConnectorRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vmmigration.v1.DeleteDatacenterConnectorRequest + * @static + * @param {google.cloud.vmmigration.v1.IDeleteDatacenterConnectorRequest=} [properties] Properties to set + * @returns {google.cloud.vmmigration.v1.DeleteDatacenterConnectorRequest} DeleteDatacenterConnectorRequest instance + */ + DeleteDatacenterConnectorRequest.create = function create(properties) { + return new DeleteDatacenterConnectorRequest(properties); + }; + + /** + * Encodes the specified DeleteDatacenterConnectorRequest message. Does not implicitly {@link google.cloud.vmmigration.v1.DeleteDatacenterConnectorRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmmigration.v1.DeleteDatacenterConnectorRequest + * @static + * @param {google.cloud.vmmigration.v1.IDeleteDatacenterConnectorRequest} message DeleteDatacenterConnectorRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteDatacenterConnectorRequest.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); + return writer; + }; + + /** + * Encodes the specified DeleteDatacenterConnectorRequest message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.DeleteDatacenterConnectorRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmmigration.v1.DeleteDatacenterConnectorRequest + * @static + * @param {google.cloud.vmmigration.v1.IDeleteDatacenterConnectorRequest} message DeleteDatacenterConnectorRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteDatacenterConnectorRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteDatacenterConnectorRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmmigration.v1.DeleteDatacenterConnectorRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmmigration.v1.DeleteDatacenterConnectorRequest} DeleteDatacenterConnectorRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteDatacenterConnectorRequest.decode = function 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.vmmigration.v1.DeleteDatacenterConnectorRequest(); + 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; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteDatacenterConnectorRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmmigration.v1.DeleteDatacenterConnectorRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmmigration.v1.DeleteDatacenterConnectorRequest} DeleteDatacenterConnectorRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteDatacenterConnectorRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteDatacenterConnectorRequest message. + * @function verify + * @memberof google.cloud.vmmigration.v1.DeleteDatacenterConnectorRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteDatacenterConnectorRequest.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"; + return null; + }; + + /** + * Creates a DeleteDatacenterConnectorRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmmigration.v1.DeleteDatacenterConnectorRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmmigration.v1.DeleteDatacenterConnectorRequest} DeleteDatacenterConnectorRequest + */ + DeleteDatacenterConnectorRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmmigration.v1.DeleteDatacenterConnectorRequest) + return object; + var message = new $root.google.cloud.vmmigration.v1.DeleteDatacenterConnectorRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a DeleteDatacenterConnectorRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmmigration.v1.DeleteDatacenterConnectorRequest + * @static + * @param {google.cloud.vmmigration.v1.DeleteDatacenterConnectorRequest} message DeleteDatacenterConnectorRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteDatacenterConnectorRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.requestId = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this DeleteDatacenterConnectorRequest to JSON. + * @function toJSON + * @memberof google.cloud.vmmigration.v1.DeleteDatacenterConnectorRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteDatacenterConnectorRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteDatacenterConnectorRequest + * @function getTypeUrl + * @memberof google.cloud.vmmigration.v1.DeleteDatacenterConnectorRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteDatacenterConnectorRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmmigration.v1.DeleteDatacenterConnectorRequest"; + }; + + return DeleteDatacenterConnectorRequest; + })(); + + v1.UpgradeApplianceRequest = (function() { + + /** + * Properties of an UpgradeApplianceRequest. + * @memberof google.cloud.vmmigration.v1 + * @interface IUpgradeApplianceRequest + * @property {string|null} [datacenterConnector] UpgradeApplianceRequest datacenterConnector + * @property {string|null} [requestId] UpgradeApplianceRequest requestId + */ + + /** + * Constructs a new UpgradeApplianceRequest. + * @memberof google.cloud.vmmigration.v1 + * @classdesc Represents an UpgradeApplianceRequest. + * @implements IUpgradeApplianceRequest + * @constructor + * @param {google.cloud.vmmigration.v1.IUpgradeApplianceRequest=} [properties] Properties to set + */ + function UpgradeApplianceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpgradeApplianceRequest datacenterConnector. + * @member {string} datacenterConnector + * @memberof google.cloud.vmmigration.v1.UpgradeApplianceRequest + * @instance + */ + UpgradeApplianceRequest.prototype.datacenterConnector = ""; + + /** + * UpgradeApplianceRequest requestId. + * @member {string} requestId + * @memberof google.cloud.vmmigration.v1.UpgradeApplianceRequest + * @instance + */ + UpgradeApplianceRequest.prototype.requestId = ""; + + /** + * Creates a new UpgradeApplianceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vmmigration.v1.UpgradeApplianceRequest + * @static + * @param {google.cloud.vmmigration.v1.IUpgradeApplianceRequest=} [properties] Properties to set + * @returns {google.cloud.vmmigration.v1.UpgradeApplianceRequest} UpgradeApplianceRequest instance + */ + UpgradeApplianceRequest.create = function create(properties) { + return new UpgradeApplianceRequest(properties); + }; + + /** + * Encodes the specified UpgradeApplianceRequest message. Does not implicitly {@link google.cloud.vmmigration.v1.UpgradeApplianceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmmigration.v1.UpgradeApplianceRequest + * @static + * @param {google.cloud.vmmigration.v1.IUpgradeApplianceRequest} message UpgradeApplianceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpgradeApplianceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.datacenterConnector != null && Object.hasOwnProperty.call(message, "datacenterConnector")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.datacenterConnector); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified UpgradeApplianceRequest message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.UpgradeApplianceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmmigration.v1.UpgradeApplianceRequest + * @static + * @param {google.cloud.vmmigration.v1.IUpgradeApplianceRequest} message UpgradeApplianceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpgradeApplianceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpgradeApplianceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmmigration.v1.UpgradeApplianceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmmigration.v1.UpgradeApplianceRequest} UpgradeApplianceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpgradeApplianceRequest.decode = function 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.vmmigration.v1.UpgradeApplianceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.datacenterConnector = reader.string(); + break; + } + case 2: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpgradeApplianceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmmigration.v1.UpgradeApplianceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmmigration.v1.UpgradeApplianceRequest} UpgradeApplianceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpgradeApplianceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpgradeApplianceRequest message. + * @function verify + * @memberof google.cloud.vmmigration.v1.UpgradeApplianceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpgradeApplianceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.datacenterConnector != null && message.hasOwnProperty("datacenterConnector")) + if (!$util.isString(message.datacenterConnector)) + return "datacenterConnector: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates an UpgradeApplianceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmmigration.v1.UpgradeApplianceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmmigration.v1.UpgradeApplianceRequest} UpgradeApplianceRequest + */ + UpgradeApplianceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmmigration.v1.UpgradeApplianceRequest) + return object; + var message = new $root.google.cloud.vmmigration.v1.UpgradeApplianceRequest(); + if (object.datacenterConnector != null) + message.datacenterConnector = String(object.datacenterConnector); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from an UpgradeApplianceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmmigration.v1.UpgradeApplianceRequest + * @static + * @param {google.cloud.vmmigration.v1.UpgradeApplianceRequest} message UpgradeApplianceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpgradeApplianceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.datacenterConnector = ""; + object.requestId = ""; + } + if (message.datacenterConnector != null && message.hasOwnProperty("datacenterConnector")) + object.datacenterConnector = message.datacenterConnector; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this UpgradeApplianceRequest to JSON. + * @function toJSON + * @memberof google.cloud.vmmigration.v1.UpgradeApplianceRequest + * @instance + * @returns {Object.} JSON object + */ + UpgradeApplianceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpgradeApplianceRequest + * @function getTypeUrl + * @memberof google.cloud.vmmigration.v1.UpgradeApplianceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpgradeApplianceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmmigration.v1.UpgradeApplianceRequest"; + }; + + return UpgradeApplianceRequest; + })(); + + v1.UpgradeApplianceResponse = (function() { + + /** + * Properties of an UpgradeApplianceResponse. + * @memberof google.cloud.vmmigration.v1 + * @interface IUpgradeApplianceResponse + */ + + /** + * Constructs a new UpgradeApplianceResponse. + * @memberof google.cloud.vmmigration.v1 + * @classdesc Represents an UpgradeApplianceResponse. + * @implements IUpgradeApplianceResponse + * @constructor + * @param {google.cloud.vmmigration.v1.IUpgradeApplianceResponse=} [properties] Properties to set + */ + function UpgradeApplianceResponse(properties) { + if (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 UpgradeApplianceResponse instance using the specified properties. + * @function create + * @memberof google.cloud.vmmigration.v1.UpgradeApplianceResponse + * @static + * @param {google.cloud.vmmigration.v1.IUpgradeApplianceResponse=} [properties] Properties to set + * @returns {google.cloud.vmmigration.v1.UpgradeApplianceResponse} UpgradeApplianceResponse instance + */ + UpgradeApplianceResponse.create = function create(properties) { + return new UpgradeApplianceResponse(properties); + }; + + /** + * Encodes the specified UpgradeApplianceResponse message. Does not implicitly {@link google.cloud.vmmigration.v1.UpgradeApplianceResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmmigration.v1.UpgradeApplianceResponse + * @static + * @param {google.cloud.vmmigration.v1.IUpgradeApplianceResponse} message UpgradeApplianceResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpgradeApplianceResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified UpgradeApplianceResponse message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.UpgradeApplianceResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmmigration.v1.UpgradeApplianceResponse + * @static + * @param {google.cloud.vmmigration.v1.IUpgradeApplianceResponse} message UpgradeApplianceResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpgradeApplianceResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpgradeApplianceResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmmigration.v1.UpgradeApplianceResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmmigration.v1.UpgradeApplianceResponse} UpgradeApplianceResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpgradeApplianceResponse.decode = function 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.vmmigration.v1.UpgradeApplianceResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpgradeApplianceResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmmigration.v1.UpgradeApplianceResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmmigration.v1.UpgradeApplianceResponse} UpgradeApplianceResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpgradeApplianceResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpgradeApplianceResponse message. + * @function verify + * @memberof google.cloud.vmmigration.v1.UpgradeApplianceResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpgradeApplianceResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates an UpgradeApplianceResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmmigration.v1.UpgradeApplianceResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmmigration.v1.UpgradeApplianceResponse} UpgradeApplianceResponse + */ + UpgradeApplianceResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmmigration.v1.UpgradeApplianceResponse) + return object; + return new $root.google.cloud.vmmigration.v1.UpgradeApplianceResponse(); + }; + + /** + * Creates a plain object from an UpgradeApplianceResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmmigration.v1.UpgradeApplianceResponse + * @static + * @param {google.cloud.vmmigration.v1.UpgradeApplianceResponse} message UpgradeApplianceResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpgradeApplianceResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this UpgradeApplianceResponse to JSON. + * @function toJSON + * @memberof google.cloud.vmmigration.v1.UpgradeApplianceResponse + * @instance + * @returns {Object.} JSON object + */ + UpgradeApplianceResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpgradeApplianceResponse + * @function getTypeUrl + * @memberof google.cloud.vmmigration.v1.UpgradeApplianceResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpgradeApplianceResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmmigration.v1.UpgradeApplianceResponse"; + }; + + return UpgradeApplianceResponse; + })(); + + v1.ListDatacenterConnectorsRequest = (function() { + + /** + * Properties of a ListDatacenterConnectorsRequest. + * @memberof google.cloud.vmmigration.v1 + * @interface IListDatacenterConnectorsRequest + * @property {string|null} [parent] ListDatacenterConnectorsRequest parent + * @property {number|null} [pageSize] ListDatacenterConnectorsRequest pageSize + * @property {string|null} [pageToken] ListDatacenterConnectorsRequest pageToken + * @property {string|null} [filter] ListDatacenterConnectorsRequest filter + * @property {string|null} [orderBy] ListDatacenterConnectorsRequest orderBy + */ + + /** + * Constructs a new ListDatacenterConnectorsRequest. + * @memberof google.cloud.vmmigration.v1 + * @classdesc Represents a ListDatacenterConnectorsRequest. + * @implements IListDatacenterConnectorsRequest + * @constructor + * @param {google.cloud.vmmigration.v1.IListDatacenterConnectorsRequest=} [properties] Properties to set + */ + function ListDatacenterConnectorsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListDatacenterConnectorsRequest parent. + * @member {string} parent + * @memberof google.cloud.vmmigration.v1.ListDatacenterConnectorsRequest + * @instance + */ + ListDatacenterConnectorsRequest.prototype.parent = ""; + + /** + * ListDatacenterConnectorsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.vmmigration.v1.ListDatacenterConnectorsRequest + * @instance + */ + ListDatacenterConnectorsRequest.prototype.pageSize = 0; + + /** + * ListDatacenterConnectorsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.vmmigration.v1.ListDatacenterConnectorsRequest + * @instance + */ + ListDatacenterConnectorsRequest.prototype.pageToken = ""; + + /** + * ListDatacenterConnectorsRequest filter. + * @member {string} filter + * @memberof google.cloud.vmmigration.v1.ListDatacenterConnectorsRequest + * @instance + */ + ListDatacenterConnectorsRequest.prototype.filter = ""; + + /** + * ListDatacenterConnectorsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.vmmigration.v1.ListDatacenterConnectorsRequest + * @instance + */ + ListDatacenterConnectorsRequest.prototype.orderBy = ""; + + /** + * Creates a new ListDatacenterConnectorsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vmmigration.v1.ListDatacenterConnectorsRequest + * @static + * @param {google.cloud.vmmigration.v1.IListDatacenterConnectorsRequest=} [properties] Properties to set + * @returns {google.cloud.vmmigration.v1.ListDatacenterConnectorsRequest} ListDatacenterConnectorsRequest instance + */ + ListDatacenterConnectorsRequest.create = function create(properties) { + return new ListDatacenterConnectorsRequest(properties); + }; + + /** + * Encodes the specified ListDatacenterConnectorsRequest message. Does not implicitly {@link google.cloud.vmmigration.v1.ListDatacenterConnectorsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmmigration.v1.ListDatacenterConnectorsRequest + * @static + * @param {google.cloud.vmmigration.v1.IListDatacenterConnectorsRequest} message ListDatacenterConnectorsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDatacenterConnectorsRequest.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 ListDatacenterConnectorsRequest message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.ListDatacenterConnectorsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmmigration.v1.ListDatacenterConnectorsRequest + * @static + * @param {google.cloud.vmmigration.v1.IListDatacenterConnectorsRequest} message ListDatacenterConnectorsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDatacenterConnectorsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListDatacenterConnectorsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmmigration.v1.ListDatacenterConnectorsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmmigration.v1.ListDatacenterConnectorsRequest} ListDatacenterConnectorsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDatacenterConnectorsRequest.decode = function 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.vmmigration.v1.ListDatacenterConnectorsRequest(); + 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 ListDatacenterConnectorsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmmigration.v1.ListDatacenterConnectorsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmmigration.v1.ListDatacenterConnectorsRequest} ListDatacenterConnectorsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDatacenterConnectorsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListDatacenterConnectorsRequest message. + * @function verify + * @memberof google.cloud.vmmigration.v1.ListDatacenterConnectorsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListDatacenterConnectorsRequest.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 ListDatacenterConnectorsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmmigration.v1.ListDatacenterConnectorsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmmigration.v1.ListDatacenterConnectorsRequest} ListDatacenterConnectorsRequest + */ + ListDatacenterConnectorsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmmigration.v1.ListDatacenterConnectorsRequest) + return object; + var message = new $root.google.cloud.vmmigration.v1.ListDatacenterConnectorsRequest(); + 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 ListDatacenterConnectorsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmmigration.v1.ListDatacenterConnectorsRequest + * @static + * @param {google.cloud.vmmigration.v1.ListDatacenterConnectorsRequest} message ListDatacenterConnectorsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListDatacenterConnectorsRequest.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 ListDatacenterConnectorsRequest to JSON. + * @function toJSON + * @memberof google.cloud.vmmigration.v1.ListDatacenterConnectorsRequest + * @instance + * @returns {Object.} JSON object + */ + ListDatacenterConnectorsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListDatacenterConnectorsRequest + * @function getTypeUrl + * @memberof google.cloud.vmmigration.v1.ListDatacenterConnectorsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListDatacenterConnectorsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmmigration.v1.ListDatacenterConnectorsRequest"; + }; + + return ListDatacenterConnectorsRequest; + })(); + + v1.ComputeEngineTargetDefaults = (function() { + + /** + * Properties of a ComputeEngineTargetDefaults. + * @memberof google.cloud.vmmigration.v1 + * @interface IComputeEngineTargetDefaults + * @property {string|null} [vmName] ComputeEngineTargetDefaults vmName + * @property {string|null} [targetProject] ComputeEngineTargetDefaults targetProject + * @property {string|null} [zone] ComputeEngineTargetDefaults zone + * @property {string|null} [machineTypeSeries] ComputeEngineTargetDefaults machineTypeSeries + * @property {string|null} [machineType] ComputeEngineTargetDefaults machineType + * @property {Array.|null} [networkTags] ComputeEngineTargetDefaults networkTags + * @property {Array.|null} [networkInterfaces] ComputeEngineTargetDefaults networkInterfaces + * @property {string|null} [serviceAccount] ComputeEngineTargetDefaults serviceAccount + * @property {google.cloud.vmmigration.v1.ComputeEngineDiskType|null} [diskType] ComputeEngineTargetDefaults diskType + * @property {Object.|null} [labels] ComputeEngineTargetDefaults labels + * @property {google.cloud.vmmigration.v1.ComputeEngineLicenseType|null} [licenseType] ComputeEngineTargetDefaults licenseType + * @property {google.cloud.vmmigration.v1.IAppliedLicense|null} [appliedLicense] ComputeEngineTargetDefaults appliedLicense + * @property {google.cloud.vmmigration.v1.IComputeScheduling|null} [computeScheduling] ComputeEngineTargetDefaults computeScheduling + * @property {boolean|null} [secureBoot] ComputeEngineTargetDefaults secureBoot + * @property {google.cloud.vmmigration.v1.ComputeEngineBootOption|null} [bootOption] ComputeEngineTargetDefaults bootOption + * @property {Object.|null} [metadata] ComputeEngineTargetDefaults metadata + * @property {Array.|null} [additionalLicenses] ComputeEngineTargetDefaults additionalLicenses + * @property {string|null} [hostname] ComputeEngineTargetDefaults hostname + */ + + /** + * Constructs a new ComputeEngineTargetDefaults. + * @memberof google.cloud.vmmigration.v1 + * @classdesc Represents a ComputeEngineTargetDefaults. + * @implements IComputeEngineTargetDefaults + * @constructor + * @param {google.cloud.vmmigration.v1.IComputeEngineTargetDefaults=} [properties] Properties to set + */ + function ComputeEngineTargetDefaults(properties) { + this.networkTags = []; + this.networkInterfaces = []; + this.labels = {}; + this.metadata = {}; + this.additionalLicenses = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ComputeEngineTargetDefaults vmName. + * @member {string} vmName + * @memberof google.cloud.vmmigration.v1.ComputeEngineTargetDefaults + * @instance + */ + ComputeEngineTargetDefaults.prototype.vmName = ""; + + /** + * ComputeEngineTargetDefaults targetProject. + * @member {string} targetProject + * @memberof google.cloud.vmmigration.v1.ComputeEngineTargetDefaults + * @instance + */ + ComputeEngineTargetDefaults.prototype.targetProject = ""; + + /** + * ComputeEngineTargetDefaults zone. + * @member {string} zone + * @memberof google.cloud.vmmigration.v1.ComputeEngineTargetDefaults + * @instance + */ + ComputeEngineTargetDefaults.prototype.zone = ""; + + /** + * ComputeEngineTargetDefaults machineTypeSeries. + * @member {string} machineTypeSeries + * @memberof google.cloud.vmmigration.v1.ComputeEngineTargetDefaults + * @instance + */ + ComputeEngineTargetDefaults.prototype.machineTypeSeries = ""; + + /** + * ComputeEngineTargetDefaults machineType. + * @member {string} machineType + * @memberof google.cloud.vmmigration.v1.ComputeEngineTargetDefaults + * @instance + */ + ComputeEngineTargetDefaults.prototype.machineType = ""; + + /** + * ComputeEngineTargetDefaults networkTags. + * @member {Array.} networkTags + * @memberof google.cloud.vmmigration.v1.ComputeEngineTargetDefaults + * @instance + */ + ComputeEngineTargetDefaults.prototype.networkTags = $util.emptyArray; + + /** + * ComputeEngineTargetDefaults networkInterfaces. + * @member {Array.} networkInterfaces + * @memberof google.cloud.vmmigration.v1.ComputeEngineTargetDefaults + * @instance + */ + ComputeEngineTargetDefaults.prototype.networkInterfaces = $util.emptyArray; + + /** + * ComputeEngineTargetDefaults serviceAccount. + * @member {string} serviceAccount + * @memberof google.cloud.vmmigration.v1.ComputeEngineTargetDefaults + * @instance + */ + ComputeEngineTargetDefaults.prototype.serviceAccount = ""; + + /** + * ComputeEngineTargetDefaults diskType. + * @member {google.cloud.vmmigration.v1.ComputeEngineDiskType} diskType + * @memberof google.cloud.vmmigration.v1.ComputeEngineTargetDefaults + * @instance + */ + ComputeEngineTargetDefaults.prototype.diskType = 0; + + /** + * ComputeEngineTargetDefaults labels. + * @member {Object.} labels + * @memberof google.cloud.vmmigration.v1.ComputeEngineTargetDefaults + * @instance + */ + ComputeEngineTargetDefaults.prototype.labels = $util.emptyObject; + + /** + * ComputeEngineTargetDefaults licenseType. + * @member {google.cloud.vmmigration.v1.ComputeEngineLicenseType} licenseType + * @memberof google.cloud.vmmigration.v1.ComputeEngineTargetDefaults + * @instance + */ + ComputeEngineTargetDefaults.prototype.licenseType = 0; + + /** + * ComputeEngineTargetDefaults appliedLicense. + * @member {google.cloud.vmmigration.v1.IAppliedLicense|null|undefined} appliedLicense + * @memberof google.cloud.vmmigration.v1.ComputeEngineTargetDefaults + * @instance + */ + ComputeEngineTargetDefaults.prototype.appliedLicense = null; + + /** + * ComputeEngineTargetDefaults computeScheduling. + * @member {google.cloud.vmmigration.v1.IComputeScheduling|null|undefined} computeScheduling + * @memberof google.cloud.vmmigration.v1.ComputeEngineTargetDefaults + * @instance + */ + ComputeEngineTargetDefaults.prototype.computeScheduling = null; + + /** + * ComputeEngineTargetDefaults secureBoot. + * @member {boolean} secureBoot + * @memberof google.cloud.vmmigration.v1.ComputeEngineTargetDefaults + * @instance + */ + ComputeEngineTargetDefaults.prototype.secureBoot = false; + + /** + * ComputeEngineTargetDefaults bootOption. + * @member {google.cloud.vmmigration.v1.ComputeEngineBootOption} bootOption + * @memberof google.cloud.vmmigration.v1.ComputeEngineTargetDefaults + * @instance + */ + ComputeEngineTargetDefaults.prototype.bootOption = 0; + + /** + * ComputeEngineTargetDefaults metadata. + * @member {Object.} metadata + * @memberof google.cloud.vmmigration.v1.ComputeEngineTargetDefaults + * @instance + */ + ComputeEngineTargetDefaults.prototype.metadata = $util.emptyObject; + + /** + * ComputeEngineTargetDefaults additionalLicenses. + * @member {Array.} additionalLicenses + * @memberof google.cloud.vmmigration.v1.ComputeEngineTargetDefaults + * @instance + */ + ComputeEngineTargetDefaults.prototype.additionalLicenses = $util.emptyArray; + + /** + * ComputeEngineTargetDefaults hostname. + * @member {string} hostname + * @memberof google.cloud.vmmigration.v1.ComputeEngineTargetDefaults + * @instance + */ + ComputeEngineTargetDefaults.prototype.hostname = ""; + + /** + * Creates a new ComputeEngineTargetDefaults instance using the specified properties. + * @function create + * @memberof google.cloud.vmmigration.v1.ComputeEngineTargetDefaults + * @static + * @param {google.cloud.vmmigration.v1.IComputeEngineTargetDefaults=} [properties] Properties to set + * @returns {google.cloud.vmmigration.v1.ComputeEngineTargetDefaults} ComputeEngineTargetDefaults instance + */ + ComputeEngineTargetDefaults.create = function create(properties) { + return new ComputeEngineTargetDefaults(properties); + }; + + /** + * Encodes the specified ComputeEngineTargetDefaults message. Does not implicitly {@link google.cloud.vmmigration.v1.ComputeEngineTargetDefaults.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmmigration.v1.ComputeEngineTargetDefaults + * @static + * @param {google.cloud.vmmigration.v1.IComputeEngineTargetDefaults} message ComputeEngineTargetDefaults message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ComputeEngineTargetDefaults.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.vmName != null && Object.hasOwnProperty.call(message, "vmName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.vmName); + if (message.targetProject != null && Object.hasOwnProperty.call(message, "targetProject")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.targetProject); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.zone); + if (message.machineTypeSeries != null && Object.hasOwnProperty.call(message, "machineTypeSeries")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.machineTypeSeries); + if (message.machineType != null && Object.hasOwnProperty.call(message, "machineType")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.machineType); + if (message.networkTags != null && message.networkTags.length) + for (var i = 0; i < message.networkTags.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.networkTags[i]); + if (message.networkInterfaces != null && message.networkInterfaces.length) + for (var i = 0; i < message.networkInterfaces.length; ++i) + $root.google.cloud.vmmigration.v1.NetworkInterface.encode(message.networkInterfaces[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.serviceAccount != null && Object.hasOwnProperty.call(message, "serviceAccount")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.serviceAccount); + if (message.diskType != null && Object.hasOwnProperty.call(message, "diskType")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.diskType); + 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 10, wireType 2 =*/82).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.licenseType != null && Object.hasOwnProperty.call(message, "licenseType")) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.licenseType); + if (message.appliedLicense != null && Object.hasOwnProperty.call(message, "appliedLicense")) + $root.google.cloud.vmmigration.v1.AppliedLicense.encode(message.appliedLicense, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.computeScheduling != null && Object.hasOwnProperty.call(message, "computeScheduling")) + $root.google.cloud.vmmigration.v1.ComputeScheduling.encode(message.computeScheduling, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.secureBoot != null && Object.hasOwnProperty.call(message, "secureBoot")) + writer.uint32(/* id 14, wireType 0 =*/112).bool(message.secureBoot); + if (message.bootOption != null && Object.hasOwnProperty.call(message, "bootOption")) + writer.uint32(/* id 15, wireType 0 =*/120).int32(message.bootOption); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + for (var keys = Object.keys(message.metadata), i = 0; i < keys.length; ++i) + writer.uint32(/* id 16, wireType 2 =*/130).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.metadata[keys[i]]).ldelim(); + if (message.additionalLicenses != null && message.additionalLicenses.length) + for (var i = 0; i < message.additionalLicenses.length; ++i) + writer.uint32(/* id 17, wireType 2 =*/138).string(message.additionalLicenses[i]); + if (message.hostname != null && Object.hasOwnProperty.call(message, "hostname")) + writer.uint32(/* id 18, wireType 2 =*/146).string(message.hostname); + return writer; + }; + + /** + * Encodes the specified ComputeEngineTargetDefaults message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.ComputeEngineTargetDefaults.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmmigration.v1.ComputeEngineTargetDefaults + * @static + * @param {google.cloud.vmmigration.v1.IComputeEngineTargetDefaults} message ComputeEngineTargetDefaults message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ComputeEngineTargetDefaults.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ComputeEngineTargetDefaults message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmmigration.v1.ComputeEngineTargetDefaults + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmmigration.v1.ComputeEngineTargetDefaults} ComputeEngineTargetDefaults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ComputeEngineTargetDefaults.decode = function 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.vmmigration.v1.ComputeEngineTargetDefaults(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.vmName = reader.string(); + break; + } + case 2: { + message.targetProject = reader.string(); + break; + } + case 3: { + message.zone = reader.string(); + break; + } + case 4: { + message.machineTypeSeries = reader.string(); + break; + } + case 5: { + message.machineType = reader.string(); + break; + } + case 6: { + if (!(message.networkTags && message.networkTags.length)) + message.networkTags = []; + message.networkTags.push(reader.string()); + break; + } + case 7: { + if (!(message.networkInterfaces && message.networkInterfaces.length)) + message.networkInterfaces = []; + message.networkInterfaces.push($root.google.cloud.vmmigration.v1.NetworkInterface.decode(reader, reader.uint32())); + break; + } + case 8: { + message.serviceAccount = reader.string(); + break; + } + case 9: { + message.diskType = reader.int32(); + break; + } + case 10: { + 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 11: { + message.licenseType = reader.int32(); + break; + } + case 12: { + message.appliedLicense = $root.google.cloud.vmmigration.v1.AppliedLicense.decode(reader, reader.uint32()); + break; + } + case 13: { + message.computeScheduling = $root.google.cloud.vmmigration.v1.ComputeScheduling.decode(reader, reader.uint32()); + break; + } + case 14: { + message.secureBoot = reader.bool(); + break; + } + case 15: { + message.bootOption = reader.int32(); + break; + } + case 16: { + if (message.metadata === $util.emptyObject) + message.metadata = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.metadata[key] = value; + break; + } + case 17: { + if (!(message.additionalLicenses && message.additionalLicenses.length)) + message.additionalLicenses = []; + message.additionalLicenses.push(reader.string()); + break; + } + case 18: { + message.hostname = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ComputeEngineTargetDefaults message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmmigration.v1.ComputeEngineTargetDefaults + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmmigration.v1.ComputeEngineTargetDefaults} ComputeEngineTargetDefaults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ComputeEngineTargetDefaults.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ComputeEngineTargetDefaults message. + * @function verify + * @memberof google.cloud.vmmigration.v1.ComputeEngineTargetDefaults + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ComputeEngineTargetDefaults.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.vmName != null && message.hasOwnProperty("vmName")) + if (!$util.isString(message.vmName)) + return "vmName: string expected"; + if (message.targetProject != null && message.hasOwnProperty("targetProject")) + if (!$util.isString(message.targetProject)) + return "targetProject: string expected"; + if (message.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: string expected"; + if (message.machineTypeSeries != null && message.hasOwnProperty("machineTypeSeries")) + if (!$util.isString(message.machineTypeSeries)) + return "machineTypeSeries: string expected"; + if (message.machineType != null && message.hasOwnProperty("machineType")) + if (!$util.isString(message.machineType)) + return "machineType: string expected"; + if (message.networkTags != null && message.hasOwnProperty("networkTags")) { + if (!Array.isArray(message.networkTags)) + return "networkTags: array expected"; + for (var i = 0; i < message.networkTags.length; ++i) + if (!$util.isString(message.networkTags[i])) + return "networkTags: string[] expected"; + } + if (message.networkInterfaces != null && message.hasOwnProperty("networkInterfaces")) { + if (!Array.isArray(message.networkInterfaces)) + return "networkInterfaces: array expected"; + for (var i = 0; i < message.networkInterfaces.length; ++i) { + var error = $root.google.cloud.vmmigration.v1.NetworkInterface.verify(message.networkInterfaces[i]); + if (error) + return "networkInterfaces." + error; + } + } + if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) + if (!$util.isString(message.serviceAccount)) + return "serviceAccount: string expected"; + if (message.diskType != null && message.hasOwnProperty("diskType")) + switch (message.diskType) { + default: + return "diskType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + 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.licenseType != null && message.hasOwnProperty("licenseType")) + switch (message.licenseType) { + default: + return "licenseType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.appliedLicense != null && message.hasOwnProperty("appliedLicense")) { + var error = $root.google.cloud.vmmigration.v1.AppliedLicense.verify(message.appliedLicense); + if (error) + return "appliedLicense." + error; + } + if (message.computeScheduling != null && message.hasOwnProperty("computeScheduling")) { + var error = $root.google.cloud.vmmigration.v1.ComputeScheduling.verify(message.computeScheduling); + if (error) + return "computeScheduling." + error; + } + if (message.secureBoot != null && message.hasOwnProperty("secureBoot")) + if (typeof message.secureBoot !== "boolean") + return "secureBoot: boolean expected"; + if (message.bootOption != null && message.hasOwnProperty("bootOption")) + switch (message.bootOption) { + default: + return "bootOption: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + if (!$util.isObject(message.metadata)) + return "metadata: object expected"; + var key = Object.keys(message.metadata); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.metadata[key[i]])) + return "metadata: string{k:string} expected"; + } + if (message.additionalLicenses != null && message.hasOwnProperty("additionalLicenses")) { + if (!Array.isArray(message.additionalLicenses)) + return "additionalLicenses: array expected"; + for (var i = 0; i < message.additionalLicenses.length; ++i) + if (!$util.isString(message.additionalLicenses[i])) + return "additionalLicenses: string[] expected"; + } + if (message.hostname != null && message.hasOwnProperty("hostname")) + if (!$util.isString(message.hostname)) + return "hostname: string expected"; + return null; + }; + + /** + * Creates a ComputeEngineTargetDefaults message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmmigration.v1.ComputeEngineTargetDefaults + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmmigration.v1.ComputeEngineTargetDefaults} ComputeEngineTargetDefaults + */ + ComputeEngineTargetDefaults.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmmigration.v1.ComputeEngineTargetDefaults) + return object; + var message = new $root.google.cloud.vmmigration.v1.ComputeEngineTargetDefaults(); + if (object.vmName != null) + message.vmName = String(object.vmName); + if (object.targetProject != null) + message.targetProject = String(object.targetProject); + if (object.zone != null) + message.zone = String(object.zone); + if (object.machineTypeSeries != null) + message.machineTypeSeries = String(object.machineTypeSeries); + if (object.machineType != null) + message.machineType = String(object.machineType); + if (object.networkTags) { + if (!Array.isArray(object.networkTags)) + throw TypeError(".google.cloud.vmmigration.v1.ComputeEngineTargetDefaults.networkTags: array expected"); + message.networkTags = []; + for (var i = 0; i < object.networkTags.length; ++i) + message.networkTags[i] = String(object.networkTags[i]); + } + if (object.networkInterfaces) { + if (!Array.isArray(object.networkInterfaces)) + throw TypeError(".google.cloud.vmmigration.v1.ComputeEngineTargetDefaults.networkInterfaces: array expected"); + message.networkInterfaces = []; + for (var i = 0; i < object.networkInterfaces.length; ++i) { + if (typeof object.networkInterfaces[i] !== "object") + throw TypeError(".google.cloud.vmmigration.v1.ComputeEngineTargetDefaults.networkInterfaces: object expected"); + message.networkInterfaces[i] = $root.google.cloud.vmmigration.v1.NetworkInterface.fromObject(object.networkInterfaces[i]); + } + } + if (object.serviceAccount != null) + message.serviceAccount = String(object.serviceAccount); + switch (object.diskType) { + default: + if (typeof object.diskType === "number") { + message.diskType = object.diskType; + break; + } + break; + case "COMPUTE_ENGINE_DISK_TYPE_UNSPECIFIED": + case 0: + message.diskType = 0; + break; + case "COMPUTE_ENGINE_DISK_TYPE_STANDARD": + case 1: + message.diskType = 1; + break; + case "COMPUTE_ENGINE_DISK_TYPE_SSD": + case 2: + message.diskType = 2; + break; + case "COMPUTE_ENGINE_DISK_TYPE_BALANCED": + case 3: + message.diskType = 3; + break; + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.vmmigration.v1.ComputeEngineTargetDefaults.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.licenseType) { + default: + if (typeof object.licenseType === "number") { + message.licenseType = object.licenseType; + break; + } + break; + case "COMPUTE_ENGINE_LICENSE_TYPE_DEFAULT": + case 0: + message.licenseType = 0; + break; + case "COMPUTE_ENGINE_LICENSE_TYPE_PAYG": + case 1: + message.licenseType = 1; + break; + case "COMPUTE_ENGINE_LICENSE_TYPE_BYOL": + case 2: + message.licenseType = 2; + break; + } + if (object.appliedLicense != null) { + if (typeof object.appliedLicense !== "object") + throw TypeError(".google.cloud.vmmigration.v1.ComputeEngineTargetDefaults.appliedLicense: object expected"); + message.appliedLicense = $root.google.cloud.vmmigration.v1.AppliedLicense.fromObject(object.appliedLicense); + } + if (object.computeScheduling != null) { + if (typeof object.computeScheduling !== "object") + throw TypeError(".google.cloud.vmmigration.v1.ComputeEngineTargetDefaults.computeScheduling: object expected"); + message.computeScheduling = $root.google.cloud.vmmigration.v1.ComputeScheduling.fromObject(object.computeScheduling); + } + if (object.secureBoot != null) + message.secureBoot = Boolean(object.secureBoot); + switch (object.bootOption) { + default: + if (typeof object.bootOption === "number") { + message.bootOption = object.bootOption; + break; + } + break; + case "COMPUTE_ENGINE_BOOT_OPTION_UNSPECIFIED": + case 0: + message.bootOption = 0; + break; + case "COMPUTE_ENGINE_BOOT_OPTION_EFI": + case 1: + message.bootOption = 1; + break; + case "COMPUTE_ENGINE_BOOT_OPTION_BIOS": + case 2: + message.bootOption = 2; + break; + } + if (object.metadata) { + if (typeof object.metadata !== "object") + throw TypeError(".google.cloud.vmmigration.v1.ComputeEngineTargetDefaults.metadata: object expected"); + message.metadata = {}; + for (var keys = Object.keys(object.metadata), i = 0; i < keys.length; ++i) + message.metadata[keys[i]] = String(object.metadata[keys[i]]); + } + if (object.additionalLicenses) { + if (!Array.isArray(object.additionalLicenses)) + throw TypeError(".google.cloud.vmmigration.v1.ComputeEngineTargetDefaults.additionalLicenses: array expected"); + message.additionalLicenses = []; + for (var i = 0; i < object.additionalLicenses.length; ++i) + message.additionalLicenses[i] = String(object.additionalLicenses[i]); + } + if (object.hostname != null) + message.hostname = String(object.hostname); + return message; + }; + + /** + * Creates a plain object from a ComputeEngineTargetDefaults message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmmigration.v1.ComputeEngineTargetDefaults + * @static + * @param {google.cloud.vmmigration.v1.ComputeEngineTargetDefaults} message ComputeEngineTargetDefaults + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ComputeEngineTargetDefaults.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.networkTags = []; + object.networkInterfaces = []; + object.additionalLicenses = []; + } + if (options.objects || options.defaults) { + object.labels = {}; + object.metadata = {}; + } + if (options.defaults) { + object.vmName = ""; + object.targetProject = ""; + object.zone = ""; + object.machineTypeSeries = ""; + object.machineType = ""; + object.serviceAccount = ""; + object.diskType = options.enums === String ? "COMPUTE_ENGINE_DISK_TYPE_UNSPECIFIED" : 0; + object.licenseType = options.enums === String ? "COMPUTE_ENGINE_LICENSE_TYPE_DEFAULT" : 0; + object.appliedLicense = null; + object.computeScheduling = null; + object.secureBoot = false; + object.bootOption = options.enums === String ? "COMPUTE_ENGINE_BOOT_OPTION_UNSPECIFIED" : 0; + object.hostname = ""; + } + if (message.vmName != null && message.hasOwnProperty("vmName")) + object.vmName = message.vmName; + if (message.targetProject != null && message.hasOwnProperty("targetProject")) + object.targetProject = message.targetProject; + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + if (message.machineTypeSeries != null && message.hasOwnProperty("machineTypeSeries")) + object.machineTypeSeries = message.machineTypeSeries; + if (message.machineType != null && message.hasOwnProperty("machineType")) + object.machineType = message.machineType; + if (message.networkTags && message.networkTags.length) { + object.networkTags = []; + for (var j = 0; j < message.networkTags.length; ++j) + object.networkTags[j] = message.networkTags[j]; + } + if (message.networkInterfaces && message.networkInterfaces.length) { + object.networkInterfaces = []; + for (var j = 0; j < message.networkInterfaces.length; ++j) + object.networkInterfaces[j] = $root.google.cloud.vmmigration.v1.NetworkInterface.toObject(message.networkInterfaces[j], options); + } + if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) + object.serviceAccount = message.serviceAccount; + if (message.diskType != null && message.hasOwnProperty("diskType")) + object.diskType = options.enums === String ? $root.google.cloud.vmmigration.v1.ComputeEngineDiskType[message.diskType] === undefined ? message.diskType : $root.google.cloud.vmmigration.v1.ComputeEngineDiskType[message.diskType] : message.diskType; + 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.licenseType != null && message.hasOwnProperty("licenseType")) + object.licenseType = options.enums === String ? $root.google.cloud.vmmigration.v1.ComputeEngineLicenseType[message.licenseType] === undefined ? message.licenseType : $root.google.cloud.vmmigration.v1.ComputeEngineLicenseType[message.licenseType] : message.licenseType; + if (message.appliedLicense != null && message.hasOwnProperty("appliedLicense")) + object.appliedLicense = $root.google.cloud.vmmigration.v1.AppliedLicense.toObject(message.appliedLicense, options); + if (message.computeScheduling != null && message.hasOwnProperty("computeScheduling")) + object.computeScheduling = $root.google.cloud.vmmigration.v1.ComputeScheduling.toObject(message.computeScheduling, options); + if (message.secureBoot != null && message.hasOwnProperty("secureBoot")) + object.secureBoot = message.secureBoot; + if (message.bootOption != null && message.hasOwnProperty("bootOption")) + object.bootOption = options.enums === String ? $root.google.cloud.vmmigration.v1.ComputeEngineBootOption[message.bootOption] === undefined ? message.bootOption : $root.google.cloud.vmmigration.v1.ComputeEngineBootOption[message.bootOption] : message.bootOption; + if (message.metadata && (keys2 = Object.keys(message.metadata)).length) { + object.metadata = {}; + for (var j = 0; j < keys2.length; ++j) + object.metadata[keys2[j]] = message.metadata[keys2[j]]; + } + if (message.additionalLicenses && message.additionalLicenses.length) { + object.additionalLicenses = []; + for (var j = 0; j < message.additionalLicenses.length; ++j) + object.additionalLicenses[j] = message.additionalLicenses[j]; + } + if (message.hostname != null && message.hasOwnProperty("hostname")) + object.hostname = message.hostname; + return object; + }; + + /** + * Converts this ComputeEngineTargetDefaults to JSON. + * @function toJSON + * @memberof google.cloud.vmmigration.v1.ComputeEngineTargetDefaults + * @instance + * @returns {Object.} JSON object + */ + ComputeEngineTargetDefaults.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ComputeEngineTargetDefaults + * @function getTypeUrl + * @memberof google.cloud.vmmigration.v1.ComputeEngineTargetDefaults + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ComputeEngineTargetDefaults.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmmigration.v1.ComputeEngineTargetDefaults"; + }; + + return ComputeEngineTargetDefaults; + })(); + + v1.ComputeEngineTargetDetails = (function() { + + /** + * Properties of a ComputeEngineTargetDetails. + * @memberof google.cloud.vmmigration.v1 + * @interface IComputeEngineTargetDetails + * @property {string|null} [vmName] ComputeEngineTargetDetails vmName + * @property {string|null} [project] ComputeEngineTargetDetails project + * @property {string|null} [zone] ComputeEngineTargetDetails zone + * @property {string|null} [machineTypeSeries] ComputeEngineTargetDetails machineTypeSeries + * @property {string|null} [machineType] ComputeEngineTargetDetails machineType + * @property {Array.|null} [networkTags] ComputeEngineTargetDetails networkTags + * @property {Array.|null} [networkInterfaces] ComputeEngineTargetDetails networkInterfaces + * @property {string|null} [serviceAccount] ComputeEngineTargetDetails serviceAccount + * @property {google.cloud.vmmigration.v1.ComputeEngineDiskType|null} [diskType] ComputeEngineTargetDetails diskType + * @property {Object.|null} [labels] ComputeEngineTargetDetails labels + * @property {google.cloud.vmmigration.v1.ComputeEngineLicenseType|null} [licenseType] ComputeEngineTargetDetails licenseType + * @property {google.cloud.vmmigration.v1.IAppliedLicense|null} [appliedLicense] ComputeEngineTargetDetails appliedLicense + * @property {google.cloud.vmmigration.v1.IComputeScheduling|null} [computeScheduling] ComputeEngineTargetDetails computeScheduling + * @property {boolean|null} [secureBoot] ComputeEngineTargetDetails secureBoot + * @property {google.cloud.vmmigration.v1.ComputeEngineBootOption|null} [bootOption] ComputeEngineTargetDetails bootOption + * @property {Object.|null} [metadata] ComputeEngineTargetDetails metadata + * @property {Array.|null} [additionalLicenses] ComputeEngineTargetDetails additionalLicenses + * @property {string|null} [hostname] ComputeEngineTargetDetails hostname + */ + + /** + * Constructs a new ComputeEngineTargetDetails. + * @memberof google.cloud.vmmigration.v1 + * @classdesc Represents a ComputeEngineTargetDetails. + * @implements IComputeEngineTargetDetails + * @constructor + * @param {google.cloud.vmmigration.v1.IComputeEngineTargetDetails=} [properties] Properties to set + */ + function ComputeEngineTargetDetails(properties) { + this.networkTags = []; + this.networkInterfaces = []; + this.labels = {}; + this.metadata = {}; + this.additionalLicenses = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ComputeEngineTargetDetails vmName. + * @member {string} vmName + * @memberof google.cloud.vmmigration.v1.ComputeEngineTargetDetails + * @instance + */ + ComputeEngineTargetDetails.prototype.vmName = ""; + + /** + * ComputeEngineTargetDetails project. + * @member {string} project + * @memberof google.cloud.vmmigration.v1.ComputeEngineTargetDetails + * @instance + */ + ComputeEngineTargetDetails.prototype.project = ""; + + /** + * ComputeEngineTargetDetails zone. + * @member {string} zone + * @memberof google.cloud.vmmigration.v1.ComputeEngineTargetDetails + * @instance + */ + ComputeEngineTargetDetails.prototype.zone = ""; + + /** + * ComputeEngineTargetDetails machineTypeSeries. + * @member {string} machineTypeSeries + * @memberof google.cloud.vmmigration.v1.ComputeEngineTargetDetails + * @instance + */ + ComputeEngineTargetDetails.prototype.machineTypeSeries = ""; + + /** + * ComputeEngineTargetDetails machineType. + * @member {string} machineType + * @memberof google.cloud.vmmigration.v1.ComputeEngineTargetDetails + * @instance + */ + ComputeEngineTargetDetails.prototype.machineType = ""; + + /** + * ComputeEngineTargetDetails networkTags. + * @member {Array.} networkTags + * @memberof google.cloud.vmmigration.v1.ComputeEngineTargetDetails + * @instance + */ + ComputeEngineTargetDetails.prototype.networkTags = $util.emptyArray; + + /** + * ComputeEngineTargetDetails networkInterfaces. + * @member {Array.} networkInterfaces + * @memberof google.cloud.vmmigration.v1.ComputeEngineTargetDetails + * @instance + */ + ComputeEngineTargetDetails.prototype.networkInterfaces = $util.emptyArray; + + /** + * ComputeEngineTargetDetails serviceAccount. + * @member {string} serviceAccount + * @memberof google.cloud.vmmigration.v1.ComputeEngineTargetDetails + * @instance + */ + ComputeEngineTargetDetails.prototype.serviceAccount = ""; + + /** + * ComputeEngineTargetDetails diskType. + * @member {google.cloud.vmmigration.v1.ComputeEngineDiskType} diskType + * @memberof google.cloud.vmmigration.v1.ComputeEngineTargetDetails + * @instance + */ + ComputeEngineTargetDetails.prototype.diskType = 0; + + /** + * ComputeEngineTargetDetails labels. + * @member {Object.} labels + * @memberof google.cloud.vmmigration.v1.ComputeEngineTargetDetails + * @instance + */ + ComputeEngineTargetDetails.prototype.labels = $util.emptyObject; + + /** + * ComputeEngineTargetDetails licenseType. + * @member {google.cloud.vmmigration.v1.ComputeEngineLicenseType} licenseType + * @memberof google.cloud.vmmigration.v1.ComputeEngineTargetDetails + * @instance + */ + ComputeEngineTargetDetails.prototype.licenseType = 0; + + /** + * ComputeEngineTargetDetails appliedLicense. + * @member {google.cloud.vmmigration.v1.IAppliedLicense|null|undefined} appliedLicense + * @memberof google.cloud.vmmigration.v1.ComputeEngineTargetDetails + * @instance + */ + ComputeEngineTargetDetails.prototype.appliedLicense = null; + + /** + * ComputeEngineTargetDetails computeScheduling. + * @member {google.cloud.vmmigration.v1.IComputeScheduling|null|undefined} computeScheduling + * @memberof google.cloud.vmmigration.v1.ComputeEngineTargetDetails + * @instance + */ + ComputeEngineTargetDetails.prototype.computeScheduling = null; + + /** + * ComputeEngineTargetDetails secureBoot. + * @member {boolean} secureBoot + * @memberof google.cloud.vmmigration.v1.ComputeEngineTargetDetails + * @instance + */ + ComputeEngineTargetDetails.prototype.secureBoot = false; + + /** + * ComputeEngineTargetDetails bootOption. + * @member {google.cloud.vmmigration.v1.ComputeEngineBootOption} bootOption + * @memberof google.cloud.vmmigration.v1.ComputeEngineTargetDetails + * @instance + */ + ComputeEngineTargetDetails.prototype.bootOption = 0; + + /** + * ComputeEngineTargetDetails metadata. + * @member {Object.} metadata + * @memberof google.cloud.vmmigration.v1.ComputeEngineTargetDetails + * @instance + */ + ComputeEngineTargetDetails.prototype.metadata = $util.emptyObject; + + /** + * ComputeEngineTargetDetails additionalLicenses. + * @member {Array.} additionalLicenses + * @memberof google.cloud.vmmigration.v1.ComputeEngineTargetDetails + * @instance + */ + ComputeEngineTargetDetails.prototype.additionalLicenses = $util.emptyArray; + + /** + * ComputeEngineTargetDetails hostname. + * @member {string} hostname + * @memberof google.cloud.vmmigration.v1.ComputeEngineTargetDetails + * @instance + */ + ComputeEngineTargetDetails.prototype.hostname = ""; + + /** + * Creates a new ComputeEngineTargetDetails instance using the specified properties. + * @function create + * @memberof google.cloud.vmmigration.v1.ComputeEngineTargetDetails + * @static + * @param {google.cloud.vmmigration.v1.IComputeEngineTargetDetails=} [properties] Properties to set + * @returns {google.cloud.vmmigration.v1.ComputeEngineTargetDetails} ComputeEngineTargetDetails instance + */ + ComputeEngineTargetDetails.create = function create(properties) { + return new ComputeEngineTargetDetails(properties); + }; + + /** + * Encodes the specified ComputeEngineTargetDetails message. Does not implicitly {@link google.cloud.vmmigration.v1.ComputeEngineTargetDetails.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmmigration.v1.ComputeEngineTargetDetails + * @static + * @param {google.cloud.vmmigration.v1.IComputeEngineTargetDetails} message ComputeEngineTargetDetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ComputeEngineTargetDetails.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.vmName != null && Object.hasOwnProperty.call(message, "vmName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.vmName); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.project); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.zone); + if (message.machineTypeSeries != null && Object.hasOwnProperty.call(message, "machineTypeSeries")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.machineTypeSeries); + if (message.machineType != null && Object.hasOwnProperty.call(message, "machineType")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.machineType); + if (message.networkTags != null && message.networkTags.length) + for (var i = 0; i < message.networkTags.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.networkTags[i]); + if (message.networkInterfaces != null && message.networkInterfaces.length) + for (var i = 0; i < message.networkInterfaces.length; ++i) + $root.google.cloud.vmmigration.v1.NetworkInterface.encode(message.networkInterfaces[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.serviceAccount != null && Object.hasOwnProperty.call(message, "serviceAccount")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.serviceAccount); + if (message.diskType != null && Object.hasOwnProperty.call(message, "diskType")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.diskType); + 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 10, wireType 2 =*/82).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.licenseType != null && Object.hasOwnProperty.call(message, "licenseType")) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.licenseType); + if (message.appliedLicense != null && Object.hasOwnProperty.call(message, "appliedLicense")) + $root.google.cloud.vmmigration.v1.AppliedLicense.encode(message.appliedLicense, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.computeScheduling != null && Object.hasOwnProperty.call(message, "computeScheduling")) + $root.google.cloud.vmmigration.v1.ComputeScheduling.encode(message.computeScheduling, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.secureBoot != null && Object.hasOwnProperty.call(message, "secureBoot")) + writer.uint32(/* id 14, wireType 0 =*/112).bool(message.secureBoot); + if (message.bootOption != null && Object.hasOwnProperty.call(message, "bootOption")) + writer.uint32(/* id 15, wireType 0 =*/120).int32(message.bootOption); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + for (var keys = Object.keys(message.metadata), i = 0; i < keys.length; ++i) + writer.uint32(/* id 16, wireType 2 =*/130).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.metadata[keys[i]]).ldelim(); + if (message.additionalLicenses != null && message.additionalLicenses.length) + for (var i = 0; i < message.additionalLicenses.length; ++i) + writer.uint32(/* id 17, wireType 2 =*/138).string(message.additionalLicenses[i]); + if (message.hostname != null && Object.hasOwnProperty.call(message, "hostname")) + writer.uint32(/* id 18, wireType 2 =*/146).string(message.hostname); + return writer; + }; + + /** + * Encodes the specified ComputeEngineTargetDetails message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.ComputeEngineTargetDetails.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmmigration.v1.ComputeEngineTargetDetails + * @static + * @param {google.cloud.vmmigration.v1.IComputeEngineTargetDetails} message ComputeEngineTargetDetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ComputeEngineTargetDetails.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ComputeEngineTargetDetails message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmmigration.v1.ComputeEngineTargetDetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmmigration.v1.ComputeEngineTargetDetails} ComputeEngineTargetDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ComputeEngineTargetDetails.decode = function 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.vmmigration.v1.ComputeEngineTargetDetails(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.vmName = reader.string(); + break; + } + case 2: { + message.project = reader.string(); + break; + } + case 3: { + message.zone = reader.string(); + break; + } + case 4: { + message.machineTypeSeries = reader.string(); + break; + } + case 5: { + message.machineType = reader.string(); + break; + } + case 6: { + if (!(message.networkTags && message.networkTags.length)) + message.networkTags = []; + message.networkTags.push(reader.string()); + break; + } + case 7: { + if (!(message.networkInterfaces && message.networkInterfaces.length)) + message.networkInterfaces = []; + message.networkInterfaces.push($root.google.cloud.vmmigration.v1.NetworkInterface.decode(reader, reader.uint32())); + break; + } + case 8: { + message.serviceAccount = reader.string(); + break; + } + case 9: { + message.diskType = reader.int32(); + break; + } + case 10: { + 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 11: { + message.licenseType = reader.int32(); + break; + } + case 12: { + message.appliedLicense = $root.google.cloud.vmmigration.v1.AppliedLicense.decode(reader, reader.uint32()); + break; + } + case 13: { + message.computeScheduling = $root.google.cloud.vmmigration.v1.ComputeScheduling.decode(reader, reader.uint32()); + break; + } + case 14: { + message.secureBoot = reader.bool(); + break; + } + case 15: { + message.bootOption = reader.int32(); + break; + } + case 16: { + if (message.metadata === $util.emptyObject) + message.metadata = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.metadata[key] = value; + break; + } + case 17: { + if (!(message.additionalLicenses && message.additionalLicenses.length)) + message.additionalLicenses = []; + message.additionalLicenses.push(reader.string()); + break; + } + case 18: { + message.hostname = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ComputeEngineTargetDetails message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmmigration.v1.ComputeEngineTargetDetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmmigration.v1.ComputeEngineTargetDetails} ComputeEngineTargetDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ComputeEngineTargetDetails.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ComputeEngineTargetDetails message. + * @function verify + * @memberof google.cloud.vmmigration.v1.ComputeEngineTargetDetails + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ComputeEngineTargetDetails.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.vmName != null && message.hasOwnProperty("vmName")) + if (!$util.isString(message.vmName)) + return "vmName: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: string expected"; + if (message.machineTypeSeries != null && message.hasOwnProperty("machineTypeSeries")) + if (!$util.isString(message.machineTypeSeries)) + return "machineTypeSeries: string expected"; + if (message.machineType != null && message.hasOwnProperty("machineType")) + if (!$util.isString(message.machineType)) + return "machineType: string expected"; + if (message.networkTags != null && message.hasOwnProperty("networkTags")) { + if (!Array.isArray(message.networkTags)) + return "networkTags: array expected"; + for (var i = 0; i < message.networkTags.length; ++i) + if (!$util.isString(message.networkTags[i])) + return "networkTags: string[] expected"; + } + if (message.networkInterfaces != null && message.hasOwnProperty("networkInterfaces")) { + if (!Array.isArray(message.networkInterfaces)) + return "networkInterfaces: array expected"; + for (var i = 0; i < message.networkInterfaces.length; ++i) { + var error = $root.google.cloud.vmmigration.v1.NetworkInterface.verify(message.networkInterfaces[i]); + if (error) + return "networkInterfaces." + error; + } + } + if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) + if (!$util.isString(message.serviceAccount)) + return "serviceAccount: string expected"; + if (message.diskType != null && message.hasOwnProperty("diskType")) + switch (message.diskType) { + default: + return "diskType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + 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.licenseType != null && message.hasOwnProperty("licenseType")) + switch (message.licenseType) { + default: + return "licenseType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.appliedLicense != null && message.hasOwnProperty("appliedLicense")) { + var error = $root.google.cloud.vmmigration.v1.AppliedLicense.verify(message.appliedLicense); + if (error) + return "appliedLicense." + error; + } + if (message.computeScheduling != null && message.hasOwnProperty("computeScheduling")) { + var error = $root.google.cloud.vmmigration.v1.ComputeScheduling.verify(message.computeScheduling); + if (error) + return "computeScheduling." + error; + } + if (message.secureBoot != null && message.hasOwnProperty("secureBoot")) + if (typeof message.secureBoot !== "boolean") + return "secureBoot: boolean expected"; + if (message.bootOption != null && message.hasOwnProperty("bootOption")) + switch (message.bootOption) { + default: + return "bootOption: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + if (!$util.isObject(message.metadata)) + return "metadata: object expected"; + var key = Object.keys(message.metadata); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.metadata[key[i]])) + return "metadata: string{k:string} expected"; + } + if (message.additionalLicenses != null && message.hasOwnProperty("additionalLicenses")) { + if (!Array.isArray(message.additionalLicenses)) + return "additionalLicenses: array expected"; + for (var i = 0; i < message.additionalLicenses.length; ++i) + if (!$util.isString(message.additionalLicenses[i])) + return "additionalLicenses: string[] expected"; + } + if (message.hostname != null && message.hasOwnProperty("hostname")) + if (!$util.isString(message.hostname)) + return "hostname: string expected"; + return null; + }; + + /** + * Creates a ComputeEngineTargetDetails message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmmigration.v1.ComputeEngineTargetDetails + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmmigration.v1.ComputeEngineTargetDetails} ComputeEngineTargetDetails + */ + ComputeEngineTargetDetails.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmmigration.v1.ComputeEngineTargetDetails) + return object; + var message = new $root.google.cloud.vmmigration.v1.ComputeEngineTargetDetails(); + if (object.vmName != null) + message.vmName = String(object.vmName); + if (object.project != null) + message.project = String(object.project); + if (object.zone != null) + message.zone = String(object.zone); + if (object.machineTypeSeries != null) + message.machineTypeSeries = String(object.machineTypeSeries); + if (object.machineType != null) + message.machineType = String(object.machineType); + if (object.networkTags) { + if (!Array.isArray(object.networkTags)) + throw TypeError(".google.cloud.vmmigration.v1.ComputeEngineTargetDetails.networkTags: array expected"); + message.networkTags = []; + for (var i = 0; i < object.networkTags.length; ++i) + message.networkTags[i] = String(object.networkTags[i]); + } + if (object.networkInterfaces) { + if (!Array.isArray(object.networkInterfaces)) + throw TypeError(".google.cloud.vmmigration.v1.ComputeEngineTargetDetails.networkInterfaces: array expected"); + message.networkInterfaces = []; + for (var i = 0; i < object.networkInterfaces.length; ++i) { + if (typeof object.networkInterfaces[i] !== "object") + throw TypeError(".google.cloud.vmmigration.v1.ComputeEngineTargetDetails.networkInterfaces: object expected"); + message.networkInterfaces[i] = $root.google.cloud.vmmigration.v1.NetworkInterface.fromObject(object.networkInterfaces[i]); + } + } + if (object.serviceAccount != null) + message.serviceAccount = String(object.serviceAccount); + switch (object.diskType) { + default: + if (typeof object.diskType === "number") { + message.diskType = object.diskType; + break; + } + break; + case "COMPUTE_ENGINE_DISK_TYPE_UNSPECIFIED": + case 0: + message.diskType = 0; + break; + case "COMPUTE_ENGINE_DISK_TYPE_STANDARD": + case 1: + message.diskType = 1; + break; + case "COMPUTE_ENGINE_DISK_TYPE_SSD": + case 2: + message.diskType = 2; + break; + case "COMPUTE_ENGINE_DISK_TYPE_BALANCED": + case 3: + message.diskType = 3; + break; + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.vmmigration.v1.ComputeEngineTargetDetails.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.licenseType) { + default: + if (typeof object.licenseType === "number") { + message.licenseType = object.licenseType; + break; + } + break; + case "COMPUTE_ENGINE_LICENSE_TYPE_DEFAULT": + case 0: + message.licenseType = 0; + break; + case "COMPUTE_ENGINE_LICENSE_TYPE_PAYG": + case 1: + message.licenseType = 1; + break; + case "COMPUTE_ENGINE_LICENSE_TYPE_BYOL": + case 2: + message.licenseType = 2; + break; + } + if (object.appliedLicense != null) { + if (typeof object.appliedLicense !== "object") + throw TypeError(".google.cloud.vmmigration.v1.ComputeEngineTargetDetails.appliedLicense: object expected"); + message.appliedLicense = $root.google.cloud.vmmigration.v1.AppliedLicense.fromObject(object.appliedLicense); + } + if (object.computeScheduling != null) { + if (typeof object.computeScheduling !== "object") + throw TypeError(".google.cloud.vmmigration.v1.ComputeEngineTargetDetails.computeScheduling: object expected"); + message.computeScheduling = $root.google.cloud.vmmigration.v1.ComputeScheduling.fromObject(object.computeScheduling); + } + if (object.secureBoot != null) + message.secureBoot = Boolean(object.secureBoot); + switch (object.bootOption) { + default: + if (typeof object.bootOption === "number") { + message.bootOption = object.bootOption; + break; + } + break; + case "COMPUTE_ENGINE_BOOT_OPTION_UNSPECIFIED": + case 0: + message.bootOption = 0; + break; + case "COMPUTE_ENGINE_BOOT_OPTION_EFI": + case 1: + message.bootOption = 1; + break; + case "COMPUTE_ENGINE_BOOT_OPTION_BIOS": + case 2: + message.bootOption = 2; + break; + } + if (object.metadata) { + if (typeof object.metadata !== "object") + throw TypeError(".google.cloud.vmmigration.v1.ComputeEngineTargetDetails.metadata: object expected"); + message.metadata = {}; + for (var keys = Object.keys(object.metadata), i = 0; i < keys.length; ++i) + message.metadata[keys[i]] = String(object.metadata[keys[i]]); + } + if (object.additionalLicenses) { + if (!Array.isArray(object.additionalLicenses)) + throw TypeError(".google.cloud.vmmigration.v1.ComputeEngineTargetDetails.additionalLicenses: array expected"); + message.additionalLicenses = []; + for (var i = 0; i < object.additionalLicenses.length; ++i) + message.additionalLicenses[i] = String(object.additionalLicenses[i]); + } + if (object.hostname != null) + message.hostname = String(object.hostname); + return message; + }; + + /** + * Creates a plain object from a ComputeEngineTargetDetails message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmmigration.v1.ComputeEngineTargetDetails + * @static + * @param {google.cloud.vmmigration.v1.ComputeEngineTargetDetails} message ComputeEngineTargetDetails + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ComputeEngineTargetDetails.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.networkTags = []; + object.networkInterfaces = []; + object.additionalLicenses = []; + } + if (options.objects || options.defaults) { + object.labels = {}; + object.metadata = {}; + } + if (options.defaults) { + object.vmName = ""; + object.project = ""; + object.zone = ""; + object.machineTypeSeries = ""; + object.machineType = ""; + object.serviceAccount = ""; + object.diskType = options.enums === String ? "COMPUTE_ENGINE_DISK_TYPE_UNSPECIFIED" : 0; + object.licenseType = options.enums === String ? "COMPUTE_ENGINE_LICENSE_TYPE_DEFAULT" : 0; + object.appliedLicense = null; + object.computeScheduling = null; + object.secureBoot = false; + object.bootOption = options.enums === String ? "COMPUTE_ENGINE_BOOT_OPTION_UNSPECIFIED" : 0; + object.hostname = ""; + } + if (message.vmName != null && message.hasOwnProperty("vmName")) + object.vmName = message.vmName; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + if (message.machineTypeSeries != null && message.hasOwnProperty("machineTypeSeries")) + object.machineTypeSeries = message.machineTypeSeries; + if (message.machineType != null && message.hasOwnProperty("machineType")) + object.machineType = message.machineType; + if (message.networkTags && message.networkTags.length) { + object.networkTags = []; + for (var j = 0; j < message.networkTags.length; ++j) + object.networkTags[j] = message.networkTags[j]; + } + if (message.networkInterfaces && message.networkInterfaces.length) { + object.networkInterfaces = []; + for (var j = 0; j < message.networkInterfaces.length; ++j) + object.networkInterfaces[j] = $root.google.cloud.vmmigration.v1.NetworkInterface.toObject(message.networkInterfaces[j], options); + } + if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) + object.serviceAccount = message.serviceAccount; + if (message.diskType != null && message.hasOwnProperty("diskType")) + object.diskType = options.enums === String ? $root.google.cloud.vmmigration.v1.ComputeEngineDiskType[message.diskType] === undefined ? message.diskType : $root.google.cloud.vmmigration.v1.ComputeEngineDiskType[message.diskType] : message.diskType; + 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.licenseType != null && message.hasOwnProperty("licenseType")) + object.licenseType = options.enums === String ? $root.google.cloud.vmmigration.v1.ComputeEngineLicenseType[message.licenseType] === undefined ? message.licenseType : $root.google.cloud.vmmigration.v1.ComputeEngineLicenseType[message.licenseType] : message.licenseType; + if (message.appliedLicense != null && message.hasOwnProperty("appliedLicense")) + object.appliedLicense = $root.google.cloud.vmmigration.v1.AppliedLicense.toObject(message.appliedLicense, options); + if (message.computeScheduling != null && message.hasOwnProperty("computeScheduling")) + object.computeScheduling = $root.google.cloud.vmmigration.v1.ComputeScheduling.toObject(message.computeScheduling, options); + if (message.secureBoot != null && message.hasOwnProperty("secureBoot")) + object.secureBoot = message.secureBoot; + if (message.bootOption != null && message.hasOwnProperty("bootOption")) + object.bootOption = options.enums === String ? $root.google.cloud.vmmigration.v1.ComputeEngineBootOption[message.bootOption] === undefined ? message.bootOption : $root.google.cloud.vmmigration.v1.ComputeEngineBootOption[message.bootOption] : message.bootOption; + if (message.metadata && (keys2 = Object.keys(message.metadata)).length) { + object.metadata = {}; + for (var j = 0; j < keys2.length; ++j) + object.metadata[keys2[j]] = message.metadata[keys2[j]]; + } + if (message.additionalLicenses && message.additionalLicenses.length) { + object.additionalLicenses = []; + for (var j = 0; j < message.additionalLicenses.length; ++j) + object.additionalLicenses[j] = message.additionalLicenses[j]; + } + if (message.hostname != null && message.hasOwnProperty("hostname")) + object.hostname = message.hostname; + return object; + }; + + /** + * Converts this ComputeEngineTargetDetails to JSON. + * @function toJSON + * @memberof google.cloud.vmmigration.v1.ComputeEngineTargetDetails + * @instance + * @returns {Object.} JSON object + */ + ComputeEngineTargetDetails.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ComputeEngineTargetDetails + * @function getTypeUrl + * @memberof google.cloud.vmmigration.v1.ComputeEngineTargetDetails + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ComputeEngineTargetDetails.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmmigration.v1.ComputeEngineTargetDetails"; + }; + + return ComputeEngineTargetDetails; + })(); + + v1.NetworkInterface = (function() { + + /** + * Properties of a NetworkInterface. + * @memberof google.cloud.vmmigration.v1 + * @interface INetworkInterface + * @property {string|null} [network] NetworkInterface network + * @property {string|null} [subnetwork] NetworkInterface subnetwork + * @property {string|null} [internalIp] NetworkInterface internalIp + * @property {string|null} [externalIp] NetworkInterface externalIp + */ + + /** + * Constructs a new NetworkInterface. + * @memberof google.cloud.vmmigration.v1 + * @classdesc Represents a NetworkInterface. + * @implements INetworkInterface + * @constructor + * @param {google.cloud.vmmigration.v1.INetworkInterface=} [properties] Properties to set + */ + function NetworkInterface(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NetworkInterface network. + * @member {string} network + * @memberof google.cloud.vmmigration.v1.NetworkInterface + * @instance + */ + NetworkInterface.prototype.network = ""; + + /** + * NetworkInterface subnetwork. + * @member {string} subnetwork + * @memberof google.cloud.vmmigration.v1.NetworkInterface + * @instance + */ + NetworkInterface.prototype.subnetwork = ""; + + /** + * NetworkInterface internalIp. + * @member {string} internalIp + * @memberof google.cloud.vmmigration.v1.NetworkInterface + * @instance + */ + NetworkInterface.prototype.internalIp = ""; + + /** + * NetworkInterface externalIp. + * @member {string} externalIp + * @memberof google.cloud.vmmigration.v1.NetworkInterface + * @instance + */ + NetworkInterface.prototype.externalIp = ""; + + /** + * Creates a new NetworkInterface instance using the specified properties. + * @function create + * @memberof google.cloud.vmmigration.v1.NetworkInterface + * @static + * @param {google.cloud.vmmigration.v1.INetworkInterface=} [properties] Properties to set + * @returns {google.cloud.vmmigration.v1.NetworkInterface} NetworkInterface instance + */ + NetworkInterface.create = function create(properties) { + return new NetworkInterface(properties); + }; + + /** + * Encodes the specified NetworkInterface message. Does not implicitly {@link google.cloud.vmmigration.v1.NetworkInterface.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmmigration.v1.NetworkInterface + * @static + * @param {google.cloud.vmmigration.v1.INetworkInterface} message NetworkInterface message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NetworkInterface.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.network != null && Object.hasOwnProperty.call(message, "network")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.network); + if (message.subnetwork != null && Object.hasOwnProperty.call(message, "subnetwork")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.subnetwork); + if (message.internalIp != null && Object.hasOwnProperty.call(message, "internalIp")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.internalIp); + if (message.externalIp != null && Object.hasOwnProperty.call(message, "externalIp")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.externalIp); + return writer; + }; + + /** + * Encodes the specified NetworkInterface message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.NetworkInterface.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmmigration.v1.NetworkInterface + * @static + * @param {google.cloud.vmmigration.v1.INetworkInterface} message NetworkInterface message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NetworkInterface.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NetworkInterface message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmmigration.v1.NetworkInterface + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmmigration.v1.NetworkInterface} NetworkInterface + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NetworkInterface.decode = function 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.vmmigration.v1.NetworkInterface(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.network = reader.string(); + break; + } + case 2: { + message.subnetwork = reader.string(); + break; + } + case 3: { + message.internalIp = reader.string(); + break; + } + case 4: { + message.externalIp = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NetworkInterface message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmmigration.v1.NetworkInterface + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmmigration.v1.NetworkInterface} NetworkInterface + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NetworkInterface.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NetworkInterface message. + * @function verify + * @memberof google.cloud.vmmigration.v1.NetworkInterface + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NetworkInterface.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.network != null && message.hasOwnProperty("network")) + if (!$util.isString(message.network)) + return "network: string expected"; + if (message.subnetwork != null && message.hasOwnProperty("subnetwork")) + if (!$util.isString(message.subnetwork)) + return "subnetwork: string expected"; + if (message.internalIp != null && message.hasOwnProperty("internalIp")) + if (!$util.isString(message.internalIp)) + return "internalIp: string expected"; + if (message.externalIp != null && message.hasOwnProperty("externalIp")) + if (!$util.isString(message.externalIp)) + return "externalIp: string expected"; + return null; + }; + + /** + * Creates a NetworkInterface message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmmigration.v1.NetworkInterface + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmmigration.v1.NetworkInterface} NetworkInterface + */ + NetworkInterface.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmmigration.v1.NetworkInterface) + return object; + var message = new $root.google.cloud.vmmigration.v1.NetworkInterface(); + if (object.network != null) + message.network = String(object.network); + if (object.subnetwork != null) + message.subnetwork = String(object.subnetwork); + if (object.internalIp != null) + message.internalIp = String(object.internalIp); + if (object.externalIp != null) + message.externalIp = String(object.externalIp); + return message; + }; + + /** + * Creates a plain object from a NetworkInterface message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmmigration.v1.NetworkInterface + * @static + * @param {google.cloud.vmmigration.v1.NetworkInterface} message NetworkInterface + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NetworkInterface.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.network = ""; + object.subnetwork = ""; + object.internalIp = ""; + object.externalIp = ""; + } + if (message.network != null && message.hasOwnProperty("network")) + object.network = message.network; + if (message.subnetwork != null && message.hasOwnProperty("subnetwork")) + object.subnetwork = message.subnetwork; + if (message.internalIp != null && message.hasOwnProperty("internalIp")) + object.internalIp = message.internalIp; + if (message.externalIp != null && message.hasOwnProperty("externalIp")) + object.externalIp = message.externalIp; + return object; + }; + + /** + * Converts this NetworkInterface to JSON. + * @function toJSON + * @memberof google.cloud.vmmigration.v1.NetworkInterface + * @instance + * @returns {Object.} JSON object + */ + NetworkInterface.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NetworkInterface + * @function getTypeUrl + * @memberof google.cloud.vmmigration.v1.NetworkInterface + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NetworkInterface.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmmigration.v1.NetworkInterface"; + }; + + return NetworkInterface; + })(); + + v1.AppliedLicense = (function() { + + /** + * Properties of an AppliedLicense. + * @memberof google.cloud.vmmigration.v1 + * @interface IAppliedLicense + * @property {google.cloud.vmmigration.v1.AppliedLicense.Type|null} [type] AppliedLicense type + * @property {string|null} [osLicense] AppliedLicense osLicense + */ + + /** + * Constructs a new AppliedLicense. + * @memberof google.cloud.vmmigration.v1 + * @classdesc Represents an AppliedLicense. + * @implements IAppliedLicense + * @constructor + * @param {google.cloud.vmmigration.v1.IAppliedLicense=} [properties] Properties to set + */ + function AppliedLicense(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AppliedLicense type. + * @member {google.cloud.vmmigration.v1.AppliedLicense.Type} type + * @memberof google.cloud.vmmigration.v1.AppliedLicense + * @instance + */ + AppliedLicense.prototype.type = 0; + + /** + * AppliedLicense osLicense. + * @member {string} osLicense + * @memberof google.cloud.vmmigration.v1.AppliedLicense + * @instance + */ + AppliedLicense.prototype.osLicense = ""; + + /** + * Creates a new AppliedLicense instance using the specified properties. + * @function create + * @memberof google.cloud.vmmigration.v1.AppliedLicense + * @static + * @param {google.cloud.vmmigration.v1.IAppliedLicense=} [properties] Properties to set + * @returns {google.cloud.vmmigration.v1.AppliedLicense} AppliedLicense instance + */ + AppliedLicense.create = function create(properties) { + return new AppliedLicense(properties); + }; + + /** + * Encodes the specified AppliedLicense message. Does not implicitly {@link google.cloud.vmmigration.v1.AppliedLicense.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmmigration.v1.AppliedLicense + * @static + * @param {google.cloud.vmmigration.v1.IAppliedLicense} message AppliedLicense message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AppliedLicense.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.osLicense != null && Object.hasOwnProperty.call(message, "osLicense")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.osLicense); + return writer; + }; + + /** + * Encodes the specified AppliedLicense message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.AppliedLicense.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmmigration.v1.AppliedLicense + * @static + * @param {google.cloud.vmmigration.v1.IAppliedLicense} message AppliedLicense message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AppliedLicense.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AppliedLicense message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmmigration.v1.AppliedLicense + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmmigration.v1.AppliedLicense} AppliedLicense + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AppliedLicense.decode = function 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.vmmigration.v1.AppliedLicense(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.type = reader.int32(); + break; + } + case 2: { + message.osLicense = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AppliedLicense message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmmigration.v1.AppliedLicense + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmmigration.v1.AppliedLicense} AppliedLicense + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AppliedLicense.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AppliedLicense message. + * @function verify + * @memberof google.cloud.vmmigration.v1.AppliedLicense + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AppliedLicense.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.osLicense != null && message.hasOwnProperty("osLicense")) + if (!$util.isString(message.osLicense)) + return "osLicense: string expected"; + return null; + }; + + /** + * Creates an AppliedLicense message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmmigration.v1.AppliedLicense + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmmigration.v1.AppliedLicense} AppliedLicense + */ + AppliedLicense.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmmigration.v1.AppliedLicense) + return object; + var message = new $root.google.cloud.vmmigration.v1.AppliedLicense(); + 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 "NONE": + case 1: + message.type = 1; + break; + case "PAYG": + case 2: + message.type = 2; + break; + case "BYOL": + case 3: + message.type = 3; + break; + } + if (object.osLicense != null) + message.osLicense = String(object.osLicense); + return message; + }; + + /** + * Creates a plain object from an AppliedLicense message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmmigration.v1.AppliedLicense + * @static + * @param {google.cloud.vmmigration.v1.AppliedLicense} message AppliedLicense + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AppliedLicense.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; + object.osLicense = ""; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.vmmigration.v1.AppliedLicense.Type[message.type] === undefined ? message.type : $root.google.cloud.vmmigration.v1.AppliedLicense.Type[message.type] : message.type; + if (message.osLicense != null && message.hasOwnProperty("osLicense")) + object.osLicense = message.osLicense; + return object; + }; + + /** + * Converts this AppliedLicense to JSON. + * @function toJSON + * @memberof google.cloud.vmmigration.v1.AppliedLicense + * @instance + * @returns {Object.} JSON object + */ + AppliedLicense.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AppliedLicense + * @function getTypeUrl + * @memberof google.cloud.vmmigration.v1.AppliedLicense + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AppliedLicense.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmmigration.v1.AppliedLicense"; + }; + + /** + * Type enum. + * @name google.cloud.vmmigration.v1.AppliedLicense.Type + * @enum {number} + * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value + * @property {number} NONE=1 NONE value + * @property {number} PAYG=2 PAYG value + * @property {number} BYOL=3 BYOL value + */ + AppliedLicense.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "NONE"] = 1; + values[valuesById[2] = "PAYG"] = 2; + values[valuesById[3] = "BYOL"] = 3; + return values; + })(); + + return AppliedLicense; + })(); + + v1.SchedulingNodeAffinity = (function() { + + /** + * Properties of a SchedulingNodeAffinity. + * @memberof google.cloud.vmmigration.v1 + * @interface ISchedulingNodeAffinity + * @property {string|null} [key] SchedulingNodeAffinity key + * @property {google.cloud.vmmigration.v1.SchedulingNodeAffinity.Operator|null} [operator] SchedulingNodeAffinity operator + * @property {Array.|null} [values] SchedulingNodeAffinity values + */ + + /** + * Constructs a new SchedulingNodeAffinity. + * @memberof google.cloud.vmmigration.v1 + * @classdesc Represents a SchedulingNodeAffinity. + * @implements ISchedulingNodeAffinity + * @constructor + * @param {google.cloud.vmmigration.v1.ISchedulingNodeAffinity=} [properties] Properties to set + */ + function SchedulingNodeAffinity(properties) { + this.values = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SchedulingNodeAffinity key. + * @member {string} key + * @memberof google.cloud.vmmigration.v1.SchedulingNodeAffinity + * @instance + */ + SchedulingNodeAffinity.prototype.key = ""; + + /** + * SchedulingNodeAffinity operator. + * @member {google.cloud.vmmigration.v1.SchedulingNodeAffinity.Operator} operator + * @memberof google.cloud.vmmigration.v1.SchedulingNodeAffinity + * @instance + */ + SchedulingNodeAffinity.prototype.operator = 0; + + /** + * SchedulingNodeAffinity values. + * @member {Array.} values + * @memberof google.cloud.vmmigration.v1.SchedulingNodeAffinity + * @instance + */ + SchedulingNodeAffinity.prototype.values = $util.emptyArray; + + /** + * Creates a new SchedulingNodeAffinity instance using the specified properties. + * @function create + * @memberof google.cloud.vmmigration.v1.SchedulingNodeAffinity + * @static + * @param {google.cloud.vmmigration.v1.ISchedulingNodeAffinity=} [properties] Properties to set + * @returns {google.cloud.vmmigration.v1.SchedulingNodeAffinity} SchedulingNodeAffinity instance + */ + SchedulingNodeAffinity.create = function create(properties) { + return new SchedulingNodeAffinity(properties); + }; + + /** + * Encodes the specified SchedulingNodeAffinity message. Does not implicitly {@link google.cloud.vmmigration.v1.SchedulingNodeAffinity.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmmigration.v1.SchedulingNodeAffinity + * @static + * @param {google.cloud.vmmigration.v1.ISchedulingNodeAffinity} message SchedulingNodeAffinity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SchedulingNodeAffinity.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.key != null && Object.hasOwnProperty.call(message, "key")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.key); + if (message.operator != null && Object.hasOwnProperty.call(message, "operator")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.operator); + if (message.values != null && message.values.length) + for (var i = 0; i < message.values.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.values[i]); + return writer; + }; + + /** + * Encodes the specified SchedulingNodeAffinity message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.SchedulingNodeAffinity.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmmigration.v1.SchedulingNodeAffinity + * @static + * @param {google.cloud.vmmigration.v1.ISchedulingNodeAffinity} message SchedulingNodeAffinity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SchedulingNodeAffinity.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SchedulingNodeAffinity message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmmigration.v1.SchedulingNodeAffinity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmmigration.v1.SchedulingNodeAffinity} SchedulingNodeAffinity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SchedulingNodeAffinity.decode = function 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.vmmigration.v1.SchedulingNodeAffinity(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.key = reader.string(); + break; + } + case 2: { + message.operator = reader.int32(); + break; + } + case 3: { + if (!(message.values && message.values.length)) + message.values = []; + message.values.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SchedulingNodeAffinity message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmmigration.v1.SchedulingNodeAffinity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmmigration.v1.SchedulingNodeAffinity} SchedulingNodeAffinity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SchedulingNodeAffinity.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SchedulingNodeAffinity message. + * @function verify + * @memberof google.cloud.vmmigration.v1.SchedulingNodeAffinity + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SchedulingNodeAffinity.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.key != null && message.hasOwnProperty("key")) + if (!$util.isString(message.key)) + return "key: string expected"; + if (message.operator != null && message.hasOwnProperty("operator")) + switch (message.operator) { + default: + return "operator: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.values != null && message.hasOwnProperty("values")) { + if (!Array.isArray(message.values)) + return "values: array expected"; + for (var i = 0; i < message.values.length; ++i) + if (!$util.isString(message.values[i])) + return "values: string[] expected"; + } + return null; + }; + + /** + * Creates a SchedulingNodeAffinity message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmmigration.v1.SchedulingNodeAffinity + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmmigration.v1.SchedulingNodeAffinity} SchedulingNodeAffinity + */ + SchedulingNodeAffinity.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmmigration.v1.SchedulingNodeAffinity) + return object; + var message = new $root.google.cloud.vmmigration.v1.SchedulingNodeAffinity(); + if (object.key != null) + message.key = String(object.key); + switch (object.operator) { + default: + if (typeof object.operator === "number") { + message.operator = object.operator; + break; + } + break; + case "OPERATOR_UNSPECIFIED": + case 0: + message.operator = 0; + break; + case "IN": + case 1: + message.operator = 1; + break; + case "NOT_IN": + case 2: + message.operator = 2; + break; + } + if (object.values) { + if (!Array.isArray(object.values)) + throw TypeError(".google.cloud.vmmigration.v1.SchedulingNodeAffinity.values: array expected"); + message.values = []; + for (var i = 0; i < object.values.length; ++i) + message.values[i] = String(object.values[i]); + } + return message; + }; + + /** + * Creates a plain object from a SchedulingNodeAffinity message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmmigration.v1.SchedulingNodeAffinity + * @static + * @param {google.cloud.vmmigration.v1.SchedulingNodeAffinity} message SchedulingNodeAffinity + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SchedulingNodeAffinity.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.values = []; + if (options.defaults) { + object.key = ""; + object.operator = options.enums === String ? "OPERATOR_UNSPECIFIED" : 0; + } + if (message.key != null && message.hasOwnProperty("key")) + object.key = message.key; + if (message.operator != null && message.hasOwnProperty("operator")) + object.operator = options.enums === String ? $root.google.cloud.vmmigration.v1.SchedulingNodeAffinity.Operator[message.operator] === undefined ? message.operator : $root.google.cloud.vmmigration.v1.SchedulingNodeAffinity.Operator[message.operator] : message.operator; + if (message.values && message.values.length) { + object.values = []; + for (var j = 0; j < message.values.length; ++j) + object.values[j] = message.values[j]; + } + return object; + }; + + /** + * Converts this SchedulingNodeAffinity to JSON. + * @function toJSON + * @memberof google.cloud.vmmigration.v1.SchedulingNodeAffinity + * @instance + * @returns {Object.} JSON object + */ + SchedulingNodeAffinity.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SchedulingNodeAffinity + * @function getTypeUrl + * @memberof google.cloud.vmmigration.v1.SchedulingNodeAffinity + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SchedulingNodeAffinity.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmmigration.v1.SchedulingNodeAffinity"; + }; + + /** + * Operator enum. + * @name google.cloud.vmmigration.v1.SchedulingNodeAffinity.Operator + * @enum {number} + * @property {number} OPERATOR_UNSPECIFIED=0 OPERATOR_UNSPECIFIED value + * @property {number} IN=1 IN value + * @property {number} NOT_IN=2 NOT_IN value + */ + SchedulingNodeAffinity.Operator = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "OPERATOR_UNSPECIFIED"] = 0; + values[valuesById[1] = "IN"] = 1; + values[valuesById[2] = "NOT_IN"] = 2; + return values; + })(); + + return SchedulingNodeAffinity; + })(); + + v1.ComputeScheduling = (function() { + + /** + * Properties of a ComputeScheduling. + * @memberof google.cloud.vmmigration.v1 + * @interface IComputeScheduling + * @property {google.cloud.vmmigration.v1.ComputeScheduling.OnHostMaintenance|null} [onHostMaintenance] ComputeScheduling onHostMaintenance + * @property {google.cloud.vmmigration.v1.ComputeScheduling.RestartType|null} [restartType] ComputeScheduling restartType + * @property {Array.|null} [nodeAffinities] ComputeScheduling nodeAffinities + * @property {number|null} [minNodeCpus] ComputeScheduling minNodeCpus + */ + + /** + * Constructs a new ComputeScheduling. + * @memberof google.cloud.vmmigration.v1 + * @classdesc Represents a ComputeScheduling. + * @implements IComputeScheduling + * @constructor + * @param {google.cloud.vmmigration.v1.IComputeScheduling=} [properties] Properties to set + */ + function ComputeScheduling(properties) { + this.nodeAffinities = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ComputeScheduling onHostMaintenance. + * @member {google.cloud.vmmigration.v1.ComputeScheduling.OnHostMaintenance} onHostMaintenance + * @memberof google.cloud.vmmigration.v1.ComputeScheduling + * @instance + */ + ComputeScheduling.prototype.onHostMaintenance = 0; + + /** + * ComputeScheduling restartType. + * @member {google.cloud.vmmigration.v1.ComputeScheduling.RestartType} restartType + * @memberof google.cloud.vmmigration.v1.ComputeScheduling + * @instance + */ + ComputeScheduling.prototype.restartType = 0; + + /** + * ComputeScheduling nodeAffinities. + * @member {Array.} nodeAffinities + * @memberof google.cloud.vmmigration.v1.ComputeScheduling + * @instance + */ + ComputeScheduling.prototype.nodeAffinities = $util.emptyArray; + + /** + * ComputeScheduling minNodeCpus. + * @member {number} minNodeCpus + * @memberof google.cloud.vmmigration.v1.ComputeScheduling + * @instance + */ + ComputeScheduling.prototype.minNodeCpus = 0; + + /** + * Creates a new ComputeScheduling instance using the specified properties. + * @function create + * @memberof google.cloud.vmmigration.v1.ComputeScheduling + * @static + * @param {google.cloud.vmmigration.v1.IComputeScheduling=} [properties] Properties to set + * @returns {google.cloud.vmmigration.v1.ComputeScheduling} ComputeScheduling instance + */ + ComputeScheduling.create = function create(properties) { + return new ComputeScheduling(properties); + }; + + /** + * Encodes the specified ComputeScheduling message. Does not implicitly {@link google.cloud.vmmigration.v1.ComputeScheduling.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmmigration.v1.ComputeScheduling + * @static + * @param {google.cloud.vmmigration.v1.IComputeScheduling} message ComputeScheduling message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ComputeScheduling.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.onHostMaintenance != null && Object.hasOwnProperty.call(message, "onHostMaintenance")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.onHostMaintenance); + if (message.nodeAffinities != null && message.nodeAffinities.length) + for (var i = 0; i < message.nodeAffinities.length; ++i) + $root.google.cloud.vmmigration.v1.SchedulingNodeAffinity.encode(message.nodeAffinities[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.minNodeCpus != null && Object.hasOwnProperty.call(message, "minNodeCpus")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.minNodeCpus); + if (message.restartType != null && Object.hasOwnProperty.call(message, "restartType")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.restartType); + return writer; + }; + + /** + * Encodes the specified ComputeScheduling message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.ComputeScheduling.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmmigration.v1.ComputeScheduling + * @static + * @param {google.cloud.vmmigration.v1.IComputeScheduling} message ComputeScheduling message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ComputeScheduling.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ComputeScheduling message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmmigration.v1.ComputeScheduling + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmmigration.v1.ComputeScheduling} ComputeScheduling + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ComputeScheduling.decode = function 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.vmmigration.v1.ComputeScheduling(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.onHostMaintenance = reader.int32(); + break; + } + case 5: { + message.restartType = reader.int32(); + break; + } + case 3: { + if (!(message.nodeAffinities && message.nodeAffinities.length)) + message.nodeAffinities = []; + message.nodeAffinities.push($root.google.cloud.vmmigration.v1.SchedulingNodeAffinity.decode(reader, reader.uint32())); + break; + } + case 4: { + message.minNodeCpus = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ComputeScheduling message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmmigration.v1.ComputeScheduling + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmmigration.v1.ComputeScheduling} ComputeScheduling + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ComputeScheduling.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ComputeScheduling message. + * @function verify + * @memberof google.cloud.vmmigration.v1.ComputeScheduling + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ComputeScheduling.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.onHostMaintenance != null && message.hasOwnProperty("onHostMaintenance")) + switch (message.onHostMaintenance) { + default: + return "onHostMaintenance: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.restartType != null && message.hasOwnProperty("restartType")) + switch (message.restartType) { + default: + return "restartType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.nodeAffinities != null && message.hasOwnProperty("nodeAffinities")) { + if (!Array.isArray(message.nodeAffinities)) + return "nodeAffinities: array expected"; + for (var i = 0; i < message.nodeAffinities.length; ++i) { + var error = $root.google.cloud.vmmigration.v1.SchedulingNodeAffinity.verify(message.nodeAffinities[i]); + if (error) + return "nodeAffinities." + error; + } + } + if (message.minNodeCpus != null && message.hasOwnProperty("minNodeCpus")) + if (!$util.isInteger(message.minNodeCpus)) + return "minNodeCpus: integer expected"; + return null; + }; + + /** + * Creates a ComputeScheduling message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmmigration.v1.ComputeScheduling + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmmigration.v1.ComputeScheduling} ComputeScheduling + */ + ComputeScheduling.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmmigration.v1.ComputeScheduling) + return object; + var message = new $root.google.cloud.vmmigration.v1.ComputeScheduling(); + switch (object.onHostMaintenance) { + default: + if (typeof object.onHostMaintenance === "number") { + message.onHostMaintenance = object.onHostMaintenance; + break; + } + break; + case "ON_HOST_MAINTENANCE_UNSPECIFIED": + case 0: + message.onHostMaintenance = 0; + break; + case "TERMINATE": + case 1: + message.onHostMaintenance = 1; + break; + case "MIGRATE": + case 2: + message.onHostMaintenance = 2; + break; + } + switch (object.restartType) { + default: + if (typeof object.restartType === "number") { + message.restartType = object.restartType; + break; + } + break; + case "RESTART_TYPE_UNSPECIFIED": + case 0: + message.restartType = 0; + break; + case "AUTOMATIC_RESTART": + case 1: + message.restartType = 1; + break; + case "NO_AUTOMATIC_RESTART": + case 2: + message.restartType = 2; + break; + } + if (object.nodeAffinities) { + if (!Array.isArray(object.nodeAffinities)) + throw TypeError(".google.cloud.vmmigration.v1.ComputeScheduling.nodeAffinities: array expected"); + message.nodeAffinities = []; + for (var i = 0; i < object.nodeAffinities.length; ++i) { + if (typeof object.nodeAffinities[i] !== "object") + throw TypeError(".google.cloud.vmmigration.v1.ComputeScheduling.nodeAffinities: object expected"); + message.nodeAffinities[i] = $root.google.cloud.vmmigration.v1.SchedulingNodeAffinity.fromObject(object.nodeAffinities[i]); + } + } + if (object.minNodeCpus != null) + message.minNodeCpus = object.minNodeCpus | 0; + return message; + }; + + /** + * Creates a plain object from a ComputeScheduling message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmmigration.v1.ComputeScheduling + * @static + * @param {google.cloud.vmmigration.v1.ComputeScheduling} message ComputeScheduling + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ComputeScheduling.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.nodeAffinities = []; + if (options.defaults) { + object.onHostMaintenance = options.enums === String ? "ON_HOST_MAINTENANCE_UNSPECIFIED" : 0; + object.minNodeCpus = 0; + object.restartType = options.enums === String ? "RESTART_TYPE_UNSPECIFIED" : 0; + } + if (message.onHostMaintenance != null && message.hasOwnProperty("onHostMaintenance")) + object.onHostMaintenance = options.enums === String ? $root.google.cloud.vmmigration.v1.ComputeScheduling.OnHostMaintenance[message.onHostMaintenance] === undefined ? message.onHostMaintenance : $root.google.cloud.vmmigration.v1.ComputeScheduling.OnHostMaintenance[message.onHostMaintenance] : message.onHostMaintenance; + if (message.nodeAffinities && message.nodeAffinities.length) { + object.nodeAffinities = []; + for (var j = 0; j < message.nodeAffinities.length; ++j) + object.nodeAffinities[j] = $root.google.cloud.vmmigration.v1.SchedulingNodeAffinity.toObject(message.nodeAffinities[j], options); + } + if (message.minNodeCpus != null && message.hasOwnProperty("minNodeCpus")) + object.minNodeCpus = message.minNodeCpus; + if (message.restartType != null && message.hasOwnProperty("restartType")) + object.restartType = options.enums === String ? $root.google.cloud.vmmigration.v1.ComputeScheduling.RestartType[message.restartType] === undefined ? message.restartType : $root.google.cloud.vmmigration.v1.ComputeScheduling.RestartType[message.restartType] : message.restartType; + return object; + }; + + /** + * Converts this ComputeScheduling to JSON. + * @function toJSON + * @memberof google.cloud.vmmigration.v1.ComputeScheduling + * @instance + * @returns {Object.} JSON object + */ + ComputeScheduling.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ComputeScheduling + * @function getTypeUrl + * @memberof google.cloud.vmmigration.v1.ComputeScheduling + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ComputeScheduling.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmmigration.v1.ComputeScheduling"; + }; + + /** + * OnHostMaintenance enum. + * @name google.cloud.vmmigration.v1.ComputeScheduling.OnHostMaintenance + * @enum {number} + * @property {number} ON_HOST_MAINTENANCE_UNSPECIFIED=0 ON_HOST_MAINTENANCE_UNSPECIFIED value + * @property {number} TERMINATE=1 TERMINATE value + * @property {number} MIGRATE=2 MIGRATE value + */ + ComputeScheduling.OnHostMaintenance = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ON_HOST_MAINTENANCE_UNSPECIFIED"] = 0; + values[valuesById[1] = "TERMINATE"] = 1; + values[valuesById[2] = "MIGRATE"] = 2; + return values; + })(); + + /** + * RestartType enum. + * @name google.cloud.vmmigration.v1.ComputeScheduling.RestartType + * @enum {number} + * @property {number} RESTART_TYPE_UNSPECIFIED=0 RESTART_TYPE_UNSPECIFIED value + * @property {number} AUTOMATIC_RESTART=1 AUTOMATIC_RESTART value + * @property {number} NO_AUTOMATIC_RESTART=2 NO_AUTOMATIC_RESTART value + */ + ComputeScheduling.RestartType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "RESTART_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "AUTOMATIC_RESTART"] = 1; + values[valuesById[2] = "NO_AUTOMATIC_RESTART"] = 2; + return values; + })(); + + return ComputeScheduling; + })(); + + v1.SchedulePolicy = (function() { + + /** + * Properties of a SchedulePolicy. + * @memberof google.cloud.vmmigration.v1 + * @interface ISchedulePolicy + * @property {google.protobuf.IDuration|null} [idleDuration] SchedulePolicy idleDuration + * @property {boolean|null} [skipOsAdaptation] SchedulePolicy skipOsAdaptation + */ + + /** + * Constructs a new SchedulePolicy. + * @memberof google.cloud.vmmigration.v1 + * @classdesc Represents a SchedulePolicy. + * @implements ISchedulePolicy + * @constructor + * @param {google.cloud.vmmigration.v1.ISchedulePolicy=} [properties] Properties to set + */ + function SchedulePolicy(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SchedulePolicy idleDuration. + * @member {google.protobuf.IDuration|null|undefined} idleDuration + * @memberof google.cloud.vmmigration.v1.SchedulePolicy + * @instance + */ + SchedulePolicy.prototype.idleDuration = null; + + /** + * SchedulePolicy skipOsAdaptation. + * @member {boolean} skipOsAdaptation + * @memberof google.cloud.vmmigration.v1.SchedulePolicy + * @instance + */ + SchedulePolicy.prototype.skipOsAdaptation = false; + + /** + * Creates a new SchedulePolicy instance using the specified properties. + * @function create + * @memberof google.cloud.vmmigration.v1.SchedulePolicy + * @static + * @param {google.cloud.vmmigration.v1.ISchedulePolicy=} [properties] Properties to set + * @returns {google.cloud.vmmigration.v1.SchedulePolicy} SchedulePolicy instance + */ + SchedulePolicy.create = function create(properties) { + return new SchedulePolicy(properties); + }; + + /** + * Encodes the specified SchedulePolicy message. Does not implicitly {@link google.cloud.vmmigration.v1.SchedulePolicy.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmmigration.v1.SchedulePolicy + * @static + * @param {google.cloud.vmmigration.v1.ISchedulePolicy} message SchedulePolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SchedulePolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.idleDuration != null && Object.hasOwnProperty.call(message, "idleDuration")) + $root.google.protobuf.Duration.encode(message.idleDuration, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.skipOsAdaptation != null && Object.hasOwnProperty.call(message, "skipOsAdaptation")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.skipOsAdaptation); + return writer; + }; + + /** + * Encodes the specified SchedulePolicy message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.SchedulePolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmmigration.v1.SchedulePolicy + * @static + * @param {google.cloud.vmmigration.v1.ISchedulePolicy} message SchedulePolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SchedulePolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SchedulePolicy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmmigration.v1.SchedulePolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmmigration.v1.SchedulePolicy} SchedulePolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SchedulePolicy.decode = function 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.vmmigration.v1.SchedulePolicy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.idleDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 2: { + message.skipOsAdaptation = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SchedulePolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmmigration.v1.SchedulePolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmmigration.v1.SchedulePolicy} SchedulePolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SchedulePolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SchedulePolicy message. + * @function verify + * @memberof google.cloud.vmmigration.v1.SchedulePolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SchedulePolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.idleDuration != null && message.hasOwnProperty("idleDuration")) { + var error = $root.google.protobuf.Duration.verify(message.idleDuration); + if (error) + return "idleDuration." + error; + } + if (message.skipOsAdaptation != null && message.hasOwnProperty("skipOsAdaptation")) + if (typeof message.skipOsAdaptation !== "boolean") + return "skipOsAdaptation: boolean expected"; + return null; + }; + + /** + * Creates a SchedulePolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmmigration.v1.SchedulePolicy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmmigration.v1.SchedulePolicy} SchedulePolicy + */ + SchedulePolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmmigration.v1.SchedulePolicy) + return object; + var message = new $root.google.cloud.vmmigration.v1.SchedulePolicy(); + if (object.idleDuration != null) { + if (typeof object.idleDuration !== "object") + throw TypeError(".google.cloud.vmmigration.v1.SchedulePolicy.idleDuration: object expected"); + message.idleDuration = $root.google.protobuf.Duration.fromObject(object.idleDuration); + } + if (object.skipOsAdaptation != null) + message.skipOsAdaptation = Boolean(object.skipOsAdaptation); + return message; + }; + + /** + * Creates a plain object from a SchedulePolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmmigration.v1.SchedulePolicy + * @static + * @param {google.cloud.vmmigration.v1.SchedulePolicy} message SchedulePolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SchedulePolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.idleDuration = null; + object.skipOsAdaptation = false; + } + if (message.idleDuration != null && message.hasOwnProperty("idleDuration")) + object.idleDuration = $root.google.protobuf.Duration.toObject(message.idleDuration, options); + if (message.skipOsAdaptation != null && message.hasOwnProperty("skipOsAdaptation")) + object.skipOsAdaptation = message.skipOsAdaptation; + return object; + }; + + /** + * Converts this SchedulePolicy to JSON. + * @function toJSON + * @memberof google.cloud.vmmigration.v1.SchedulePolicy + * @instance + * @returns {Object.} JSON object + */ + SchedulePolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SchedulePolicy + * @function getTypeUrl + * @memberof google.cloud.vmmigration.v1.SchedulePolicy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SchedulePolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmmigration.v1.SchedulePolicy"; + }; + + return SchedulePolicy; + })(); + + v1.CreateMigratingVmRequest = (function() { + + /** + * Properties of a CreateMigratingVmRequest. + * @memberof google.cloud.vmmigration.v1 + * @interface ICreateMigratingVmRequest + * @property {string|null} [parent] CreateMigratingVmRequest parent + * @property {string|null} [migratingVmId] CreateMigratingVmRequest migratingVmId + * @property {google.cloud.vmmigration.v1.IMigratingVm|null} [migratingVm] CreateMigratingVmRequest migratingVm + * @property {string|null} [requestId] CreateMigratingVmRequest requestId + */ + + /** + * Constructs a new CreateMigratingVmRequest. + * @memberof google.cloud.vmmigration.v1 + * @classdesc Represents a CreateMigratingVmRequest. + * @implements ICreateMigratingVmRequest + * @constructor + * @param {google.cloud.vmmigration.v1.ICreateMigratingVmRequest=} [properties] Properties to set + */ + function CreateMigratingVmRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateMigratingVmRequest parent. + * @member {string} parent + * @memberof google.cloud.vmmigration.v1.CreateMigratingVmRequest + * @instance + */ + CreateMigratingVmRequest.prototype.parent = ""; + + /** + * CreateMigratingVmRequest migratingVmId. + * @member {string} migratingVmId + * @memberof google.cloud.vmmigration.v1.CreateMigratingVmRequest + * @instance + */ + CreateMigratingVmRequest.prototype.migratingVmId = ""; + + /** + * CreateMigratingVmRequest migratingVm. + * @member {google.cloud.vmmigration.v1.IMigratingVm|null|undefined} migratingVm + * @memberof google.cloud.vmmigration.v1.CreateMigratingVmRequest + * @instance + */ + CreateMigratingVmRequest.prototype.migratingVm = null; + + /** + * CreateMigratingVmRequest requestId. + * @member {string} requestId + * @memberof google.cloud.vmmigration.v1.CreateMigratingVmRequest + * @instance + */ + CreateMigratingVmRequest.prototype.requestId = ""; + + /** + * Creates a new CreateMigratingVmRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vmmigration.v1.CreateMigratingVmRequest + * @static + * @param {google.cloud.vmmigration.v1.ICreateMigratingVmRequest=} [properties] Properties to set + * @returns {google.cloud.vmmigration.v1.CreateMigratingVmRequest} CreateMigratingVmRequest instance + */ + CreateMigratingVmRequest.create = function create(properties) { + return new CreateMigratingVmRequest(properties); + }; + + /** + * Encodes the specified CreateMigratingVmRequest message. Does not implicitly {@link google.cloud.vmmigration.v1.CreateMigratingVmRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmmigration.v1.CreateMigratingVmRequest + * @static + * @param {google.cloud.vmmigration.v1.ICreateMigratingVmRequest} message CreateMigratingVmRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateMigratingVmRequest.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.migratingVmId != null && Object.hasOwnProperty.call(message, "migratingVmId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.migratingVmId); + if (message.migratingVm != null && Object.hasOwnProperty.call(message, "migratingVm")) + $root.google.cloud.vmmigration.v1.MigratingVm.encode(message.migratingVm, 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 CreateMigratingVmRequest message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.CreateMigratingVmRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmmigration.v1.CreateMigratingVmRequest + * @static + * @param {google.cloud.vmmigration.v1.ICreateMigratingVmRequest} message CreateMigratingVmRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateMigratingVmRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateMigratingVmRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmmigration.v1.CreateMigratingVmRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmmigration.v1.CreateMigratingVmRequest} CreateMigratingVmRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateMigratingVmRequest.decode = function 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.vmmigration.v1.CreateMigratingVmRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.migratingVmId = reader.string(); + break; + } + case 3: { + message.migratingVm = $root.google.cloud.vmmigration.v1.MigratingVm.decode(reader, reader.uint32()); + break; + } + case 4: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateMigratingVmRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmmigration.v1.CreateMigratingVmRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmmigration.v1.CreateMigratingVmRequest} CreateMigratingVmRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateMigratingVmRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateMigratingVmRequest message. + * @function verify + * @memberof google.cloud.vmmigration.v1.CreateMigratingVmRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateMigratingVmRequest.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.migratingVmId != null && message.hasOwnProperty("migratingVmId")) + if (!$util.isString(message.migratingVmId)) + return "migratingVmId: string expected"; + if (message.migratingVm != null && message.hasOwnProperty("migratingVm")) { + var error = $root.google.cloud.vmmigration.v1.MigratingVm.verify(message.migratingVm); + if (error) + return "migratingVm." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a CreateMigratingVmRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmmigration.v1.CreateMigratingVmRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmmigration.v1.CreateMigratingVmRequest} CreateMigratingVmRequest + */ + CreateMigratingVmRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmmigration.v1.CreateMigratingVmRequest) + return object; + var message = new $root.google.cloud.vmmigration.v1.CreateMigratingVmRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.migratingVmId != null) + message.migratingVmId = String(object.migratingVmId); + if (object.migratingVm != null) { + if (typeof object.migratingVm !== "object") + throw TypeError(".google.cloud.vmmigration.v1.CreateMigratingVmRequest.migratingVm: object expected"); + message.migratingVm = $root.google.cloud.vmmigration.v1.MigratingVm.fromObject(object.migratingVm); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a CreateMigratingVmRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmmigration.v1.CreateMigratingVmRequest + * @static + * @param {google.cloud.vmmigration.v1.CreateMigratingVmRequest} message CreateMigratingVmRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateMigratingVmRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.migratingVmId = ""; + object.migratingVm = null; + object.requestId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.migratingVmId != null && message.hasOwnProperty("migratingVmId")) + object.migratingVmId = message.migratingVmId; + if (message.migratingVm != null && message.hasOwnProperty("migratingVm")) + object.migratingVm = $root.google.cloud.vmmigration.v1.MigratingVm.toObject(message.migratingVm, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this CreateMigratingVmRequest to JSON. + * @function toJSON + * @memberof google.cloud.vmmigration.v1.CreateMigratingVmRequest + * @instance + * @returns {Object.} JSON object + */ + CreateMigratingVmRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateMigratingVmRequest + * @function getTypeUrl + * @memberof google.cloud.vmmigration.v1.CreateMigratingVmRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateMigratingVmRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmmigration.v1.CreateMigratingVmRequest"; + }; + + return CreateMigratingVmRequest; + })(); + + v1.ListMigratingVmsRequest = (function() { + + /** + * Properties of a ListMigratingVmsRequest. + * @memberof google.cloud.vmmigration.v1 + * @interface IListMigratingVmsRequest + * @property {string|null} [parent] ListMigratingVmsRequest parent + * @property {number|null} [pageSize] ListMigratingVmsRequest pageSize + * @property {string|null} [pageToken] ListMigratingVmsRequest pageToken + * @property {string|null} [filter] ListMigratingVmsRequest filter + * @property {string|null} [orderBy] ListMigratingVmsRequest orderBy + * @property {google.cloud.vmmigration.v1.MigratingVmView|null} [view] ListMigratingVmsRequest view + */ + + /** + * Constructs a new ListMigratingVmsRequest. + * @memberof google.cloud.vmmigration.v1 + * @classdesc Represents a ListMigratingVmsRequest. + * @implements IListMigratingVmsRequest + * @constructor + * @param {google.cloud.vmmigration.v1.IListMigratingVmsRequest=} [properties] Properties to set + */ + function ListMigratingVmsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListMigratingVmsRequest parent. + * @member {string} parent + * @memberof google.cloud.vmmigration.v1.ListMigratingVmsRequest + * @instance + */ + ListMigratingVmsRequest.prototype.parent = ""; + + /** + * ListMigratingVmsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.vmmigration.v1.ListMigratingVmsRequest + * @instance + */ + ListMigratingVmsRequest.prototype.pageSize = 0; + + /** + * ListMigratingVmsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.vmmigration.v1.ListMigratingVmsRequest + * @instance + */ + ListMigratingVmsRequest.prototype.pageToken = ""; + + /** + * ListMigratingVmsRequest filter. + * @member {string} filter + * @memberof google.cloud.vmmigration.v1.ListMigratingVmsRequest + * @instance + */ + ListMigratingVmsRequest.prototype.filter = ""; + + /** + * ListMigratingVmsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.vmmigration.v1.ListMigratingVmsRequest + * @instance + */ + ListMigratingVmsRequest.prototype.orderBy = ""; + + /** + * ListMigratingVmsRequest view. + * @member {google.cloud.vmmigration.v1.MigratingVmView} view + * @memberof google.cloud.vmmigration.v1.ListMigratingVmsRequest + * @instance + */ + ListMigratingVmsRequest.prototype.view = 0; + + /** + * Creates a new ListMigratingVmsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vmmigration.v1.ListMigratingVmsRequest + * @static + * @param {google.cloud.vmmigration.v1.IListMigratingVmsRequest=} [properties] Properties to set + * @returns {google.cloud.vmmigration.v1.ListMigratingVmsRequest} ListMigratingVmsRequest instance + */ + ListMigratingVmsRequest.create = function create(properties) { + return new ListMigratingVmsRequest(properties); + }; + + /** + * Encodes the specified ListMigratingVmsRequest message. Does not implicitly {@link google.cloud.vmmigration.v1.ListMigratingVmsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmmigration.v1.ListMigratingVmsRequest + * @static + * @param {google.cloud.vmmigration.v1.IListMigratingVmsRequest} message ListMigratingVmsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListMigratingVmsRequest.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); + if (message.view != null && Object.hasOwnProperty.call(message, "view")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.view); + return writer; + }; + + /** + * Encodes the specified ListMigratingVmsRequest message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.ListMigratingVmsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmmigration.v1.ListMigratingVmsRequest + * @static + * @param {google.cloud.vmmigration.v1.IListMigratingVmsRequest} message ListMigratingVmsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListMigratingVmsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListMigratingVmsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmmigration.v1.ListMigratingVmsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmmigration.v1.ListMigratingVmsRequest} ListMigratingVmsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListMigratingVmsRequest.decode = function 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.vmmigration.v1.ListMigratingVmsRequest(); + 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; + } + case 6: { + message.view = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListMigratingVmsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmmigration.v1.ListMigratingVmsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmmigration.v1.ListMigratingVmsRequest} ListMigratingVmsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListMigratingVmsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListMigratingVmsRequest message. + * @function verify + * @memberof google.cloud.vmmigration.v1.ListMigratingVmsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListMigratingVmsRequest.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"; + if (message.view != null && message.hasOwnProperty("view")) + switch (message.view) { + default: + return "view: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a ListMigratingVmsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmmigration.v1.ListMigratingVmsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmmigration.v1.ListMigratingVmsRequest} ListMigratingVmsRequest + */ + ListMigratingVmsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmmigration.v1.ListMigratingVmsRequest) + return object; + var message = new $root.google.cloud.vmmigration.v1.ListMigratingVmsRequest(); + 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); + switch (object.view) { + default: + if (typeof object.view === "number") { + message.view = object.view; + break; + } + break; + case "MIGRATING_VM_VIEW_UNSPECIFIED": + case 0: + message.view = 0; + break; + case "MIGRATING_VM_VIEW_BASIC": + case 1: + message.view = 1; + break; + case "MIGRATING_VM_VIEW_FULL": + case 2: + message.view = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a ListMigratingVmsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmmigration.v1.ListMigratingVmsRequest + * @static + * @param {google.cloud.vmmigration.v1.ListMigratingVmsRequest} message ListMigratingVmsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListMigratingVmsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.orderBy = ""; + object.view = options.enums === String ? "MIGRATING_VM_VIEW_UNSPECIFIED" : 0; + } + 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; + if (message.view != null && message.hasOwnProperty("view")) + object.view = options.enums === String ? $root.google.cloud.vmmigration.v1.MigratingVmView[message.view] === undefined ? message.view : $root.google.cloud.vmmigration.v1.MigratingVmView[message.view] : message.view; + return object; + }; + + /** + * Converts this ListMigratingVmsRequest to JSON. + * @function toJSON + * @memberof google.cloud.vmmigration.v1.ListMigratingVmsRequest + * @instance + * @returns {Object.} JSON object + */ + ListMigratingVmsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListMigratingVmsRequest + * @function getTypeUrl + * @memberof google.cloud.vmmigration.v1.ListMigratingVmsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListMigratingVmsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmmigration.v1.ListMigratingVmsRequest"; + }; + + return ListMigratingVmsRequest; + })(); + + v1.ListMigratingVmsResponse = (function() { + + /** + * Properties of a ListMigratingVmsResponse. + * @memberof google.cloud.vmmigration.v1 + * @interface IListMigratingVmsResponse + * @property {Array.|null} [migratingVms] ListMigratingVmsResponse migratingVms + * @property {string|null} [nextPageToken] ListMigratingVmsResponse nextPageToken + * @property {Array.|null} [unreachable] ListMigratingVmsResponse unreachable + */ + + /** + * Constructs a new ListMigratingVmsResponse. + * @memberof google.cloud.vmmigration.v1 + * @classdesc Represents a ListMigratingVmsResponse. + * @implements IListMigratingVmsResponse + * @constructor + * @param {google.cloud.vmmigration.v1.IListMigratingVmsResponse=} [properties] Properties to set + */ + function ListMigratingVmsResponse(properties) { + this.migratingVms = []; + 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]]; + } + + /** + * ListMigratingVmsResponse migratingVms. + * @member {Array.} migratingVms + * @memberof google.cloud.vmmigration.v1.ListMigratingVmsResponse + * @instance + */ + ListMigratingVmsResponse.prototype.migratingVms = $util.emptyArray; + + /** + * ListMigratingVmsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.vmmigration.v1.ListMigratingVmsResponse + * @instance + */ + ListMigratingVmsResponse.prototype.nextPageToken = ""; + + /** + * ListMigratingVmsResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.vmmigration.v1.ListMigratingVmsResponse + * @instance + */ + ListMigratingVmsResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListMigratingVmsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.vmmigration.v1.ListMigratingVmsResponse + * @static + * @param {google.cloud.vmmigration.v1.IListMigratingVmsResponse=} [properties] Properties to set + * @returns {google.cloud.vmmigration.v1.ListMigratingVmsResponse} ListMigratingVmsResponse instance + */ + ListMigratingVmsResponse.create = function create(properties) { + return new ListMigratingVmsResponse(properties); + }; + + /** + * Encodes the specified ListMigratingVmsResponse message. Does not implicitly {@link google.cloud.vmmigration.v1.ListMigratingVmsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmmigration.v1.ListMigratingVmsResponse + * @static + * @param {google.cloud.vmmigration.v1.IListMigratingVmsResponse} message ListMigratingVmsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListMigratingVmsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.migratingVms != null && message.migratingVms.length) + for (var i = 0; i < message.migratingVms.length; ++i) + $root.google.cloud.vmmigration.v1.MigratingVm.encode(message.migratingVms[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 ListMigratingVmsResponse message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.ListMigratingVmsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmmigration.v1.ListMigratingVmsResponse + * @static + * @param {google.cloud.vmmigration.v1.IListMigratingVmsResponse} message ListMigratingVmsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListMigratingVmsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListMigratingVmsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmmigration.v1.ListMigratingVmsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmmigration.v1.ListMigratingVmsResponse} ListMigratingVmsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListMigratingVmsResponse.decode = function 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.vmmigration.v1.ListMigratingVmsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.migratingVms && message.migratingVms.length)) + message.migratingVms = []; + message.migratingVms.push($root.google.cloud.vmmigration.v1.MigratingVm.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 ListMigratingVmsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmmigration.v1.ListMigratingVmsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmmigration.v1.ListMigratingVmsResponse} ListMigratingVmsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListMigratingVmsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListMigratingVmsResponse message. + * @function verify + * @memberof google.cloud.vmmigration.v1.ListMigratingVmsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListMigratingVmsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.migratingVms != null && message.hasOwnProperty("migratingVms")) { + if (!Array.isArray(message.migratingVms)) + return "migratingVms: array expected"; + for (var i = 0; i < message.migratingVms.length; ++i) { + var error = $root.google.cloud.vmmigration.v1.MigratingVm.verify(message.migratingVms[i]); + if (error) + return "migratingVms." + 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 ListMigratingVmsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmmigration.v1.ListMigratingVmsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmmigration.v1.ListMigratingVmsResponse} ListMigratingVmsResponse + */ + ListMigratingVmsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmmigration.v1.ListMigratingVmsResponse) + return object; + var message = new $root.google.cloud.vmmigration.v1.ListMigratingVmsResponse(); + if (object.migratingVms) { + if (!Array.isArray(object.migratingVms)) + throw TypeError(".google.cloud.vmmigration.v1.ListMigratingVmsResponse.migratingVms: array expected"); + message.migratingVms = []; + for (var i = 0; i < object.migratingVms.length; ++i) { + if (typeof object.migratingVms[i] !== "object") + throw TypeError(".google.cloud.vmmigration.v1.ListMigratingVmsResponse.migratingVms: object expected"); + message.migratingVms[i] = $root.google.cloud.vmmigration.v1.MigratingVm.fromObject(object.migratingVms[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.vmmigration.v1.ListMigratingVmsResponse.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 ListMigratingVmsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmmigration.v1.ListMigratingVmsResponse + * @static + * @param {google.cloud.vmmigration.v1.ListMigratingVmsResponse} message ListMigratingVmsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListMigratingVmsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.migratingVms = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.migratingVms && message.migratingVms.length) { + object.migratingVms = []; + for (var j = 0; j < message.migratingVms.length; ++j) + object.migratingVms[j] = $root.google.cloud.vmmigration.v1.MigratingVm.toObject(message.migratingVms[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 ListMigratingVmsResponse to JSON. + * @function toJSON + * @memberof google.cloud.vmmigration.v1.ListMigratingVmsResponse + * @instance + * @returns {Object.} JSON object + */ + ListMigratingVmsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListMigratingVmsResponse + * @function getTypeUrl + * @memberof google.cloud.vmmigration.v1.ListMigratingVmsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListMigratingVmsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmmigration.v1.ListMigratingVmsResponse"; + }; + + return ListMigratingVmsResponse; + })(); + + v1.GetMigratingVmRequest = (function() { + + /** + * Properties of a GetMigratingVmRequest. + * @memberof google.cloud.vmmigration.v1 + * @interface IGetMigratingVmRequest + * @property {string|null} [name] GetMigratingVmRequest name + * @property {google.cloud.vmmigration.v1.MigratingVmView|null} [view] GetMigratingVmRequest view + */ + + /** + * Constructs a new GetMigratingVmRequest. + * @memberof google.cloud.vmmigration.v1 + * @classdesc Represents a GetMigratingVmRequest. + * @implements IGetMigratingVmRequest + * @constructor + * @param {google.cloud.vmmigration.v1.IGetMigratingVmRequest=} [properties] Properties to set + */ + function GetMigratingVmRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetMigratingVmRequest name. + * @member {string} name + * @memberof google.cloud.vmmigration.v1.GetMigratingVmRequest + * @instance + */ + GetMigratingVmRequest.prototype.name = ""; + + /** + * GetMigratingVmRequest view. + * @member {google.cloud.vmmigration.v1.MigratingVmView} view + * @memberof google.cloud.vmmigration.v1.GetMigratingVmRequest + * @instance + */ + GetMigratingVmRequest.prototype.view = 0; + + /** + * Creates a new GetMigratingVmRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vmmigration.v1.GetMigratingVmRequest + * @static + * @param {google.cloud.vmmigration.v1.IGetMigratingVmRequest=} [properties] Properties to set + * @returns {google.cloud.vmmigration.v1.GetMigratingVmRequest} GetMigratingVmRequest instance + */ + GetMigratingVmRequest.create = function create(properties) { + return new GetMigratingVmRequest(properties); + }; + + /** + * Encodes the specified GetMigratingVmRequest message. Does not implicitly {@link google.cloud.vmmigration.v1.GetMigratingVmRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmmigration.v1.GetMigratingVmRequest + * @static + * @param {google.cloud.vmmigration.v1.IGetMigratingVmRequest} message GetMigratingVmRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetMigratingVmRequest.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.view != null && Object.hasOwnProperty.call(message, "view")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.view); + return writer; + }; + + /** + * Encodes the specified GetMigratingVmRequest message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.GetMigratingVmRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmmigration.v1.GetMigratingVmRequest + * @static + * @param {google.cloud.vmmigration.v1.IGetMigratingVmRequest} message GetMigratingVmRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetMigratingVmRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetMigratingVmRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmmigration.v1.GetMigratingVmRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmmigration.v1.GetMigratingVmRequest} GetMigratingVmRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetMigratingVmRequest.decode = function 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.vmmigration.v1.GetMigratingVmRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.view = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetMigratingVmRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmmigration.v1.GetMigratingVmRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmmigration.v1.GetMigratingVmRequest} GetMigratingVmRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetMigratingVmRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetMigratingVmRequest message. + * @function verify + * @memberof google.cloud.vmmigration.v1.GetMigratingVmRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetMigratingVmRequest.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.view != null && message.hasOwnProperty("view")) + switch (message.view) { + default: + return "view: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a GetMigratingVmRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmmigration.v1.GetMigratingVmRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmmigration.v1.GetMigratingVmRequest} GetMigratingVmRequest + */ + GetMigratingVmRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmmigration.v1.GetMigratingVmRequest) + return object; + var message = new $root.google.cloud.vmmigration.v1.GetMigratingVmRequest(); + if (object.name != null) + message.name = String(object.name); + switch (object.view) { + default: + if (typeof object.view === "number") { + message.view = object.view; + break; + } + break; + case "MIGRATING_VM_VIEW_UNSPECIFIED": + case 0: + message.view = 0; + break; + case "MIGRATING_VM_VIEW_BASIC": + case 1: + message.view = 1; + break; + case "MIGRATING_VM_VIEW_FULL": + case 2: + message.view = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a GetMigratingVmRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmmigration.v1.GetMigratingVmRequest + * @static + * @param {google.cloud.vmmigration.v1.GetMigratingVmRequest} message GetMigratingVmRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetMigratingVmRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.view = options.enums === String ? "MIGRATING_VM_VIEW_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.view != null && message.hasOwnProperty("view")) + object.view = options.enums === String ? $root.google.cloud.vmmigration.v1.MigratingVmView[message.view] === undefined ? message.view : $root.google.cloud.vmmigration.v1.MigratingVmView[message.view] : message.view; + return object; + }; + + /** + * Converts this GetMigratingVmRequest to JSON. + * @function toJSON + * @memberof google.cloud.vmmigration.v1.GetMigratingVmRequest + * @instance + * @returns {Object.} JSON object + */ + GetMigratingVmRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetMigratingVmRequest + * @function getTypeUrl + * @memberof google.cloud.vmmigration.v1.GetMigratingVmRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetMigratingVmRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmmigration.v1.GetMigratingVmRequest"; + }; + + return GetMigratingVmRequest; + })(); + + v1.UpdateMigratingVmRequest = (function() { + + /** + * Properties of an UpdateMigratingVmRequest. + * @memberof google.cloud.vmmigration.v1 + * @interface IUpdateMigratingVmRequest + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateMigratingVmRequest updateMask + * @property {google.cloud.vmmigration.v1.IMigratingVm|null} [migratingVm] UpdateMigratingVmRequest migratingVm + * @property {string|null} [requestId] UpdateMigratingVmRequest requestId + */ + + /** + * Constructs a new UpdateMigratingVmRequest. + * @memberof google.cloud.vmmigration.v1 + * @classdesc Represents an UpdateMigratingVmRequest. + * @implements IUpdateMigratingVmRequest + * @constructor + * @param {google.cloud.vmmigration.v1.IUpdateMigratingVmRequest=} [properties] Properties to set + */ + function UpdateMigratingVmRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateMigratingVmRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.vmmigration.v1.UpdateMigratingVmRequest + * @instance + */ + UpdateMigratingVmRequest.prototype.updateMask = null; + + /** + * UpdateMigratingVmRequest migratingVm. + * @member {google.cloud.vmmigration.v1.IMigratingVm|null|undefined} migratingVm + * @memberof google.cloud.vmmigration.v1.UpdateMigratingVmRequest + * @instance + */ + UpdateMigratingVmRequest.prototype.migratingVm = null; + + /** + * UpdateMigratingVmRequest requestId. + * @member {string} requestId + * @memberof google.cloud.vmmigration.v1.UpdateMigratingVmRequest + * @instance + */ + UpdateMigratingVmRequest.prototype.requestId = ""; + + /** + * Creates a new UpdateMigratingVmRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vmmigration.v1.UpdateMigratingVmRequest + * @static + * @param {google.cloud.vmmigration.v1.IUpdateMigratingVmRequest=} [properties] Properties to set + * @returns {google.cloud.vmmigration.v1.UpdateMigratingVmRequest} UpdateMigratingVmRequest instance + */ + UpdateMigratingVmRequest.create = function create(properties) { + return new UpdateMigratingVmRequest(properties); + }; + + /** + * Encodes the specified UpdateMigratingVmRequest message. Does not implicitly {@link google.cloud.vmmigration.v1.UpdateMigratingVmRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmmigration.v1.UpdateMigratingVmRequest + * @static + * @param {google.cloud.vmmigration.v1.IUpdateMigratingVmRequest} message UpdateMigratingVmRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateMigratingVmRequest.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.migratingVm != null && Object.hasOwnProperty.call(message, "migratingVm")) + $root.google.cloud.vmmigration.v1.MigratingVm.encode(message.migratingVm, 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 UpdateMigratingVmRequest message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.UpdateMigratingVmRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmmigration.v1.UpdateMigratingVmRequest + * @static + * @param {google.cloud.vmmigration.v1.IUpdateMigratingVmRequest} message UpdateMigratingVmRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateMigratingVmRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateMigratingVmRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmmigration.v1.UpdateMigratingVmRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmmigration.v1.UpdateMigratingVmRequest} UpdateMigratingVmRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateMigratingVmRequest.decode = function 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.vmmigration.v1.UpdateMigratingVmRequest(); + 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.migratingVm = $root.google.cloud.vmmigration.v1.MigratingVm.decode(reader, reader.uint32()); + break; + } + case 3: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateMigratingVmRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmmigration.v1.UpdateMigratingVmRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmmigration.v1.UpdateMigratingVmRequest} UpdateMigratingVmRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateMigratingVmRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateMigratingVmRequest message. + * @function verify + * @memberof google.cloud.vmmigration.v1.UpdateMigratingVmRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateMigratingVmRequest.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.migratingVm != null && message.hasOwnProperty("migratingVm")) { + var error = $root.google.cloud.vmmigration.v1.MigratingVm.verify(message.migratingVm); + if (error) + return "migratingVm." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates an UpdateMigratingVmRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmmigration.v1.UpdateMigratingVmRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmmigration.v1.UpdateMigratingVmRequest} UpdateMigratingVmRequest + */ + UpdateMigratingVmRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmmigration.v1.UpdateMigratingVmRequest) + return object; + var message = new $root.google.cloud.vmmigration.v1.UpdateMigratingVmRequest(); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.vmmigration.v1.UpdateMigratingVmRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.migratingVm != null) { + if (typeof object.migratingVm !== "object") + throw TypeError(".google.cloud.vmmigration.v1.UpdateMigratingVmRequest.migratingVm: object expected"); + message.migratingVm = $root.google.cloud.vmmigration.v1.MigratingVm.fromObject(object.migratingVm); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from an UpdateMigratingVmRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmmigration.v1.UpdateMigratingVmRequest + * @static + * @param {google.cloud.vmmigration.v1.UpdateMigratingVmRequest} message UpdateMigratingVmRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateMigratingVmRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.updateMask = null; + object.migratingVm = null; + object.requestId = ""; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.migratingVm != null && message.hasOwnProperty("migratingVm")) + object.migratingVm = $root.google.cloud.vmmigration.v1.MigratingVm.toObject(message.migratingVm, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this UpdateMigratingVmRequest to JSON. + * @function toJSON + * @memberof google.cloud.vmmigration.v1.UpdateMigratingVmRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateMigratingVmRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateMigratingVmRequest + * @function getTypeUrl + * @memberof google.cloud.vmmigration.v1.UpdateMigratingVmRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateMigratingVmRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmmigration.v1.UpdateMigratingVmRequest"; + }; + + return UpdateMigratingVmRequest; + })(); + + v1.DeleteMigratingVmRequest = (function() { + + /** + * Properties of a DeleteMigratingVmRequest. + * @memberof google.cloud.vmmigration.v1 + * @interface IDeleteMigratingVmRequest + * @property {string|null} [name] DeleteMigratingVmRequest name + */ + + /** + * Constructs a new DeleteMigratingVmRequest. + * @memberof google.cloud.vmmigration.v1 + * @classdesc Represents a DeleteMigratingVmRequest. + * @implements IDeleteMigratingVmRequest + * @constructor + * @param {google.cloud.vmmigration.v1.IDeleteMigratingVmRequest=} [properties] Properties to set + */ + function DeleteMigratingVmRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteMigratingVmRequest name. + * @member {string} name + * @memberof google.cloud.vmmigration.v1.DeleteMigratingVmRequest + * @instance + */ + DeleteMigratingVmRequest.prototype.name = ""; + + /** + * Creates a new DeleteMigratingVmRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vmmigration.v1.DeleteMigratingVmRequest + * @static + * @param {google.cloud.vmmigration.v1.IDeleteMigratingVmRequest=} [properties] Properties to set + * @returns {google.cloud.vmmigration.v1.DeleteMigratingVmRequest} DeleteMigratingVmRequest instance + */ + DeleteMigratingVmRequest.create = function create(properties) { + return new DeleteMigratingVmRequest(properties); + }; + + /** + * Encodes the specified DeleteMigratingVmRequest message. Does not implicitly {@link google.cloud.vmmigration.v1.DeleteMigratingVmRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmmigration.v1.DeleteMigratingVmRequest + * @static + * @param {google.cloud.vmmigration.v1.IDeleteMigratingVmRequest} message DeleteMigratingVmRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteMigratingVmRequest.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 DeleteMigratingVmRequest message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.DeleteMigratingVmRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmmigration.v1.DeleteMigratingVmRequest + * @static + * @param {google.cloud.vmmigration.v1.IDeleteMigratingVmRequest} message DeleteMigratingVmRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteMigratingVmRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteMigratingVmRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmmigration.v1.DeleteMigratingVmRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmmigration.v1.DeleteMigratingVmRequest} DeleteMigratingVmRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteMigratingVmRequest.decode = function 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.vmmigration.v1.DeleteMigratingVmRequest(); + 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 DeleteMigratingVmRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmmigration.v1.DeleteMigratingVmRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmmigration.v1.DeleteMigratingVmRequest} DeleteMigratingVmRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteMigratingVmRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteMigratingVmRequest message. + * @function verify + * @memberof google.cloud.vmmigration.v1.DeleteMigratingVmRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteMigratingVmRequest.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 DeleteMigratingVmRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmmigration.v1.DeleteMigratingVmRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmmigration.v1.DeleteMigratingVmRequest} DeleteMigratingVmRequest + */ + DeleteMigratingVmRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmmigration.v1.DeleteMigratingVmRequest) + return object; + var message = new $root.google.cloud.vmmigration.v1.DeleteMigratingVmRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteMigratingVmRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmmigration.v1.DeleteMigratingVmRequest + * @static + * @param {google.cloud.vmmigration.v1.DeleteMigratingVmRequest} message DeleteMigratingVmRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteMigratingVmRequest.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 DeleteMigratingVmRequest to JSON. + * @function toJSON + * @memberof google.cloud.vmmigration.v1.DeleteMigratingVmRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteMigratingVmRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteMigratingVmRequest + * @function getTypeUrl + * @memberof google.cloud.vmmigration.v1.DeleteMigratingVmRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteMigratingVmRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmmigration.v1.DeleteMigratingVmRequest"; + }; + + return DeleteMigratingVmRequest; + })(); + + v1.StartMigrationRequest = (function() { + + /** + * Properties of a StartMigrationRequest. + * @memberof google.cloud.vmmigration.v1 + * @interface IStartMigrationRequest + * @property {string|null} [migratingVm] StartMigrationRequest migratingVm + */ + + /** + * Constructs a new StartMigrationRequest. + * @memberof google.cloud.vmmigration.v1 + * @classdesc Represents a StartMigrationRequest. + * @implements IStartMigrationRequest + * @constructor + * @param {google.cloud.vmmigration.v1.IStartMigrationRequest=} [properties] Properties to set + */ + function StartMigrationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StartMigrationRequest migratingVm. + * @member {string} migratingVm + * @memberof google.cloud.vmmigration.v1.StartMigrationRequest + * @instance + */ + StartMigrationRequest.prototype.migratingVm = ""; + + /** + * Creates a new StartMigrationRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vmmigration.v1.StartMigrationRequest + * @static + * @param {google.cloud.vmmigration.v1.IStartMigrationRequest=} [properties] Properties to set + * @returns {google.cloud.vmmigration.v1.StartMigrationRequest} StartMigrationRequest instance + */ + StartMigrationRequest.create = function create(properties) { + return new StartMigrationRequest(properties); + }; + + /** + * Encodes the specified StartMigrationRequest message. Does not implicitly {@link google.cloud.vmmigration.v1.StartMigrationRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmmigration.v1.StartMigrationRequest + * @static + * @param {google.cloud.vmmigration.v1.IStartMigrationRequest} message StartMigrationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StartMigrationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.migratingVm != null && Object.hasOwnProperty.call(message, "migratingVm")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.migratingVm); + return writer; + }; + + /** + * Encodes the specified StartMigrationRequest message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.StartMigrationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmmigration.v1.StartMigrationRequest + * @static + * @param {google.cloud.vmmigration.v1.IStartMigrationRequest} message StartMigrationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StartMigrationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StartMigrationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmmigration.v1.StartMigrationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmmigration.v1.StartMigrationRequest} StartMigrationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StartMigrationRequest.decode = function 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.vmmigration.v1.StartMigrationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.migratingVm = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StartMigrationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmmigration.v1.StartMigrationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmmigration.v1.StartMigrationRequest} StartMigrationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StartMigrationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StartMigrationRequest message. + * @function verify + * @memberof google.cloud.vmmigration.v1.StartMigrationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StartMigrationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.migratingVm != null && message.hasOwnProperty("migratingVm")) + if (!$util.isString(message.migratingVm)) + return "migratingVm: string expected"; + return null; + }; + + /** + * Creates a StartMigrationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmmigration.v1.StartMigrationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmmigration.v1.StartMigrationRequest} StartMigrationRequest + */ + StartMigrationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmmigration.v1.StartMigrationRequest) + return object; + var message = new $root.google.cloud.vmmigration.v1.StartMigrationRequest(); + if (object.migratingVm != null) + message.migratingVm = String(object.migratingVm); + return message; + }; + + /** + * Creates a plain object from a StartMigrationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmmigration.v1.StartMigrationRequest + * @static + * @param {google.cloud.vmmigration.v1.StartMigrationRequest} message StartMigrationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StartMigrationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.migratingVm = ""; + if (message.migratingVm != null && message.hasOwnProperty("migratingVm")) + object.migratingVm = message.migratingVm; + return object; + }; + + /** + * Converts this StartMigrationRequest to JSON. + * @function toJSON + * @memberof google.cloud.vmmigration.v1.StartMigrationRequest + * @instance + * @returns {Object.} JSON object + */ + StartMigrationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StartMigrationRequest + * @function getTypeUrl + * @memberof google.cloud.vmmigration.v1.StartMigrationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StartMigrationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmmigration.v1.StartMigrationRequest"; + }; + + return StartMigrationRequest; + })(); + + v1.StartMigrationResponse = (function() { + + /** + * Properties of a StartMigrationResponse. + * @memberof google.cloud.vmmigration.v1 + * @interface IStartMigrationResponse + */ + + /** + * Constructs a new StartMigrationResponse. + * @memberof google.cloud.vmmigration.v1 + * @classdesc Represents a StartMigrationResponse. + * @implements IStartMigrationResponse + * @constructor + * @param {google.cloud.vmmigration.v1.IStartMigrationResponse=} [properties] Properties to set + */ + function StartMigrationResponse(properties) { + if (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 StartMigrationResponse instance using the specified properties. + * @function create + * @memberof google.cloud.vmmigration.v1.StartMigrationResponse + * @static + * @param {google.cloud.vmmigration.v1.IStartMigrationResponse=} [properties] Properties to set + * @returns {google.cloud.vmmigration.v1.StartMigrationResponse} StartMigrationResponse instance + */ + StartMigrationResponse.create = function create(properties) { + return new StartMigrationResponse(properties); + }; + + /** + * Encodes the specified StartMigrationResponse message. Does not implicitly {@link google.cloud.vmmigration.v1.StartMigrationResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmmigration.v1.StartMigrationResponse + * @static + * @param {google.cloud.vmmigration.v1.IStartMigrationResponse} message StartMigrationResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StartMigrationResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified StartMigrationResponse message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.StartMigrationResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmmigration.v1.StartMigrationResponse + * @static + * @param {google.cloud.vmmigration.v1.IStartMigrationResponse} message StartMigrationResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StartMigrationResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StartMigrationResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmmigration.v1.StartMigrationResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmmigration.v1.StartMigrationResponse} StartMigrationResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StartMigrationResponse.decode = function 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.vmmigration.v1.StartMigrationResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StartMigrationResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmmigration.v1.StartMigrationResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmmigration.v1.StartMigrationResponse} StartMigrationResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StartMigrationResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StartMigrationResponse message. + * @function verify + * @memberof google.cloud.vmmigration.v1.StartMigrationResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StartMigrationResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a StartMigrationResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmmigration.v1.StartMigrationResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmmigration.v1.StartMigrationResponse} StartMigrationResponse + */ + StartMigrationResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmmigration.v1.StartMigrationResponse) + return object; + return new $root.google.cloud.vmmigration.v1.StartMigrationResponse(); + }; + + /** + * Creates a plain object from a StartMigrationResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmmigration.v1.StartMigrationResponse + * @static + * @param {google.cloud.vmmigration.v1.StartMigrationResponse} message StartMigrationResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StartMigrationResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this StartMigrationResponse to JSON. + * @function toJSON + * @memberof google.cloud.vmmigration.v1.StartMigrationResponse + * @instance + * @returns {Object.} JSON object + */ + StartMigrationResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StartMigrationResponse + * @function getTypeUrl + * @memberof google.cloud.vmmigration.v1.StartMigrationResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StartMigrationResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmmigration.v1.StartMigrationResponse"; + }; + + return StartMigrationResponse; + })(); + + v1.PauseMigrationRequest = (function() { + + /** + * Properties of a PauseMigrationRequest. + * @memberof google.cloud.vmmigration.v1 + * @interface IPauseMigrationRequest + * @property {string|null} [migratingVm] PauseMigrationRequest migratingVm + */ + + /** + * Constructs a new PauseMigrationRequest. + * @memberof google.cloud.vmmigration.v1 + * @classdesc Represents a PauseMigrationRequest. + * @implements IPauseMigrationRequest + * @constructor + * @param {google.cloud.vmmigration.v1.IPauseMigrationRequest=} [properties] Properties to set + */ + function PauseMigrationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PauseMigrationRequest migratingVm. + * @member {string} migratingVm + * @memberof google.cloud.vmmigration.v1.PauseMigrationRequest + * @instance + */ + PauseMigrationRequest.prototype.migratingVm = ""; + + /** + * Creates a new PauseMigrationRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vmmigration.v1.PauseMigrationRequest + * @static + * @param {google.cloud.vmmigration.v1.IPauseMigrationRequest=} [properties] Properties to set + * @returns {google.cloud.vmmigration.v1.PauseMigrationRequest} PauseMigrationRequest instance + */ + PauseMigrationRequest.create = function create(properties) { + return new PauseMigrationRequest(properties); + }; + + /** + * Encodes the specified PauseMigrationRequest message. Does not implicitly {@link google.cloud.vmmigration.v1.PauseMigrationRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmmigration.v1.PauseMigrationRequest + * @static + * @param {google.cloud.vmmigration.v1.IPauseMigrationRequest} message PauseMigrationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PauseMigrationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.migratingVm != null && Object.hasOwnProperty.call(message, "migratingVm")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.migratingVm); + return writer; + }; + + /** + * Encodes the specified PauseMigrationRequest message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.PauseMigrationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmmigration.v1.PauseMigrationRequest + * @static + * @param {google.cloud.vmmigration.v1.IPauseMigrationRequest} message PauseMigrationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PauseMigrationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PauseMigrationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmmigration.v1.PauseMigrationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmmigration.v1.PauseMigrationRequest} PauseMigrationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PauseMigrationRequest.decode = function 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.vmmigration.v1.PauseMigrationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.migratingVm = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PauseMigrationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmmigration.v1.PauseMigrationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmmigration.v1.PauseMigrationRequest} PauseMigrationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PauseMigrationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PauseMigrationRequest message. + * @function verify + * @memberof google.cloud.vmmigration.v1.PauseMigrationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PauseMigrationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.migratingVm != null && message.hasOwnProperty("migratingVm")) + if (!$util.isString(message.migratingVm)) + return "migratingVm: string expected"; + return null; + }; + + /** + * Creates a PauseMigrationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmmigration.v1.PauseMigrationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmmigration.v1.PauseMigrationRequest} PauseMigrationRequest + */ + PauseMigrationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmmigration.v1.PauseMigrationRequest) + return object; + var message = new $root.google.cloud.vmmigration.v1.PauseMigrationRequest(); + if (object.migratingVm != null) + message.migratingVm = String(object.migratingVm); + return message; + }; + + /** + * Creates a plain object from a PauseMigrationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmmigration.v1.PauseMigrationRequest + * @static + * @param {google.cloud.vmmigration.v1.PauseMigrationRequest} message PauseMigrationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PauseMigrationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.migratingVm = ""; + if (message.migratingVm != null && message.hasOwnProperty("migratingVm")) + object.migratingVm = message.migratingVm; + return object; + }; + + /** + * Converts this PauseMigrationRequest to JSON. + * @function toJSON + * @memberof google.cloud.vmmigration.v1.PauseMigrationRequest + * @instance + * @returns {Object.} JSON object + */ + PauseMigrationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PauseMigrationRequest + * @function getTypeUrl + * @memberof google.cloud.vmmigration.v1.PauseMigrationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PauseMigrationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmmigration.v1.PauseMigrationRequest"; + }; + + return PauseMigrationRequest; + })(); + + v1.PauseMigrationResponse = (function() { + + /** + * Properties of a PauseMigrationResponse. + * @memberof google.cloud.vmmigration.v1 + * @interface IPauseMigrationResponse + */ + + /** + * Constructs a new PauseMigrationResponse. + * @memberof google.cloud.vmmigration.v1 + * @classdesc Represents a PauseMigrationResponse. + * @implements IPauseMigrationResponse + * @constructor + * @param {google.cloud.vmmigration.v1.IPauseMigrationResponse=} [properties] Properties to set + */ + function PauseMigrationResponse(properties) { + if (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 PauseMigrationResponse instance using the specified properties. + * @function create + * @memberof google.cloud.vmmigration.v1.PauseMigrationResponse + * @static + * @param {google.cloud.vmmigration.v1.IPauseMigrationResponse=} [properties] Properties to set + * @returns {google.cloud.vmmigration.v1.PauseMigrationResponse} PauseMigrationResponse instance + */ + PauseMigrationResponse.create = function create(properties) { + return new PauseMigrationResponse(properties); + }; + + /** + * Encodes the specified PauseMigrationResponse message. Does not implicitly {@link google.cloud.vmmigration.v1.PauseMigrationResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmmigration.v1.PauseMigrationResponse + * @static + * @param {google.cloud.vmmigration.v1.IPauseMigrationResponse} message PauseMigrationResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PauseMigrationResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified PauseMigrationResponse message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.PauseMigrationResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmmigration.v1.PauseMigrationResponse + * @static + * @param {google.cloud.vmmigration.v1.IPauseMigrationResponse} message PauseMigrationResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PauseMigrationResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PauseMigrationResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmmigration.v1.PauseMigrationResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmmigration.v1.PauseMigrationResponse} PauseMigrationResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PauseMigrationResponse.decode = function 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.vmmigration.v1.PauseMigrationResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PauseMigrationResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmmigration.v1.PauseMigrationResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmmigration.v1.PauseMigrationResponse} PauseMigrationResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PauseMigrationResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PauseMigrationResponse message. + * @function verify + * @memberof google.cloud.vmmigration.v1.PauseMigrationResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PauseMigrationResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a PauseMigrationResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmmigration.v1.PauseMigrationResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmmigration.v1.PauseMigrationResponse} PauseMigrationResponse + */ + PauseMigrationResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmmigration.v1.PauseMigrationResponse) + return object; + return new $root.google.cloud.vmmigration.v1.PauseMigrationResponse(); + }; + + /** + * Creates a plain object from a PauseMigrationResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmmigration.v1.PauseMigrationResponse + * @static + * @param {google.cloud.vmmigration.v1.PauseMigrationResponse} message PauseMigrationResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PauseMigrationResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this PauseMigrationResponse to JSON. + * @function toJSON + * @memberof google.cloud.vmmigration.v1.PauseMigrationResponse + * @instance + * @returns {Object.} JSON object + */ + PauseMigrationResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PauseMigrationResponse + * @function getTypeUrl + * @memberof google.cloud.vmmigration.v1.PauseMigrationResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PauseMigrationResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmmigration.v1.PauseMigrationResponse"; + }; + + return PauseMigrationResponse; + })(); + + v1.ResumeMigrationRequest = (function() { + + /** + * Properties of a ResumeMigrationRequest. + * @memberof google.cloud.vmmigration.v1 + * @interface IResumeMigrationRequest + * @property {string|null} [migratingVm] ResumeMigrationRequest migratingVm + */ + + /** + * Constructs a new ResumeMigrationRequest. + * @memberof google.cloud.vmmigration.v1 + * @classdesc Represents a ResumeMigrationRequest. + * @implements IResumeMigrationRequest + * @constructor + * @param {google.cloud.vmmigration.v1.IResumeMigrationRequest=} [properties] Properties to set + */ + function ResumeMigrationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResumeMigrationRequest migratingVm. + * @member {string} migratingVm + * @memberof google.cloud.vmmigration.v1.ResumeMigrationRequest + * @instance + */ + ResumeMigrationRequest.prototype.migratingVm = ""; + + /** + * Creates a new ResumeMigrationRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vmmigration.v1.ResumeMigrationRequest + * @static + * @param {google.cloud.vmmigration.v1.IResumeMigrationRequest=} [properties] Properties to set + * @returns {google.cloud.vmmigration.v1.ResumeMigrationRequest} ResumeMigrationRequest instance + */ + ResumeMigrationRequest.create = function create(properties) { + return new ResumeMigrationRequest(properties); + }; + + /** + * Encodes the specified ResumeMigrationRequest message. Does not implicitly {@link google.cloud.vmmigration.v1.ResumeMigrationRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmmigration.v1.ResumeMigrationRequest + * @static + * @param {google.cloud.vmmigration.v1.IResumeMigrationRequest} message ResumeMigrationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResumeMigrationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.migratingVm != null && Object.hasOwnProperty.call(message, "migratingVm")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.migratingVm); + return writer; + }; + + /** + * Encodes the specified ResumeMigrationRequest message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.ResumeMigrationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmmigration.v1.ResumeMigrationRequest + * @static + * @param {google.cloud.vmmigration.v1.IResumeMigrationRequest} message ResumeMigrationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResumeMigrationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResumeMigrationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmmigration.v1.ResumeMigrationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmmigration.v1.ResumeMigrationRequest} ResumeMigrationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResumeMigrationRequest.decode = function 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.vmmigration.v1.ResumeMigrationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.migratingVm = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResumeMigrationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmmigration.v1.ResumeMigrationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmmigration.v1.ResumeMigrationRequest} ResumeMigrationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResumeMigrationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResumeMigrationRequest message. + * @function verify + * @memberof google.cloud.vmmigration.v1.ResumeMigrationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResumeMigrationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.migratingVm != null && message.hasOwnProperty("migratingVm")) + if (!$util.isString(message.migratingVm)) + return "migratingVm: string expected"; + return null; + }; + + /** + * Creates a ResumeMigrationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmmigration.v1.ResumeMigrationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmmigration.v1.ResumeMigrationRequest} ResumeMigrationRequest + */ + ResumeMigrationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmmigration.v1.ResumeMigrationRequest) + return object; + var message = new $root.google.cloud.vmmigration.v1.ResumeMigrationRequest(); + if (object.migratingVm != null) + message.migratingVm = String(object.migratingVm); + return message; + }; + + /** + * Creates a plain object from a ResumeMigrationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmmigration.v1.ResumeMigrationRequest + * @static + * @param {google.cloud.vmmigration.v1.ResumeMigrationRequest} message ResumeMigrationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResumeMigrationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.migratingVm = ""; + if (message.migratingVm != null && message.hasOwnProperty("migratingVm")) + object.migratingVm = message.migratingVm; + return object; + }; + + /** + * Converts this ResumeMigrationRequest to JSON. + * @function toJSON + * @memberof google.cloud.vmmigration.v1.ResumeMigrationRequest + * @instance + * @returns {Object.} JSON object + */ + ResumeMigrationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ResumeMigrationRequest + * @function getTypeUrl + * @memberof google.cloud.vmmigration.v1.ResumeMigrationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResumeMigrationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmmigration.v1.ResumeMigrationRequest"; + }; + + return ResumeMigrationRequest; + })(); + + v1.ResumeMigrationResponse = (function() { + + /** + * Properties of a ResumeMigrationResponse. + * @memberof google.cloud.vmmigration.v1 + * @interface IResumeMigrationResponse + */ + + /** + * Constructs a new ResumeMigrationResponse. + * @memberof google.cloud.vmmigration.v1 + * @classdesc Represents a ResumeMigrationResponse. + * @implements IResumeMigrationResponse + * @constructor + * @param {google.cloud.vmmigration.v1.IResumeMigrationResponse=} [properties] Properties to set + */ + function ResumeMigrationResponse(properties) { + if (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 ResumeMigrationResponse instance using the specified properties. + * @function create + * @memberof google.cloud.vmmigration.v1.ResumeMigrationResponse + * @static + * @param {google.cloud.vmmigration.v1.IResumeMigrationResponse=} [properties] Properties to set + * @returns {google.cloud.vmmigration.v1.ResumeMigrationResponse} ResumeMigrationResponse instance + */ + ResumeMigrationResponse.create = function create(properties) { + return new ResumeMigrationResponse(properties); + }; + + /** + * Encodes the specified ResumeMigrationResponse message. Does not implicitly {@link google.cloud.vmmigration.v1.ResumeMigrationResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmmigration.v1.ResumeMigrationResponse + * @static + * @param {google.cloud.vmmigration.v1.IResumeMigrationResponse} message ResumeMigrationResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResumeMigrationResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified ResumeMigrationResponse message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.ResumeMigrationResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmmigration.v1.ResumeMigrationResponse + * @static + * @param {google.cloud.vmmigration.v1.IResumeMigrationResponse} message ResumeMigrationResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResumeMigrationResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResumeMigrationResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmmigration.v1.ResumeMigrationResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmmigration.v1.ResumeMigrationResponse} ResumeMigrationResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResumeMigrationResponse.decode = function 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.vmmigration.v1.ResumeMigrationResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResumeMigrationResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmmigration.v1.ResumeMigrationResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmmigration.v1.ResumeMigrationResponse} ResumeMigrationResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResumeMigrationResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResumeMigrationResponse message. + * @function verify + * @memberof google.cloud.vmmigration.v1.ResumeMigrationResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResumeMigrationResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a ResumeMigrationResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmmigration.v1.ResumeMigrationResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmmigration.v1.ResumeMigrationResponse} ResumeMigrationResponse + */ + ResumeMigrationResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmmigration.v1.ResumeMigrationResponse) + return object; + return new $root.google.cloud.vmmigration.v1.ResumeMigrationResponse(); + }; + + /** + * Creates a plain object from a ResumeMigrationResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmmigration.v1.ResumeMigrationResponse + * @static + * @param {google.cloud.vmmigration.v1.ResumeMigrationResponse} message ResumeMigrationResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResumeMigrationResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this ResumeMigrationResponse to JSON. + * @function toJSON + * @memberof google.cloud.vmmigration.v1.ResumeMigrationResponse + * @instance + * @returns {Object.} JSON object + */ + ResumeMigrationResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ResumeMigrationResponse + * @function getTypeUrl + * @memberof google.cloud.vmmigration.v1.ResumeMigrationResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResumeMigrationResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmmigration.v1.ResumeMigrationResponse"; + }; + + return ResumeMigrationResponse; + })(); + + v1.FinalizeMigrationRequest = (function() { + + /** + * Properties of a FinalizeMigrationRequest. + * @memberof google.cloud.vmmigration.v1 + * @interface IFinalizeMigrationRequest + * @property {string|null} [migratingVm] FinalizeMigrationRequest migratingVm + */ + + /** + * Constructs a new FinalizeMigrationRequest. + * @memberof google.cloud.vmmigration.v1 + * @classdesc Represents a FinalizeMigrationRequest. + * @implements IFinalizeMigrationRequest + * @constructor + * @param {google.cloud.vmmigration.v1.IFinalizeMigrationRequest=} [properties] Properties to set + */ + function FinalizeMigrationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FinalizeMigrationRequest migratingVm. + * @member {string} migratingVm + * @memberof google.cloud.vmmigration.v1.FinalizeMigrationRequest + * @instance + */ + FinalizeMigrationRequest.prototype.migratingVm = ""; + + /** + * Creates a new FinalizeMigrationRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vmmigration.v1.FinalizeMigrationRequest + * @static + * @param {google.cloud.vmmigration.v1.IFinalizeMigrationRequest=} [properties] Properties to set + * @returns {google.cloud.vmmigration.v1.FinalizeMigrationRequest} FinalizeMigrationRequest instance + */ + FinalizeMigrationRequest.create = function create(properties) { + return new FinalizeMigrationRequest(properties); + }; + + /** + * Encodes the specified FinalizeMigrationRequest message. Does not implicitly {@link google.cloud.vmmigration.v1.FinalizeMigrationRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmmigration.v1.FinalizeMigrationRequest + * @static + * @param {google.cloud.vmmigration.v1.IFinalizeMigrationRequest} message FinalizeMigrationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FinalizeMigrationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.migratingVm != null && Object.hasOwnProperty.call(message, "migratingVm")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.migratingVm); + return writer; + }; + + /** + * Encodes the specified FinalizeMigrationRequest message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.FinalizeMigrationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmmigration.v1.FinalizeMigrationRequest + * @static + * @param {google.cloud.vmmigration.v1.IFinalizeMigrationRequest} message FinalizeMigrationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FinalizeMigrationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FinalizeMigrationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmmigration.v1.FinalizeMigrationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmmigration.v1.FinalizeMigrationRequest} FinalizeMigrationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FinalizeMigrationRequest.decode = function 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.vmmigration.v1.FinalizeMigrationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.migratingVm = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FinalizeMigrationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmmigration.v1.FinalizeMigrationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmmigration.v1.FinalizeMigrationRequest} FinalizeMigrationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FinalizeMigrationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FinalizeMigrationRequest message. + * @function verify + * @memberof google.cloud.vmmigration.v1.FinalizeMigrationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FinalizeMigrationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.migratingVm != null && message.hasOwnProperty("migratingVm")) + if (!$util.isString(message.migratingVm)) + return "migratingVm: string expected"; + return null; + }; + + /** + * Creates a FinalizeMigrationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmmigration.v1.FinalizeMigrationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmmigration.v1.FinalizeMigrationRequest} FinalizeMigrationRequest + */ + FinalizeMigrationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmmigration.v1.FinalizeMigrationRequest) + return object; + var message = new $root.google.cloud.vmmigration.v1.FinalizeMigrationRequest(); + if (object.migratingVm != null) + message.migratingVm = String(object.migratingVm); + return message; + }; + + /** + * Creates a plain object from a FinalizeMigrationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmmigration.v1.FinalizeMigrationRequest + * @static + * @param {google.cloud.vmmigration.v1.FinalizeMigrationRequest} message FinalizeMigrationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FinalizeMigrationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.migratingVm = ""; + if (message.migratingVm != null && message.hasOwnProperty("migratingVm")) + object.migratingVm = message.migratingVm; + return object; + }; + + /** + * Converts this FinalizeMigrationRequest to JSON. + * @function toJSON + * @memberof google.cloud.vmmigration.v1.FinalizeMigrationRequest + * @instance + * @returns {Object.} JSON object + */ + FinalizeMigrationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FinalizeMigrationRequest + * @function getTypeUrl + * @memberof google.cloud.vmmigration.v1.FinalizeMigrationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FinalizeMigrationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmmigration.v1.FinalizeMigrationRequest"; + }; + + return FinalizeMigrationRequest; + })(); + + v1.FinalizeMigrationResponse = (function() { + + /** + * Properties of a FinalizeMigrationResponse. + * @memberof google.cloud.vmmigration.v1 + * @interface IFinalizeMigrationResponse + */ + + /** + * Constructs a new FinalizeMigrationResponse. + * @memberof google.cloud.vmmigration.v1 + * @classdesc Represents a FinalizeMigrationResponse. + * @implements IFinalizeMigrationResponse + * @constructor + * @param {google.cloud.vmmigration.v1.IFinalizeMigrationResponse=} [properties] Properties to set + */ + function FinalizeMigrationResponse(properties) { + if (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 FinalizeMigrationResponse instance using the specified properties. + * @function create + * @memberof google.cloud.vmmigration.v1.FinalizeMigrationResponse + * @static + * @param {google.cloud.vmmigration.v1.IFinalizeMigrationResponse=} [properties] Properties to set + * @returns {google.cloud.vmmigration.v1.FinalizeMigrationResponse} FinalizeMigrationResponse instance + */ + FinalizeMigrationResponse.create = function create(properties) { + return new FinalizeMigrationResponse(properties); + }; + + /** + * Encodes the specified FinalizeMigrationResponse message. Does not implicitly {@link google.cloud.vmmigration.v1.FinalizeMigrationResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmmigration.v1.FinalizeMigrationResponse + * @static + * @param {google.cloud.vmmigration.v1.IFinalizeMigrationResponse} message FinalizeMigrationResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FinalizeMigrationResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified FinalizeMigrationResponse message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.FinalizeMigrationResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmmigration.v1.FinalizeMigrationResponse + * @static + * @param {google.cloud.vmmigration.v1.IFinalizeMigrationResponse} message FinalizeMigrationResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FinalizeMigrationResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FinalizeMigrationResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmmigration.v1.FinalizeMigrationResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmmigration.v1.FinalizeMigrationResponse} FinalizeMigrationResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FinalizeMigrationResponse.decode = function 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.vmmigration.v1.FinalizeMigrationResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FinalizeMigrationResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmmigration.v1.FinalizeMigrationResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmmigration.v1.FinalizeMigrationResponse} FinalizeMigrationResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FinalizeMigrationResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FinalizeMigrationResponse message. + * @function verify + * @memberof google.cloud.vmmigration.v1.FinalizeMigrationResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FinalizeMigrationResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a FinalizeMigrationResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmmigration.v1.FinalizeMigrationResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmmigration.v1.FinalizeMigrationResponse} FinalizeMigrationResponse + */ + FinalizeMigrationResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmmigration.v1.FinalizeMigrationResponse) + return object; + return new $root.google.cloud.vmmigration.v1.FinalizeMigrationResponse(); + }; + + /** + * Creates a plain object from a FinalizeMigrationResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmmigration.v1.FinalizeMigrationResponse + * @static + * @param {google.cloud.vmmigration.v1.FinalizeMigrationResponse} message FinalizeMigrationResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FinalizeMigrationResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this FinalizeMigrationResponse to JSON. + * @function toJSON + * @memberof google.cloud.vmmigration.v1.FinalizeMigrationResponse + * @instance + * @returns {Object.} JSON object + */ + FinalizeMigrationResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FinalizeMigrationResponse + * @function getTypeUrl + * @memberof google.cloud.vmmigration.v1.FinalizeMigrationResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FinalizeMigrationResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmmigration.v1.FinalizeMigrationResponse"; + }; + + return FinalizeMigrationResponse; + })(); + + v1.TargetProject = (function() { + + /** + * Properties of a TargetProject. + * @memberof google.cloud.vmmigration.v1 + * @interface ITargetProject + * @property {string|null} [name] TargetProject name + * @property {string|null} [project] TargetProject project + * @property {string|null} [description] TargetProject description + * @property {google.protobuf.ITimestamp|null} [createTime] TargetProject createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] TargetProject updateTime + */ + + /** + * Constructs a new TargetProject. + * @memberof google.cloud.vmmigration.v1 + * @classdesc Represents a TargetProject. + * @implements ITargetProject + * @constructor + * @param {google.cloud.vmmigration.v1.ITargetProject=} [properties] Properties to set + */ + function TargetProject(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TargetProject name. + * @member {string} name + * @memberof google.cloud.vmmigration.v1.TargetProject + * @instance + */ + TargetProject.prototype.name = ""; + + /** + * TargetProject project. + * @member {string} project + * @memberof google.cloud.vmmigration.v1.TargetProject + * @instance + */ + TargetProject.prototype.project = ""; + + /** + * TargetProject description. + * @member {string} description + * @memberof google.cloud.vmmigration.v1.TargetProject + * @instance + */ + TargetProject.prototype.description = ""; + + /** + * TargetProject createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.vmmigration.v1.TargetProject + * @instance + */ + TargetProject.prototype.createTime = null; + + /** + * TargetProject updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.vmmigration.v1.TargetProject + * @instance + */ + TargetProject.prototype.updateTime = null; + + /** + * Creates a new TargetProject instance using the specified properties. + * @function create + * @memberof google.cloud.vmmigration.v1.TargetProject + * @static + * @param {google.cloud.vmmigration.v1.ITargetProject=} [properties] Properties to set + * @returns {google.cloud.vmmigration.v1.TargetProject} TargetProject instance + */ + TargetProject.create = function create(properties) { + return new TargetProject(properties); + }; + + /** + * Encodes the specified TargetProject message. Does not implicitly {@link google.cloud.vmmigration.v1.TargetProject.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmmigration.v1.TargetProject + * @static + * @param {google.cloud.vmmigration.v1.ITargetProject} message TargetProject message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TargetProject.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.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.project); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TargetProject message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.TargetProject.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmmigration.v1.TargetProject + * @static + * @param {google.cloud.vmmigration.v1.ITargetProject} message TargetProject message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TargetProject.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TargetProject message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmmigration.v1.TargetProject + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmmigration.v1.TargetProject} TargetProject + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TargetProject.decode = function 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.vmmigration.v1.TargetProject(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.project = reader.string(); + break; + } + case 3: { + message.description = reader.string(); + break; + } + case 4: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TargetProject message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmmigration.v1.TargetProject + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmmigration.v1.TargetProject} TargetProject + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TargetProject.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TargetProject message. + * @function verify + * @memberof google.cloud.vmmigration.v1.TargetProject + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TargetProject.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.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: 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; + } + return null; + }; + + /** + * Creates a TargetProject message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmmigration.v1.TargetProject + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmmigration.v1.TargetProject} TargetProject + */ + TargetProject.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmmigration.v1.TargetProject) + return object; + var message = new $root.google.cloud.vmmigration.v1.TargetProject(); + if (object.name != null) + message.name = String(object.name); + if (object.project != null) + message.project = String(object.project); + if (object.description != null) + message.description = String(object.description); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.vmmigration.v1.TargetProject.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.vmmigration.v1.TargetProject.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + return message; + }; + + /** + * Creates a plain object from a TargetProject message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmmigration.v1.TargetProject + * @static + * @param {google.cloud.vmmigration.v1.TargetProject} message TargetProject + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TargetProject.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.project = ""; + object.description = ""; + object.createTime = null; + object.updateTime = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + 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); + return object; + }; + + /** + * Converts this TargetProject to JSON. + * @function toJSON + * @memberof google.cloud.vmmigration.v1.TargetProject + * @instance + * @returns {Object.} JSON object + */ + TargetProject.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TargetProject + * @function getTypeUrl + * @memberof google.cloud.vmmigration.v1.TargetProject + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TargetProject.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmmigration.v1.TargetProject"; + }; + + return TargetProject; + })(); + + v1.GetTargetProjectRequest = (function() { + + /** + * Properties of a GetTargetProjectRequest. + * @memberof google.cloud.vmmigration.v1 + * @interface IGetTargetProjectRequest + * @property {string|null} [name] GetTargetProjectRequest name + */ + + /** + * Constructs a new GetTargetProjectRequest. + * @memberof google.cloud.vmmigration.v1 + * @classdesc Represents a GetTargetProjectRequest. + * @implements IGetTargetProjectRequest + * @constructor + * @param {google.cloud.vmmigration.v1.IGetTargetProjectRequest=} [properties] Properties to set + */ + function GetTargetProjectRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetTargetProjectRequest name. + * @member {string} name + * @memberof google.cloud.vmmigration.v1.GetTargetProjectRequest + * @instance + */ + GetTargetProjectRequest.prototype.name = ""; + + /** + * Creates a new GetTargetProjectRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vmmigration.v1.GetTargetProjectRequest + * @static + * @param {google.cloud.vmmigration.v1.IGetTargetProjectRequest=} [properties] Properties to set + * @returns {google.cloud.vmmigration.v1.GetTargetProjectRequest} GetTargetProjectRequest instance + */ + GetTargetProjectRequest.create = function create(properties) { + return new GetTargetProjectRequest(properties); + }; + + /** + * Encodes the specified GetTargetProjectRequest message. Does not implicitly {@link google.cloud.vmmigration.v1.GetTargetProjectRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmmigration.v1.GetTargetProjectRequest + * @static + * @param {google.cloud.vmmigration.v1.IGetTargetProjectRequest} message GetTargetProjectRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTargetProjectRequest.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 GetTargetProjectRequest message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.GetTargetProjectRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmmigration.v1.GetTargetProjectRequest + * @static + * @param {google.cloud.vmmigration.v1.IGetTargetProjectRequest} message GetTargetProjectRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTargetProjectRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetTargetProjectRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmmigration.v1.GetTargetProjectRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmmigration.v1.GetTargetProjectRequest} GetTargetProjectRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTargetProjectRequest.decode = function 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.vmmigration.v1.GetTargetProjectRequest(); + 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 GetTargetProjectRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmmigration.v1.GetTargetProjectRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmmigration.v1.GetTargetProjectRequest} GetTargetProjectRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTargetProjectRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetTargetProjectRequest message. + * @function verify + * @memberof google.cloud.vmmigration.v1.GetTargetProjectRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetTargetProjectRequest.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 GetTargetProjectRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmmigration.v1.GetTargetProjectRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmmigration.v1.GetTargetProjectRequest} GetTargetProjectRequest + */ + GetTargetProjectRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmmigration.v1.GetTargetProjectRequest) + return object; + var message = new $root.google.cloud.vmmigration.v1.GetTargetProjectRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetTargetProjectRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmmigration.v1.GetTargetProjectRequest + * @static + * @param {google.cloud.vmmigration.v1.GetTargetProjectRequest} message GetTargetProjectRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetTargetProjectRequest.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 GetTargetProjectRequest to JSON. + * @function toJSON + * @memberof google.cloud.vmmigration.v1.GetTargetProjectRequest + * @instance + * @returns {Object.} JSON object + */ + GetTargetProjectRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetTargetProjectRequest + * @function getTypeUrl + * @memberof google.cloud.vmmigration.v1.GetTargetProjectRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetTargetProjectRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmmigration.v1.GetTargetProjectRequest"; + }; + + return GetTargetProjectRequest; + })(); + + v1.ListTargetProjectsRequest = (function() { + + /** + * Properties of a ListTargetProjectsRequest. + * @memberof google.cloud.vmmigration.v1 + * @interface IListTargetProjectsRequest + * @property {string|null} [parent] ListTargetProjectsRequest parent + * @property {number|null} [pageSize] ListTargetProjectsRequest pageSize + * @property {string|null} [pageToken] ListTargetProjectsRequest pageToken + * @property {string|null} [filter] ListTargetProjectsRequest filter + * @property {string|null} [orderBy] ListTargetProjectsRequest orderBy + */ + + /** + * Constructs a new ListTargetProjectsRequest. + * @memberof google.cloud.vmmigration.v1 + * @classdesc Represents a ListTargetProjectsRequest. + * @implements IListTargetProjectsRequest + * @constructor + * @param {google.cloud.vmmigration.v1.IListTargetProjectsRequest=} [properties] Properties to set + */ + function ListTargetProjectsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListTargetProjectsRequest parent. + * @member {string} parent + * @memberof google.cloud.vmmigration.v1.ListTargetProjectsRequest + * @instance + */ + ListTargetProjectsRequest.prototype.parent = ""; + + /** + * ListTargetProjectsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.vmmigration.v1.ListTargetProjectsRequest + * @instance + */ + ListTargetProjectsRequest.prototype.pageSize = 0; + + /** + * ListTargetProjectsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.vmmigration.v1.ListTargetProjectsRequest + * @instance + */ + ListTargetProjectsRequest.prototype.pageToken = ""; + + /** + * ListTargetProjectsRequest filter. + * @member {string} filter + * @memberof google.cloud.vmmigration.v1.ListTargetProjectsRequest + * @instance + */ + ListTargetProjectsRequest.prototype.filter = ""; + + /** + * ListTargetProjectsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.vmmigration.v1.ListTargetProjectsRequest + * @instance + */ + ListTargetProjectsRequest.prototype.orderBy = ""; + + /** + * Creates a new ListTargetProjectsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vmmigration.v1.ListTargetProjectsRequest + * @static + * @param {google.cloud.vmmigration.v1.IListTargetProjectsRequest=} [properties] Properties to set + * @returns {google.cloud.vmmigration.v1.ListTargetProjectsRequest} ListTargetProjectsRequest instance + */ + ListTargetProjectsRequest.create = function create(properties) { + return new ListTargetProjectsRequest(properties); + }; + + /** + * Encodes the specified ListTargetProjectsRequest message. Does not implicitly {@link google.cloud.vmmigration.v1.ListTargetProjectsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmmigration.v1.ListTargetProjectsRequest + * @static + * @param {google.cloud.vmmigration.v1.IListTargetProjectsRequest} message ListTargetProjectsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTargetProjectsRequest.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 ListTargetProjectsRequest message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.ListTargetProjectsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmmigration.v1.ListTargetProjectsRequest + * @static + * @param {google.cloud.vmmigration.v1.IListTargetProjectsRequest} message ListTargetProjectsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTargetProjectsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListTargetProjectsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmmigration.v1.ListTargetProjectsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmmigration.v1.ListTargetProjectsRequest} ListTargetProjectsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTargetProjectsRequest.decode = function 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.vmmigration.v1.ListTargetProjectsRequest(); + 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 ListTargetProjectsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmmigration.v1.ListTargetProjectsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmmigration.v1.ListTargetProjectsRequest} ListTargetProjectsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTargetProjectsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListTargetProjectsRequest message. + * @function verify + * @memberof google.cloud.vmmigration.v1.ListTargetProjectsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListTargetProjectsRequest.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 ListTargetProjectsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmmigration.v1.ListTargetProjectsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmmigration.v1.ListTargetProjectsRequest} ListTargetProjectsRequest + */ + ListTargetProjectsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmmigration.v1.ListTargetProjectsRequest) + return object; + var message = new $root.google.cloud.vmmigration.v1.ListTargetProjectsRequest(); + 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 ListTargetProjectsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmmigration.v1.ListTargetProjectsRequest + * @static + * @param {google.cloud.vmmigration.v1.ListTargetProjectsRequest} message ListTargetProjectsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListTargetProjectsRequest.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 ListTargetProjectsRequest to JSON. + * @function toJSON + * @memberof google.cloud.vmmigration.v1.ListTargetProjectsRequest + * @instance + * @returns {Object.} JSON object + */ + ListTargetProjectsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListTargetProjectsRequest + * @function getTypeUrl + * @memberof google.cloud.vmmigration.v1.ListTargetProjectsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListTargetProjectsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmmigration.v1.ListTargetProjectsRequest"; + }; + + return ListTargetProjectsRequest; + })(); + + v1.ListTargetProjectsResponse = (function() { + + /** + * Properties of a ListTargetProjectsResponse. + * @memberof google.cloud.vmmigration.v1 + * @interface IListTargetProjectsResponse + * @property {Array.|null} [targetProjects] ListTargetProjectsResponse targetProjects + * @property {string|null} [nextPageToken] ListTargetProjectsResponse nextPageToken + * @property {Array.|null} [unreachable] ListTargetProjectsResponse unreachable + */ + + /** + * Constructs a new ListTargetProjectsResponse. + * @memberof google.cloud.vmmigration.v1 + * @classdesc Represents a ListTargetProjectsResponse. + * @implements IListTargetProjectsResponse + * @constructor + * @param {google.cloud.vmmigration.v1.IListTargetProjectsResponse=} [properties] Properties to set + */ + function ListTargetProjectsResponse(properties) { + this.targetProjects = []; + 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]]; + } + + /** + * ListTargetProjectsResponse targetProjects. + * @member {Array.} targetProjects + * @memberof google.cloud.vmmigration.v1.ListTargetProjectsResponse + * @instance + */ + ListTargetProjectsResponse.prototype.targetProjects = $util.emptyArray; + + /** + * ListTargetProjectsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.vmmigration.v1.ListTargetProjectsResponse + * @instance + */ + ListTargetProjectsResponse.prototype.nextPageToken = ""; + + /** + * ListTargetProjectsResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.vmmigration.v1.ListTargetProjectsResponse + * @instance + */ + ListTargetProjectsResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListTargetProjectsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.vmmigration.v1.ListTargetProjectsResponse + * @static + * @param {google.cloud.vmmigration.v1.IListTargetProjectsResponse=} [properties] Properties to set + * @returns {google.cloud.vmmigration.v1.ListTargetProjectsResponse} ListTargetProjectsResponse instance + */ + ListTargetProjectsResponse.create = function create(properties) { + return new ListTargetProjectsResponse(properties); + }; + + /** + * Encodes the specified ListTargetProjectsResponse message. Does not implicitly {@link google.cloud.vmmigration.v1.ListTargetProjectsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmmigration.v1.ListTargetProjectsResponse + * @static + * @param {google.cloud.vmmigration.v1.IListTargetProjectsResponse} message ListTargetProjectsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTargetProjectsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.targetProjects != null && message.targetProjects.length) + for (var i = 0; i < message.targetProjects.length; ++i) + $root.google.cloud.vmmigration.v1.TargetProject.encode(message.targetProjects[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 ListTargetProjectsResponse message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.ListTargetProjectsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmmigration.v1.ListTargetProjectsResponse + * @static + * @param {google.cloud.vmmigration.v1.IListTargetProjectsResponse} message ListTargetProjectsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTargetProjectsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListTargetProjectsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmmigration.v1.ListTargetProjectsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmmigration.v1.ListTargetProjectsResponse} ListTargetProjectsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTargetProjectsResponse.decode = function 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.vmmigration.v1.ListTargetProjectsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.targetProjects && message.targetProjects.length)) + message.targetProjects = []; + message.targetProjects.push($root.google.cloud.vmmigration.v1.TargetProject.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 ListTargetProjectsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmmigration.v1.ListTargetProjectsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmmigration.v1.ListTargetProjectsResponse} ListTargetProjectsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTargetProjectsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListTargetProjectsResponse message. + * @function verify + * @memberof google.cloud.vmmigration.v1.ListTargetProjectsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListTargetProjectsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.targetProjects != null && message.hasOwnProperty("targetProjects")) { + if (!Array.isArray(message.targetProjects)) + return "targetProjects: array expected"; + for (var i = 0; i < message.targetProjects.length; ++i) { + var error = $root.google.cloud.vmmigration.v1.TargetProject.verify(message.targetProjects[i]); + if (error) + return "targetProjects." + 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 ListTargetProjectsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmmigration.v1.ListTargetProjectsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmmigration.v1.ListTargetProjectsResponse} ListTargetProjectsResponse + */ + ListTargetProjectsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmmigration.v1.ListTargetProjectsResponse) + return object; + var message = new $root.google.cloud.vmmigration.v1.ListTargetProjectsResponse(); + if (object.targetProjects) { + if (!Array.isArray(object.targetProjects)) + throw TypeError(".google.cloud.vmmigration.v1.ListTargetProjectsResponse.targetProjects: array expected"); + message.targetProjects = []; + for (var i = 0; i < object.targetProjects.length; ++i) { + if (typeof object.targetProjects[i] !== "object") + throw TypeError(".google.cloud.vmmigration.v1.ListTargetProjectsResponse.targetProjects: object expected"); + message.targetProjects[i] = $root.google.cloud.vmmigration.v1.TargetProject.fromObject(object.targetProjects[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.vmmigration.v1.ListTargetProjectsResponse.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 ListTargetProjectsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmmigration.v1.ListTargetProjectsResponse + * @static + * @param {google.cloud.vmmigration.v1.ListTargetProjectsResponse} message ListTargetProjectsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListTargetProjectsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.targetProjects = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.targetProjects && message.targetProjects.length) { + object.targetProjects = []; + for (var j = 0; j < message.targetProjects.length; ++j) + object.targetProjects[j] = $root.google.cloud.vmmigration.v1.TargetProject.toObject(message.targetProjects[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 ListTargetProjectsResponse to JSON. + * @function toJSON + * @memberof google.cloud.vmmigration.v1.ListTargetProjectsResponse + * @instance + * @returns {Object.} JSON object + */ + ListTargetProjectsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListTargetProjectsResponse + * @function getTypeUrl + * @memberof google.cloud.vmmigration.v1.ListTargetProjectsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListTargetProjectsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmmigration.v1.ListTargetProjectsResponse"; + }; + + return ListTargetProjectsResponse; + })(); + + v1.CreateTargetProjectRequest = (function() { + + /** + * Properties of a CreateTargetProjectRequest. + * @memberof google.cloud.vmmigration.v1 + * @interface ICreateTargetProjectRequest + * @property {string|null} [parent] CreateTargetProjectRequest parent + * @property {string|null} [targetProjectId] CreateTargetProjectRequest targetProjectId + * @property {google.cloud.vmmigration.v1.ITargetProject|null} [targetProject] CreateTargetProjectRequest targetProject + * @property {string|null} [requestId] CreateTargetProjectRequest requestId + */ + + /** + * Constructs a new CreateTargetProjectRequest. + * @memberof google.cloud.vmmigration.v1 + * @classdesc Represents a CreateTargetProjectRequest. + * @implements ICreateTargetProjectRequest + * @constructor + * @param {google.cloud.vmmigration.v1.ICreateTargetProjectRequest=} [properties] Properties to set + */ + function CreateTargetProjectRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateTargetProjectRequest parent. + * @member {string} parent + * @memberof google.cloud.vmmigration.v1.CreateTargetProjectRequest + * @instance + */ + CreateTargetProjectRequest.prototype.parent = ""; + + /** + * CreateTargetProjectRequest targetProjectId. + * @member {string} targetProjectId + * @memberof google.cloud.vmmigration.v1.CreateTargetProjectRequest + * @instance + */ + CreateTargetProjectRequest.prototype.targetProjectId = ""; + + /** + * CreateTargetProjectRequest targetProject. + * @member {google.cloud.vmmigration.v1.ITargetProject|null|undefined} targetProject + * @memberof google.cloud.vmmigration.v1.CreateTargetProjectRequest + * @instance + */ + CreateTargetProjectRequest.prototype.targetProject = null; + + /** + * CreateTargetProjectRequest requestId. + * @member {string} requestId + * @memberof google.cloud.vmmigration.v1.CreateTargetProjectRequest + * @instance + */ + CreateTargetProjectRequest.prototype.requestId = ""; + + /** + * Creates a new CreateTargetProjectRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vmmigration.v1.CreateTargetProjectRequest + * @static + * @param {google.cloud.vmmigration.v1.ICreateTargetProjectRequest=} [properties] Properties to set + * @returns {google.cloud.vmmigration.v1.CreateTargetProjectRequest} CreateTargetProjectRequest instance + */ + CreateTargetProjectRequest.create = function create(properties) { + return new CreateTargetProjectRequest(properties); + }; + + /** + * Encodes the specified CreateTargetProjectRequest message. Does not implicitly {@link google.cloud.vmmigration.v1.CreateTargetProjectRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmmigration.v1.CreateTargetProjectRequest + * @static + * @param {google.cloud.vmmigration.v1.ICreateTargetProjectRequest} message CreateTargetProjectRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateTargetProjectRequest.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.targetProjectId != null && Object.hasOwnProperty.call(message, "targetProjectId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.targetProjectId); + if (message.targetProject != null && Object.hasOwnProperty.call(message, "targetProject")) + $root.google.cloud.vmmigration.v1.TargetProject.encode(message.targetProject, 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 CreateTargetProjectRequest message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.CreateTargetProjectRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmmigration.v1.CreateTargetProjectRequest + * @static + * @param {google.cloud.vmmigration.v1.ICreateTargetProjectRequest} message CreateTargetProjectRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateTargetProjectRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateTargetProjectRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmmigration.v1.CreateTargetProjectRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmmigration.v1.CreateTargetProjectRequest} CreateTargetProjectRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateTargetProjectRequest.decode = function 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.vmmigration.v1.CreateTargetProjectRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.targetProjectId = reader.string(); + break; + } + case 3: { + message.targetProject = $root.google.cloud.vmmigration.v1.TargetProject.decode(reader, reader.uint32()); + break; + } + case 4: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateTargetProjectRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmmigration.v1.CreateTargetProjectRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmmigration.v1.CreateTargetProjectRequest} CreateTargetProjectRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateTargetProjectRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateTargetProjectRequest message. + * @function verify + * @memberof google.cloud.vmmigration.v1.CreateTargetProjectRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateTargetProjectRequest.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.targetProjectId != null && message.hasOwnProperty("targetProjectId")) + if (!$util.isString(message.targetProjectId)) + return "targetProjectId: string expected"; + if (message.targetProject != null && message.hasOwnProperty("targetProject")) { + var error = $root.google.cloud.vmmigration.v1.TargetProject.verify(message.targetProject); + if (error) + return "targetProject." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a CreateTargetProjectRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmmigration.v1.CreateTargetProjectRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmmigration.v1.CreateTargetProjectRequest} CreateTargetProjectRequest + */ + CreateTargetProjectRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmmigration.v1.CreateTargetProjectRequest) + return object; + var message = new $root.google.cloud.vmmigration.v1.CreateTargetProjectRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.targetProjectId != null) + message.targetProjectId = String(object.targetProjectId); + if (object.targetProject != null) { + if (typeof object.targetProject !== "object") + throw TypeError(".google.cloud.vmmigration.v1.CreateTargetProjectRequest.targetProject: object expected"); + message.targetProject = $root.google.cloud.vmmigration.v1.TargetProject.fromObject(object.targetProject); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a CreateTargetProjectRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmmigration.v1.CreateTargetProjectRequest + * @static + * @param {google.cloud.vmmigration.v1.CreateTargetProjectRequest} message CreateTargetProjectRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateTargetProjectRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.targetProjectId = ""; + object.targetProject = null; + object.requestId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.targetProjectId != null && message.hasOwnProperty("targetProjectId")) + object.targetProjectId = message.targetProjectId; + if (message.targetProject != null && message.hasOwnProperty("targetProject")) + object.targetProject = $root.google.cloud.vmmigration.v1.TargetProject.toObject(message.targetProject, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this CreateTargetProjectRequest to JSON. + * @function toJSON + * @memberof google.cloud.vmmigration.v1.CreateTargetProjectRequest + * @instance + * @returns {Object.} JSON object + */ + CreateTargetProjectRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateTargetProjectRequest + * @function getTypeUrl + * @memberof google.cloud.vmmigration.v1.CreateTargetProjectRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateTargetProjectRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmmigration.v1.CreateTargetProjectRequest"; + }; + + return CreateTargetProjectRequest; + })(); + + v1.UpdateTargetProjectRequest = (function() { + + /** + * Properties of an UpdateTargetProjectRequest. + * @memberof google.cloud.vmmigration.v1 + * @interface IUpdateTargetProjectRequest + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateTargetProjectRequest updateMask + * @property {google.cloud.vmmigration.v1.ITargetProject|null} [targetProject] UpdateTargetProjectRequest targetProject + * @property {string|null} [requestId] UpdateTargetProjectRequest requestId + */ + + /** + * Constructs a new UpdateTargetProjectRequest. + * @memberof google.cloud.vmmigration.v1 + * @classdesc Represents an UpdateTargetProjectRequest. + * @implements IUpdateTargetProjectRequest + * @constructor + * @param {google.cloud.vmmigration.v1.IUpdateTargetProjectRequest=} [properties] Properties to set + */ + function UpdateTargetProjectRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateTargetProjectRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.vmmigration.v1.UpdateTargetProjectRequest + * @instance + */ + UpdateTargetProjectRequest.prototype.updateMask = null; + + /** + * UpdateTargetProjectRequest targetProject. + * @member {google.cloud.vmmigration.v1.ITargetProject|null|undefined} targetProject + * @memberof google.cloud.vmmigration.v1.UpdateTargetProjectRequest + * @instance + */ + UpdateTargetProjectRequest.prototype.targetProject = null; + + /** + * UpdateTargetProjectRequest requestId. + * @member {string} requestId + * @memberof google.cloud.vmmigration.v1.UpdateTargetProjectRequest + * @instance + */ + UpdateTargetProjectRequest.prototype.requestId = ""; + + /** + * Creates a new UpdateTargetProjectRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vmmigration.v1.UpdateTargetProjectRequest + * @static + * @param {google.cloud.vmmigration.v1.IUpdateTargetProjectRequest=} [properties] Properties to set + * @returns {google.cloud.vmmigration.v1.UpdateTargetProjectRequest} UpdateTargetProjectRequest instance + */ + UpdateTargetProjectRequest.create = function create(properties) { + return new UpdateTargetProjectRequest(properties); + }; + + /** + * Encodes the specified UpdateTargetProjectRequest message. Does not implicitly {@link google.cloud.vmmigration.v1.UpdateTargetProjectRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmmigration.v1.UpdateTargetProjectRequest + * @static + * @param {google.cloud.vmmigration.v1.IUpdateTargetProjectRequest} message UpdateTargetProjectRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateTargetProjectRequest.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.targetProject != null && Object.hasOwnProperty.call(message, "targetProject")) + $root.google.cloud.vmmigration.v1.TargetProject.encode(message.targetProject, 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 UpdateTargetProjectRequest message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.UpdateTargetProjectRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmmigration.v1.UpdateTargetProjectRequest + * @static + * @param {google.cloud.vmmigration.v1.IUpdateTargetProjectRequest} message UpdateTargetProjectRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateTargetProjectRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateTargetProjectRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmmigration.v1.UpdateTargetProjectRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmmigration.v1.UpdateTargetProjectRequest} UpdateTargetProjectRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateTargetProjectRequest.decode = function 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.vmmigration.v1.UpdateTargetProjectRequest(); + 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.targetProject = $root.google.cloud.vmmigration.v1.TargetProject.decode(reader, reader.uint32()); + break; + } + case 3: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateTargetProjectRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmmigration.v1.UpdateTargetProjectRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmmigration.v1.UpdateTargetProjectRequest} UpdateTargetProjectRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateTargetProjectRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateTargetProjectRequest message. + * @function verify + * @memberof google.cloud.vmmigration.v1.UpdateTargetProjectRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateTargetProjectRequest.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.targetProject != null && message.hasOwnProperty("targetProject")) { + var error = $root.google.cloud.vmmigration.v1.TargetProject.verify(message.targetProject); + if (error) + return "targetProject." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates an UpdateTargetProjectRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmmigration.v1.UpdateTargetProjectRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmmigration.v1.UpdateTargetProjectRequest} UpdateTargetProjectRequest + */ + UpdateTargetProjectRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmmigration.v1.UpdateTargetProjectRequest) + return object; + var message = new $root.google.cloud.vmmigration.v1.UpdateTargetProjectRequest(); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.vmmigration.v1.UpdateTargetProjectRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.targetProject != null) { + if (typeof object.targetProject !== "object") + throw TypeError(".google.cloud.vmmigration.v1.UpdateTargetProjectRequest.targetProject: object expected"); + message.targetProject = $root.google.cloud.vmmigration.v1.TargetProject.fromObject(object.targetProject); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from an UpdateTargetProjectRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmmigration.v1.UpdateTargetProjectRequest + * @static + * @param {google.cloud.vmmigration.v1.UpdateTargetProjectRequest} message UpdateTargetProjectRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateTargetProjectRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.updateMask = null; + object.targetProject = null; + object.requestId = ""; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.targetProject != null && message.hasOwnProperty("targetProject")) + object.targetProject = $root.google.cloud.vmmigration.v1.TargetProject.toObject(message.targetProject, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this UpdateTargetProjectRequest to JSON. + * @function toJSON + * @memberof google.cloud.vmmigration.v1.UpdateTargetProjectRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateTargetProjectRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateTargetProjectRequest + * @function getTypeUrl + * @memberof google.cloud.vmmigration.v1.UpdateTargetProjectRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateTargetProjectRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmmigration.v1.UpdateTargetProjectRequest"; + }; + + return UpdateTargetProjectRequest; + })(); + + v1.DeleteTargetProjectRequest = (function() { + + /** + * Properties of a DeleteTargetProjectRequest. + * @memberof google.cloud.vmmigration.v1 + * @interface IDeleteTargetProjectRequest + * @property {string|null} [name] DeleteTargetProjectRequest name + * @property {string|null} [requestId] DeleteTargetProjectRequest requestId + */ + + /** + * Constructs a new DeleteTargetProjectRequest. + * @memberof google.cloud.vmmigration.v1 + * @classdesc Represents a DeleteTargetProjectRequest. + * @implements IDeleteTargetProjectRequest + * @constructor + * @param {google.cloud.vmmigration.v1.IDeleteTargetProjectRequest=} [properties] Properties to set + */ + function DeleteTargetProjectRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteTargetProjectRequest name. + * @member {string} name + * @memberof google.cloud.vmmigration.v1.DeleteTargetProjectRequest + * @instance + */ + DeleteTargetProjectRequest.prototype.name = ""; + + /** + * DeleteTargetProjectRequest requestId. + * @member {string} requestId + * @memberof google.cloud.vmmigration.v1.DeleteTargetProjectRequest + * @instance + */ + DeleteTargetProjectRequest.prototype.requestId = ""; + + /** + * Creates a new DeleteTargetProjectRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vmmigration.v1.DeleteTargetProjectRequest + * @static + * @param {google.cloud.vmmigration.v1.IDeleteTargetProjectRequest=} [properties] Properties to set + * @returns {google.cloud.vmmigration.v1.DeleteTargetProjectRequest} DeleteTargetProjectRequest instance + */ + DeleteTargetProjectRequest.create = function create(properties) { + return new DeleteTargetProjectRequest(properties); + }; + + /** + * Encodes the specified DeleteTargetProjectRequest message. Does not implicitly {@link google.cloud.vmmigration.v1.DeleteTargetProjectRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmmigration.v1.DeleteTargetProjectRequest + * @static + * @param {google.cloud.vmmigration.v1.IDeleteTargetProjectRequest} message DeleteTargetProjectRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteTargetProjectRequest.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); + return writer; + }; + + /** + * Encodes the specified DeleteTargetProjectRequest message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.DeleteTargetProjectRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmmigration.v1.DeleteTargetProjectRequest + * @static + * @param {google.cloud.vmmigration.v1.IDeleteTargetProjectRequest} message DeleteTargetProjectRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteTargetProjectRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteTargetProjectRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmmigration.v1.DeleteTargetProjectRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmmigration.v1.DeleteTargetProjectRequest} DeleteTargetProjectRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteTargetProjectRequest.decode = function 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.vmmigration.v1.DeleteTargetProjectRequest(); + 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; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteTargetProjectRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmmigration.v1.DeleteTargetProjectRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmmigration.v1.DeleteTargetProjectRequest} DeleteTargetProjectRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteTargetProjectRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteTargetProjectRequest message. + * @function verify + * @memberof google.cloud.vmmigration.v1.DeleteTargetProjectRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteTargetProjectRequest.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"; + return null; + }; + + /** + * Creates a DeleteTargetProjectRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmmigration.v1.DeleteTargetProjectRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmmigration.v1.DeleteTargetProjectRequest} DeleteTargetProjectRequest + */ + DeleteTargetProjectRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmmigration.v1.DeleteTargetProjectRequest) + return object; + var message = new $root.google.cloud.vmmigration.v1.DeleteTargetProjectRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a DeleteTargetProjectRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmmigration.v1.DeleteTargetProjectRequest + * @static + * @param {google.cloud.vmmigration.v1.DeleteTargetProjectRequest} message DeleteTargetProjectRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteTargetProjectRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.requestId = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this DeleteTargetProjectRequest to JSON. + * @function toJSON + * @memberof google.cloud.vmmigration.v1.DeleteTargetProjectRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteTargetProjectRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteTargetProjectRequest + * @function getTypeUrl + * @memberof google.cloud.vmmigration.v1.DeleteTargetProjectRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteTargetProjectRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmmigration.v1.DeleteTargetProjectRequest"; + }; + + return DeleteTargetProjectRequest; + })(); + + v1.Group = (function() { + + /** + * Properties of a Group. + * @memberof google.cloud.vmmigration.v1 + * @interface IGroup + * @property {string|null} [name] Group name + * @property {google.protobuf.ITimestamp|null} [createTime] Group createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Group updateTime + * @property {string|null} [description] Group description + * @property {string|null} [displayName] Group displayName + */ + + /** + * Constructs a new Group. + * @memberof google.cloud.vmmigration.v1 + * @classdesc Represents a Group. + * @implements IGroup + * @constructor + * @param {google.cloud.vmmigration.v1.IGroup=} [properties] Properties to set + */ + function Group(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Group name. + * @member {string} name + * @memberof google.cloud.vmmigration.v1.Group + * @instance + */ + Group.prototype.name = ""; + + /** + * Group createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.vmmigration.v1.Group + * @instance + */ + Group.prototype.createTime = null; + + /** + * Group updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.vmmigration.v1.Group + * @instance + */ + Group.prototype.updateTime = null; + + /** + * Group description. + * @member {string} description + * @memberof google.cloud.vmmigration.v1.Group + * @instance + */ + Group.prototype.description = ""; + + /** + * Group displayName. + * @member {string} displayName + * @memberof google.cloud.vmmigration.v1.Group + * @instance + */ + Group.prototype.displayName = ""; + + /** + * Creates a new Group instance using the specified properties. + * @function create + * @memberof google.cloud.vmmigration.v1.Group + * @static + * @param {google.cloud.vmmigration.v1.IGroup=} [properties] Properties to set + * @returns {google.cloud.vmmigration.v1.Group} Group instance + */ + Group.create = function create(properties) { + return new Group(properties); + }; + + /** + * Encodes the specified Group message. Does not implicitly {@link google.cloud.vmmigration.v1.Group.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmmigration.v1.Group + * @static + * @param {google.cloud.vmmigration.v1.IGroup} message Group message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Group.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.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.description); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.displayName); + return writer; + }; + + /** + * Encodes the specified Group message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.Group.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmmigration.v1.Group + * @static + * @param {google.cloud.vmmigration.v1.IGroup} message Group message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Group.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Group message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmmigration.v1.Group + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmmigration.v1.Group} Group + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Group.decode = function 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.vmmigration.v1.Group(); + 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: { + message.description = reader.string(); + break; + } + case 5: { + message.displayName = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Group message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmmigration.v1.Group + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmmigration.v1.Group} Group + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Group.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Group message. + * @function verify + * @memberof google.cloud.vmmigration.v1.Group + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Group.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.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.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + return null; + }; + + /** + * Creates a Group message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmmigration.v1.Group + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmmigration.v1.Group} Group + */ + Group.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmmigration.v1.Group) + return object; + var message = new $root.google.cloud.vmmigration.v1.Group(); + if (object.name != null) + message.name = String(object.name); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.vmmigration.v1.Group.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.vmmigration.v1.Group.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.description != null) + message.description = String(object.description); + if (object.displayName != null) + message.displayName = String(object.displayName); + return message; + }; + + /** + * Creates a plain object from a Group message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmmigration.v1.Group + * @static + * @param {google.cloud.vmmigration.v1.Group} message Group + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Group.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.createTime = null; + object.updateTime = null; + object.description = ""; + object.displayName = ""; + } + 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); + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + return object; + }; + + /** + * Converts this Group to JSON. + * @function toJSON + * @memberof google.cloud.vmmigration.v1.Group + * @instance + * @returns {Object.} JSON object + */ + Group.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Group + * @function getTypeUrl + * @memberof google.cloud.vmmigration.v1.Group + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Group.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmmigration.v1.Group"; + }; + + return Group; + })(); + + v1.ListGroupsRequest = (function() { + + /** + * Properties of a ListGroupsRequest. + * @memberof google.cloud.vmmigration.v1 + * @interface IListGroupsRequest + * @property {string|null} [parent] ListGroupsRequest parent + * @property {number|null} [pageSize] ListGroupsRequest pageSize + * @property {string|null} [pageToken] ListGroupsRequest pageToken + * @property {string|null} [filter] ListGroupsRequest filter + * @property {string|null} [orderBy] ListGroupsRequest orderBy + */ + + /** + * Constructs a new ListGroupsRequest. + * @memberof google.cloud.vmmigration.v1 + * @classdesc Represents a ListGroupsRequest. + * @implements IListGroupsRequest + * @constructor + * @param {google.cloud.vmmigration.v1.IListGroupsRequest=} [properties] Properties to set + */ + function ListGroupsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListGroupsRequest parent. + * @member {string} parent + * @memberof google.cloud.vmmigration.v1.ListGroupsRequest + * @instance + */ + ListGroupsRequest.prototype.parent = ""; + + /** + * ListGroupsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.vmmigration.v1.ListGroupsRequest + * @instance + */ + ListGroupsRequest.prototype.pageSize = 0; + + /** + * ListGroupsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.vmmigration.v1.ListGroupsRequest + * @instance + */ + ListGroupsRequest.prototype.pageToken = ""; + + /** + * ListGroupsRequest filter. + * @member {string} filter + * @memberof google.cloud.vmmigration.v1.ListGroupsRequest + * @instance + */ + ListGroupsRequest.prototype.filter = ""; + + /** + * ListGroupsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.vmmigration.v1.ListGroupsRequest + * @instance + */ + ListGroupsRequest.prototype.orderBy = ""; + + /** + * Creates a new ListGroupsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vmmigration.v1.ListGroupsRequest + * @static + * @param {google.cloud.vmmigration.v1.IListGroupsRequest=} [properties] Properties to set + * @returns {google.cloud.vmmigration.v1.ListGroupsRequest} ListGroupsRequest instance + */ + ListGroupsRequest.create = function create(properties) { + return new ListGroupsRequest(properties); + }; + + /** + * Encodes the specified ListGroupsRequest message. Does not implicitly {@link google.cloud.vmmigration.v1.ListGroupsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmmigration.v1.ListGroupsRequest + * @static + * @param {google.cloud.vmmigration.v1.IListGroupsRequest} message ListGroupsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListGroupsRequest.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 ListGroupsRequest message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.ListGroupsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmmigration.v1.ListGroupsRequest + * @static + * @param {google.cloud.vmmigration.v1.IListGroupsRequest} message ListGroupsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListGroupsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListGroupsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmmigration.v1.ListGroupsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmmigration.v1.ListGroupsRequest} ListGroupsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListGroupsRequest.decode = function 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.vmmigration.v1.ListGroupsRequest(); + 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 ListGroupsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmmigration.v1.ListGroupsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmmigration.v1.ListGroupsRequest} ListGroupsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListGroupsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListGroupsRequest message. + * @function verify + * @memberof google.cloud.vmmigration.v1.ListGroupsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListGroupsRequest.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 ListGroupsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmmigration.v1.ListGroupsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmmigration.v1.ListGroupsRequest} ListGroupsRequest + */ + ListGroupsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmmigration.v1.ListGroupsRequest) + return object; + var message = new $root.google.cloud.vmmigration.v1.ListGroupsRequest(); + 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 ListGroupsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmmigration.v1.ListGroupsRequest + * @static + * @param {google.cloud.vmmigration.v1.ListGroupsRequest} message ListGroupsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListGroupsRequest.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 ListGroupsRequest to JSON. + * @function toJSON + * @memberof google.cloud.vmmigration.v1.ListGroupsRequest + * @instance + * @returns {Object.} JSON object + */ + ListGroupsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListGroupsRequest + * @function getTypeUrl + * @memberof google.cloud.vmmigration.v1.ListGroupsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListGroupsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmmigration.v1.ListGroupsRequest"; + }; + + return ListGroupsRequest; + })(); + + v1.ListGroupsResponse = (function() { + + /** + * Properties of a ListGroupsResponse. + * @memberof google.cloud.vmmigration.v1 + * @interface IListGroupsResponse + * @property {Array.|null} [groups] ListGroupsResponse groups + * @property {string|null} [nextPageToken] ListGroupsResponse nextPageToken + * @property {Array.|null} [unreachable] ListGroupsResponse unreachable + */ + + /** + * Constructs a new ListGroupsResponse. + * @memberof google.cloud.vmmigration.v1 + * @classdesc Represents a ListGroupsResponse. + * @implements IListGroupsResponse + * @constructor + * @param {google.cloud.vmmigration.v1.IListGroupsResponse=} [properties] Properties to set + */ + function ListGroupsResponse(properties) { + this.groups = []; + 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]]; + } + + /** + * ListGroupsResponse groups. + * @member {Array.} groups + * @memberof google.cloud.vmmigration.v1.ListGroupsResponse + * @instance + */ + ListGroupsResponse.prototype.groups = $util.emptyArray; + + /** + * ListGroupsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.vmmigration.v1.ListGroupsResponse + * @instance + */ + ListGroupsResponse.prototype.nextPageToken = ""; + + /** + * ListGroupsResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.vmmigration.v1.ListGroupsResponse + * @instance + */ + ListGroupsResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListGroupsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.vmmigration.v1.ListGroupsResponse + * @static + * @param {google.cloud.vmmigration.v1.IListGroupsResponse=} [properties] Properties to set + * @returns {google.cloud.vmmigration.v1.ListGroupsResponse} ListGroupsResponse instance + */ + ListGroupsResponse.create = function create(properties) { + return new ListGroupsResponse(properties); + }; + + /** + * Encodes the specified ListGroupsResponse message. Does not implicitly {@link google.cloud.vmmigration.v1.ListGroupsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmmigration.v1.ListGroupsResponse + * @static + * @param {google.cloud.vmmigration.v1.IListGroupsResponse} message ListGroupsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListGroupsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.groups != null && message.groups.length) + for (var i = 0; i < message.groups.length; ++i) + $root.google.cloud.vmmigration.v1.Group.encode(message.groups[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 ListGroupsResponse message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.ListGroupsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmmigration.v1.ListGroupsResponse + * @static + * @param {google.cloud.vmmigration.v1.IListGroupsResponse} message ListGroupsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListGroupsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListGroupsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmmigration.v1.ListGroupsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmmigration.v1.ListGroupsResponse} ListGroupsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListGroupsResponse.decode = function 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.vmmigration.v1.ListGroupsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.groups && message.groups.length)) + message.groups = []; + message.groups.push($root.google.cloud.vmmigration.v1.Group.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 ListGroupsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmmigration.v1.ListGroupsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmmigration.v1.ListGroupsResponse} ListGroupsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListGroupsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListGroupsResponse message. + * @function verify + * @memberof google.cloud.vmmigration.v1.ListGroupsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListGroupsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.groups != null && message.hasOwnProperty("groups")) { + if (!Array.isArray(message.groups)) + return "groups: array expected"; + for (var i = 0; i < message.groups.length; ++i) { + var error = $root.google.cloud.vmmigration.v1.Group.verify(message.groups[i]); + if (error) + return "groups." + 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 ListGroupsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmmigration.v1.ListGroupsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmmigration.v1.ListGroupsResponse} ListGroupsResponse + */ + ListGroupsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmmigration.v1.ListGroupsResponse) + return object; + var message = new $root.google.cloud.vmmigration.v1.ListGroupsResponse(); + if (object.groups) { + if (!Array.isArray(object.groups)) + throw TypeError(".google.cloud.vmmigration.v1.ListGroupsResponse.groups: array expected"); + message.groups = []; + for (var i = 0; i < object.groups.length; ++i) { + if (typeof object.groups[i] !== "object") + throw TypeError(".google.cloud.vmmigration.v1.ListGroupsResponse.groups: object expected"); + message.groups[i] = $root.google.cloud.vmmigration.v1.Group.fromObject(object.groups[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.vmmigration.v1.ListGroupsResponse.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 ListGroupsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmmigration.v1.ListGroupsResponse + * @static + * @param {google.cloud.vmmigration.v1.ListGroupsResponse} message ListGroupsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListGroupsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.groups = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.groups && message.groups.length) { + object.groups = []; + for (var j = 0; j < message.groups.length; ++j) + object.groups[j] = $root.google.cloud.vmmigration.v1.Group.toObject(message.groups[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 ListGroupsResponse to JSON. + * @function toJSON + * @memberof google.cloud.vmmigration.v1.ListGroupsResponse + * @instance + * @returns {Object.} JSON object + */ + ListGroupsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListGroupsResponse + * @function getTypeUrl + * @memberof google.cloud.vmmigration.v1.ListGroupsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListGroupsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmmigration.v1.ListGroupsResponse"; + }; + + return ListGroupsResponse; + })(); + + v1.GetGroupRequest = (function() { + + /** + * Properties of a GetGroupRequest. + * @memberof google.cloud.vmmigration.v1 + * @interface IGetGroupRequest + * @property {string|null} [name] GetGroupRequest name + */ + + /** + * Constructs a new GetGroupRequest. + * @memberof google.cloud.vmmigration.v1 + * @classdesc Represents a GetGroupRequest. + * @implements IGetGroupRequest + * @constructor + * @param {google.cloud.vmmigration.v1.IGetGroupRequest=} [properties] Properties to set + */ + function GetGroupRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetGroupRequest name. + * @member {string} name + * @memberof google.cloud.vmmigration.v1.GetGroupRequest + * @instance + */ + GetGroupRequest.prototype.name = ""; + + /** + * Creates a new GetGroupRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vmmigration.v1.GetGroupRequest + * @static + * @param {google.cloud.vmmigration.v1.IGetGroupRequest=} [properties] Properties to set + * @returns {google.cloud.vmmigration.v1.GetGroupRequest} GetGroupRequest instance + */ + GetGroupRequest.create = function create(properties) { + return new GetGroupRequest(properties); + }; + + /** + * Encodes the specified GetGroupRequest message. Does not implicitly {@link google.cloud.vmmigration.v1.GetGroupRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmmigration.v1.GetGroupRequest + * @static + * @param {google.cloud.vmmigration.v1.IGetGroupRequest} message GetGroupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGroupRequest.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 GetGroupRequest message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.GetGroupRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmmigration.v1.GetGroupRequest + * @static + * @param {google.cloud.vmmigration.v1.IGetGroupRequest} message GetGroupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGroupRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetGroupRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmmigration.v1.GetGroupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmmigration.v1.GetGroupRequest} GetGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGroupRequest.decode = function 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.vmmigration.v1.GetGroupRequest(); + 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 GetGroupRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmmigration.v1.GetGroupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmmigration.v1.GetGroupRequest} GetGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGroupRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetGroupRequest message. + * @function verify + * @memberof google.cloud.vmmigration.v1.GetGroupRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetGroupRequest.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 GetGroupRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmmigration.v1.GetGroupRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmmigration.v1.GetGroupRequest} GetGroupRequest + */ + GetGroupRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmmigration.v1.GetGroupRequest) + return object; + var message = new $root.google.cloud.vmmigration.v1.GetGroupRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetGroupRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmmigration.v1.GetGroupRequest + * @static + * @param {google.cloud.vmmigration.v1.GetGroupRequest} message GetGroupRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetGroupRequest.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 GetGroupRequest to JSON. + * @function toJSON + * @memberof google.cloud.vmmigration.v1.GetGroupRequest + * @instance + * @returns {Object.} JSON object + */ + GetGroupRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetGroupRequest + * @function getTypeUrl + * @memberof google.cloud.vmmigration.v1.GetGroupRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetGroupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmmigration.v1.GetGroupRequest"; + }; + + return GetGroupRequest; + })(); + + v1.CreateGroupRequest = (function() { + + /** + * Properties of a CreateGroupRequest. + * @memberof google.cloud.vmmigration.v1 + * @interface ICreateGroupRequest + * @property {string|null} [parent] CreateGroupRequest parent + * @property {string|null} [groupId] CreateGroupRequest groupId + * @property {google.cloud.vmmigration.v1.IGroup|null} [group] CreateGroupRequest group + * @property {string|null} [requestId] CreateGroupRequest requestId + */ + + /** + * Constructs a new CreateGroupRequest. + * @memberof google.cloud.vmmigration.v1 + * @classdesc Represents a CreateGroupRequest. + * @implements ICreateGroupRequest + * @constructor + * @param {google.cloud.vmmigration.v1.ICreateGroupRequest=} [properties] Properties to set + */ + function CreateGroupRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateGroupRequest parent. + * @member {string} parent + * @memberof google.cloud.vmmigration.v1.CreateGroupRequest + * @instance + */ + CreateGroupRequest.prototype.parent = ""; + + /** + * CreateGroupRequest groupId. + * @member {string} groupId + * @memberof google.cloud.vmmigration.v1.CreateGroupRequest + * @instance + */ + CreateGroupRequest.prototype.groupId = ""; + + /** + * CreateGroupRequest group. + * @member {google.cloud.vmmigration.v1.IGroup|null|undefined} group + * @memberof google.cloud.vmmigration.v1.CreateGroupRequest + * @instance + */ + CreateGroupRequest.prototype.group = null; + + /** + * CreateGroupRequest requestId. + * @member {string} requestId + * @memberof google.cloud.vmmigration.v1.CreateGroupRequest + * @instance + */ + CreateGroupRequest.prototype.requestId = ""; + + /** + * Creates a new CreateGroupRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vmmigration.v1.CreateGroupRequest + * @static + * @param {google.cloud.vmmigration.v1.ICreateGroupRequest=} [properties] Properties to set + * @returns {google.cloud.vmmigration.v1.CreateGroupRequest} CreateGroupRequest instance + */ + CreateGroupRequest.create = function create(properties) { + return new CreateGroupRequest(properties); + }; + + /** + * Encodes the specified CreateGroupRequest message. Does not implicitly {@link google.cloud.vmmigration.v1.CreateGroupRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmmigration.v1.CreateGroupRequest + * @static + * @param {google.cloud.vmmigration.v1.ICreateGroupRequest} message CreateGroupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateGroupRequest.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.groupId != null && Object.hasOwnProperty.call(message, "groupId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.groupId); + if (message.group != null && Object.hasOwnProperty.call(message, "group")) + $root.google.cloud.vmmigration.v1.Group.encode(message.group, 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 CreateGroupRequest message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.CreateGroupRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmmigration.v1.CreateGroupRequest + * @static + * @param {google.cloud.vmmigration.v1.ICreateGroupRequest} message CreateGroupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateGroupRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateGroupRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmmigration.v1.CreateGroupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmmigration.v1.CreateGroupRequest} CreateGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateGroupRequest.decode = function 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.vmmigration.v1.CreateGroupRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.groupId = reader.string(); + break; + } + case 3: { + message.group = $root.google.cloud.vmmigration.v1.Group.decode(reader, reader.uint32()); + break; + } + case 4: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateGroupRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmmigration.v1.CreateGroupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmmigration.v1.CreateGroupRequest} CreateGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateGroupRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateGroupRequest message. + * @function verify + * @memberof google.cloud.vmmigration.v1.CreateGroupRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateGroupRequest.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.groupId != null && message.hasOwnProperty("groupId")) + if (!$util.isString(message.groupId)) + return "groupId: string expected"; + if (message.group != null && message.hasOwnProperty("group")) { + var error = $root.google.cloud.vmmigration.v1.Group.verify(message.group); + if (error) + return "group." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a CreateGroupRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmmigration.v1.CreateGroupRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmmigration.v1.CreateGroupRequest} CreateGroupRequest + */ + CreateGroupRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmmigration.v1.CreateGroupRequest) + return object; + var message = new $root.google.cloud.vmmigration.v1.CreateGroupRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.groupId != null) + message.groupId = String(object.groupId); + if (object.group != null) { + if (typeof object.group !== "object") + throw TypeError(".google.cloud.vmmigration.v1.CreateGroupRequest.group: object expected"); + message.group = $root.google.cloud.vmmigration.v1.Group.fromObject(object.group); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a CreateGroupRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmmigration.v1.CreateGroupRequest + * @static + * @param {google.cloud.vmmigration.v1.CreateGroupRequest} message CreateGroupRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateGroupRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.groupId = ""; + object.group = null; + object.requestId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.groupId != null && message.hasOwnProperty("groupId")) + object.groupId = message.groupId; + if (message.group != null && message.hasOwnProperty("group")) + object.group = $root.google.cloud.vmmigration.v1.Group.toObject(message.group, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this CreateGroupRequest to JSON. + * @function toJSON + * @memberof google.cloud.vmmigration.v1.CreateGroupRequest + * @instance + * @returns {Object.} JSON object + */ + CreateGroupRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateGroupRequest + * @function getTypeUrl + * @memberof google.cloud.vmmigration.v1.CreateGroupRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateGroupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmmigration.v1.CreateGroupRequest"; + }; + + return CreateGroupRequest; + })(); + + v1.UpdateGroupRequest = (function() { + + /** + * Properties of an UpdateGroupRequest. + * @memberof google.cloud.vmmigration.v1 + * @interface IUpdateGroupRequest + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateGroupRequest updateMask + * @property {google.cloud.vmmigration.v1.IGroup|null} [group] UpdateGroupRequest group + * @property {string|null} [requestId] UpdateGroupRequest requestId + */ + + /** + * Constructs a new UpdateGroupRequest. + * @memberof google.cloud.vmmigration.v1 + * @classdesc Represents an UpdateGroupRequest. + * @implements IUpdateGroupRequest + * @constructor + * @param {google.cloud.vmmigration.v1.IUpdateGroupRequest=} [properties] Properties to set + */ + function UpdateGroupRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateGroupRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.vmmigration.v1.UpdateGroupRequest + * @instance + */ + UpdateGroupRequest.prototype.updateMask = null; + + /** + * UpdateGroupRequest group. + * @member {google.cloud.vmmigration.v1.IGroup|null|undefined} group + * @memberof google.cloud.vmmigration.v1.UpdateGroupRequest + * @instance + */ + UpdateGroupRequest.prototype.group = null; + + /** + * UpdateGroupRequest requestId. + * @member {string} requestId + * @memberof google.cloud.vmmigration.v1.UpdateGroupRequest + * @instance + */ + UpdateGroupRequest.prototype.requestId = ""; + + /** + * Creates a new UpdateGroupRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vmmigration.v1.UpdateGroupRequest + * @static + * @param {google.cloud.vmmigration.v1.IUpdateGroupRequest=} [properties] Properties to set + * @returns {google.cloud.vmmigration.v1.UpdateGroupRequest} UpdateGroupRequest instance + */ + UpdateGroupRequest.create = function create(properties) { + return new UpdateGroupRequest(properties); + }; + + /** + * Encodes the specified UpdateGroupRequest message. Does not implicitly {@link google.cloud.vmmigration.v1.UpdateGroupRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmmigration.v1.UpdateGroupRequest + * @static + * @param {google.cloud.vmmigration.v1.IUpdateGroupRequest} message UpdateGroupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateGroupRequest.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.group != null && Object.hasOwnProperty.call(message, "group")) + $root.google.cloud.vmmigration.v1.Group.encode(message.group, 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 UpdateGroupRequest message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.UpdateGroupRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmmigration.v1.UpdateGroupRequest + * @static + * @param {google.cloud.vmmigration.v1.IUpdateGroupRequest} message UpdateGroupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateGroupRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateGroupRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmmigration.v1.UpdateGroupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmmigration.v1.UpdateGroupRequest} UpdateGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateGroupRequest.decode = function 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.vmmigration.v1.UpdateGroupRequest(); + 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.group = $root.google.cloud.vmmigration.v1.Group.decode(reader, reader.uint32()); + break; + } + case 3: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateGroupRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmmigration.v1.UpdateGroupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmmigration.v1.UpdateGroupRequest} UpdateGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateGroupRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateGroupRequest message. + * @function verify + * @memberof google.cloud.vmmigration.v1.UpdateGroupRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateGroupRequest.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.group != null && message.hasOwnProperty("group")) { + var error = $root.google.cloud.vmmigration.v1.Group.verify(message.group); + if (error) + return "group." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates an UpdateGroupRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmmigration.v1.UpdateGroupRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmmigration.v1.UpdateGroupRequest} UpdateGroupRequest + */ + UpdateGroupRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmmigration.v1.UpdateGroupRequest) + return object; + var message = new $root.google.cloud.vmmigration.v1.UpdateGroupRequest(); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.vmmigration.v1.UpdateGroupRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.group != null) { + if (typeof object.group !== "object") + throw TypeError(".google.cloud.vmmigration.v1.UpdateGroupRequest.group: object expected"); + message.group = $root.google.cloud.vmmigration.v1.Group.fromObject(object.group); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from an UpdateGroupRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmmigration.v1.UpdateGroupRequest + * @static + * @param {google.cloud.vmmigration.v1.UpdateGroupRequest} message UpdateGroupRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateGroupRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.updateMask = null; + object.group = null; + object.requestId = ""; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.group != null && message.hasOwnProperty("group")) + object.group = $root.google.cloud.vmmigration.v1.Group.toObject(message.group, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this UpdateGroupRequest to JSON. + * @function toJSON + * @memberof google.cloud.vmmigration.v1.UpdateGroupRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateGroupRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateGroupRequest + * @function getTypeUrl + * @memberof google.cloud.vmmigration.v1.UpdateGroupRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateGroupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmmigration.v1.UpdateGroupRequest"; + }; + + return UpdateGroupRequest; + })(); + + v1.DeleteGroupRequest = (function() { + + /** + * Properties of a DeleteGroupRequest. + * @memberof google.cloud.vmmigration.v1 + * @interface IDeleteGroupRequest + * @property {string|null} [name] DeleteGroupRequest name + * @property {string|null} [requestId] DeleteGroupRequest requestId + */ + + /** + * Constructs a new DeleteGroupRequest. + * @memberof google.cloud.vmmigration.v1 + * @classdesc Represents a DeleteGroupRequest. + * @implements IDeleteGroupRequest + * @constructor + * @param {google.cloud.vmmigration.v1.IDeleteGroupRequest=} [properties] Properties to set + */ + function DeleteGroupRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteGroupRequest name. + * @member {string} name + * @memberof google.cloud.vmmigration.v1.DeleteGroupRequest + * @instance + */ + DeleteGroupRequest.prototype.name = ""; + + /** + * DeleteGroupRequest requestId. + * @member {string} requestId + * @memberof google.cloud.vmmigration.v1.DeleteGroupRequest + * @instance + */ + DeleteGroupRequest.prototype.requestId = ""; + + /** + * Creates a new DeleteGroupRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vmmigration.v1.DeleteGroupRequest + * @static + * @param {google.cloud.vmmigration.v1.IDeleteGroupRequest=} [properties] Properties to set + * @returns {google.cloud.vmmigration.v1.DeleteGroupRequest} DeleteGroupRequest instance + */ + DeleteGroupRequest.create = function create(properties) { + return new DeleteGroupRequest(properties); + }; + + /** + * Encodes the specified DeleteGroupRequest message. Does not implicitly {@link google.cloud.vmmigration.v1.DeleteGroupRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmmigration.v1.DeleteGroupRequest + * @static + * @param {google.cloud.vmmigration.v1.IDeleteGroupRequest} message DeleteGroupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteGroupRequest.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); + return writer; + }; + + /** + * Encodes the specified DeleteGroupRequest message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.DeleteGroupRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmmigration.v1.DeleteGroupRequest + * @static + * @param {google.cloud.vmmigration.v1.IDeleteGroupRequest} message DeleteGroupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteGroupRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteGroupRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmmigration.v1.DeleteGroupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmmigration.v1.DeleteGroupRequest} DeleteGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteGroupRequest.decode = function 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.vmmigration.v1.DeleteGroupRequest(); + 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; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteGroupRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmmigration.v1.DeleteGroupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmmigration.v1.DeleteGroupRequest} DeleteGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteGroupRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteGroupRequest message. + * @function verify + * @memberof google.cloud.vmmigration.v1.DeleteGroupRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteGroupRequest.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"; + return null; + }; + + /** + * Creates a DeleteGroupRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmmigration.v1.DeleteGroupRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmmigration.v1.DeleteGroupRequest} DeleteGroupRequest + */ + DeleteGroupRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmmigration.v1.DeleteGroupRequest) + return object; + var message = new $root.google.cloud.vmmigration.v1.DeleteGroupRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a DeleteGroupRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmmigration.v1.DeleteGroupRequest + * @static + * @param {google.cloud.vmmigration.v1.DeleteGroupRequest} message DeleteGroupRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteGroupRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.requestId = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this DeleteGroupRequest to JSON. + * @function toJSON + * @memberof google.cloud.vmmigration.v1.DeleteGroupRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteGroupRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteGroupRequest + * @function getTypeUrl + * @memberof google.cloud.vmmigration.v1.DeleteGroupRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteGroupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmmigration.v1.DeleteGroupRequest"; + }; + + return DeleteGroupRequest; + })(); + + v1.AddGroupMigrationRequest = (function() { + + /** + * Properties of an AddGroupMigrationRequest. + * @memberof google.cloud.vmmigration.v1 + * @interface IAddGroupMigrationRequest + * @property {string|null} [group] AddGroupMigrationRequest group + * @property {string|null} [migratingVm] AddGroupMigrationRequest migratingVm + */ + + /** + * Constructs a new AddGroupMigrationRequest. + * @memberof google.cloud.vmmigration.v1 + * @classdesc Represents an AddGroupMigrationRequest. + * @implements IAddGroupMigrationRequest + * @constructor + * @param {google.cloud.vmmigration.v1.IAddGroupMigrationRequest=} [properties] Properties to set + */ + function AddGroupMigrationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AddGroupMigrationRequest group. + * @member {string} group + * @memberof google.cloud.vmmigration.v1.AddGroupMigrationRequest + * @instance + */ + AddGroupMigrationRequest.prototype.group = ""; + + /** + * AddGroupMigrationRequest migratingVm. + * @member {string} migratingVm + * @memberof google.cloud.vmmigration.v1.AddGroupMigrationRequest + * @instance + */ + AddGroupMigrationRequest.prototype.migratingVm = ""; + + /** + * Creates a new AddGroupMigrationRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vmmigration.v1.AddGroupMigrationRequest + * @static + * @param {google.cloud.vmmigration.v1.IAddGroupMigrationRequest=} [properties] Properties to set + * @returns {google.cloud.vmmigration.v1.AddGroupMigrationRequest} AddGroupMigrationRequest instance + */ + AddGroupMigrationRequest.create = function create(properties) { + return new AddGroupMigrationRequest(properties); + }; + + /** + * Encodes the specified AddGroupMigrationRequest message. Does not implicitly {@link google.cloud.vmmigration.v1.AddGroupMigrationRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmmigration.v1.AddGroupMigrationRequest + * @static + * @param {google.cloud.vmmigration.v1.IAddGroupMigrationRequest} message AddGroupMigrationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AddGroupMigrationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.group != null && Object.hasOwnProperty.call(message, "group")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.group); + if (message.migratingVm != null && Object.hasOwnProperty.call(message, "migratingVm")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.migratingVm); + return writer; + }; + + /** + * Encodes the specified AddGroupMigrationRequest message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.AddGroupMigrationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmmigration.v1.AddGroupMigrationRequest + * @static + * @param {google.cloud.vmmigration.v1.IAddGroupMigrationRequest} message AddGroupMigrationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AddGroupMigrationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AddGroupMigrationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmmigration.v1.AddGroupMigrationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmmigration.v1.AddGroupMigrationRequest} AddGroupMigrationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AddGroupMigrationRequest.decode = function 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.vmmigration.v1.AddGroupMigrationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.group = reader.string(); + break; + } + case 2: { + message.migratingVm = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AddGroupMigrationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmmigration.v1.AddGroupMigrationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmmigration.v1.AddGroupMigrationRequest} AddGroupMigrationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AddGroupMigrationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AddGroupMigrationRequest message. + * @function verify + * @memberof google.cloud.vmmigration.v1.AddGroupMigrationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AddGroupMigrationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.group != null && message.hasOwnProperty("group")) + if (!$util.isString(message.group)) + return "group: string expected"; + if (message.migratingVm != null && message.hasOwnProperty("migratingVm")) + if (!$util.isString(message.migratingVm)) + return "migratingVm: string expected"; + return null; + }; + + /** + * Creates an AddGroupMigrationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmmigration.v1.AddGroupMigrationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmmigration.v1.AddGroupMigrationRequest} AddGroupMigrationRequest + */ + AddGroupMigrationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmmigration.v1.AddGroupMigrationRequest) + return object; + var message = new $root.google.cloud.vmmigration.v1.AddGroupMigrationRequest(); + if (object.group != null) + message.group = String(object.group); + if (object.migratingVm != null) + message.migratingVm = String(object.migratingVm); + return message; + }; + + /** + * Creates a plain object from an AddGroupMigrationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmmigration.v1.AddGroupMigrationRequest + * @static + * @param {google.cloud.vmmigration.v1.AddGroupMigrationRequest} message AddGroupMigrationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AddGroupMigrationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.group = ""; + object.migratingVm = ""; + } + if (message.group != null && message.hasOwnProperty("group")) + object.group = message.group; + if (message.migratingVm != null && message.hasOwnProperty("migratingVm")) + object.migratingVm = message.migratingVm; + return object; + }; + + /** + * Converts this AddGroupMigrationRequest to JSON. + * @function toJSON + * @memberof google.cloud.vmmigration.v1.AddGroupMigrationRequest + * @instance + * @returns {Object.} JSON object + */ + AddGroupMigrationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AddGroupMigrationRequest + * @function getTypeUrl + * @memberof google.cloud.vmmigration.v1.AddGroupMigrationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AddGroupMigrationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmmigration.v1.AddGroupMigrationRequest"; + }; + + return AddGroupMigrationRequest; + })(); + + v1.AddGroupMigrationResponse = (function() { + + /** + * Properties of an AddGroupMigrationResponse. + * @memberof google.cloud.vmmigration.v1 + * @interface IAddGroupMigrationResponse + */ + + /** + * Constructs a new AddGroupMigrationResponse. + * @memberof google.cloud.vmmigration.v1 + * @classdesc Represents an AddGroupMigrationResponse. + * @implements IAddGroupMigrationResponse + * @constructor + * @param {google.cloud.vmmigration.v1.IAddGroupMigrationResponse=} [properties] Properties to set + */ + function AddGroupMigrationResponse(properties) { + if (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 AddGroupMigrationResponse instance using the specified properties. + * @function create + * @memberof google.cloud.vmmigration.v1.AddGroupMigrationResponse + * @static + * @param {google.cloud.vmmigration.v1.IAddGroupMigrationResponse=} [properties] Properties to set + * @returns {google.cloud.vmmigration.v1.AddGroupMigrationResponse} AddGroupMigrationResponse instance + */ + AddGroupMigrationResponse.create = function create(properties) { + return new AddGroupMigrationResponse(properties); + }; + + /** + * Encodes the specified AddGroupMigrationResponse message. Does not implicitly {@link google.cloud.vmmigration.v1.AddGroupMigrationResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmmigration.v1.AddGroupMigrationResponse + * @static + * @param {google.cloud.vmmigration.v1.IAddGroupMigrationResponse} message AddGroupMigrationResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AddGroupMigrationResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified AddGroupMigrationResponse message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.AddGroupMigrationResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmmigration.v1.AddGroupMigrationResponse + * @static + * @param {google.cloud.vmmigration.v1.IAddGroupMigrationResponse} message AddGroupMigrationResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AddGroupMigrationResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AddGroupMigrationResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmmigration.v1.AddGroupMigrationResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmmigration.v1.AddGroupMigrationResponse} AddGroupMigrationResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AddGroupMigrationResponse.decode = function 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.vmmigration.v1.AddGroupMigrationResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AddGroupMigrationResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmmigration.v1.AddGroupMigrationResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmmigration.v1.AddGroupMigrationResponse} AddGroupMigrationResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AddGroupMigrationResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AddGroupMigrationResponse message. + * @function verify + * @memberof google.cloud.vmmigration.v1.AddGroupMigrationResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AddGroupMigrationResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates an AddGroupMigrationResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmmigration.v1.AddGroupMigrationResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmmigration.v1.AddGroupMigrationResponse} AddGroupMigrationResponse + */ + AddGroupMigrationResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmmigration.v1.AddGroupMigrationResponse) + return object; + return new $root.google.cloud.vmmigration.v1.AddGroupMigrationResponse(); + }; + + /** + * Creates a plain object from an AddGroupMigrationResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmmigration.v1.AddGroupMigrationResponse + * @static + * @param {google.cloud.vmmigration.v1.AddGroupMigrationResponse} message AddGroupMigrationResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AddGroupMigrationResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this AddGroupMigrationResponse to JSON. + * @function toJSON + * @memberof google.cloud.vmmigration.v1.AddGroupMigrationResponse + * @instance + * @returns {Object.} JSON object + */ + AddGroupMigrationResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AddGroupMigrationResponse + * @function getTypeUrl + * @memberof google.cloud.vmmigration.v1.AddGroupMigrationResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AddGroupMigrationResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmmigration.v1.AddGroupMigrationResponse"; + }; + + return AddGroupMigrationResponse; + })(); + + v1.RemoveGroupMigrationRequest = (function() { + + /** + * Properties of a RemoveGroupMigrationRequest. + * @memberof google.cloud.vmmigration.v1 + * @interface IRemoveGroupMigrationRequest + * @property {string|null} [group] RemoveGroupMigrationRequest group + * @property {string|null} [migratingVm] RemoveGroupMigrationRequest migratingVm + */ + + /** + * Constructs a new RemoveGroupMigrationRequest. + * @memberof google.cloud.vmmigration.v1 + * @classdesc Represents a RemoveGroupMigrationRequest. + * @implements IRemoveGroupMigrationRequest + * @constructor + * @param {google.cloud.vmmigration.v1.IRemoveGroupMigrationRequest=} [properties] Properties to set + */ + function RemoveGroupMigrationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RemoveGroupMigrationRequest group. + * @member {string} group + * @memberof google.cloud.vmmigration.v1.RemoveGroupMigrationRequest + * @instance + */ + RemoveGroupMigrationRequest.prototype.group = ""; + + /** + * RemoveGroupMigrationRequest migratingVm. + * @member {string} migratingVm + * @memberof google.cloud.vmmigration.v1.RemoveGroupMigrationRequest + * @instance + */ + RemoveGroupMigrationRequest.prototype.migratingVm = ""; + + /** + * Creates a new RemoveGroupMigrationRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vmmigration.v1.RemoveGroupMigrationRequest + * @static + * @param {google.cloud.vmmigration.v1.IRemoveGroupMigrationRequest=} [properties] Properties to set + * @returns {google.cloud.vmmigration.v1.RemoveGroupMigrationRequest} RemoveGroupMigrationRequest instance + */ + RemoveGroupMigrationRequest.create = function create(properties) { + return new RemoveGroupMigrationRequest(properties); + }; + + /** + * Encodes the specified RemoveGroupMigrationRequest message. Does not implicitly {@link google.cloud.vmmigration.v1.RemoveGroupMigrationRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmmigration.v1.RemoveGroupMigrationRequest + * @static + * @param {google.cloud.vmmigration.v1.IRemoveGroupMigrationRequest} message RemoveGroupMigrationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RemoveGroupMigrationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.group != null && Object.hasOwnProperty.call(message, "group")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.group); + if (message.migratingVm != null && Object.hasOwnProperty.call(message, "migratingVm")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.migratingVm); + return writer; + }; + + /** + * Encodes the specified RemoveGroupMigrationRequest message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.RemoveGroupMigrationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmmigration.v1.RemoveGroupMigrationRequest + * @static + * @param {google.cloud.vmmigration.v1.IRemoveGroupMigrationRequest} message RemoveGroupMigrationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RemoveGroupMigrationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RemoveGroupMigrationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmmigration.v1.RemoveGroupMigrationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmmigration.v1.RemoveGroupMigrationRequest} RemoveGroupMigrationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RemoveGroupMigrationRequest.decode = function 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.vmmigration.v1.RemoveGroupMigrationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.group = reader.string(); + break; + } + case 2: { + message.migratingVm = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RemoveGroupMigrationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmmigration.v1.RemoveGroupMigrationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmmigration.v1.RemoveGroupMigrationRequest} RemoveGroupMigrationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RemoveGroupMigrationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RemoveGroupMigrationRequest message. + * @function verify + * @memberof google.cloud.vmmigration.v1.RemoveGroupMigrationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RemoveGroupMigrationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.group != null && message.hasOwnProperty("group")) + if (!$util.isString(message.group)) + return "group: string expected"; + if (message.migratingVm != null && message.hasOwnProperty("migratingVm")) + if (!$util.isString(message.migratingVm)) + return "migratingVm: string expected"; + return null; + }; + + /** + * Creates a RemoveGroupMigrationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmmigration.v1.RemoveGroupMigrationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmmigration.v1.RemoveGroupMigrationRequest} RemoveGroupMigrationRequest + */ + RemoveGroupMigrationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmmigration.v1.RemoveGroupMigrationRequest) + return object; + var message = new $root.google.cloud.vmmigration.v1.RemoveGroupMigrationRequest(); + if (object.group != null) + message.group = String(object.group); + if (object.migratingVm != null) + message.migratingVm = String(object.migratingVm); + return message; + }; + + /** + * Creates a plain object from a RemoveGroupMigrationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmmigration.v1.RemoveGroupMigrationRequest + * @static + * @param {google.cloud.vmmigration.v1.RemoveGroupMigrationRequest} message RemoveGroupMigrationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RemoveGroupMigrationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.group = ""; + object.migratingVm = ""; + } + if (message.group != null && message.hasOwnProperty("group")) + object.group = message.group; + if (message.migratingVm != null && message.hasOwnProperty("migratingVm")) + object.migratingVm = message.migratingVm; + return object; + }; + + /** + * Converts this RemoveGroupMigrationRequest to JSON. + * @function toJSON + * @memberof google.cloud.vmmigration.v1.RemoveGroupMigrationRequest + * @instance + * @returns {Object.} JSON object + */ + RemoveGroupMigrationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RemoveGroupMigrationRequest + * @function getTypeUrl + * @memberof google.cloud.vmmigration.v1.RemoveGroupMigrationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RemoveGroupMigrationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmmigration.v1.RemoveGroupMigrationRequest"; + }; + + return RemoveGroupMigrationRequest; + })(); + + v1.RemoveGroupMigrationResponse = (function() { + + /** + * Properties of a RemoveGroupMigrationResponse. + * @memberof google.cloud.vmmigration.v1 + * @interface IRemoveGroupMigrationResponse + */ + + /** + * Constructs a new RemoveGroupMigrationResponse. + * @memberof google.cloud.vmmigration.v1 + * @classdesc Represents a RemoveGroupMigrationResponse. + * @implements IRemoveGroupMigrationResponse + * @constructor + * @param {google.cloud.vmmigration.v1.IRemoveGroupMigrationResponse=} [properties] Properties to set + */ + function RemoveGroupMigrationResponse(properties) { + if (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 RemoveGroupMigrationResponse instance using the specified properties. + * @function create + * @memberof google.cloud.vmmigration.v1.RemoveGroupMigrationResponse + * @static + * @param {google.cloud.vmmigration.v1.IRemoveGroupMigrationResponse=} [properties] Properties to set + * @returns {google.cloud.vmmigration.v1.RemoveGroupMigrationResponse} RemoveGroupMigrationResponse instance + */ + RemoveGroupMigrationResponse.create = function create(properties) { + return new RemoveGroupMigrationResponse(properties); + }; + + /** + * Encodes the specified RemoveGroupMigrationResponse message. Does not implicitly {@link google.cloud.vmmigration.v1.RemoveGroupMigrationResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmmigration.v1.RemoveGroupMigrationResponse + * @static + * @param {google.cloud.vmmigration.v1.IRemoveGroupMigrationResponse} message RemoveGroupMigrationResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RemoveGroupMigrationResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified RemoveGroupMigrationResponse message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.RemoveGroupMigrationResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmmigration.v1.RemoveGroupMigrationResponse + * @static + * @param {google.cloud.vmmigration.v1.IRemoveGroupMigrationResponse} message RemoveGroupMigrationResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RemoveGroupMigrationResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RemoveGroupMigrationResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmmigration.v1.RemoveGroupMigrationResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmmigration.v1.RemoveGroupMigrationResponse} RemoveGroupMigrationResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RemoveGroupMigrationResponse.decode = function 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.vmmigration.v1.RemoveGroupMigrationResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RemoveGroupMigrationResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmmigration.v1.RemoveGroupMigrationResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmmigration.v1.RemoveGroupMigrationResponse} RemoveGroupMigrationResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RemoveGroupMigrationResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RemoveGroupMigrationResponse message. + * @function verify + * @memberof google.cloud.vmmigration.v1.RemoveGroupMigrationResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RemoveGroupMigrationResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a RemoveGroupMigrationResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmmigration.v1.RemoveGroupMigrationResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmmigration.v1.RemoveGroupMigrationResponse} RemoveGroupMigrationResponse + */ + RemoveGroupMigrationResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmmigration.v1.RemoveGroupMigrationResponse) + return object; + return new $root.google.cloud.vmmigration.v1.RemoveGroupMigrationResponse(); + }; + + /** + * Creates a plain object from a RemoveGroupMigrationResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmmigration.v1.RemoveGroupMigrationResponse + * @static + * @param {google.cloud.vmmigration.v1.RemoveGroupMigrationResponse} message RemoveGroupMigrationResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RemoveGroupMigrationResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this RemoveGroupMigrationResponse to JSON. + * @function toJSON + * @memberof google.cloud.vmmigration.v1.RemoveGroupMigrationResponse + * @instance + * @returns {Object.} JSON object + */ + RemoveGroupMigrationResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RemoveGroupMigrationResponse + * @function getTypeUrl + * @memberof google.cloud.vmmigration.v1.RemoveGroupMigrationResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RemoveGroupMigrationResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmmigration.v1.RemoveGroupMigrationResponse"; + }; + + return RemoveGroupMigrationResponse; + })(); + + v1.CreateCutoverJobRequest = (function() { + + /** + * Properties of a CreateCutoverJobRequest. + * @memberof google.cloud.vmmigration.v1 + * @interface ICreateCutoverJobRequest + * @property {string|null} [parent] CreateCutoverJobRequest parent + * @property {string|null} [cutoverJobId] CreateCutoverJobRequest cutoverJobId + * @property {google.cloud.vmmigration.v1.ICutoverJob|null} [cutoverJob] CreateCutoverJobRequest cutoverJob + * @property {string|null} [requestId] CreateCutoverJobRequest requestId + */ + + /** + * Constructs a new CreateCutoverJobRequest. + * @memberof google.cloud.vmmigration.v1 + * @classdesc Represents a CreateCutoverJobRequest. + * @implements ICreateCutoverJobRequest + * @constructor + * @param {google.cloud.vmmigration.v1.ICreateCutoverJobRequest=} [properties] Properties to set + */ + function CreateCutoverJobRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateCutoverJobRequest parent. + * @member {string} parent + * @memberof google.cloud.vmmigration.v1.CreateCutoverJobRequest + * @instance + */ + CreateCutoverJobRequest.prototype.parent = ""; + + /** + * CreateCutoverJobRequest cutoverJobId. + * @member {string} cutoverJobId + * @memberof google.cloud.vmmigration.v1.CreateCutoverJobRequest + * @instance + */ + CreateCutoverJobRequest.prototype.cutoverJobId = ""; + + /** + * CreateCutoverJobRequest cutoverJob. + * @member {google.cloud.vmmigration.v1.ICutoverJob|null|undefined} cutoverJob + * @memberof google.cloud.vmmigration.v1.CreateCutoverJobRequest + * @instance + */ + CreateCutoverJobRequest.prototype.cutoverJob = null; + + /** + * CreateCutoverJobRequest requestId. + * @member {string} requestId + * @memberof google.cloud.vmmigration.v1.CreateCutoverJobRequest + * @instance + */ + CreateCutoverJobRequest.prototype.requestId = ""; + + /** + * Creates a new CreateCutoverJobRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vmmigration.v1.CreateCutoverJobRequest + * @static + * @param {google.cloud.vmmigration.v1.ICreateCutoverJobRequest=} [properties] Properties to set + * @returns {google.cloud.vmmigration.v1.CreateCutoverJobRequest} CreateCutoverJobRequest instance + */ + CreateCutoverJobRequest.create = function create(properties) { + return new CreateCutoverJobRequest(properties); + }; + + /** + * Encodes the specified CreateCutoverJobRequest message. Does not implicitly {@link google.cloud.vmmigration.v1.CreateCutoverJobRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmmigration.v1.CreateCutoverJobRequest + * @static + * @param {google.cloud.vmmigration.v1.ICreateCutoverJobRequest} message CreateCutoverJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateCutoverJobRequest.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.cutoverJobId != null && Object.hasOwnProperty.call(message, "cutoverJobId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.cutoverJobId); + if (message.cutoverJob != null && Object.hasOwnProperty.call(message, "cutoverJob")) + $root.google.cloud.vmmigration.v1.CutoverJob.encode(message.cutoverJob, 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 CreateCutoverJobRequest message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.CreateCutoverJobRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmmigration.v1.CreateCutoverJobRequest + * @static + * @param {google.cloud.vmmigration.v1.ICreateCutoverJobRequest} message CreateCutoverJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateCutoverJobRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateCutoverJobRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmmigration.v1.CreateCutoverJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmmigration.v1.CreateCutoverJobRequest} CreateCutoverJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateCutoverJobRequest.decode = function 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.vmmigration.v1.CreateCutoverJobRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.cutoverJobId = reader.string(); + break; + } + case 3: { + message.cutoverJob = $root.google.cloud.vmmigration.v1.CutoverJob.decode(reader, reader.uint32()); + break; + } + case 4: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateCutoverJobRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmmigration.v1.CreateCutoverJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmmigration.v1.CreateCutoverJobRequest} CreateCutoverJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateCutoverJobRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateCutoverJobRequest message. + * @function verify + * @memberof google.cloud.vmmigration.v1.CreateCutoverJobRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateCutoverJobRequest.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.cutoverJobId != null && message.hasOwnProperty("cutoverJobId")) + if (!$util.isString(message.cutoverJobId)) + return "cutoverJobId: string expected"; + if (message.cutoverJob != null && message.hasOwnProperty("cutoverJob")) { + var error = $root.google.cloud.vmmigration.v1.CutoverJob.verify(message.cutoverJob); + if (error) + return "cutoverJob." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a CreateCutoverJobRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmmigration.v1.CreateCutoverJobRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmmigration.v1.CreateCutoverJobRequest} CreateCutoverJobRequest + */ + CreateCutoverJobRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmmigration.v1.CreateCutoverJobRequest) + return object; + var message = new $root.google.cloud.vmmigration.v1.CreateCutoverJobRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.cutoverJobId != null) + message.cutoverJobId = String(object.cutoverJobId); + if (object.cutoverJob != null) { + if (typeof object.cutoverJob !== "object") + throw TypeError(".google.cloud.vmmigration.v1.CreateCutoverJobRequest.cutoverJob: object expected"); + message.cutoverJob = $root.google.cloud.vmmigration.v1.CutoverJob.fromObject(object.cutoverJob); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a CreateCutoverJobRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmmigration.v1.CreateCutoverJobRequest + * @static + * @param {google.cloud.vmmigration.v1.CreateCutoverJobRequest} message CreateCutoverJobRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateCutoverJobRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.cutoverJobId = ""; + object.cutoverJob = null; + object.requestId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.cutoverJobId != null && message.hasOwnProperty("cutoverJobId")) + object.cutoverJobId = message.cutoverJobId; + if (message.cutoverJob != null && message.hasOwnProperty("cutoverJob")) + object.cutoverJob = $root.google.cloud.vmmigration.v1.CutoverJob.toObject(message.cutoverJob, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this CreateCutoverJobRequest to JSON. + * @function toJSON + * @memberof google.cloud.vmmigration.v1.CreateCutoverJobRequest + * @instance + * @returns {Object.} JSON object + */ + CreateCutoverJobRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateCutoverJobRequest + * @function getTypeUrl + * @memberof google.cloud.vmmigration.v1.CreateCutoverJobRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateCutoverJobRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmmigration.v1.CreateCutoverJobRequest"; + }; + + return CreateCutoverJobRequest; + })(); + + v1.CancelCutoverJobRequest = (function() { + + /** + * Properties of a CancelCutoverJobRequest. + * @memberof google.cloud.vmmigration.v1 + * @interface ICancelCutoverJobRequest + * @property {string|null} [name] CancelCutoverJobRequest name + */ + + /** + * Constructs a new CancelCutoverJobRequest. + * @memberof google.cloud.vmmigration.v1 + * @classdesc Represents a CancelCutoverJobRequest. + * @implements ICancelCutoverJobRequest + * @constructor + * @param {google.cloud.vmmigration.v1.ICancelCutoverJobRequest=} [properties] Properties to set + */ + function CancelCutoverJobRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CancelCutoverJobRequest name. + * @member {string} name + * @memberof google.cloud.vmmigration.v1.CancelCutoverJobRequest + * @instance + */ + CancelCutoverJobRequest.prototype.name = ""; + + /** + * Creates a new CancelCutoverJobRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vmmigration.v1.CancelCutoverJobRequest + * @static + * @param {google.cloud.vmmigration.v1.ICancelCutoverJobRequest=} [properties] Properties to set + * @returns {google.cloud.vmmigration.v1.CancelCutoverJobRequest} CancelCutoverJobRequest instance + */ + CancelCutoverJobRequest.create = function create(properties) { + return new CancelCutoverJobRequest(properties); + }; + + /** + * Encodes the specified CancelCutoverJobRequest message. Does not implicitly {@link google.cloud.vmmigration.v1.CancelCutoverJobRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmmigration.v1.CancelCutoverJobRequest + * @static + * @param {google.cloud.vmmigration.v1.ICancelCutoverJobRequest} message CancelCutoverJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CancelCutoverJobRequest.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 CancelCutoverJobRequest message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.CancelCutoverJobRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmmigration.v1.CancelCutoverJobRequest + * @static + * @param {google.cloud.vmmigration.v1.ICancelCutoverJobRequest} message CancelCutoverJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CancelCutoverJobRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CancelCutoverJobRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmmigration.v1.CancelCutoverJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmmigration.v1.CancelCutoverJobRequest} CancelCutoverJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CancelCutoverJobRequest.decode = function 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.vmmigration.v1.CancelCutoverJobRequest(); + 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 CancelCutoverJobRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmmigration.v1.CancelCutoverJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmmigration.v1.CancelCutoverJobRequest} CancelCutoverJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CancelCutoverJobRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CancelCutoverJobRequest message. + * @function verify + * @memberof google.cloud.vmmigration.v1.CancelCutoverJobRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CancelCutoverJobRequest.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 CancelCutoverJobRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmmigration.v1.CancelCutoverJobRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmmigration.v1.CancelCutoverJobRequest} CancelCutoverJobRequest + */ + CancelCutoverJobRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmmigration.v1.CancelCutoverJobRequest) + return object; + var message = new $root.google.cloud.vmmigration.v1.CancelCutoverJobRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a CancelCutoverJobRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmmigration.v1.CancelCutoverJobRequest + * @static + * @param {google.cloud.vmmigration.v1.CancelCutoverJobRequest} message CancelCutoverJobRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CancelCutoverJobRequest.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 CancelCutoverJobRequest to JSON. + * @function toJSON + * @memberof google.cloud.vmmigration.v1.CancelCutoverJobRequest + * @instance + * @returns {Object.} JSON object + */ + CancelCutoverJobRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CancelCutoverJobRequest + * @function getTypeUrl + * @memberof google.cloud.vmmigration.v1.CancelCutoverJobRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CancelCutoverJobRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmmigration.v1.CancelCutoverJobRequest"; + }; + + return CancelCutoverJobRequest; + })(); + + v1.CancelCutoverJobResponse = (function() { + + /** + * Properties of a CancelCutoverJobResponse. + * @memberof google.cloud.vmmigration.v1 + * @interface ICancelCutoverJobResponse + */ + + /** + * Constructs a new CancelCutoverJobResponse. + * @memberof google.cloud.vmmigration.v1 + * @classdesc Represents a CancelCutoverJobResponse. + * @implements ICancelCutoverJobResponse + * @constructor + * @param {google.cloud.vmmigration.v1.ICancelCutoverJobResponse=} [properties] Properties to set + */ + function CancelCutoverJobResponse(properties) { + if (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 CancelCutoverJobResponse instance using the specified properties. + * @function create + * @memberof google.cloud.vmmigration.v1.CancelCutoverJobResponse + * @static + * @param {google.cloud.vmmigration.v1.ICancelCutoverJobResponse=} [properties] Properties to set + * @returns {google.cloud.vmmigration.v1.CancelCutoverJobResponse} CancelCutoverJobResponse instance + */ + CancelCutoverJobResponse.create = function create(properties) { + return new CancelCutoverJobResponse(properties); + }; + + /** + * Encodes the specified CancelCutoverJobResponse message. Does not implicitly {@link google.cloud.vmmigration.v1.CancelCutoverJobResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmmigration.v1.CancelCutoverJobResponse + * @static + * @param {google.cloud.vmmigration.v1.ICancelCutoverJobResponse} message CancelCutoverJobResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CancelCutoverJobResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified CancelCutoverJobResponse message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.CancelCutoverJobResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmmigration.v1.CancelCutoverJobResponse + * @static + * @param {google.cloud.vmmigration.v1.ICancelCutoverJobResponse} message CancelCutoverJobResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CancelCutoverJobResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CancelCutoverJobResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmmigration.v1.CancelCutoverJobResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmmigration.v1.CancelCutoverJobResponse} CancelCutoverJobResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CancelCutoverJobResponse.decode = function 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.vmmigration.v1.CancelCutoverJobResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CancelCutoverJobResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmmigration.v1.CancelCutoverJobResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmmigration.v1.CancelCutoverJobResponse} CancelCutoverJobResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CancelCutoverJobResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CancelCutoverJobResponse message. + * @function verify + * @memberof google.cloud.vmmigration.v1.CancelCutoverJobResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CancelCutoverJobResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a CancelCutoverJobResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmmigration.v1.CancelCutoverJobResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmmigration.v1.CancelCutoverJobResponse} CancelCutoverJobResponse + */ + CancelCutoverJobResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmmigration.v1.CancelCutoverJobResponse) + return object; + return new $root.google.cloud.vmmigration.v1.CancelCutoverJobResponse(); + }; + + /** + * Creates a plain object from a CancelCutoverJobResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmmigration.v1.CancelCutoverJobResponse + * @static + * @param {google.cloud.vmmigration.v1.CancelCutoverJobResponse} message CancelCutoverJobResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CancelCutoverJobResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this CancelCutoverJobResponse to JSON. + * @function toJSON + * @memberof google.cloud.vmmigration.v1.CancelCutoverJobResponse + * @instance + * @returns {Object.} JSON object + */ + CancelCutoverJobResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CancelCutoverJobResponse + * @function getTypeUrl + * @memberof google.cloud.vmmigration.v1.CancelCutoverJobResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CancelCutoverJobResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmmigration.v1.CancelCutoverJobResponse"; + }; + + return CancelCutoverJobResponse; + })(); + + v1.ListCutoverJobsRequest = (function() { + + /** + * Properties of a ListCutoverJobsRequest. + * @memberof google.cloud.vmmigration.v1 + * @interface IListCutoverJobsRequest + * @property {string|null} [parent] ListCutoverJobsRequest parent + * @property {number|null} [pageSize] ListCutoverJobsRequest pageSize + * @property {string|null} [pageToken] ListCutoverJobsRequest pageToken + * @property {string|null} [filter] ListCutoverJobsRequest filter + * @property {string|null} [orderBy] ListCutoverJobsRequest orderBy + */ + + /** + * Constructs a new ListCutoverJobsRequest. + * @memberof google.cloud.vmmigration.v1 + * @classdesc Represents a ListCutoverJobsRequest. + * @implements IListCutoverJobsRequest + * @constructor + * @param {google.cloud.vmmigration.v1.IListCutoverJobsRequest=} [properties] Properties to set + */ + function ListCutoverJobsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListCutoverJobsRequest parent. + * @member {string} parent + * @memberof google.cloud.vmmigration.v1.ListCutoverJobsRequest + * @instance + */ + ListCutoverJobsRequest.prototype.parent = ""; + + /** + * ListCutoverJobsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.vmmigration.v1.ListCutoverJobsRequest + * @instance + */ + ListCutoverJobsRequest.prototype.pageSize = 0; + + /** + * ListCutoverJobsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.vmmigration.v1.ListCutoverJobsRequest + * @instance + */ + ListCutoverJobsRequest.prototype.pageToken = ""; + + /** + * ListCutoverJobsRequest filter. + * @member {string} filter + * @memberof google.cloud.vmmigration.v1.ListCutoverJobsRequest + * @instance + */ + ListCutoverJobsRequest.prototype.filter = ""; + + /** + * ListCutoverJobsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.vmmigration.v1.ListCutoverJobsRequest + * @instance + */ + ListCutoverJobsRequest.prototype.orderBy = ""; + + /** + * Creates a new ListCutoverJobsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vmmigration.v1.ListCutoverJobsRequest + * @static + * @param {google.cloud.vmmigration.v1.IListCutoverJobsRequest=} [properties] Properties to set + * @returns {google.cloud.vmmigration.v1.ListCutoverJobsRequest} ListCutoverJobsRequest instance + */ + ListCutoverJobsRequest.create = function create(properties) { + return new ListCutoverJobsRequest(properties); + }; + + /** + * Encodes the specified ListCutoverJobsRequest message. Does not implicitly {@link google.cloud.vmmigration.v1.ListCutoverJobsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmmigration.v1.ListCutoverJobsRequest + * @static + * @param {google.cloud.vmmigration.v1.IListCutoverJobsRequest} message ListCutoverJobsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCutoverJobsRequest.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 ListCutoverJobsRequest message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.ListCutoverJobsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmmigration.v1.ListCutoverJobsRequest + * @static + * @param {google.cloud.vmmigration.v1.IListCutoverJobsRequest} message ListCutoverJobsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCutoverJobsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListCutoverJobsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmmigration.v1.ListCutoverJobsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmmigration.v1.ListCutoverJobsRequest} ListCutoverJobsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCutoverJobsRequest.decode = function 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.vmmigration.v1.ListCutoverJobsRequest(); + 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 ListCutoverJobsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmmigration.v1.ListCutoverJobsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmmigration.v1.ListCutoverJobsRequest} ListCutoverJobsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCutoverJobsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListCutoverJobsRequest message. + * @function verify + * @memberof google.cloud.vmmigration.v1.ListCutoverJobsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListCutoverJobsRequest.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 ListCutoverJobsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmmigration.v1.ListCutoverJobsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmmigration.v1.ListCutoverJobsRequest} ListCutoverJobsRequest + */ + ListCutoverJobsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmmigration.v1.ListCutoverJobsRequest) + return object; + var message = new $root.google.cloud.vmmigration.v1.ListCutoverJobsRequest(); + 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 ListCutoverJobsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmmigration.v1.ListCutoverJobsRequest + * @static + * @param {google.cloud.vmmigration.v1.ListCutoverJobsRequest} message ListCutoverJobsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListCutoverJobsRequest.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 ListCutoverJobsRequest to JSON. + * @function toJSON + * @memberof google.cloud.vmmigration.v1.ListCutoverJobsRequest + * @instance + * @returns {Object.} JSON object + */ + ListCutoverJobsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListCutoverJobsRequest + * @function getTypeUrl + * @memberof google.cloud.vmmigration.v1.ListCutoverJobsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListCutoverJobsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmmigration.v1.ListCutoverJobsRequest"; + }; + + return ListCutoverJobsRequest; + })(); + + v1.ListCutoverJobsResponse = (function() { + + /** + * Properties of a ListCutoverJobsResponse. + * @memberof google.cloud.vmmigration.v1 + * @interface IListCutoverJobsResponse + * @property {Array.|null} [cutoverJobs] ListCutoverJobsResponse cutoverJobs + * @property {string|null} [nextPageToken] ListCutoverJobsResponse nextPageToken + * @property {Array.|null} [unreachable] ListCutoverJobsResponse unreachable + */ + + /** + * Constructs a new ListCutoverJobsResponse. + * @memberof google.cloud.vmmigration.v1 + * @classdesc Represents a ListCutoverJobsResponse. + * @implements IListCutoverJobsResponse + * @constructor + * @param {google.cloud.vmmigration.v1.IListCutoverJobsResponse=} [properties] Properties to set + */ + function ListCutoverJobsResponse(properties) { + this.cutoverJobs = []; + 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]]; + } + + /** + * ListCutoverJobsResponse cutoverJobs. + * @member {Array.} cutoverJobs + * @memberof google.cloud.vmmigration.v1.ListCutoverJobsResponse + * @instance + */ + ListCutoverJobsResponse.prototype.cutoverJobs = $util.emptyArray; + + /** + * ListCutoverJobsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.vmmigration.v1.ListCutoverJobsResponse + * @instance + */ + ListCutoverJobsResponse.prototype.nextPageToken = ""; + + /** + * ListCutoverJobsResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.vmmigration.v1.ListCutoverJobsResponse + * @instance + */ + ListCutoverJobsResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListCutoverJobsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.vmmigration.v1.ListCutoverJobsResponse + * @static + * @param {google.cloud.vmmigration.v1.IListCutoverJobsResponse=} [properties] Properties to set + * @returns {google.cloud.vmmigration.v1.ListCutoverJobsResponse} ListCutoverJobsResponse instance + */ + ListCutoverJobsResponse.create = function create(properties) { + return new ListCutoverJobsResponse(properties); + }; + + /** + * Encodes the specified ListCutoverJobsResponse message. Does not implicitly {@link google.cloud.vmmigration.v1.ListCutoverJobsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmmigration.v1.ListCutoverJobsResponse + * @static + * @param {google.cloud.vmmigration.v1.IListCutoverJobsResponse} message ListCutoverJobsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCutoverJobsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.cutoverJobs != null && message.cutoverJobs.length) + for (var i = 0; i < message.cutoverJobs.length; ++i) + $root.google.cloud.vmmigration.v1.CutoverJob.encode(message.cutoverJobs[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 ListCutoverJobsResponse message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.ListCutoverJobsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmmigration.v1.ListCutoverJobsResponse + * @static + * @param {google.cloud.vmmigration.v1.IListCutoverJobsResponse} message ListCutoverJobsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCutoverJobsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListCutoverJobsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmmigration.v1.ListCutoverJobsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmmigration.v1.ListCutoverJobsResponse} ListCutoverJobsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCutoverJobsResponse.decode = function 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.vmmigration.v1.ListCutoverJobsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.cutoverJobs && message.cutoverJobs.length)) + message.cutoverJobs = []; + message.cutoverJobs.push($root.google.cloud.vmmigration.v1.CutoverJob.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 ListCutoverJobsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmmigration.v1.ListCutoverJobsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmmigration.v1.ListCutoverJobsResponse} ListCutoverJobsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCutoverJobsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListCutoverJobsResponse message. + * @function verify + * @memberof google.cloud.vmmigration.v1.ListCutoverJobsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListCutoverJobsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.cutoverJobs != null && message.hasOwnProperty("cutoverJobs")) { + if (!Array.isArray(message.cutoverJobs)) + return "cutoverJobs: array expected"; + for (var i = 0; i < message.cutoverJobs.length; ++i) { + var error = $root.google.cloud.vmmigration.v1.CutoverJob.verify(message.cutoverJobs[i]); + if (error) + return "cutoverJobs." + 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 ListCutoverJobsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmmigration.v1.ListCutoverJobsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmmigration.v1.ListCutoverJobsResponse} ListCutoverJobsResponse + */ + ListCutoverJobsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmmigration.v1.ListCutoverJobsResponse) + return object; + var message = new $root.google.cloud.vmmigration.v1.ListCutoverJobsResponse(); + if (object.cutoverJobs) { + if (!Array.isArray(object.cutoverJobs)) + throw TypeError(".google.cloud.vmmigration.v1.ListCutoverJobsResponse.cutoverJobs: array expected"); + message.cutoverJobs = []; + for (var i = 0; i < object.cutoverJobs.length; ++i) { + if (typeof object.cutoverJobs[i] !== "object") + throw TypeError(".google.cloud.vmmigration.v1.ListCutoverJobsResponse.cutoverJobs: object expected"); + message.cutoverJobs[i] = $root.google.cloud.vmmigration.v1.CutoverJob.fromObject(object.cutoverJobs[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.vmmigration.v1.ListCutoverJobsResponse.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 ListCutoverJobsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmmigration.v1.ListCutoverJobsResponse + * @static + * @param {google.cloud.vmmigration.v1.ListCutoverJobsResponse} message ListCutoverJobsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListCutoverJobsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.cutoverJobs = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.cutoverJobs && message.cutoverJobs.length) { + object.cutoverJobs = []; + for (var j = 0; j < message.cutoverJobs.length; ++j) + object.cutoverJobs[j] = $root.google.cloud.vmmigration.v1.CutoverJob.toObject(message.cutoverJobs[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 ListCutoverJobsResponse to JSON. + * @function toJSON + * @memberof google.cloud.vmmigration.v1.ListCutoverJobsResponse + * @instance + * @returns {Object.} JSON object + */ + ListCutoverJobsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListCutoverJobsResponse + * @function getTypeUrl + * @memberof google.cloud.vmmigration.v1.ListCutoverJobsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListCutoverJobsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmmigration.v1.ListCutoverJobsResponse"; + }; + + return ListCutoverJobsResponse; + })(); + + v1.GetCutoverJobRequest = (function() { + + /** + * Properties of a GetCutoverJobRequest. + * @memberof google.cloud.vmmigration.v1 + * @interface IGetCutoverJobRequest + * @property {string|null} [name] GetCutoverJobRequest name + */ + + /** + * Constructs a new GetCutoverJobRequest. + * @memberof google.cloud.vmmigration.v1 + * @classdesc Represents a GetCutoverJobRequest. + * @implements IGetCutoverJobRequest + * @constructor + * @param {google.cloud.vmmigration.v1.IGetCutoverJobRequest=} [properties] Properties to set + */ + function GetCutoverJobRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetCutoverJobRequest name. + * @member {string} name + * @memberof google.cloud.vmmigration.v1.GetCutoverJobRequest + * @instance + */ + GetCutoverJobRequest.prototype.name = ""; + + /** + * Creates a new GetCutoverJobRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vmmigration.v1.GetCutoverJobRequest + * @static + * @param {google.cloud.vmmigration.v1.IGetCutoverJobRequest=} [properties] Properties to set + * @returns {google.cloud.vmmigration.v1.GetCutoverJobRequest} GetCutoverJobRequest instance + */ + GetCutoverJobRequest.create = function create(properties) { + return new GetCutoverJobRequest(properties); + }; + + /** + * Encodes the specified GetCutoverJobRequest message. Does not implicitly {@link google.cloud.vmmigration.v1.GetCutoverJobRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmmigration.v1.GetCutoverJobRequest + * @static + * @param {google.cloud.vmmigration.v1.IGetCutoverJobRequest} message GetCutoverJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetCutoverJobRequest.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 GetCutoverJobRequest message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.GetCutoverJobRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmmigration.v1.GetCutoverJobRequest + * @static + * @param {google.cloud.vmmigration.v1.IGetCutoverJobRequest} message GetCutoverJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetCutoverJobRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetCutoverJobRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmmigration.v1.GetCutoverJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmmigration.v1.GetCutoverJobRequest} GetCutoverJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetCutoverJobRequest.decode = function 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.vmmigration.v1.GetCutoverJobRequest(); + 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 GetCutoverJobRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmmigration.v1.GetCutoverJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmmigration.v1.GetCutoverJobRequest} GetCutoverJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetCutoverJobRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetCutoverJobRequest message. + * @function verify + * @memberof google.cloud.vmmigration.v1.GetCutoverJobRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetCutoverJobRequest.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 GetCutoverJobRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmmigration.v1.GetCutoverJobRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmmigration.v1.GetCutoverJobRequest} GetCutoverJobRequest + */ + GetCutoverJobRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmmigration.v1.GetCutoverJobRequest) + return object; + var message = new $root.google.cloud.vmmigration.v1.GetCutoverJobRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetCutoverJobRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmmigration.v1.GetCutoverJobRequest + * @static + * @param {google.cloud.vmmigration.v1.GetCutoverJobRequest} message GetCutoverJobRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetCutoverJobRequest.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 GetCutoverJobRequest to JSON. + * @function toJSON + * @memberof google.cloud.vmmigration.v1.GetCutoverJobRequest + * @instance + * @returns {Object.} JSON object + */ + GetCutoverJobRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetCutoverJobRequest + * @function getTypeUrl + * @memberof google.cloud.vmmigration.v1.GetCutoverJobRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetCutoverJobRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmmigration.v1.GetCutoverJobRequest"; + }; + + return GetCutoverJobRequest; + })(); + + v1.OperationMetadata = (function() { + + /** + * Properties of an OperationMetadata. + * @memberof google.cloud.vmmigration.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.vmmigration.v1 + * @classdesc Represents an OperationMetadata. + * @implements IOperationMetadata + * @constructor + * @param {google.cloud.vmmigration.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.vmmigration.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.createTime = null; + + /** + * OperationMetadata endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.vmmigration.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.endTime = null; + + /** + * OperationMetadata target. + * @member {string} target + * @memberof google.cloud.vmmigration.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.target = ""; + + /** + * OperationMetadata verb. + * @member {string} verb + * @memberof google.cloud.vmmigration.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.verb = ""; + + /** + * OperationMetadata statusMessage. + * @member {string} statusMessage + * @memberof google.cloud.vmmigration.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.statusMessage = ""; + + /** + * OperationMetadata requestedCancellation. + * @member {boolean} requestedCancellation + * @memberof google.cloud.vmmigration.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.requestedCancellation = false; + + /** + * OperationMetadata apiVersion. + * @member {string} apiVersion + * @memberof google.cloud.vmmigration.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.apiVersion = ""; + + /** + * Creates a new OperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.vmmigration.v1.OperationMetadata + * @static + * @param {google.cloud.vmmigration.v1.IOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.vmmigration.v1.OperationMetadata} OperationMetadata instance + */ + OperationMetadata.create = function create(properties) { + return new OperationMetadata(properties); + }; + + /** + * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.vmmigration.v1.OperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmmigration.v1.OperationMetadata + * @static + * @param {google.cloud.vmmigration.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.vmmigration.v1.OperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmmigration.v1.OperationMetadata + * @static + * @param {google.cloud.vmmigration.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.vmmigration.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.vmmigration.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.vmmigration.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.vmmigration.v1.OperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmmigration.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.vmmigration.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.vmmigration.v1.OperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmmigration.v1.OperationMetadata} OperationMetadata + */ + OperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmmigration.v1.OperationMetadata) + return object; + var message = new $root.google.cloud.vmmigration.v1.OperationMetadata(); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.vmmigration.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.vmmigration.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.vmmigration.v1.OperationMetadata + * @static + * @param {google.cloud.vmmigration.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.vmmigration.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.vmmigration.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.vmmigration.v1.OperationMetadata"; + }; + + return OperationMetadata; + })(); + + v1.MigrationError = (function() { + + /** + * Properties of a MigrationError. + * @memberof google.cloud.vmmigration.v1 + * @interface IMigrationError + * @property {google.cloud.vmmigration.v1.MigrationError.ErrorCode|null} [code] MigrationError code + * @property {google.rpc.ILocalizedMessage|null} [errorMessage] MigrationError errorMessage + * @property {google.rpc.ILocalizedMessage|null} [actionItem] MigrationError actionItem + * @property {Array.|null} [helpLinks] MigrationError helpLinks + * @property {google.protobuf.ITimestamp|null} [errorTime] MigrationError errorTime + */ + + /** + * Constructs a new MigrationError. + * @memberof google.cloud.vmmigration.v1 + * @classdesc Represents a MigrationError. + * @implements IMigrationError + * @constructor + * @param {google.cloud.vmmigration.v1.IMigrationError=} [properties] Properties to set + */ + function MigrationError(properties) { + this.helpLinks = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MigrationError code. + * @member {google.cloud.vmmigration.v1.MigrationError.ErrorCode} code + * @memberof google.cloud.vmmigration.v1.MigrationError + * @instance + */ + MigrationError.prototype.code = 0; + + /** + * MigrationError errorMessage. + * @member {google.rpc.ILocalizedMessage|null|undefined} errorMessage + * @memberof google.cloud.vmmigration.v1.MigrationError + * @instance + */ + MigrationError.prototype.errorMessage = null; + + /** + * MigrationError actionItem. + * @member {google.rpc.ILocalizedMessage|null|undefined} actionItem + * @memberof google.cloud.vmmigration.v1.MigrationError + * @instance + */ + MigrationError.prototype.actionItem = null; + + /** + * MigrationError helpLinks. + * @member {Array.} helpLinks + * @memberof google.cloud.vmmigration.v1.MigrationError + * @instance + */ + MigrationError.prototype.helpLinks = $util.emptyArray; + + /** + * MigrationError errorTime. + * @member {google.protobuf.ITimestamp|null|undefined} errorTime + * @memberof google.cloud.vmmigration.v1.MigrationError + * @instance + */ + MigrationError.prototype.errorTime = null; + + /** + * Creates a new MigrationError instance using the specified properties. + * @function create + * @memberof google.cloud.vmmigration.v1.MigrationError + * @static + * @param {google.cloud.vmmigration.v1.IMigrationError=} [properties] Properties to set + * @returns {google.cloud.vmmigration.v1.MigrationError} MigrationError instance + */ + MigrationError.create = function create(properties) { + return new MigrationError(properties); + }; + + /** + * Encodes the specified MigrationError message. Does not implicitly {@link google.cloud.vmmigration.v1.MigrationError.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmmigration.v1.MigrationError + * @static + * @param {google.cloud.vmmigration.v1.IMigrationError} message MigrationError message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MigrationError.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.errorMessage != null && Object.hasOwnProperty.call(message, "errorMessage")) + $root.google.rpc.LocalizedMessage.encode(message.errorMessage, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.actionItem != null && Object.hasOwnProperty.call(message, "actionItem")) + $root.google.rpc.LocalizedMessage.encode(message.actionItem, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.helpLinks != null && message.helpLinks.length) + for (var i = 0; i < message.helpLinks.length; ++i) + $root.google.rpc.Help.Link.encode(message.helpLinks[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.errorTime != null && Object.hasOwnProperty.call(message, "errorTime")) + $root.google.protobuf.Timestamp.encode(message.errorTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MigrationError message, length delimited. Does not implicitly {@link google.cloud.vmmigration.v1.MigrationError.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmmigration.v1.MigrationError + * @static + * @param {google.cloud.vmmigration.v1.IMigrationError} message MigrationError message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MigrationError.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MigrationError message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmmigration.v1.MigrationError + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmmigration.v1.MigrationError} MigrationError + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MigrationError.decode = function 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.vmmigration.v1.MigrationError(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.code = reader.int32(); + break; + } + case 2: { + message.errorMessage = $root.google.rpc.LocalizedMessage.decode(reader, reader.uint32()); + break; + } + case 3: { + message.actionItem = $root.google.rpc.LocalizedMessage.decode(reader, reader.uint32()); + break; + } + case 4: { + if (!(message.helpLinks && message.helpLinks.length)) + message.helpLinks = []; + message.helpLinks.push($root.google.rpc.Help.Link.decode(reader, reader.uint32())); + break; + } + case 5: { + message.errorTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MigrationError message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmmigration.v1.MigrationError + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmmigration.v1.MigrationError} MigrationError + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MigrationError.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MigrationError message. + * @function verify + * @memberof google.cloud.vmmigration.v1.MigrationError + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MigrationError.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.code != null && message.hasOwnProperty("code")) + switch (message.code) { + default: + return "code: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + break; + } + if (message.errorMessage != null && message.hasOwnProperty("errorMessage")) { + var error = $root.google.rpc.LocalizedMessage.verify(message.errorMessage); + if (error) + return "errorMessage." + error; + } + if (message.actionItem != null && message.hasOwnProperty("actionItem")) { + var error = $root.google.rpc.LocalizedMessage.verify(message.actionItem); + if (error) + return "actionItem." + error; + } + if (message.helpLinks != null && message.hasOwnProperty("helpLinks")) { + if (!Array.isArray(message.helpLinks)) + return "helpLinks: array expected"; + for (var i = 0; i < message.helpLinks.length; ++i) { + var error = $root.google.rpc.Help.Link.verify(message.helpLinks[i]); + if (error) + return "helpLinks." + error; + } + } + if (message.errorTime != null && message.hasOwnProperty("errorTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.errorTime); + if (error) + return "errorTime." + error; + } + return null; + }; + + /** + * Creates a MigrationError message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmmigration.v1.MigrationError + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmmigration.v1.MigrationError} MigrationError + */ + MigrationError.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmmigration.v1.MigrationError) + return object; + var message = new $root.google.cloud.vmmigration.v1.MigrationError(); + switch (object.code) { + default: + if (typeof object.code === "number") { + message.code = object.code; + break; + } + break; + case "ERROR_CODE_UNSPECIFIED": + case 0: + message.code = 0; + break; + case "UNKNOWN_ERROR": + case 1: + message.code = 1; + break; + case "SOURCE_VALIDATION_ERROR": + case 2: + message.code = 2; + break; + case "SOURCE_REPLICATION_ERROR": + case 3: + message.code = 3; + break; + case "TARGET_REPLICATION_ERROR": + case 4: + message.code = 4; + break; + case "OS_ADAPTATION_ERROR": + case 5: + message.code = 5; + break; + case "CLONE_ERROR": + case 6: + message.code = 6; + break; + case "CUTOVER_ERROR": + case 7: + message.code = 7; + break; + case "UTILIZATION_REPORT_ERROR": + case 8: + message.code = 8; + break; + case "APPLIANCE_UPGRADE_ERROR": + case 9: + message.code = 9; + break; + } + if (object.errorMessage != null) { + if (typeof object.errorMessage !== "object") + throw TypeError(".google.cloud.vmmigration.v1.MigrationError.errorMessage: object expected"); + message.errorMessage = $root.google.rpc.LocalizedMessage.fromObject(object.errorMessage); + } + if (object.actionItem != null) { + if (typeof object.actionItem !== "object") + throw TypeError(".google.cloud.vmmigration.v1.MigrationError.actionItem: object expected"); + message.actionItem = $root.google.rpc.LocalizedMessage.fromObject(object.actionItem); + } + if (object.helpLinks) { + if (!Array.isArray(object.helpLinks)) + throw TypeError(".google.cloud.vmmigration.v1.MigrationError.helpLinks: array expected"); + message.helpLinks = []; + for (var i = 0; i < object.helpLinks.length; ++i) { + if (typeof object.helpLinks[i] !== "object") + throw TypeError(".google.cloud.vmmigration.v1.MigrationError.helpLinks: object expected"); + message.helpLinks[i] = $root.google.rpc.Help.Link.fromObject(object.helpLinks[i]); + } + } + if (object.errorTime != null) { + if (typeof object.errorTime !== "object") + throw TypeError(".google.cloud.vmmigration.v1.MigrationError.errorTime: object expected"); + message.errorTime = $root.google.protobuf.Timestamp.fromObject(object.errorTime); + } + return message; + }; + + /** + * Creates a plain object from a MigrationError message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmmigration.v1.MigrationError + * @static + * @param {google.cloud.vmmigration.v1.MigrationError} message MigrationError + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MigrationError.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.helpLinks = []; + if (options.defaults) { + object.code = options.enums === String ? "ERROR_CODE_UNSPECIFIED" : 0; + object.errorMessage = null; + object.actionItem = null; + object.errorTime = null; + } + if (message.code != null && message.hasOwnProperty("code")) + object.code = options.enums === String ? $root.google.cloud.vmmigration.v1.MigrationError.ErrorCode[message.code] === undefined ? message.code : $root.google.cloud.vmmigration.v1.MigrationError.ErrorCode[message.code] : message.code; + if (message.errorMessage != null && message.hasOwnProperty("errorMessage")) + object.errorMessage = $root.google.rpc.LocalizedMessage.toObject(message.errorMessage, options); + if (message.actionItem != null && message.hasOwnProperty("actionItem")) + object.actionItem = $root.google.rpc.LocalizedMessage.toObject(message.actionItem, options); + if (message.helpLinks && message.helpLinks.length) { + object.helpLinks = []; + for (var j = 0; j < message.helpLinks.length; ++j) + object.helpLinks[j] = $root.google.rpc.Help.Link.toObject(message.helpLinks[j], options); + } + if (message.errorTime != null && message.hasOwnProperty("errorTime")) + object.errorTime = $root.google.protobuf.Timestamp.toObject(message.errorTime, options); + return object; + }; + + /** + * Converts this MigrationError to JSON. + * @function toJSON + * @memberof google.cloud.vmmigration.v1.MigrationError + * @instance + * @returns {Object.} JSON object + */ + MigrationError.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MigrationError + * @function getTypeUrl + * @memberof google.cloud.vmmigration.v1.MigrationError + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MigrationError.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmmigration.v1.MigrationError"; + }; + + /** + * ErrorCode enum. + * @name google.cloud.vmmigration.v1.MigrationError.ErrorCode + * @enum {number} + * @property {number} ERROR_CODE_UNSPECIFIED=0 ERROR_CODE_UNSPECIFIED value + * @property {number} UNKNOWN_ERROR=1 UNKNOWN_ERROR value + * @property {number} SOURCE_VALIDATION_ERROR=2 SOURCE_VALIDATION_ERROR value + * @property {number} SOURCE_REPLICATION_ERROR=3 SOURCE_REPLICATION_ERROR value + * @property {number} TARGET_REPLICATION_ERROR=4 TARGET_REPLICATION_ERROR value + * @property {number} OS_ADAPTATION_ERROR=5 OS_ADAPTATION_ERROR value + * @property {number} CLONE_ERROR=6 CLONE_ERROR value + * @property {number} CUTOVER_ERROR=7 CUTOVER_ERROR value + * @property {number} UTILIZATION_REPORT_ERROR=8 UTILIZATION_REPORT_ERROR value + * @property {number} APPLIANCE_UPGRADE_ERROR=9 APPLIANCE_UPGRADE_ERROR value + */ + MigrationError.ErrorCode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ERROR_CODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "UNKNOWN_ERROR"] = 1; + values[valuesById[2] = "SOURCE_VALIDATION_ERROR"] = 2; + values[valuesById[3] = "SOURCE_REPLICATION_ERROR"] = 3; + values[valuesById[4] = "TARGET_REPLICATION_ERROR"] = 4; + values[valuesById[5] = "OS_ADAPTATION_ERROR"] = 5; + values[valuesById[6] = "CLONE_ERROR"] = 6; + values[valuesById[7] = "CUTOVER_ERROR"] = 7; + values[valuesById[8] = "UTILIZATION_REPORT_ERROR"] = 8; + values[valuesById[9] = "APPLIANCE_UPGRADE_ERROR"] = 9; + return values; + })(); + + return MigrationError; + })(); + + return v1; + })(); + + return vmmigration; + })(); + + 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.Any = (function() { + + /** + * Properties of an Any. + * @memberof google.protobuf + * @interface IAny + * @property {string|null} [type_url] Any type_url + * @property {Uint8Array|null} [value] Any value + */ + + /** + * Constructs a new Any. + * @memberof google.protobuf + * @classdesc Represents an Any. + * @implements IAny + * @constructor + * @param {google.protobuf.IAny=} [properties] Properties to set + */ + function Any(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Any type_url. + * @member {string} type_url + * @memberof google.protobuf.Any + * @instance + */ + Any.prototype.type_url = ""; + + /** + * Any value. + * @member {Uint8Array} value + * @memberof google.protobuf.Any + * @instance + */ + Any.prototype.value = $util.newBuffer([]); + + /** + * Creates a new Any instance using the specified properties. + * @function create + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny=} [properties] Properties to set + * @returns {google.protobuf.Any} Any instance + */ + Any.create = function create(properties) { + return new Any(properties); + }; + + /** + * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny} message Any message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Any.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type_url != null && Object.hasOwnProperty.call(message, "type_url")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type_url); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.value); + return writer; + }; + + /** + * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny} message Any message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Any.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Any message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Any + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Any} Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Any.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Any(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.type_url = reader.string(); + break; + } + case 2: { + message.value = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Any message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Any + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Any} Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Any.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Any message. + * @function verify + * @memberof google.protobuf.Any + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Any.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type_url != null && message.hasOwnProperty("type_url")) + if (!$util.isString(message.type_url)) + return "type_url: string expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) + return "value: buffer expected"; + return null; + }; + + /** + * Creates an Any message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Any + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Any} Any + */ + Any.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Any) + return object; + var message = new $root.google.protobuf.Any(); + if (object.type_url != null) + message.type_url = String(object.type_url); + if (object.value != null) + if (typeof object.value === "string") + $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); + else if (object.value.length >= 0) + message.value = object.value; + return message; + }; + + /** + * Creates a plain object from an Any message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.Any} message Any + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Any.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type_url = ""; + if (options.bytes === String) + object.value = ""; + else { + object.value = []; + if (options.bytes !== Array) + object.value = $util.newBuffer(object.value); + } + } + if (message.type_url != null && message.hasOwnProperty("type_url")) + object.type_url = message.type_url; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; + return object; + }; + + /** + * Converts this Any to JSON. + * @function toJSON + * @memberof google.protobuf.Any + * @instance + * @returns {Object.} JSON object + */ + Any.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Any + * @function getTypeUrl + * @memberof google.protobuf.Any + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Any.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Any"; + }; + + return Any; + })(); + + protobuf.Duration = (function() { + + /** + * Properties of a Duration. + * @memberof google.protobuf + * @interface IDuration + * @property {number|Long|null} [seconds] Duration seconds + * @property {number|null} [nanos] Duration nanos + */ + + /** + * Constructs a new Duration. + * @memberof google.protobuf + * @classdesc Represents a Duration. + * @implements IDuration + * @constructor + * @param {google.protobuf.IDuration=} [properties] Properties to set + */ + function Duration(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Duration seconds. + * @member {number|Long} seconds + * @memberof google.protobuf.Duration + * @instance + */ + Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Duration nanos. + * @member {number} nanos + * @memberof google.protobuf.Duration + * @instance + */ + Duration.prototype.nanos = 0; + + /** + * Creates a new Duration instance using the specified properties. + * @function create + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration=} [properties] Properties to set + * @returns {google.protobuf.Duration} Duration instance + */ + Duration.create = function create(properties) { + return new Duration(properties); + }; + + /** + * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration} message Duration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); + return writer; + }; + + /** + * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration} message Duration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Duration(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.seconds = reader.int64(); + break; + } + case 2: { + message.nanos = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Duration message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Duration message. + * @function verify + * @memberof google.protobuf.Duration + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Duration.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) + return "seconds: integer|Long expected"; + if (message.nanos != null && message.hasOwnProperty("nanos")) + if (!$util.isInteger(message.nanos)) + return "nanos: integer expected"; + return null; + }; + + /** + * Creates a Duration message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Duration + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Duration} Duration + */ + Duration.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Duration) + return object; + var message = new $root.google.protobuf.Duration(); + if (object.seconds != null) + if ($util.Long) + (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; + else if (typeof object.seconds === "string") + message.seconds = parseInt(object.seconds, 10); + else if (typeof object.seconds === "number") + message.seconds = object.seconds; + else if (typeof object.seconds === "object") + message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); + if (object.nanos != null) + message.nanos = object.nanos | 0; + return message; + }; + + /** + * Creates a plain object from a Duration message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.Duration} message Duration + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Duration.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.seconds = options.longs === String ? "0" : 0; + object.nanos = 0; + } + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (typeof message.seconds === "number") + object.seconds = options.longs === String ? String(message.seconds) : message.seconds; + else + object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; + if (message.nanos != null && message.hasOwnProperty("nanos")) + object.nanos = message.nanos; + return object; + }; + + /** + * Converts this Duration to JSON. + * @function toJSON + * @memberof google.protobuf.Duration + * @instance + * @returns {Object.} JSON object + */ + Duration.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Duration + * @function getTypeUrl + * @memberof google.protobuf.Duration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Duration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Duration"; + }; + + return Duration; + })(); + + protobuf.Empty = (function() { + + /** + * Properties of an Empty. + * @memberof google.protobuf + * @interface IEmpty + */ + + /** + * Constructs a new Empty. + * @memberof google.protobuf + * @classdesc Represents an Empty. + * @implements IEmpty + * @constructor + * @param {google.protobuf.IEmpty=} [properties] Properties to set + */ + function Empty(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new Empty instance using the specified properties. + * @function create + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty=} [properties] Properties to set + * @returns {google.protobuf.Empty} Empty instance + */ + Empty.create = function create(properties) { + return new Empty(properties); + }; + + /** + * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty} message Empty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Empty.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty} message Empty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Empty.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Empty message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Empty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Empty} Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Empty.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Empty(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Empty message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Empty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Empty} Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Empty.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Empty message. + * @function verify + * @memberof google.protobuf.Empty + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Empty.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates an Empty message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Empty + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Empty} Empty + */ + Empty.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Empty) + return object; + return new $root.google.protobuf.Empty(); + }; + + /** + * Creates a plain object from an Empty message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.Empty} message Empty + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Empty.toObject = function toObject() { + return {}; + }; + + /** + * Converts this Empty to JSON. + * @function toJSON + * @memberof google.protobuf.Empty + * @instance + * @returns {Object.} JSON object + */ + Empty.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Empty + * @function getTypeUrl + * @memberof google.protobuf.Empty + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Empty.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Empty"; + }; + + return Empty; + })(); + + protobuf.FieldMask = (function() { + + /** + * Properties of a FieldMask. + * @memberof google.protobuf + * @interface IFieldMask + * @property {Array.|null} [paths] FieldMask paths + */ + + /** + * Constructs a new FieldMask. + * @memberof google.protobuf + * @classdesc Represents a FieldMask. + * @implements IFieldMask + * @constructor + * @param {google.protobuf.IFieldMask=} [properties] Properties to set + */ + function FieldMask(properties) { + this.paths = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldMask paths. + * @member {Array.} paths + * @memberof google.protobuf.FieldMask + * @instance + */ + FieldMask.prototype.paths = $util.emptyArray; + + /** + * Creates a new FieldMask instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask=} [properties] Properties to set + * @returns {google.protobuf.FieldMask} FieldMask instance + */ + FieldMask.create = function create(properties) { + return new FieldMask(properties); + }; + + /** + * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldMask.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.paths != null && message.paths.length) + for (var i = 0; i < message.paths.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.paths[i]); + return writer; + }; + + /** + * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldMask.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldMask message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldMask + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldMask} FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldMask.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldMask(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.paths && message.paths.length)) + message.paths = []; + message.paths.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldMask message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldMask + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldMask} FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldMask.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldMask message. + * @function verify + * @memberof google.protobuf.FieldMask + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldMask.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.paths != null && message.hasOwnProperty("paths")) { + if (!Array.isArray(message.paths)) + return "paths: array expected"; + for (var i = 0; i < message.paths.length; ++i) + if (!$util.isString(message.paths[i])) + return "paths: string[] expected"; + } + return null; + }; + + /** + * Creates a FieldMask message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldMask + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldMask} FieldMask + */ + FieldMask.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldMask) + return object; + var message = new $root.google.protobuf.FieldMask(); + if (object.paths) { + if (!Array.isArray(object.paths)) + throw TypeError(".google.protobuf.FieldMask.paths: array expected"); + message.paths = []; + for (var i = 0; i < object.paths.length; ++i) + message.paths[i] = String(object.paths[i]); + } + return message; + }; + + /** + * Creates a plain object from a FieldMask message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.FieldMask} message FieldMask + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldMask.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.paths = []; + if (message.paths && message.paths.length) { + object.paths = []; + for (var j = 0; j < message.paths.length; ++j) + object.paths[j] = message.paths[j]; + } + return object; + }; + + /** + * Converts this FieldMask to JSON. + * @function toJSON + * @memberof google.protobuf.FieldMask + * @instance + * @returns {Object.} JSON object + */ + FieldMask.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldMask + * @function getTypeUrl + * @memberof google.protobuf.FieldMask + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldMask.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldMask"; + }; + + return FieldMask; + })(); + + protobuf.Timestamp = (function() { + + /** + * Properties of a Timestamp. + * @memberof google.protobuf + * @interface ITimestamp + * @property {number|Long|null} [seconds] Timestamp seconds + * @property {number|null} [nanos] Timestamp nanos + */ + + /** + * Constructs a new Timestamp. + * @memberof google.protobuf + * @classdesc Represents a Timestamp. + * @implements ITimestamp + * @constructor + * @param {google.protobuf.ITimestamp=} [properties] Properties to set + */ + function Timestamp(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Timestamp seconds. + * @member {number|Long} seconds + * @memberof google.protobuf.Timestamp + * @instance + */ + Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Timestamp nanos. + * @member {number} nanos + * @memberof google.protobuf.Timestamp + * @instance + */ + Timestamp.prototype.nanos = 0; + + /** + * Creates a new Timestamp instance using the specified properties. + * @function create + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp=} [properties] Properties to set + * @returns {google.protobuf.Timestamp} Timestamp instance + */ + Timestamp.create = function create(properties) { + return new Timestamp(properties); + }; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); + return writer; + }; + + /** + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Timestamp(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.seconds = reader.int64(); + break; + } + case 2: { + message.nanos = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Timestamp message. + * @function verify + * @memberof google.protobuf.Timestamp + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Timestamp.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) + return "seconds: integer|Long expected"; + if (message.nanos != null && message.hasOwnProperty("nanos")) + if (!$util.isInteger(message.nanos)) + return "nanos: integer expected"; + return null; + }; + + /** + * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Timestamp + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Timestamp} Timestamp + */ + Timestamp.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Timestamp) + return object; + var message = new $root.google.protobuf.Timestamp(); + if (object.seconds != null) + if ($util.Long) + (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; + else if (typeof object.seconds === "string") + message.seconds = parseInt(object.seconds, 10); + else if (typeof object.seconds === "number") + message.seconds = object.seconds; + else if (typeof object.seconds === "object") + message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); + if (object.nanos != null) + message.nanos = object.nanos | 0; + return message; + }; + + /** + * Creates a plain object from a Timestamp message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.Timestamp} message Timestamp + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Timestamp.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.seconds = options.longs === String ? "0" : 0; + object.nanos = 0; + } + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (typeof message.seconds === "number") + object.seconds = options.longs === String ? String(message.seconds) : message.seconds; + else + object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; + if (message.nanos != null && message.hasOwnProperty("nanos")) + object.nanos = message.nanos; + return object; + }; + + /** + * Converts this Timestamp to JSON. + * @function toJSON + * @memberof google.protobuf.Timestamp + * @instance + * @returns {Object.} JSON object + */ + Timestamp.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Timestamp + * @function getTypeUrl + * @memberof google.protobuf.Timestamp + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Timestamp.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Timestamp"; + }; + + return Timestamp; + })(); + + return protobuf; + })(); + + google.longrunning = (function() { + + /** + * Namespace longrunning. + * @memberof google + * @namespace + */ + var longrunning = {}; + + longrunning.Operations = (function() { + + /** + * Constructs a new Operations service. + * @memberof google.longrunning + * @classdesc Represents an Operations + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Operations(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Operations.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Operations; + + /** + * Creates new Operations service using the specified rpc implementation. + * @function create + * @memberof google.longrunning.Operations + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {Operations} RPC service. Useful where requests and/or responses are streamed. + */ + Operations.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.longrunning.Operations|listOperations}. + * @memberof google.longrunning.Operations + * @typedef ListOperationsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.ListOperationsResponse} [response] ListOperationsResponse + */ + + /** + * Calls ListOperations. + * @function listOperations + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IListOperationsRequest} request ListOperationsRequest message or plain object + * @param {google.longrunning.Operations.ListOperationsCallback} callback Node-style callback called with the error, if any, and ListOperationsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.listOperations = function listOperations(request, callback) { + return this.rpcCall(listOperations, $root.google.longrunning.ListOperationsRequest, $root.google.longrunning.ListOperationsResponse, request, callback); + }, "name", { value: "ListOperations" }); + + /** + * Calls ListOperations. + * @function listOperations + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IListOperationsRequest} request ListOperationsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|getOperation}. + * @memberof google.longrunning.Operations + * @typedef GetOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls GetOperation. + * @function getOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IGetOperationRequest} request GetOperationRequest message or plain object + * @param {google.longrunning.Operations.GetOperationCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.getOperation = function getOperation(request, callback) { + return this.rpcCall(getOperation, $root.google.longrunning.GetOperationRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "GetOperation" }); + + /** + * Calls GetOperation. + * @function getOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IGetOperationRequest} request GetOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|deleteOperation}. + * @memberof google.longrunning.Operations + * @typedef DeleteOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteOperation. + * @function deleteOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IDeleteOperationRequest} request DeleteOperationRequest message or plain object + * @param {google.longrunning.Operations.DeleteOperationCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.deleteOperation = function deleteOperation(request, callback) { + return this.rpcCall(deleteOperation, $root.google.longrunning.DeleteOperationRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteOperation" }); + + /** + * Calls DeleteOperation. + * @function deleteOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IDeleteOperationRequest} request DeleteOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|cancelOperation}. + * @memberof google.longrunning.Operations + * @typedef CancelOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls CancelOperation. + * @function cancelOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.ICancelOperationRequest} request CancelOperationRequest message or plain object + * @param {google.longrunning.Operations.CancelOperationCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.cancelOperation = function cancelOperation(request, callback) { + return this.rpcCall(cancelOperation, $root.google.longrunning.CancelOperationRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "CancelOperation" }); + + /** + * Calls CancelOperation. + * @function cancelOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.ICancelOperationRequest} request CancelOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|waitOperation}. + * @memberof google.longrunning.Operations + * @typedef WaitOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls WaitOperation. + * @function waitOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IWaitOperationRequest} request WaitOperationRequest message or plain object + * @param {google.longrunning.Operations.WaitOperationCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.waitOperation = function waitOperation(request, callback) { + return this.rpcCall(waitOperation, $root.google.longrunning.WaitOperationRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "WaitOperation" }); + + /** + * Calls WaitOperation. + * @function waitOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IWaitOperationRequest} request WaitOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Operations; + })(); + + longrunning.Operation = (function() { + + /** + * Properties of an Operation. + * @memberof google.longrunning + * @interface IOperation + * @property {string|null} [name] Operation name + * @property {google.protobuf.IAny|null} [metadata] Operation metadata + * @property {boolean|null} [done] Operation done + * @property {google.rpc.IStatus|null} [error] Operation error + * @property {google.protobuf.IAny|null} [response] Operation response + */ + + /** + * Constructs a new Operation. + * @memberof google.longrunning + * @classdesc Represents an Operation. + * @implements IOperation + * @constructor + * @param {google.longrunning.IOperation=} [properties] Properties to set + */ + function Operation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Operation name. + * @member {string} name + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.name = ""; + + /** + * Operation metadata. + * @member {google.protobuf.IAny|null|undefined} metadata + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.metadata = null; + + /** + * Operation done. + * @member {boolean} done + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.done = false; + + /** + * Operation error. + * @member {google.rpc.IStatus|null|undefined} error + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.error = null; + + /** + * Operation response. + * @member {google.protobuf.IAny|null|undefined} response + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.response = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Operation result. + * @member {"error"|"response"|undefined} result + * @memberof google.longrunning.Operation + * @instance + */ + Object.defineProperty(Operation.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["error", "response"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Operation instance using the specified properties. + * @function create + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.IOperation=} [properties] Properties to set + * @returns {google.longrunning.Operation} Operation instance + */ + Operation.create = function create(properties) { + return new Operation(properties); + }; + + /** + * Encodes the specified Operation message. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @function encode + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.IOperation} message Operation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Operation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.google.protobuf.Any.encode(message.metadata, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.done != null && Object.hasOwnProperty.call(message, "done")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.done); + if (message.error != null && Object.hasOwnProperty.call(message, "error")) + $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.response != null && Object.hasOwnProperty.call(message, "response")) + $root.google.protobuf.Any.encode(message.response, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Operation message, length delimited. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.IOperation} message Operation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Operation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Operation message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.Operation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.Operation} Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Operation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.Operation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.metadata = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + } + case 3: { + message.done = reader.bool(); + break; + } + case 4: { + message.error = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + } + case 5: { + message.response = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Operation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.Operation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.Operation} Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Operation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Operation message. + * @function verify + * @memberof google.longrunning.Operation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Operation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.google.protobuf.Any.verify(message.metadata); + if (error) + return "metadata." + error; + } + if (message.done != null && message.hasOwnProperty("done")) + if (typeof message.done !== "boolean") + return "done: boolean expected"; + if (message.error != null && message.hasOwnProperty("error")) { + properties.result = 1; + { + var error = $root.google.rpc.Status.verify(message.error); + if (error) + return "error." + error; + } + } + if (message.response != null && message.hasOwnProperty("response")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.google.protobuf.Any.verify(message.response); + if (error) + return "response." + error; + } + } + return null; + }; + + /** + * Creates an Operation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.Operation + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.Operation} Operation + */ + Operation.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.Operation) + return object; + var message = new $root.google.longrunning.Operation(); + if (object.name != null) + message.name = String(object.name); + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".google.longrunning.Operation.metadata: object expected"); + message.metadata = $root.google.protobuf.Any.fromObject(object.metadata); + } + if (object.done != null) + message.done = Boolean(object.done); + if (object.error != null) { + if (typeof object.error !== "object") + throw TypeError(".google.longrunning.Operation.error: object expected"); + message.error = $root.google.rpc.Status.fromObject(object.error); + } + if (object.response != null) { + if (typeof object.response !== "object") + throw TypeError(".google.longrunning.Operation.response: object expected"); + message.response = $root.google.protobuf.Any.fromObject(object.response); + } + return message; + }; + + /** + * Creates a plain object from an Operation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.Operation} message Operation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Operation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.metadata = null; + object.done = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.google.protobuf.Any.toObject(message.metadata, options); + if (message.done != null && message.hasOwnProperty("done")) + object.done = message.done; + if (message.error != null && message.hasOwnProperty("error")) { + object.error = $root.google.rpc.Status.toObject(message.error, options); + if (options.oneofs) + object.result = "error"; + } + if (message.response != null && message.hasOwnProperty("response")) { + object.response = $root.google.protobuf.Any.toObject(message.response, options); + if (options.oneofs) + object.result = "response"; + } + return object; + }; + + /** + * Converts this Operation to JSON. + * @function toJSON + * @memberof google.longrunning.Operation + * @instance + * @returns {Object.} JSON object + */ + Operation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Operation + * @function getTypeUrl + * @memberof google.longrunning.Operation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Operation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.Operation"; + }; + + return Operation; + })(); + + longrunning.GetOperationRequest = (function() { + + /** + * Properties of a GetOperationRequest. + * @memberof google.longrunning + * @interface IGetOperationRequest + * @property {string|null} [name] GetOperationRequest name + */ + + /** + * Constructs a new GetOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a GetOperationRequest. + * @implements IGetOperationRequest + * @constructor + * @param {google.longrunning.IGetOperationRequest=} [properties] Properties to set + */ + function GetOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetOperationRequest name. + * @member {string} name + * @memberof google.longrunning.GetOperationRequest + * @instance + */ + GetOperationRequest.prototype.name = ""; + + /** + * Creates a new GetOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.IGetOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest instance + */ + GetOperationRequest.create = function create(properties) { + return new GetOperationRequest(properties); + }; + + /** + * Encodes the specified GetOperationRequest message. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.IGetOperationRequest} message GetOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.IGetOperationRequest} message GetOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetOperationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.GetOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetOperationRequest message. + * @function verify + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetOperationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest + */ + GetOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.GetOperationRequest) + return object; + var message = new $root.google.longrunning.GetOperationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.GetOperationRequest} message GetOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.GetOperationRequest + * @instance + * @returns {Object.} JSON object + */ + GetOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.GetOperationRequest"; + }; + + return GetOperationRequest; + })(); + + longrunning.ListOperationsRequest = (function() { + + /** + * Properties of a ListOperationsRequest. + * @memberof google.longrunning + * @interface IListOperationsRequest + * @property {string|null} [name] ListOperationsRequest name + * @property {string|null} [filter] ListOperationsRequest filter + * @property {number|null} [pageSize] ListOperationsRequest pageSize + * @property {string|null} [pageToken] ListOperationsRequest pageToken + */ + + /** + * Constructs a new ListOperationsRequest. + * @memberof google.longrunning + * @classdesc Represents a ListOperationsRequest. + * @implements IListOperationsRequest + * @constructor + * @param {google.longrunning.IListOperationsRequest=} [properties] Properties to set + */ + function ListOperationsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListOperationsRequest name. + * @member {string} name + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.name = ""; + + /** + * ListOperationsRequest filter. + * @member {string} filter + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.filter = ""; + + /** + * ListOperationsRequest pageSize. + * @member {number} pageSize + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.pageSize = 0; + + /** + * ListOperationsRequest pageToken. + * @member {string} pageToken + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListOperationsRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.IListOperationsRequest=} [properties] Properties to set + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest instance + */ + ListOperationsRequest.create = function create(properties) { + return new ListOperationsRequest(properties); + }; + + /** + * Encodes the specified ListOperationsRequest message. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.IListOperationsRequest} message ListOperationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.filter); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.name); + return writer; + }; + + /** + * Encodes the specified ListOperationsRequest message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.IListOperationsRequest} message ListOperationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.ListOperationsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 4: { + message.name = reader.string(); + break; + } + case 1: { + message.filter = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListOperationsRequest message. + * @function verify + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListOperationsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListOperationsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest + */ + ListOperationsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.ListOperationsRequest) + return object; + var message = new $root.google.longrunning.ListOperationsRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.filter != null) + message.filter = String(object.filter); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListOperationsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.ListOperationsRequest} message ListOperationsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListOperationsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.filter = ""; + object.pageSize = 0; + object.pageToken = ""; + object.name = ""; + } + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this ListOperationsRequest to JSON. + * @function toJSON + * @memberof google.longrunning.ListOperationsRequest + * @instance + * @returns {Object.} JSON object + */ + ListOperationsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListOperationsRequest + * @function getTypeUrl + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListOperationsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.ListOperationsRequest"; + }; + + return ListOperationsRequest; + })(); + + longrunning.ListOperationsResponse = (function() { + + /** + * Properties of a ListOperationsResponse. + * @memberof google.longrunning + * @interface IListOperationsResponse + * @property {Array.|null} [operations] ListOperationsResponse operations + * @property {string|null} [nextPageToken] ListOperationsResponse nextPageToken + */ + + /** + * Constructs a new ListOperationsResponse. + * @memberof google.longrunning + * @classdesc Represents a ListOperationsResponse. + * @implements IListOperationsResponse + * @constructor + * @param {google.longrunning.IListOperationsResponse=} [properties] Properties to set + */ + function ListOperationsResponse(properties) { + this.operations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListOperationsResponse operations. + * @member {Array.} operations + * @memberof google.longrunning.ListOperationsResponse + * @instance + */ + ListOperationsResponse.prototype.operations = $util.emptyArray; + + /** + * ListOperationsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.longrunning.ListOperationsResponse + * @instance + */ + ListOperationsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListOperationsResponse instance using the specified properties. + * @function create + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.IListOperationsResponse=} [properties] Properties to set + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse instance + */ + ListOperationsResponse.create = function create(properties) { + return new ListOperationsResponse(properties); + }; + + /** + * Encodes the specified ListOperationsResponse message. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @function encode + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.IListOperationsResponse} message ListOperationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.operations != null && message.operations.length) + for (var i = 0; i < message.operations.length; ++i) + $root.google.longrunning.Operation.encode(message.operations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListOperationsResponse message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.IListOperationsResponse} message ListOperationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.ListOperationsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.operations && message.operations.length)) + message.operations = []; + message.operations.push($root.google.longrunning.Operation.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListOperationsResponse message. + * @function verify + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListOperationsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.operations != null && message.hasOwnProperty("operations")) { + if (!Array.isArray(message.operations)) + return "operations: array expected"; + for (var i = 0; i < message.operations.length; ++i) { + var error = $root.google.longrunning.Operation.verify(message.operations[i]); + if (error) + return "operations." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListOperationsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse + */ + ListOperationsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.ListOperationsResponse) + return object; + var message = new $root.google.longrunning.ListOperationsResponse(); + if (object.operations) { + if (!Array.isArray(object.operations)) + throw TypeError(".google.longrunning.ListOperationsResponse.operations: array expected"); + message.operations = []; + for (var i = 0; i < object.operations.length; ++i) { + if (typeof object.operations[i] !== "object") + throw TypeError(".google.longrunning.ListOperationsResponse.operations: object expected"); + message.operations[i] = $root.google.longrunning.Operation.fromObject(object.operations[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListOperationsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.ListOperationsResponse} message ListOperationsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListOperationsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.operations = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.operations && message.operations.length) { + object.operations = []; + for (var j = 0; j < message.operations.length; ++j) + object.operations[j] = $root.google.longrunning.Operation.toObject(message.operations[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListOperationsResponse to JSON. + * @function toJSON + * @memberof google.longrunning.ListOperationsResponse + * @instance + * @returns {Object.} JSON object + */ + ListOperationsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListOperationsResponse + * @function getTypeUrl + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListOperationsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.ListOperationsResponse"; + }; + + return ListOperationsResponse; + })(); + + longrunning.CancelOperationRequest = (function() { + + /** + * Properties of a CancelOperationRequest. + * @memberof google.longrunning + * @interface ICancelOperationRequest + * @property {string|null} [name] CancelOperationRequest name + */ + + /** + * Constructs a new CancelOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a CancelOperationRequest. + * @implements ICancelOperationRequest + * @constructor + * @param {google.longrunning.ICancelOperationRequest=} [properties] Properties to set + */ + function CancelOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CancelOperationRequest name. + * @member {string} name + * @memberof google.longrunning.CancelOperationRequest + * @instance + */ + CancelOperationRequest.prototype.name = ""; + + /** + * Creates a new CancelOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.ICancelOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest instance + */ + CancelOperationRequest.create = function create(properties) { + return new CancelOperationRequest(properties); + }; + + /** + * Encodes the specified CancelOperationRequest message. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.ICancelOperationRequest} message CancelOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CancelOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified CancelOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.ICancelOperationRequest} message CancelOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CancelOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CancelOperationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.CancelOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CancelOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CancelOperationRequest message. + * @function verify + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CancelOperationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a CancelOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest + */ + CancelOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.CancelOperationRequest) + return object; + var message = new $root.google.longrunning.CancelOperationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a CancelOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.CancelOperationRequest} message CancelOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CancelOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this CancelOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.CancelOperationRequest + * @instance + * @returns {Object.} JSON object + */ + CancelOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CancelOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CancelOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.CancelOperationRequest"; + }; + + return CancelOperationRequest; + })(); + + longrunning.DeleteOperationRequest = (function() { + + /** + * Properties of a DeleteOperationRequest. + * @memberof google.longrunning + * @interface IDeleteOperationRequest + * @property {string|null} [name] DeleteOperationRequest name + */ + + /** + * Constructs a new DeleteOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a DeleteOperationRequest. + * @implements IDeleteOperationRequest + * @constructor + * @param {google.longrunning.IDeleteOperationRequest=} [properties] Properties to set + */ + function DeleteOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteOperationRequest name. + * @member {string} name + * @memberof google.longrunning.DeleteOperationRequest + * @instance + */ + DeleteOperationRequest.prototype.name = ""; + + /** + * Creates a new DeleteOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.IDeleteOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest instance + */ + DeleteOperationRequest.create = function create(properties) { + return new DeleteOperationRequest(properties); + }; + + /** + * Encodes the specified DeleteOperationRequest message. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.IDeleteOperationRequest} message DeleteOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified DeleteOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.IDeleteOperationRequest} message DeleteOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteOperationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.DeleteOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteOperationRequest message. + * @function verify + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteOperationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a DeleteOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest + */ + DeleteOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.DeleteOperationRequest) + return object; + var message = new $root.google.longrunning.DeleteOperationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.DeleteOperationRequest} message DeleteOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this DeleteOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.DeleteOperationRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.DeleteOperationRequest"; + }; + + return DeleteOperationRequest; + })(); + + longrunning.WaitOperationRequest = (function() { + + /** + * Properties of a WaitOperationRequest. + * @memberof google.longrunning + * @interface IWaitOperationRequest + * @property {string|null} [name] WaitOperationRequest name + * @property {google.protobuf.IDuration|null} [timeout] WaitOperationRequest timeout + */ + + /** + * Constructs a new WaitOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a WaitOperationRequest. + * @implements IWaitOperationRequest + * @constructor + * @param {google.longrunning.IWaitOperationRequest=} [properties] Properties to set + */ + function WaitOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * WaitOperationRequest name. + * @member {string} name + * @memberof google.longrunning.WaitOperationRequest + * @instance + */ + WaitOperationRequest.prototype.name = ""; + + /** + * WaitOperationRequest timeout. + * @member {google.protobuf.IDuration|null|undefined} timeout + * @memberof google.longrunning.WaitOperationRequest + * @instance + */ + WaitOperationRequest.prototype.timeout = null; + + /** + * Creates a new WaitOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.IWaitOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest instance + */ + WaitOperationRequest.create = function create(properties) { + return new WaitOperationRequest(properties); + }; + + /** + * Encodes the specified WaitOperationRequest message. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.IWaitOperationRequest} message WaitOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WaitOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.timeout != null && Object.hasOwnProperty.call(message, "timeout")) + $root.google.protobuf.Duration.encode(message.timeout, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified WaitOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.IWaitOperationRequest} message WaitOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WaitOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WaitOperationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.WaitOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.timeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WaitOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WaitOperationRequest message. + * @function verify + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WaitOperationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.timeout != null && message.hasOwnProperty("timeout")) { + var error = $root.google.protobuf.Duration.verify(message.timeout); + if (error) + return "timeout." + error; + } + return null; + }; + + /** + * Creates a WaitOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest + */ + WaitOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.WaitOperationRequest) + return object; + var message = new $root.google.longrunning.WaitOperationRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.timeout != null) { + if (typeof object.timeout !== "object") + throw TypeError(".google.longrunning.WaitOperationRequest.timeout: object expected"); + message.timeout = $root.google.protobuf.Duration.fromObject(object.timeout); + } + return message; + }; + + /** + * Creates a plain object from a WaitOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.WaitOperationRequest} message WaitOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WaitOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.timeout = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.timeout != null && message.hasOwnProperty("timeout")) + object.timeout = $root.google.protobuf.Duration.toObject(message.timeout, options); + return object; + }; + + /** + * Converts this WaitOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.WaitOperationRequest + * @instance + * @returns {Object.} JSON object + */ + WaitOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for WaitOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WaitOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.WaitOperationRequest"; + }; + + return WaitOperationRequest; + })(); + + longrunning.OperationInfo = (function() { + + /** + * Properties of an OperationInfo. + * @memberof google.longrunning + * @interface IOperationInfo + * @property {string|null} [responseType] OperationInfo responseType + * @property {string|null} [metadataType] OperationInfo metadataType + */ + + /** + * Constructs a new OperationInfo. + * @memberof google.longrunning + * @classdesc Represents an OperationInfo. + * @implements IOperationInfo + * @constructor + * @param {google.longrunning.IOperationInfo=} [properties] Properties to set + */ + function OperationInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OperationInfo responseType. + * @member {string} responseType + * @memberof google.longrunning.OperationInfo + * @instance + */ + OperationInfo.prototype.responseType = ""; + + /** + * OperationInfo metadataType. + * @member {string} metadataType + * @memberof google.longrunning.OperationInfo + * @instance + */ + OperationInfo.prototype.metadataType = ""; + + /** + * Creates a new OperationInfo instance using the specified properties. + * @function create + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.IOperationInfo=} [properties] Properties to set + * @returns {google.longrunning.OperationInfo} OperationInfo instance + */ + OperationInfo.create = function create(properties) { + return new OperationInfo(properties); + }; + + /** + * Encodes the specified OperationInfo message. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @function encode + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.IOperationInfo} message OperationInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.responseType != null && Object.hasOwnProperty.call(message, "responseType")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.responseType); + if (message.metadataType != null && Object.hasOwnProperty.call(message, "metadataType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.metadataType); + return writer; + }; + + /** + * Encodes the specified OperationInfo message, length delimited. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.IOperationInfo} message OperationInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OperationInfo message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.OperationInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.OperationInfo} OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.OperationInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.responseType = reader.string(); + break; + } + case 2: { + message.metadataType = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OperationInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.OperationInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.OperationInfo} OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OperationInfo message. + * @function verify + * @memberof google.longrunning.OperationInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OperationInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.responseType != null && message.hasOwnProperty("responseType")) + if (!$util.isString(message.responseType)) + return "responseType: string expected"; + if (message.metadataType != null && message.hasOwnProperty("metadataType")) + if (!$util.isString(message.metadataType)) + return "metadataType: string expected"; + return null; + }; + + /** + * Creates an OperationInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.OperationInfo + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.OperationInfo} OperationInfo + */ + OperationInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.OperationInfo) + return object; + var message = new $root.google.longrunning.OperationInfo(); + if (object.responseType != null) + message.responseType = String(object.responseType); + if (object.metadataType != null) + message.metadataType = String(object.metadataType); + return message; + }; + + /** + * Creates a plain object from an OperationInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.OperationInfo} message OperationInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OperationInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.responseType = ""; + object.metadataType = ""; + } + if (message.responseType != null && message.hasOwnProperty("responseType")) + object.responseType = message.responseType; + if (message.metadataType != null && message.hasOwnProperty("metadataType")) + object.metadataType = message.metadataType; + return object; + }; + + /** + * Converts this OperationInfo to JSON. + * @function toJSON + * @memberof google.longrunning.OperationInfo + * @instance + * @returns {Object.} JSON object + */ + OperationInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OperationInfo + * @function getTypeUrl + * @memberof google.longrunning.OperationInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OperationInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.OperationInfo"; + }; + + return OperationInfo; + })(); + + return longrunning; + })(); + + google.rpc = (function() { + + /** + * Namespace rpc. + * @memberof google + * @namespace + */ + var rpc = {}; + + rpc.Status = (function() { + + /** + * Properties of a Status. + * @memberof google.rpc + * @interface IStatus + * @property {number|null} [code] Status code + * @property {string|null} [message] Status message + * @property {Array.|null} [details] Status details + */ + + /** + * Constructs a new Status. + * @memberof google.rpc + * @classdesc Represents a Status. + * @implements IStatus + * @constructor + * @param {google.rpc.IStatus=} [properties] Properties to set + */ + function Status(properties) { + this.details = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Status code. + * @member {number} code + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.code = 0; + + /** + * Status message. + * @member {string} message + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.message = ""; + + /** + * Status details. + * @member {Array.} details + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.details = $util.emptyArray; + + /** + * Creates a new Status instance using the specified properties. + * @function create + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus=} [properties] Properties to set + * @returns {google.rpc.Status} Status instance + */ + Status.create = function create(properties) { + return new Status(properties); + }; + + /** + * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @function encode + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus} message Status message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Status.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.code != null && Object.hasOwnProperty.call(message, "code")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.code); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.message); + if (message.details != null && message.details.length) + for (var i = 0; i < message.details.length; ++i) + $root.google.protobuf.Any.encode(message.details[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @function encodeDelimited + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus} message Status message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Status.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Status message from the specified reader or buffer. + * @function decode + * @memberof google.rpc.Status + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.rpc.Status} Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Status.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.rpc.Status(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.code = reader.int32(); + break; + } + case 2: { + message.message = reader.string(); + break; + } + case 3: { + if (!(message.details && message.details.length)) + message.details = []; + message.details.push($root.google.protobuf.Any.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Status message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.rpc.Status + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.rpc.Status} Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Status.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Status message. + * @function verify + * @memberof google.rpc.Status + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Status.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.code != null && message.hasOwnProperty("code")) + if (!$util.isInteger(message.code)) + return "code: integer expected"; + if (message.message != null && message.hasOwnProperty("message")) + if (!$util.isString(message.message)) + return "message: string expected"; + if (message.details != null && message.hasOwnProperty("details")) { + if (!Array.isArray(message.details)) + return "details: array expected"; + for (var i = 0; i < message.details.length; ++i) { + var error = $root.google.protobuf.Any.verify(message.details[i]); + if (error) + return "details." + error; + } + } + return null; + }; + + /** + * Creates a Status message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.rpc.Status + * @static + * @param {Object.} object Plain object + * @returns {google.rpc.Status} Status + */ + Status.fromObject = function fromObject(object) { + if (object instanceof $root.google.rpc.Status) + return object; + var message = new $root.google.rpc.Status(); + if (object.code != null) + message.code = object.code | 0; + if (object.message != null) + message.message = String(object.message); + if (object.details) { + if (!Array.isArray(object.details)) + throw TypeError(".google.rpc.Status.details: array expected"); + message.details = []; + for (var i = 0; i < object.details.length; ++i) { + if (typeof object.details[i] !== "object") + throw TypeError(".google.rpc.Status.details: object expected"); + message.details[i] = $root.google.protobuf.Any.fromObject(object.details[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Status message. Also converts values to other types if specified. + * @function toObject + * @memberof google.rpc.Status + * @static + * @param {google.rpc.Status} message Status + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Status.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.details = []; + if (options.defaults) { + object.code = 0; + object.message = ""; + } + if (message.code != null && message.hasOwnProperty("code")) + object.code = message.code; + if (message.message != null && message.hasOwnProperty("message")) + object.message = message.message; + if (message.details && message.details.length) { + object.details = []; + for (var j = 0; j < message.details.length; ++j) + object.details[j] = $root.google.protobuf.Any.toObject(message.details[j], options); + } + return object; + }; + + /** + * Converts this Status to JSON. + * @function toJSON + * @memberof google.rpc.Status + * @instance + * @returns {Object.} JSON object + */ + Status.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Status + * @function getTypeUrl + * @memberof google.rpc.Status + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Status.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.rpc.Status"; + }; + + return Status; + })(); + + rpc.RetryInfo = (function() { + + /** + * Properties of a RetryInfo. + * @memberof google.rpc + * @interface IRetryInfo + * @property {google.protobuf.IDuration|null} [retryDelay] RetryInfo retryDelay + */ + + /** + * Constructs a new RetryInfo. + * @memberof google.rpc + * @classdesc Represents a RetryInfo. + * @implements IRetryInfo + * @constructor + * @param {google.rpc.IRetryInfo=} [properties] Properties to set + */ + function RetryInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RetryInfo retryDelay. + * @member {google.protobuf.IDuration|null|undefined} retryDelay + * @memberof google.rpc.RetryInfo + * @instance + */ + RetryInfo.prototype.retryDelay = null; + + /** + * Creates a new RetryInfo instance using the specified properties. + * @function create + * @memberof google.rpc.RetryInfo + * @static + * @param {google.rpc.IRetryInfo=} [properties] Properties to set + * @returns {google.rpc.RetryInfo} RetryInfo instance + */ + RetryInfo.create = function create(properties) { + return new RetryInfo(properties); + }; + + /** + * Encodes the specified RetryInfo message. Does not implicitly {@link google.rpc.RetryInfo.verify|verify} messages. + * @function encode + * @memberof google.rpc.RetryInfo + * @static + * @param {google.rpc.IRetryInfo} message RetryInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RetryInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.retryDelay != null && Object.hasOwnProperty.call(message, "retryDelay")) + $root.google.protobuf.Duration.encode(message.retryDelay, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RetryInfo message, length delimited. Does not implicitly {@link google.rpc.RetryInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.rpc.RetryInfo + * @static + * @param {google.rpc.IRetryInfo} message RetryInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RetryInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RetryInfo message from the specified reader or buffer. + * @function decode + * @memberof google.rpc.RetryInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.rpc.RetryInfo} RetryInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RetryInfo.decode = function 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.RetryInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.retryDelay = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RetryInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.rpc.RetryInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.rpc.RetryInfo} RetryInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RetryInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RetryInfo message. + * @function verify + * @memberof google.rpc.RetryInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RetryInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.retryDelay != null && message.hasOwnProperty("retryDelay")) { + var error = $root.google.protobuf.Duration.verify(message.retryDelay); + if (error) + return "retryDelay." + error; + } + return null; + }; + + /** + * Creates a RetryInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.rpc.RetryInfo + * @static + * @param {Object.} object Plain object + * @returns {google.rpc.RetryInfo} RetryInfo + */ + RetryInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.rpc.RetryInfo) + return object; + var message = new $root.google.rpc.RetryInfo(); + if (object.retryDelay != null) { + if (typeof object.retryDelay !== "object") + throw TypeError(".google.rpc.RetryInfo.retryDelay: object expected"); + message.retryDelay = $root.google.protobuf.Duration.fromObject(object.retryDelay); + } + return message; + }; + + /** + * Creates a plain object from a RetryInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.rpc.RetryInfo + * @static + * @param {google.rpc.RetryInfo} message RetryInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RetryInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.retryDelay = null; + if (message.retryDelay != null && message.hasOwnProperty("retryDelay")) + object.retryDelay = $root.google.protobuf.Duration.toObject(message.retryDelay, options); + return object; + }; + + /** + * Converts this RetryInfo to JSON. + * @function toJSON + * @memberof google.rpc.RetryInfo + * @instance + * @returns {Object.} JSON object + */ + RetryInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RetryInfo + * @function getTypeUrl + * @memberof google.rpc.RetryInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RetryInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.rpc.RetryInfo"; + }; + + return RetryInfo; + })(); + + rpc.DebugInfo = (function() { + + /** + * Properties of a DebugInfo. + * @memberof google.rpc + * @interface IDebugInfo + * @property {Array.|null} [stackEntries] DebugInfo stackEntries + * @property {string|null} [detail] DebugInfo detail + */ + + /** + * Constructs a new DebugInfo. + * @memberof google.rpc + * @classdesc Represents a DebugInfo. + * @implements IDebugInfo + * @constructor + * @param {google.rpc.IDebugInfo=} [properties] Properties to set + */ + function DebugInfo(properties) { + this.stackEntries = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DebugInfo stackEntries. + * @member {Array.} stackEntries + * @memberof google.rpc.DebugInfo + * @instance + */ + DebugInfo.prototype.stackEntries = $util.emptyArray; + + /** + * DebugInfo detail. + * @member {string} detail + * @memberof google.rpc.DebugInfo + * @instance + */ + DebugInfo.prototype.detail = ""; + + /** + * Creates a new DebugInfo instance using the specified properties. + * @function create + * @memberof google.rpc.DebugInfo + * @static + * @param {google.rpc.IDebugInfo=} [properties] Properties to set + * @returns {google.rpc.DebugInfo} DebugInfo instance + */ + DebugInfo.create = function create(properties) { + return new DebugInfo(properties); + }; + + /** + * Encodes the specified DebugInfo message. Does not implicitly {@link google.rpc.DebugInfo.verify|verify} messages. + * @function encode + * @memberof google.rpc.DebugInfo + * @static + * @param {google.rpc.IDebugInfo} message DebugInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DebugInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.stackEntries != null && message.stackEntries.length) + for (var i = 0; i < message.stackEntries.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.stackEntries[i]); + if (message.detail != null && Object.hasOwnProperty.call(message, "detail")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.detail); + return writer; + }; + + /** + * Encodes the specified DebugInfo message, length delimited. Does not implicitly {@link google.rpc.DebugInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.rpc.DebugInfo + * @static + * @param {google.rpc.IDebugInfo} message DebugInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DebugInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DebugInfo message from the specified reader or buffer. + * @function decode + * @memberof google.rpc.DebugInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.rpc.DebugInfo} DebugInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DebugInfo.decode = function 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.DebugInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.stackEntries && message.stackEntries.length)) + message.stackEntries = []; + message.stackEntries.push(reader.string()); + break; + } + case 2: { + message.detail = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DebugInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.rpc.DebugInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.rpc.DebugInfo} DebugInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DebugInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DebugInfo message. + * @function verify + * @memberof google.rpc.DebugInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DebugInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.stackEntries != null && message.hasOwnProperty("stackEntries")) { + if (!Array.isArray(message.stackEntries)) + return "stackEntries: array expected"; + for (var i = 0; i < message.stackEntries.length; ++i) + if (!$util.isString(message.stackEntries[i])) + return "stackEntries: string[] expected"; + } + if (message.detail != null && message.hasOwnProperty("detail")) + if (!$util.isString(message.detail)) + return "detail: string expected"; + return null; + }; + + /** + * Creates a DebugInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.rpc.DebugInfo + * @static + * @param {Object.} object Plain object + * @returns {google.rpc.DebugInfo} DebugInfo + */ + DebugInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.rpc.DebugInfo) + return object; + var message = new $root.google.rpc.DebugInfo(); + if (object.stackEntries) { + if (!Array.isArray(object.stackEntries)) + throw TypeError(".google.rpc.DebugInfo.stackEntries: array expected"); + message.stackEntries = []; + for (var i = 0; i < object.stackEntries.length; ++i) + message.stackEntries[i] = String(object.stackEntries[i]); + } + if (object.detail != null) + message.detail = String(object.detail); + return message; + }; + + /** + * Creates a plain object from a DebugInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.rpc.DebugInfo + * @static + * @param {google.rpc.DebugInfo} message DebugInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DebugInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.stackEntries = []; + if (options.defaults) + object.detail = ""; + if (message.stackEntries && message.stackEntries.length) { + object.stackEntries = []; + for (var j = 0; j < message.stackEntries.length; ++j) + object.stackEntries[j] = message.stackEntries[j]; + } + if (message.detail != null && message.hasOwnProperty("detail")) + object.detail = message.detail; + return object; + }; + + /** + * Converts this DebugInfo to JSON. + * @function toJSON + * @memberof google.rpc.DebugInfo + * @instance + * @returns {Object.} JSON object + */ + DebugInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DebugInfo + * @function getTypeUrl + * @memberof google.rpc.DebugInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DebugInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.rpc.DebugInfo"; + }; + + return DebugInfo; + })(); + + rpc.QuotaFailure = (function() { + + /** + * Properties of a QuotaFailure. + * @memberof google.rpc + * @interface IQuotaFailure + * @property {Array.|null} [violations] QuotaFailure violations + */ + + /** + * Constructs a new QuotaFailure. + * @memberof google.rpc + * @classdesc Represents a QuotaFailure. + * @implements IQuotaFailure + * @constructor + * @param {google.rpc.IQuotaFailure=} [properties] Properties to set + */ + function QuotaFailure(properties) { + this.violations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QuotaFailure violations. + * @member {Array.} violations + * @memberof google.rpc.QuotaFailure + * @instance + */ + QuotaFailure.prototype.violations = $util.emptyArray; + + /** + * Creates a new QuotaFailure instance using the specified properties. + * @function create + * @memberof google.rpc.QuotaFailure + * @static + * @param {google.rpc.IQuotaFailure=} [properties] Properties to set + * @returns {google.rpc.QuotaFailure} QuotaFailure instance + */ + QuotaFailure.create = function create(properties) { + return new QuotaFailure(properties); + }; + + /** + * Encodes the specified QuotaFailure message. Does not implicitly {@link google.rpc.QuotaFailure.verify|verify} messages. + * @function encode + * @memberof google.rpc.QuotaFailure + * @static + * @param {google.rpc.IQuotaFailure} message QuotaFailure message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QuotaFailure.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.violations != null && message.violations.length) + for (var i = 0; i < message.violations.length; ++i) + $root.google.rpc.QuotaFailure.Violation.encode(message.violations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified QuotaFailure message, length delimited. Does not implicitly {@link google.rpc.QuotaFailure.verify|verify} messages. + * @function encodeDelimited + * @memberof google.rpc.QuotaFailure + * @static + * @param {google.rpc.IQuotaFailure} message QuotaFailure message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QuotaFailure.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QuotaFailure message from the specified reader or buffer. + * @function decode + * @memberof google.rpc.QuotaFailure + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.rpc.QuotaFailure} QuotaFailure + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QuotaFailure.decode = function 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.QuotaFailure(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.violations && message.violations.length)) + message.violations = []; + message.violations.push($root.google.rpc.QuotaFailure.Violation.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QuotaFailure message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.rpc.QuotaFailure + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.rpc.QuotaFailure} QuotaFailure + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QuotaFailure.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QuotaFailure message. + * @function verify + * @memberof google.rpc.QuotaFailure + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QuotaFailure.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.violations != null && message.hasOwnProperty("violations")) { + if (!Array.isArray(message.violations)) + return "violations: array expected"; + for (var i = 0; i < message.violations.length; ++i) { + var error = $root.google.rpc.QuotaFailure.Violation.verify(message.violations[i]); + if (error) + return "violations." + error; + } + } + return null; + }; + + /** + * Creates a QuotaFailure message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.rpc.QuotaFailure + * @static + * @param {Object.} object Plain object + * @returns {google.rpc.QuotaFailure} QuotaFailure + */ + QuotaFailure.fromObject = function fromObject(object) { + if (object instanceof $root.google.rpc.QuotaFailure) + return object; + var message = new $root.google.rpc.QuotaFailure(); + if (object.violations) { + if (!Array.isArray(object.violations)) + throw TypeError(".google.rpc.QuotaFailure.violations: array expected"); + message.violations = []; + for (var i = 0; i < object.violations.length; ++i) { + if (typeof object.violations[i] !== "object") + throw TypeError(".google.rpc.QuotaFailure.violations: object expected"); + message.violations[i] = $root.google.rpc.QuotaFailure.Violation.fromObject(object.violations[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a QuotaFailure message. Also converts values to other types if specified. + * @function toObject + * @memberof google.rpc.QuotaFailure + * @static + * @param {google.rpc.QuotaFailure} message QuotaFailure + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QuotaFailure.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.violations = []; + if (message.violations && message.violations.length) { + object.violations = []; + for (var j = 0; j < message.violations.length; ++j) + object.violations[j] = $root.google.rpc.QuotaFailure.Violation.toObject(message.violations[j], options); + } + return object; + }; + + /** + * Converts this QuotaFailure to JSON. + * @function toJSON + * @memberof google.rpc.QuotaFailure + * @instance + * @returns {Object.} JSON object + */ + QuotaFailure.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for QuotaFailure + * @function getTypeUrl + * @memberof google.rpc.QuotaFailure + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + QuotaFailure.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.rpc.QuotaFailure"; + }; + + QuotaFailure.Violation = (function() { + + /** + * Properties of a Violation. + * @memberof google.rpc.QuotaFailure + * @interface IViolation + * @property {string|null} [subject] Violation subject + * @property {string|null} [description] Violation description + */ + + /** + * Constructs a new Violation. + * @memberof google.rpc.QuotaFailure + * @classdesc Represents a Violation. + * @implements IViolation + * @constructor + * @param {google.rpc.QuotaFailure.IViolation=} [properties] Properties to set + */ + function Violation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Violation subject. + * @member {string} subject + * @memberof google.rpc.QuotaFailure.Violation + * @instance + */ + Violation.prototype.subject = ""; + + /** + * Violation description. + * @member {string} description + * @memberof google.rpc.QuotaFailure.Violation + * @instance + */ + Violation.prototype.description = ""; + + /** + * Creates a new Violation instance using the specified properties. + * @function create + * @memberof google.rpc.QuotaFailure.Violation + * @static + * @param {google.rpc.QuotaFailure.IViolation=} [properties] Properties to set + * @returns {google.rpc.QuotaFailure.Violation} Violation instance + */ + Violation.create = function create(properties) { + return new Violation(properties); + }; + + /** + * Encodes the specified Violation message. Does not implicitly {@link google.rpc.QuotaFailure.Violation.verify|verify} messages. + * @function encode + * @memberof google.rpc.QuotaFailure.Violation + * @static + * @param {google.rpc.QuotaFailure.IViolation} message Violation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Violation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.subject != null && Object.hasOwnProperty.call(message, "subject")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.subject); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); + return writer; + }; + + /** + * Encodes the specified Violation message, length delimited. Does not implicitly {@link google.rpc.QuotaFailure.Violation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.rpc.QuotaFailure.Violation + * @static + * @param {google.rpc.QuotaFailure.IViolation} message Violation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Violation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Violation message from the specified reader or buffer. + * @function decode + * @memberof google.rpc.QuotaFailure.Violation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.rpc.QuotaFailure.Violation} Violation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Violation.decode = function 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.QuotaFailure.Violation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.subject = reader.string(); + break; + } + case 2: { + message.description = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Violation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.rpc.QuotaFailure.Violation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.rpc.QuotaFailure.Violation} Violation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Violation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Violation message. + * @function verify + * @memberof google.rpc.QuotaFailure.Violation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Violation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.subject != null && message.hasOwnProperty("subject")) + if (!$util.isString(message.subject)) + return "subject: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + return null; + }; + + /** + * Creates a Violation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.rpc.QuotaFailure.Violation + * @static + * @param {Object.} object Plain object + * @returns {google.rpc.QuotaFailure.Violation} Violation + */ + Violation.fromObject = function fromObject(object) { + if (object instanceof $root.google.rpc.QuotaFailure.Violation) + return object; + var message = new $root.google.rpc.QuotaFailure.Violation(); + if (object.subject != null) + message.subject = String(object.subject); + if (object.description != null) + message.description = String(object.description); + return message; + }; + + /** + * Creates a plain object from a Violation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.rpc.QuotaFailure.Violation + * @static + * @param {google.rpc.QuotaFailure.Violation} message Violation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Violation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.subject = ""; + object.description = ""; + } + if (message.subject != null && message.hasOwnProperty("subject")) + object.subject = message.subject; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + return object; + }; + + /** + * Converts this Violation to JSON. + * @function toJSON + * @memberof google.rpc.QuotaFailure.Violation + * @instance + * @returns {Object.} JSON object + */ + Violation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Violation + * @function getTypeUrl + * @memberof google.rpc.QuotaFailure.Violation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Violation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.rpc.QuotaFailure.Violation"; + }; + + return Violation; + })(); + + return QuotaFailure; + })(); + + rpc.ErrorInfo = (function() { + + /** + * Properties of an ErrorInfo. + * @memberof google.rpc + * @interface IErrorInfo + * @property {string|null} [reason] ErrorInfo reason + * @property {string|null} [domain] ErrorInfo domain + * @property {Object.|null} [metadata] ErrorInfo metadata + */ + + /** + * Constructs a new ErrorInfo. + * @memberof google.rpc + * @classdesc Represents an ErrorInfo. + * @implements IErrorInfo + * @constructor + * @param {google.rpc.IErrorInfo=} [properties] Properties to set + */ + function ErrorInfo(properties) { + this.metadata = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ErrorInfo reason. + * @member {string} reason + * @memberof google.rpc.ErrorInfo + * @instance + */ + ErrorInfo.prototype.reason = ""; + + /** + * ErrorInfo domain. + * @member {string} domain + * @memberof google.rpc.ErrorInfo + * @instance + */ + ErrorInfo.prototype.domain = ""; + + /** + * ErrorInfo metadata. + * @member {Object.} metadata + * @memberof google.rpc.ErrorInfo + * @instance + */ + ErrorInfo.prototype.metadata = $util.emptyObject; + + /** + * Creates a new ErrorInfo instance using the specified properties. + * @function create + * @memberof google.rpc.ErrorInfo + * @static + * @param {google.rpc.IErrorInfo=} [properties] Properties to set + * @returns {google.rpc.ErrorInfo} ErrorInfo instance + */ + ErrorInfo.create = function create(properties) { + return new ErrorInfo(properties); + }; + + /** + * Encodes the specified ErrorInfo message. Does not implicitly {@link google.rpc.ErrorInfo.verify|verify} messages. + * @function encode + * @memberof google.rpc.ErrorInfo + * @static + * @param {google.rpc.IErrorInfo} message ErrorInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ErrorInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.reason != null && Object.hasOwnProperty.call(message, "reason")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.reason); + if (message.domain != null && Object.hasOwnProperty.call(message, "domain")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.domain); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + for (var keys = Object.keys(message.metadata), i = 0; i < keys.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.metadata[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified ErrorInfo message, length delimited. Does not implicitly {@link google.rpc.ErrorInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.rpc.ErrorInfo + * @static + * @param {google.rpc.IErrorInfo} message ErrorInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ErrorInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ErrorInfo message from the specified reader or buffer. + * @function decode + * @memberof google.rpc.ErrorInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.rpc.ErrorInfo} ErrorInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ErrorInfo.decode = function 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.ErrorInfo(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.reason = reader.string(); + break; + } + case 2: { + message.domain = reader.string(); + break; + } + case 3: { + if (message.metadata === $util.emptyObject) + message.metadata = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.metadata[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ErrorInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.rpc.ErrorInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.rpc.ErrorInfo} ErrorInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ErrorInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ErrorInfo message. + * @function verify + * @memberof google.rpc.ErrorInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ErrorInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.reason != null && message.hasOwnProperty("reason")) + if (!$util.isString(message.reason)) + return "reason: string expected"; + if (message.domain != null && message.hasOwnProperty("domain")) + if (!$util.isString(message.domain)) + return "domain: string expected"; + if (message.metadata != null && message.hasOwnProperty("metadata")) { + if (!$util.isObject(message.metadata)) + return "metadata: object expected"; + var key = Object.keys(message.metadata); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.metadata[key[i]])) + return "metadata: string{k:string} expected"; + } + return null; + }; + + /** + * Creates an ErrorInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.rpc.ErrorInfo + * @static + * @param {Object.} object Plain object + * @returns {google.rpc.ErrorInfo} ErrorInfo + */ + ErrorInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.rpc.ErrorInfo) + return object; + var message = new $root.google.rpc.ErrorInfo(); + if (object.reason != null) + message.reason = String(object.reason); + if (object.domain != null) + message.domain = String(object.domain); + if (object.metadata) { + if (typeof object.metadata !== "object") + throw TypeError(".google.rpc.ErrorInfo.metadata: object expected"); + message.metadata = {}; + for (var keys = Object.keys(object.metadata), i = 0; i < keys.length; ++i) + message.metadata[keys[i]] = String(object.metadata[keys[i]]); + } + return message; + }; + + /** + * Creates a plain object from an ErrorInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.rpc.ErrorInfo + * @static + * @param {google.rpc.ErrorInfo} message ErrorInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ErrorInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.metadata = {}; + if (options.defaults) { + object.reason = ""; + object.domain = ""; + } + if (message.reason != null && message.hasOwnProperty("reason")) + object.reason = message.reason; + if (message.domain != null && message.hasOwnProperty("domain")) + object.domain = message.domain; + var keys2; + if (message.metadata && (keys2 = Object.keys(message.metadata)).length) { + object.metadata = {}; + for (var j = 0; j < keys2.length; ++j) + object.metadata[keys2[j]] = message.metadata[keys2[j]]; + } + return object; + }; + + /** + * Converts this ErrorInfo to JSON. + * @function toJSON + * @memberof google.rpc.ErrorInfo + * @instance + * @returns {Object.} JSON object + */ + ErrorInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ErrorInfo + * @function getTypeUrl + * @memberof google.rpc.ErrorInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ErrorInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.rpc.ErrorInfo"; + }; + + return ErrorInfo; + })(); + + rpc.PreconditionFailure = (function() { + + /** + * Properties of a PreconditionFailure. + * @memberof google.rpc + * @interface IPreconditionFailure + * @property {Array.|null} [violations] PreconditionFailure violations + */ + + /** + * Constructs a new PreconditionFailure. + * @memberof google.rpc + * @classdesc Represents a PreconditionFailure. + * @implements IPreconditionFailure + * @constructor + * @param {google.rpc.IPreconditionFailure=} [properties] Properties to set + */ + function PreconditionFailure(properties) { + this.violations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PreconditionFailure violations. + * @member {Array.} violations + * @memberof google.rpc.PreconditionFailure + * @instance + */ + PreconditionFailure.prototype.violations = $util.emptyArray; + + /** + * Creates a new PreconditionFailure instance using the specified properties. + * @function create + * @memberof google.rpc.PreconditionFailure + * @static + * @param {google.rpc.IPreconditionFailure=} [properties] Properties to set + * @returns {google.rpc.PreconditionFailure} PreconditionFailure instance + */ + PreconditionFailure.create = function create(properties) { + return new PreconditionFailure(properties); + }; + + /** + * Encodes the specified PreconditionFailure message. Does not implicitly {@link google.rpc.PreconditionFailure.verify|verify} messages. + * @function encode + * @memberof google.rpc.PreconditionFailure + * @static + * @param {google.rpc.IPreconditionFailure} message PreconditionFailure message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PreconditionFailure.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.violations != null && message.violations.length) + for (var i = 0; i < message.violations.length; ++i) + $root.google.rpc.PreconditionFailure.Violation.encode(message.violations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PreconditionFailure message, length delimited. Does not implicitly {@link google.rpc.PreconditionFailure.verify|verify} messages. + * @function encodeDelimited + * @memberof google.rpc.PreconditionFailure + * @static + * @param {google.rpc.IPreconditionFailure} message PreconditionFailure message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PreconditionFailure.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PreconditionFailure message from the specified reader or buffer. + * @function decode + * @memberof google.rpc.PreconditionFailure + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.rpc.PreconditionFailure} PreconditionFailure + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PreconditionFailure.decode = function 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.PreconditionFailure(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.violations && message.violations.length)) + message.violations = []; + message.violations.push($root.google.rpc.PreconditionFailure.Violation.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PreconditionFailure message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.rpc.PreconditionFailure + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.rpc.PreconditionFailure} PreconditionFailure + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PreconditionFailure.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PreconditionFailure message. + * @function verify + * @memberof google.rpc.PreconditionFailure + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PreconditionFailure.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.violations != null && message.hasOwnProperty("violations")) { + if (!Array.isArray(message.violations)) + return "violations: array expected"; + for (var i = 0; i < message.violations.length; ++i) { + var error = $root.google.rpc.PreconditionFailure.Violation.verify(message.violations[i]); + if (error) + return "violations." + error; + } + } + return null; + }; + + /** + * Creates a PreconditionFailure message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.rpc.PreconditionFailure + * @static + * @param {Object.} object Plain object + * @returns {google.rpc.PreconditionFailure} PreconditionFailure + */ + PreconditionFailure.fromObject = function fromObject(object) { + if (object instanceof $root.google.rpc.PreconditionFailure) + return object; + var message = new $root.google.rpc.PreconditionFailure(); + if (object.violations) { + if (!Array.isArray(object.violations)) + throw TypeError(".google.rpc.PreconditionFailure.violations: array expected"); + message.violations = []; + for (var i = 0; i < object.violations.length; ++i) { + if (typeof object.violations[i] !== "object") + throw TypeError(".google.rpc.PreconditionFailure.violations: object expected"); + message.violations[i] = $root.google.rpc.PreconditionFailure.Violation.fromObject(object.violations[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a PreconditionFailure message. Also converts values to other types if specified. + * @function toObject + * @memberof google.rpc.PreconditionFailure + * @static + * @param {google.rpc.PreconditionFailure} message PreconditionFailure + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PreconditionFailure.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.violations = []; + if (message.violations && message.violations.length) { + object.violations = []; + for (var j = 0; j < message.violations.length; ++j) + object.violations[j] = $root.google.rpc.PreconditionFailure.Violation.toObject(message.violations[j], options); + } + return object; + }; + + /** + * Converts this PreconditionFailure to JSON. + * @function toJSON + * @memberof google.rpc.PreconditionFailure + * @instance + * @returns {Object.} JSON object + */ + PreconditionFailure.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PreconditionFailure + * @function getTypeUrl + * @memberof google.rpc.PreconditionFailure + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PreconditionFailure.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.rpc.PreconditionFailure"; + }; + + PreconditionFailure.Violation = (function() { + + /** + * Properties of a Violation. + * @memberof google.rpc.PreconditionFailure + * @interface IViolation + * @property {string|null} [type] Violation type + * @property {string|null} [subject] Violation subject + * @property {string|null} [description] Violation description + */ + + /** + * Constructs a new Violation. + * @memberof google.rpc.PreconditionFailure + * @classdesc Represents a Violation. + * @implements IViolation + * @constructor + * @param {google.rpc.PreconditionFailure.IViolation=} [properties] Properties to set + */ + function Violation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Violation type. + * @member {string} type + * @memberof google.rpc.PreconditionFailure.Violation + * @instance + */ + Violation.prototype.type = ""; + + /** + * Violation subject. + * @member {string} subject + * @memberof google.rpc.PreconditionFailure.Violation + * @instance + */ + Violation.prototype.subject = ""; + + /** + * Violation description. + * @member {string} description + * @memberof google.rpc.PreconditionFailure.Violation + * @instance + */ + Violation.prototype.description = ""; + + /** + * Creates a new Violation instance using the specified properties. + * @function create + * @memberof google.rpc.PreconditionFailure.Violation + * @static + * @param {google.rpc.PreconditionFailure.IViolation=} [properties] Properties to set + * @returns {google.rpc.PreconditionFailure.Violation} Violation instance + */ + Violation.create = function create(properties) { + return new Violation(properties); + }; + + /** + * Encodes the specified Violation message. Does not implicitly {@link google.rpc.PreconditionFailure.Violation.verify|verify} messages. + * @function encode + * @memberof google.rpc.PreconditionFailure.Violation + * @static + * @param {google.rpc.PreconditionFailure.IViolation} message Violation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Violation.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.subject != null && Object.hasOwnProperty.call(message, "subject")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.subject); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + return writer; + }; + + /** + * Encodes the specified Violation message, length delimited. Does not implicitly {@link google.rpc.PreconditionFailure.Violation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.rpc.PreconditionFailure.Violation + * @static + * @param {google.rpc.PreconditionFailure.IViolation} message Violation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Violation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Violation message from the specified reader or buffer. + * @function decode + * @memberof google.rpc.PreconditionFailure.Violation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.rpc.PreconditionFailure.Violation} Violation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Violation.decode = function 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.PreconditionFailure.Violation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.type = reader.string(); + break; + } + case 2: { + message.subject = reader.string(); + break; + } + case 3: { + message.description = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Violation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.rpc.PreconditionFailure.Violation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.rpc.PreconditionFailure.Violation} Violation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Violation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Violation message. + * @function verify + * @memberof google.rpc.PreconditionFailure.Violation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Violation.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.subject != null && message.hasOwnProperty("subject")) + if (!$util.isString(message.subject)) + return "subject: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + return null; + }; + + /** + * Creates a Violation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.rpc.PreconditionFailure.Violation + * @static + * @param {Object.} object Plain object + * @returns {google.rpc.PreconditionFailure.Violation} Violation + */ + Violation.fromObject = function fromObject(object) { + if (object instanceof $root.google.rpc.PreconditionFailure.Violation) + return object; + var message = new $root.google.rpc.PreconditionFailure.Violation(); + if (object.type != null) + message.type = String(object.type); + if (object.subject != null) + message.subject = String(object.subject); + if (object.description != null) + message.description = String(object.description); + return message; + }; + + /** + * Creates a plain object from a Violation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.rpc.PreconditionFailure.Violation + * @static + * @param {google.rpc.PreconditionFailure.Violation} message Violation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Violation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type = ""; + object.subject = ""; + object.description = ""; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.subject != null && message.hasOwnProperty("subject")) + object.subject = message.subject; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + return object; + }; + + /** + * Converts this Violation to JSON. + * @function toJSON + * @memberof google.rpc.PreconditionFailure.Violation + * @instance + * @returns {Object.} JSON object + */ + Violation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Violation + * @function getTypeUrl + * @memberof google.rpc.PreconditionFailure.Violation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Violation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.rpc.PreconditionFailure.Violation"; + }; + + return Violation; + })(); + + return PreconditionFailure; + })(); + + rpc.BadRequest = (function() { + + /** + * Properties of a BadRequest. + * @memberof google.rpc + * @interface IBadRequest + * @property {Array.|null} [fieldViolations] BadRequest fieldViolations + */ + + /** + * Constructs a new BadRequest. + * @memberof google.rpc + * @classdesc Represents a BadRequest. + * @implements IBadRequest + * @constructor + * @param {google.rpc.IBadRequest=} [properties] Properties to set + */ + function BadRequest(properties) { + this.fieldViolations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BadRequest fieldViolations. + * @member {Array.} fieldViolations + * @memberof google.rpc.BadRequest + * @instance + */ + BadRequest.prototype.fieldViolations = $util.emptyArray; + + /** + * Creates a new BadRequest instance using the specified properties. + * @function create + * @memberof google.rpc.BadRequest + * @static + * @param {google.rpc.IBadRequest=} [properties] Properties to set + * @returns {google.rpc.BadRequest} BadRequest instance + */ + BadRequest.create = function create(properties) { + return new BadRequest(properties); + }; + + /** + * Encodes the specified BadRequest message. Does not implicitly {@link google.rpc.BadRequest.verify|verify} messages. + * @function encode + * @memberof google.rpc.BadRequest + * @static + * @param {google.rpc.IBadRequest} message BadRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BadRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fieldViolations != null && message.fieldViolations.length) + for (var i = 0; i < message.fieldViolations.length; ++i) + $root.google.rpc.BadRequest.FieldViolation.encode(message.fieldViolations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BadRequest message, length delimited. Does not implicitly {@link google.rpc.BadRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.rpc.BadRequest + * @static + * @param {google.rpc.IBadRequest} message BadRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BadRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BadRequest message from the specified reader or buffer. + * @function decode + * @memberof google.rpc.BadRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.rpc.BadRequest} BadRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BadRequest.decode = function 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.BadRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.fieldViolations && message.fieldViolations.length)) + message.fieldViolations = []; + message.fieldViolations.push($root.google.rpc.BadRequest.FieldViolation.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BadRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.rpc.BadRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.rpc.BadRequest} BadRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BadRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BadRequest message. + * @function verify + * @memberof google.rpc.BadRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BadRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.fieldViolations != null && message.hasOwnProperty("fieldViolations")) { + if (!Array.isArray(message.fieldViolations)) + return "fieldViolations: array expected"; + for (var i = 0; i < message.fieldViolations.length; ++i) { + var error = $root.google.rpc.BadRequest.FieldViolation.verify(message.fieldViolations[i]); + if (error) + return "fieldViolations." + error; + } + } + return null; + }; + + /** + * Creates a BadRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.rpc.BadRequest + * @static + * @param {Object.} object Plain object + * @returns {google.rpc.BadRequest} BadRequest + */ + BadRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.rpc.BadRequest) + return object; + var message = new $root.google.rpc.BadRequest(); + if (object.fieldViolations) { + if (!Array.isArray(object.fieldViolations)) + throw TypeError(".google.rpc.BadRequest.fieldViolations: array expected"); + message.fieldViolations = []; + for (var i = 0; i < object.fieldViolations.length; ++i) { + if (typeof object.fieldViolations[i] !== "object") + throw TypeError(".google.rpc.BadRequest.fieldViolations: object expected"); + message.fieldViolations[i] = $root.google.rpc.BadRequest.FieldViolation.fromObject(object.fieldViolations[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a BadRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.rpc.BadRequest + * @static + * @param {google.rpc.BadRequest} message BadRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BadRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.fieldViolations = []; + if (message.fieldViolations && message.fieldViolations.length) { + object.fieldViolations = []; + for (var j = 0; j < message.fieldViolations.length; ++j) + object.fieldViolations[j] = $root.google.rpc.BadRequest.FieldViolation.toObject(message.fieldViolations[j], options); + } + return object; + }; + + /** + * Converts this BadRequest to JSON. + * @function toJSON + * @memberof google.rpc.BadRequest + * @instance + * @returns {Object.} JSON object + */ + BadRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BadRequest + * @function getTypeUrl + * @memberof google.rpc.BadRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BadRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.rpc.BadRequest"; + }; + + BadRequest.FieldViolation = (function() { + + /** + * Properties of a FieldViolation. + * @memberof google.rpc.BadRequest + * @interface IFieldViolation + * @property {string|null} [field] FieldViolation field + * @property {string|null} [description] FieldViolation description + */ + + /** + * Constructs a new FieldViolation. + * @memberof google.rpc.BadRequest + * @classdesc Represents a FieldViolation. + * @implements IFieldViolation + * @constructor + * @param {google.rpc.BadRequest.IFieldViolation=} [properties] Properties to set + */ + function FieldViolation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldViolation field. + * @member {string} field + * @memberof google.rpc.BadRequest.FieldViolation + * @instance + */ + FieldViolation.prototype.field = ""; + + /** + * FieldViolation description. + * @member {string} description + * @memberof google.rpc.BadRequest.FieldViolation + * @instance + */ + FieldViolation.prototype.description = ""; + + /** + * Creates a new FieldViolation instance using the specified properties. + * @function create + * @memberof google.rpc.BadRequest.FieldViolation + * @static + * @param {google.rpc.BadRequest.IFieldViolation=} [properties] Properties to set + * @returns {google.rpc.BadRequest.FieldViolation} FieldViolation instance + */ + FieldViolation.create = function create(properties) { + return new FieldViolation(properties); + }; + + /** + * Encodes the specified FieldViolation message. Does not implicitly {@link google.rpc.BadRequest.FieldViolation.verify|verify} messages. + * @function encode + * @memberof google.rpc.BadRequest.FieldViolation + * @static + * @param {google.rpc.BadRequest.IFieldViolation} message FieldViolation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldViolation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.field != null && Object.hasOwnProperty.call(message, "field")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.field); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); + return writer; + }; + + /** + * Encodes the specified FieldViolation message, length delimited. Does not implicitly {@link google.rpc.BadRequest.FieldViolation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.rpc.BadRequest.FieldViolation + * @static + * @param {google.rpc.BadRequest.IFieldViolation} message FieldViolation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldViolation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldViolation message from the specified reader or buffer. + * @function decode + * @memberof google.rpc.BadRequest.FieldViolation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.rpc.BadRequest.FieldViolation} FieldViolation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldViolation.decode = function 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.BadRequest.FieldViolation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.field = reader.string(); + break; + } + case 2: { + message.description = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldViolation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.rpc.BadRequest.FieldViolation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.rpc.BadRequest.FieldViolation} FieldViolation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldViolation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldViolation message. + * @function verify + * @memberof google.rpc.BadRequest.FieldViolation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldViolation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.field != null && message.hasOwnProperty("field")) + if (!$util.isString(message.field)) + return "field: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + return null; + }; + + /** + * Creates a FieldViolation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.rpc.BadRequest.FieldViolation + * @static + * @param {Object.} object Plain object + * @returns {google.rpc.BadRequest.FieldViolation} FieldViolation + */ + FieldViolation.fromObject = function fromObject(object) { + if (object instanceof $root.google.rpc.BadRequest.FieldViolation) + return object; + var message = new $root.google.rpc.BadRequest.FieldViolation(); + if (object.field != null) + message.field = String(object.field); + if (object.description != null) + message.description = String(object.description); + return message; + }; + + /** + * Creates a plain object from a FieldViolation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.rpc.BadRequest.FieldViolation + * @static + * @param {google.rpc.BadRequest.FieldViolation} message FieldViolation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldViolation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.field = ""; + object.description = ""; + } + if (message.field != null && message.hasOwnProperty("field")) + object.field = message.field; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + return object; + }; + + /** + * Converts this FieldViolation to JSON. + * @function toJSON + * @memberof google.rpc.BadRequest.FieldViolation + * @instance + * @returns {Object.} JSON object + */ + FieldViolation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldViolation + * @function getTypeUrl + * @memberof google.rpc.BadRequest.FieldViolation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldViolation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.rpc.BadRequest.FieldViolation"; + }; + + return FieldViolation; + })(); + + return BadRequest; + })(); + + rpc.RequestInfo = (function() { + + /** + * Properties of a RequestInfo. + * @memberof google.rpc + * @interface IRequestInfo + * @property {string|null} [requestId] RequestInfo requestId + * @property {string|null} [servingData] RequestInfo servingData + */ + + /** + * Constructs a new RequestInfo. + * @memberof google.rpc + * @classdesc Represents a RequestInfo. + * @implements IRequestInfo + * @constructor + * @param {google.rpc.IRequestInfo=} [properties] Properties to set + */ + function RequestInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RequestInfo requestId. + * @member {string} requestId + * @memberof google.rpc.RequestInfo + * @instance + */ + RequestInfo.prototype.requestId = ""; + + /** + * RequestInfo servingData. + * @member {string} servingData + * @memberof google.rpc.RequestInfo + * @instance + */ + RequestInfo.prototype.servingData = ""; + + /** + * Creates a new RequestInfo instance using the specified properties. + * @function create + * @memberof google.rpc.RequestInfo + * @static + * @param {google.rpc.IRequestInfo=} [properties] Properties to set + * @returns {google.rpc.RequestInfo} RequestInfo instance + */ + RequestInfo.create = function create(properties) { + return new RequestInfo(properties); + }; + + /** + * Encodes the specified RequestInfo message. Does not implicitly {@link google.rpc.RequestInfo.verify|verify} messages. + * @function encode + * @memberof google.rpc.RequestInfo + * @static + * @param {google.rpc.IRequestInfo} message RequestInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RequestInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.requestId); + if (message.servingData != null && Object.hasOwnProperty.call(message, "servingData")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.servingData); + return writer; + }; + + /** + * Encodes the specified RequestInfo message, length delimited. Does not implicitly {@link google.rpc.RequestInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.rpc.RequestInfo + * @static + * @param {google.rpc.IRequestInfo} message RequestInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RequestInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RequestInfo message from the specified reader or buffer. + * @function decode + * @memberof google.rpc.RequestInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.rpc.RequestInfo} RequestInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RequestInfo.decode = function 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.RequestInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.requestId = reader.string(); + break; + } + case 2: { + message.servingData = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RequestInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.rpc.RequestInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.rpc.RequestInfo} RequestInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RequestInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RequestInfo message. + * @function verify + * @memberof google.rpc.RequestInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RequestInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.servingData != null && message.hasOwnProperty("servingData")) + if (!$util.isString(message.servingData)) + return "servingData: string expected"; + return null; + }; + + /** + * Creates a RequestInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.rpc.RequestInfo + * @static + * @param {Object.} object Plain object + * @returns {google.rpc.RequestInfo} RequestInfo + */ + RequestInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.rpc.RequestInfo) + return object; + var message = new $root.google.rpc.RequestInfo(); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.servingData != null) + message.servingData = String(object.servingData); + return message; + }; + + /** + * Creates a plain object from a RequestInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.rpc.RequestInfo + * @static + * @param {google.rpc.RequestInfo} message RequestInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RequestInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.requestId = ""; + object.servingData = ""; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.servingData != null && message.hasOwnProperty("servingData")) + object.servingData = message.servingData; + return object; + }; + + /** + * Converts this RequestInfo to JSON. + * @function toJSON + * @memberof google.rpc.RequestInfo + * @instance + * @returns {Object.} JSON object + */ + RequestInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RequestInfo + * @function getTypeUrl + * @memberof google.rpc.RequestInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RequestInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.rpc.RequestInfo"; + }; + + return RequestInfo; + })(); + + rpc.ResourceInfo = (function() { + + /** + * Properties of a ResourceInfo. + * @memberof google.rpc + * @interface IResourceInfo + * @property {string|null} [resourceType] ResourceInfo resourceType + * @property {string|null} [resourceName] ResourceInfo resourceName + * @property {string|null} [owner] ResourceInfo owner + * @property {string|null} [description] ResourceInfo description + */ + + /** + * Constructs a new ResourceInfo. + * @memberof google.rpc + * @classdesc Represents a ResourceInfo. + * @implements IResourceInfo + * @constructor + * @param {google.rpc.IResourceInfo=} [properties] Properties to set + */ + function ResourceInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResourceInfo resourceType. + * @member {string} resourceType + * @memberof google.rpc.ResourceInfo + * @instance + */ + ResourceInfo.prototype.resourceType = ""; + + /** + * ResourceInfo resourceName. + * @member {string} resourceName + * @memberof google.rpc.ResourceInfo + * @instance + */ + ResourceInfo.prototype.resourceName = ""; + + /** + * ResourceInfo owner. + * @member {string} owner + * @memberof google.rpc.ResourceInfo + * @instance + */ + ResourceInfo.prototype.owner = ""; + + /** + * ResourceInfo description. + * @member {string} description + * @memberof google.rpc.ResourceInfo + * @instance + */ + ResourceInfo.prototype.description = ""; + + /** + * Creates a new ResourceInfo instance using the specified properties. + * @function create + * @memberof google.rpc.ResourceInfo + * @static + * @param {google.rpc.IResourceInfo=} [properties] Properties to set + * @returns {google.rpc.ResourceInfo} ResourceInfo instance + */ + ResourceInfo.create = function create(properties) { + return new ResourceInfo(properties); + }; + + /** + * Encodes the specified ResourceInfo message. Does not implicitly {@link google.rpc.ResourceInfo.verify|verify} messages. + * @function encode + * @memberof google.rpc.ResourceInfo + * @static + * @param {google.rpc.IResourceInfo} message ResourceInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resourceType != null && Object.hasOwnProperty.call(message, "resourceType")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.resourceType); + if (message.resourceName != null && Object.hasOwnProperty.call(message, "resourceName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.resourceName); + if (message.owner != null && Object.hasOwnProperty.call(message, "owner")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.owner); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.description); + return writer; + }; + + /** + * Encodes the specified ResourceInfo message, length delimited. Does not implicitly {@link google.rpc.ResourceInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.rpc.ResourceInfo + * @static + * @param {google.rpc.IResourceInfo} message ResourceInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourceInfo message from the specified reader or buffer. + * @function decode + * @memberof google.rpc.ResourceInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.rpc.ResourceInfo} ResourceInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceInfo.decode = function 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.ResourceInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.resourceType = reader.string(); + break; + } + case 2: { + message.resourceName = reader.string(); + break; + } + case 3: { + message.owner = reader.string(); + break; + } + case 4: { + message.description = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourceInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.rpc.ResourceInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.rpc.ResourceInfo} ResourceInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourceInfo message. + * @function verify + * @memberof google.rpc.ResourceInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.resourceType != null && message.hasOwnProperty("resourceType")) + if (!$util.isString(message.resourceType)) + return "resourceType: string expected"; + if (message.resourceName != null && message.hasOwnProperty("resourceName")) + if (!$util.isString(message.resourceName)) + return "resourceName: string expected"; + if (message.owner != null && message.hasOwnProperty("owner")) + if (!$util.isString(message.owner)) + return "owner: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + return null; + }; + + /** + * Creates a ResourceInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.rpc.ResourceInfo + * @static + * @param {Object.} object Plain object + * @returns {google.rpc.ResourceInfo} ResourceInfo + */ + ResourceInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.rpc.ResourceInfo) + return object; + var message = new $root.google.rpc.ResourceInfo(); + if (object.resourceType != null) + message.resourceType = String(object.resourceType); + if (object.resourceName != null) + message.resourceName = String(object.resourceName); + if (object.owner != null) + message.owner = String(object.owner); + if (object.description != null) + message.description = String(object.description); + return message; + }; + + /** + * Creates a plain object from a ResourceInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.rpc.ResourceInfo + * @static + * @param {google.rpc.ResourceInfo} message ResourceInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.resourceType = ""; + object.resourceName = ""; + object.owner = ""; + object.description = ""; + } + if (message.resourceType != null && message.hasOwnProperty("resourceType")) + object.resourceType = message.resourceType; + if (message.resourceName != null && message.hasOwnProperty("resourceName")) + object.resourceName = message.resourceName; + if (message.owner != null && message.hasOwnProperty("owner")) + object.owner = message.owner; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + return object; + }; + + /** + * Converts this ResourceInfo to JSON. + * @function toJSON + * @memberof google.rpc.ResourceInfo + * @instance + * @returns {Object.} JSON object + */ + ResourceInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ResourceInfo + * @function getTypeUrl + * @memberof google.rpc.ResourceInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResourceInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.rpc.ResourceInfo"; + }; + + return ResourceInfo; + })(); + + rpc.Help = (function() { + + /** + * Properties of a Help. + * @memberof google.rpc + * @interface IHelp + * @property {Array.|null} [links] Help links + */ + + /** + * Constructs a new Help. + * @memberof google.rpc + * @classdesc Represents a Help. + * @implements IHelp + * @constructor + * @param {google.rpc.IHelp=} [properties] Properties to set + */ + function Help(properties) { + this.links = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Help links. + * @member {Array.} links + * @memberof google.rpc.Help + * @instance + */ + Help.prototype.links = $util.emptyArray; + + /** + * Creates a new Help instance using the specified properties. + * @function create + * @memberof google.rpc.Help + * @static + * @param {google.rpc.IHelp=} [properties] Properties to set + * @returns {google.rpc.Help} Help instance + */ + Help.create = function create(properties) { + return new Help(properties); + }; + + /** + * Encodes the specified Help message. Does not implicitly {@link google.rpc.Help.verify|verify} messages. + * @function encode + * @memberof google.rpc.Help + * @static + * @param {google.rpc.IHelp} message Help message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Help.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.links != null && message.links.length) + for (var i = 0; i < message.links.length; ++i) + $root.google.rpc.Help.Link.encode(message.links[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Help message, length delimited. Does not implicitly {@link google.rpc.Help.verify|verify} messages. + * @function encodeDelimited + * @memberof google.rpc.Help + * @static + * @param {google.rpc.IHelp} message Help message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Help.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Help message from the specified reader or buffer. + * @function decode + * @memberof google.rpc.Help + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.rpc.Help} Help + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Help.decode = function 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.Help(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.links && message.links.length)) + message.links = []; + message.links.push($root.google.rpc.Help.Link.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Help message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.rpc.Help + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.rpc.Help} Help + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Help.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Help message. + * @function verify + * @memberof google.rpc.Help + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Help.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.links != null && message.hasOwnProperty("links")) { + if (!Array.isArray(message.links)) + return "links: array expected"; + for (var i = 0; i < message.links.length; ++i) { + var error = $root.google.rpc.Help.Link.verify(message.links[i]); + if (error) + return "links." + error; + } + } + return null; + }; + + /** + * Creates a Help message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.rpc.Help + * @static + * @param {Object.} object Plain object + * @returns {google.rpc.Help} Help + */ + Help.fromObject = function fromObject(object) { + if (object instanceof $root.google.rpc.Help) + return object; + var message = new $root.google.rpc.Help(); + if (object.links) { + if (!Array.isArray(object.links)) + throw TypeError(".google.rpc.Help.links: array expected"); + message.links = []; + for (var i = 0; i < object.links.length; ++i) { + if (typeof object.links[i] !== "object") + throw TypeError(".google.rpc.Help.links: object expected"); + message.links[i] = $root.google.rpc.Help.Link.fromObject(object.links[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Help message. Also converts values to other types if specified. + * @function toObject + * @memberof google.rpc.Help + * @static + * @param {google.rpc.Help} message Help + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Help.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.links = []; + if (message.links && message.links.length) { + object.links = []; + for (var j = 0; j < message.links.length; ++j) + object.links[j] = $root.google.rpc.Help.Link.toObject(message.links[j], options); + } + return object; + }; + + /** + * Converts this Help to JSON. + * @function toJSON + * @memberof google.rpc.Help + * @instance + * @returns {Object.} JSON object + */ + Help.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Help + * @function getTypeUrl + * @memberof google.rpc.Help + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Help.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.rpc.Help"; + }; + + Help.Link = (function() { + + /** + * Properties of a Link. + * @memberof google.rpc.Help + * @interface ILink + * @property {string|null} [description] Link description + * @property {string|null} [url] Link url + */ + + /** + * Constructs a new Link. + * @memberof google.rpc.Help + * @classdesc Represents a Link. + * @implements ILink + * @constructor + * @param {google.rpc.Help.ILink=} [properties] Properties to set + */ + function Link(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Link description. + * @member {string} description + * @memberof google.rpc.Help.Link + * @instance + */ + Link.prototype.description = ""; + + /** + * Link url. + * @member {string} url + * @memberof google.rpc.Help.Link + * @instance + */ + Link.prototype.url = ""; + + /** + * Creates a new Link instance using the specified properties. + * @function create + * @memberof google.rpc.Help.Link + * @static + * @param {google.rpc.Help.ILink=} [properties] Properties to set + * @returns {google.rpc.Help.Link} Link instance + */ + Link.create = function create(properties) { + return new Link(properties); + }; + + /** + * Encodes the specified Link message. Does not implicitly {@link google.rpc.Help.Link.verify|verify} messages. + * @function encode + * @memberof google.rpc.Help.Link + * @static + * @param {google.rpc.Help.ILink} message Link message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Link.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.description); + if (message.url != null && Object.hasOwnProperty.call(message, "url")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.url); + return writer; + }; + + /** + * Encodes the specified Link message, length delimited. Does not implicitly {@link google.rpc.Help.Link.verify|verify} messages. + * @function encodeDelimited + * @memberof google.rpc.Help.Link + * @static + * @param {google.rpc.Help.ILink} message Link message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Link.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Link message from the specified reader or buffer. + * @function decode + * @memberof google.rpc.Help.Link + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.rpc.Help.Link} Link + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Link.decode = function 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.Help.Link(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.description = reader.string(); + break; + } + case 2: { + message.url = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Link message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.rpc.Help.Link + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.rpc.Help.Link} Link + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Link.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Link message. + * @function verify + * @memberof google.rpc.Help.Link + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Link.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.url != null && message.hasOwnProperty("url")) + if (!$util.isString(message.url)) + return "url: string expected"; + return null; + }; + + /** + * Creates a Link message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.rpc.Help.Link + * @static + * @param {Object.} object Plain object + * @returns {google.rpc.Help.Link} Link + */ + Link.fromObject = function fromObject(object) { + if (object instanceof $root.google.rpc.Help.Link) + return object; + var message = new $root.google.rpc.Help.Link(); + if (object.description != null) + message.description = String(object.description); + if (object.url != null) + message.url = String(object.url); + return message; + }; + + /** + * Creates a plain object from a Link message. Also converts values to other types if specified. + * @function toObject + * @memberof google.rpc.Help.Link + * @static + * @param {google.rpc.Help.Link} message Link + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Link.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.description = ""; + object.url = ""; + } + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.url != null && message.hasOwnProperty("url")) + object.url = message.url; + return object; + }; + + /** + * Converts this Link to JSON. + * @function toJSON + * @memberof google.rpc.Help.Link + * @instance + * @returns {Object.} JSON object + */ + Link.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Link + * @function getTypeUrl + * @memberof google.rpc.Help.Link + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Link.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.rpc.Help.Link"; + }; + + return Link; + })(); + + return Help; + })(); + + rpc.LocalizedMessage = (function() { + + /** + * Properties of a LocalizedMessage. + * @memberof google.rpc + * @interface ILocalizedMessage + * @property {string|null} [locale] LocalizedMessage locale + * @property {string|null} [message] LocalizedMessage message + */ + + /** + * Constructs a new LocalizedMessage. + * @memberof google.rpc + * @classdesc Represents a LocalizedMessage. + * @implements ILocalizedMessage + * @constructor + * @param {google.rpc.ILocalizedMessage=} [properties] Properties to set + */ + function LocalizedMessage(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LocalizedMessage locale. + * @member {string} locale + * @memberof google.rpc.LocalizedMessage + * @instance + */ + LocalizedMessage.prototype.locale = ""; + + /** + * LocalizedMessage message. + * @member {string} message + * @memberof google.rpc.LocalizedMessage + * @instance + */ + LocalizedMessage.prototype.message = ""; + + /** + * Creates a new LocalizedMessage instance using the specified properties. + * @function create + * @memberof google.rpc.LocalizedMessage + * @static + * @param {google.rpc.ILocalizedMessage=} [properties] Properties to set + * @returns {google.rpc.LocalizedMessage} LocalizedMessage instance + */ + LocalizedMessage.create = function create(properties) { + return new LocalizedMessage(properties); + }; + + /** + * Encodes the specified LocalizedMessage message. Does not implicitly {@link google.rpc.LocalizedMessage.verify|verify} messages. + * @function encode + * @memberof google.rpc.LocalizedMessage + * @static + * @param {google.rpc.ILocalizedMessage} message LocalizedMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LocalizedMessage.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.locale != null && Object.hasOwnProperty.call(message, "locale")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.locale); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.message); + return writer; + }; + + /** + * Encodes the specified LocalizedMessage message, length delimited. Does not implicitly {@link google.rpc.LocalizedMessage.verify|verify} messages. + * @function encodeDelimited + * @memberof google.rpc.LocalizedMessage + * @static + * @param {google.rpc.ILocalizedMessage} message LocalizedMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LocalizedMessage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LocalizedMessage message from the specified reader or buffer. + * @function decode + * @memberof google.rpc.LocalizedMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.rpc.LocalizedMessage} LocalizedMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LocalizedMessage.decode = function 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.LocalizedMessage(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.locale = reader.string(); + break; + } + case 2: { + message.message = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LocalizedMessage message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.rpc.LocalizedMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.rpc.LocalizedMessage} LocalizedMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LocalizedMessage.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LocalizedMessage message. + * @function verify + * @memberof google.rpc.LocalizedMessage + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LocalizedMessage.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.locale != null && message.hasOwnProperty("locale")) + if (!$util.isString(message.locale)) + return "locale: string expected"; + if (message.message != null && message.hasOwnProperty("message")) + if (!$util.isString(message.message)) + return "message: string expected"; + return null; + }; + + /** + * Creates a LocalizedMessage message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.rpc.LocalizedMessage + * @static + * @param {Object.} object Plain object + * @returns {google.rpc.LocalizedMessage} LocalizedMessage + */ + LocalizedMessage.fromObject = function fromObject(object) { + if (object instanceof $root.google.rpc.LocalizedMessage) + return object; + var message = new $root.google.rpc.LocalizedMessage(); + if (object.locale != null) + message.locale = String(object.locale); + if (object.message != null) + message.message = String(object.message); + return message; + }; + + /** + * Creates a plain object from a LocalizedMessage message. Also converts values to other types if specified. + * @function toObject + * @memberof google.rpc.LocalizedMessage + * @static + * @param {google.rpc.LocalizedMessage} message LocalizedMessage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LocalizedMessage.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.locale = ""; + object.message = ""; + } + if (message.locale != null && message.hasOwnProperty("locale")) + object.locale = message.locale; + if (message.message != null && message.hasOwnProperty("message")) + object.message = message.message; + return object; + }; + + /** + * Converts this LocalizedMessage to JSON. + * @function toJSON + * @memberof google.rpc.LocalizedMessage + * @instance + * @returns {Object.} JSON object + */ + LocalizedMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LocalizedMessage + * @function getTypeUrl + * @memberof google.rpc.LocalizedMessage + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LocalizedMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.rpc.LocalizedMessage"; + }; + + return LocalizedMessage; + })(); + + return rpc; + })(); + + return google; + })(); + + return $root; +}); diff --git a/packages/google-cloud-vmmigration/protos/protos.json b/packages/google-cloud-vmmigration/protos/protos.json new file mode 100644 index 00000000000..8aac93bc33f --- /dev/null +++ b/packages/google-cloud-vmmigration/protos/protos.json @@ -0,0 +1,5272 @@ +{ + "nested": { + "google": { + "nested": { + "cloud": { + "nested": { + "vmmigration": { + "nested": { + "v1": { + "options": { + "csharp_namespace": "Google.Cloud.VMMigration.V1", + "go_package": "google.golang.org/genproto/googleapis/cloud/vmmigration/v1;vmmigration", + "java_multiple_files": true, + "java_outer_classname": "VmMigrationProto", + "java_package": "com.google.cloud.vmmigration.v1", + "php_namespace": "Google\\Cloud\\VMMigration\\V1", + "ruby_package": "Google::Cloud::VMMigration::V1" + }, + "nested": { + "VmMigration": { + "options": { + "(google.api.default_host)": "vmmigration.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "ListSources": { + "requestType": "ListSourcesRequest", + "responseType": "ListSourcesResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/sources", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}/sources" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetSource": { + "requestType": "GetSourceRequest", + "responseType": "Source", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/sources/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/sources/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateSource": { + "requestType": "CreateSourceRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/sources", + "(google.api.http).body": "source", + "(google.api.method_signature)": "parent,source,source_id", + "(google.longrunning.operation_info).response_type": "Source", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*}/sources", + "body": "source" + } + }, + { + "(google.api.method_signature)": "parent,source,source_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Source", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "UpdateSource": { + "requestType": "UpdateSourceRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v1/{source.name=projects/*/locations/*/sources/*}", + "(google.api.http).body": "source", + "(google.api.method_signature)": "source,update_mask", + "(google.longrunning.operation_info).response_type": "Source", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{source.name=projects/*/locations/*/sources/*}", + "body": "source" + } + }, + { + "(google.api.method_signature)": "source,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Source", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "DeleteSource": { + "requestType": "DeleteSourceRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/sources/*}", + "(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/*/sources/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "FetchInventory": { + "requestType": "FetchInventoryRequest", + "responseType": "FetchInventoryResponse", + "options": { + "(google.api.http).get": "/v1/{source=projects/*/locations/*/sources/*}:fetchInventory", + "(google.api.method_signature)": "source" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{source=projects/*/locations/*/sources/*}:fetchInventory" + } + }, + { + "(google.api.method_signature)": "source" + } + ] + }, + "ListUtilizationReports": { + "requestType": "ListUtilizationReportsRequest", + "responseType": "ListUtilizationReportsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*/sources/*}/utilizationReports", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*/sources/*}/utilizationReports" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetUtilizationReport": { + "requestType": "GetUtilizationReportRequest", + "responseType": "UtilizationReport", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/sources/*/utilizationReports/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/sources/*/utilizationReports/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateUtilizationReport": { + "requestType": "CreateUtilizationReportRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*/sources/*}/utilizationReports", + "(google.api.http).body": "utilization_report", + "(google.api.method_signature)": "parent,utilization_report,utilization_report_id", + "(google.longrunning.operation_info).response_type": "UtilizationReport", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*/sources/*}/utilizationReports", + "body": "utilization_report" + } + }, + { + "(google.api.method_signature)": "parent,utilization_report,utilization_report_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "UtilizationReport", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "DeleteUtilizationReport": { + "requestType": "DeleteUtilizationReportRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/sources/*/utilizationReports/*}", + "(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/*/sources/*/utilizationReports/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "ListDatacenterConnectors": { + "requestType": "ListDatacenterConnectorsRequest", + "responseType": "ListDatacenterConnectorsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*/sources/*}/datacenterConnectors", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*/sources/*}/datacenterConnectors" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetDatacenterConnector": { + "requestType": "GetDatacenterConnectorRequest", + "responseType": "DatacenterConnector", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/sources/*/datacenterConnectors/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/sources/*/datacenterConnectors/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateDatacenterConnector": { + "requestType": "CreateDatacenterConnectorRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*/sources/*}/datacenterConnectors", + "(google.api.http).body": "datacenter_connector", + "(google.api.method_signature)": "parent,datacenter_connector,datacenter_connector_id", + "(google.longrunning.operation_info).response_type": "DatacenterConnector", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*/sources/*}/datacenterConnectors", + "body": "datacenter_connector" + } + }, + { + "(google.api.method_signature)": "parent,datacenter_connector,datacenter_connector_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "DatacenterConnector", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "DeleteDatacenterConnector": { + "requestType": "DeleteDatacenterConnectorRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/sources/*/datacenterConnectors/*}", + "(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/*/sources/*/datacenterConnectors/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "UpgradeAppliance": { + "requestType": "UpgradeApplianceRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{datacenter_connector=projects/*/locations/*/sources/*/datacenterConnectors/*}:upgradeAppliance", + "(google.api.http).body": "*", + "(google.longrunning.operation_info).response_type": "UpgradeApplianceResponse", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{datacenter_connector=projects/*/locations/*/sources/*/datacenterConnectors/*}:upgradeAppliance", + "body": "*" + } + }, + { + "(google.longrunning.operation_info)": { + "response_type": "UpgradeApplianceResponse", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "CreateMigratingVm": { + "requestType": "CreateMigratingVmRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*/sources/*}/migratingVms", + "(google.api.http).body": "migrating_vm", + "(google.api.method_signature)": "parent,migrating_vm,migrating_vm_id", + "(google.longrunning.operation_info).response_type": "MigratingVm", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*/sources/*}/migratingVms", + "body": "migrating_vm" + } + }, + { + "(google.api.method_signature)": "parent,migrating_vm,migrating_vm_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "MigratingVm", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "ListMigratingVms": { + "requestType": "ListMigratingVmsRequest", + "responseType": "ListMigratingVmsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*/sources/*}/migratingVms", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*/sources/*}/migratingVms" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetMigratingVm": { + "requestType": "GetMigratingVmRequest", + "responseType": "MigratingVm", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/sources/*/migratingVms/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/sources/*/migratingVms/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "UpdateMigratingVm": { + "requestType": "UpdateMigratingVmRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v1/{migrating_vm.name=projects/*/locations/*/sources/*/migratingVms/*}", + "(google.api.http).body": "migrating_vm", + "(google.api.method_signature)": "migrating_vm,update_mask", + "(google.longrunning.operation_info).response_type": "MigratingVm", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{migrating_vm.name=projects/*/locations/*/sources/*/migratingVms/*}", + "body": "migrating_vm" + } + }, + { + "(google.api.method_signature)": "migrating_vm,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "MigratingVm", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "DeleteMigratingVm": { + "requestType": "DeleteMigratingVmRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/sources/*/migratingVms/*}", + "(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/*/sources/*/migratingVms/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "StartMigration": { + "requestType": "StartMigrationRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{migrating_vm=projects/*/locations/*/sources/*/migratingVms/*}:startMigration", + "(google.api.http).body": "*", + "(google.api.method_signature)": "migrating_vm", + "(google.longrunning.operation_info).response_type": "StartMigrationResponse", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{migrating_vm=projects/*/locations/*/sources/*/migratingVms/*}:startMigration", + "body": "*" + } + }, + { + "(google.api.method_signature)": "migrating_vm" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "StartMigrationResponse", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "ResumeMigration": { + "requestType": "ResumeMigrationRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{migrating_vm=projects/*/locations/*/sources/*/migratingVms/*}:resumeMigration", + "(google.api.http).body": "*", + "(google.longrunning.operation_info).response_type": "ResumeMigrationResponse", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{migrating_vm=projects/*/locations/*/sources/*/migratingVms/*}:resumeMigration", + "body": "*" + } + }, + { + "(google.longrunning.operation_info)": { + "response_type": "ResumeMigrationResponse", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "PauseMigration": { + "requestType": "PauseMigrationRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{migrating_vm=projects/*/locations/*/sources/*/migratingVms/*}:pauseMigration", + "(google.api.http).body": "*", + "(google.longrunning.operation_info).response_type": "PauseMigrationResponse", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{migrating_vm=projects/*/locations/*/sources/*/migratingVms/*}:pauseMigration", + "body": "*" + } + }, + { + "(google.longrunning.operation_info)": { + "response_type": "PauseMigrationResponse", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "FinalizeMigration": { + "requestType": "FinalizeMigrationRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{migrating_vm=projects/*/locations/*/sources/*/migratingVms/*}:finalizeMigration", + "(google.api.http).body": "*", + "(google.api.method_signature)": "migrating_vm", + "(google.longrunning.operation_info).response_type": "FinalizeMigrationResponse", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{migrating_vm=projects/*/locations/*/sources/*/migratingVms/*}:finalizeMigration", + "body": "*" + } + }, + { + "(google.api.method_signature)": "migrating_vm" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "FinalizeMigrationResponse", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "CreateCloneJob": { + "requestType": "CreateCloneJobRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*/sources/*/migratingVms/*}/cloneJobs", + "(google.api.http).body": "clone_job", + "(google.api.method_signature)": "parent,clone_job,clone_job_id", + "(google.longrunning.operation_info).response_type": "CloneJob", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*/sources/*/migratingVms/*}/cloneJobs", + "body": "clone_job" + } + }, + { + "(google.api.method_signature)": "parent,clone_job,clone_job_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "CloneJob", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "CancelCloneJob": { + "requestType": "CancelCloneJobRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{name=projects/*/locations/*/sources/*/migratingVms/*/cloneJobs/*}:cancel", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "CancelCloneJobResponse", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=projects/*/locations/*/sources/*/migratingVms/*/cloneJobs/*}:cancel", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "CancelCloneJobResponse", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "ListCloneJobs": { + "requestType": "ListCloneJobsRequest", + "responseType": "ListCloneJobsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*/sources/*/migratingVms/*}/cloneJobs", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*/sources/*/migratingVms/*}/cloneJobs" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetCloneJob": { + "requestType": "GetCloneJobRequest", + "responseType": "CloneJob", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/sources/*/migratingVms/*/cloneJobs/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/sources/*/migratingVms/*/cloneJobs/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateCutoverJob": { + "requestType": "CreateCutoverJobRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*/sources/*/migratingVms/*}/cutoverJobs", + "(google.api.http).body": "cutover_job", + "(google.api.method_signature)": "parent,cutover_job,cutover_job_id", + "(google.longrunning.operation_info).response_type": "CutoverJob", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*/sources/*/migratingVms/*}/cutoverJobs", + "body": "cutover_job" + } + }, + { + "(google.api.method_signature)": "parent,cutover_job,cutover_job_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "CutoverJob", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "CancelCutoverJob": { + "requestType": "CancelCutoverJobRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{name=projects/*/locations/*/sources/*/migratingVms/*/cutoverJobs/*}:cancel", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "CancelCutoverJobResponse", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=projects/*/locations/*/sources/*/migratingVms/*/cutoverJobs/*}:cancel", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "CancelCutoverJobResponse", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "ListCutoverJobs": { + "requestType": "ListCutoverJobsRequest", + "responseType": "ListCutoverJobsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*/sources/*/migratingVms/*}/cutoverJobs", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*/sources/*/migratingVms/*}/cutoverJobs" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetCutoverJob": { + "requestType": "GetCutoverJobRequest", + "responseType": "CutoverJob", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/sources/*/migratingVms/*/cutoverJobs/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/sources/*/migratingVms/*/cutoverJobs/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListGroups": { + "requestType": "ListGroupsRequest", + "responseType": "ListGroupsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/groups", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}/groups" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetGroup": { + "requestType": "GetGroupRequest", + "responseType": "Group", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/groups/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/groups/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateGroup": { + "requestType": "CreateGroupRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/groups", + "(google.api.http).body": "group", + "(google.api.method_signature)": "parent,group,group_id", + "(google.longrunning.operation_info).response_type": "Group", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*}/groups", + "body": "group" + } + }, + { + "(google.api.method_signature)": "parent,group,group_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Group", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "UpdateGroup": { + "requestType": "UpdateGroupRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v1/{group.name=projects/*/locations/*/groups/*}", + "(google.api.http).body": "group", + "(google.api.method_signature)": "group,update_mask", + "(google.longrunning.operation_info).response_type": "Group", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{group.name=projects/*/locations/*/groups/*}", + "body": "group" + } + }, + { + "(google.api.method_signature)": "group,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Group", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "DeleteGroup": { + "requestType": "DeleteGroupRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/groups/*}", + "(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/*/groups/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "AddGroupMigration": { + "requestType": "AddGroupMigrationRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{group=projects/*/locations/*/groups/*}:addGroupMigration", + "(google.api.http).body": "*", + "(google.api.method_signature)": "group", + "(google.longrunning.operation_info).response_type": "AddGroupMigrationResponse", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{group=projects/*/locations/*/groups/*}:addGroupMigration", + "body": "*" + } + }, + { + "(google.api.method_signature)": "group" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "AddGroupMigrationResponse", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "RemoveGroupMigration": { + "requestType": "RemoveGroupMigrationRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{group=projects/*/locations/*/groups/*}:removeGroupMigration", + "(google.api.http).body": "*", + "(google.api.method_signature)": "group", + "(google.longrunning.operation_info).response_type": "RemoveGroupMigrationResponse", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{group=projects/*/locations/*/groups/*}:removeGroupMigration", + "body": "*" + } + }, + { + "(google.api.method_signature)": "group" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "RemoveGroupMigrationResponse", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "ListTargetProjects": { + "requestType": "ListTargetProjectsRequest", + "responseType": "ListTargetProjectsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/targetProjects", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}/targetProjects" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetTargetProject": { + "requestType": "GetTargetProjectRequest", + "responseType": "TargetProject", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/targetProjects/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/targetProjects/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateTargetProject": { + "requestType": "CreateTargetProjectRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/targetProjects", + "(google.api.http).body": "target_project", + "(google.api.method_signature)": "parent,target_project,target_project_id", + "(google.longrunning.operation_info).response_type": "TargetProject", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*}/targetProjects", + "body": "target_project" + } + }, + { + "(google.api.method_signature)": "parent,target_project,target_project_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "TargetProject", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "UpdateTargetProject": { + "requestType": "UpdateTargetProjectRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v1/{target_project.name=projects/*/locations/*/targetProjects/*}", + "(google.api.http).body": "target_project", + "(google.api.method_signature)": "target_project,update_mask", + "(google.longrunning.operation_info).response_type": "TargetProject", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{target_project.name=projects/*/locations/*/targetProjects/*}", + "body": "target_project" + } + }, + { + "(google.api.method_signature)": "target_project,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "TargetProject", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "DeleteTargetProject": { + "requestType": "DeleteTargetProjectRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/targetProjects/*}", + "(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/*/targetProjects/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "OperationMetadata" + } + } + ] + } + } + }, + "UtilizationReportView": { + "values": { + "UTILIZATION_REPORT_VIEW_UNSPECIFIED": 0, + "BASIC": 1, + "FULL": 2 + } + }, + "MigratingVmView": { + "values": { + "MIGRATING_VM_VIEW_UNSPECIFIED": 0, + "MIGRATING_VM_VIEW_BASIC": 1, + "MIGRATING_VM_VIEW_FULL": 2 + } + }, + "ComputeEngineDiskType": { + "values": { + "COMPUTE_ENGINE_DISK_TYPE_UNSPECIFIED": 0, + "COMPUTE_ENGINE_DISK_TYPE_STANDARD": 1, + "COMPUTE_ENGINE_DISK_TYPE_SSD": 2, + "COMPUTE_ENGINE_DISK_TYPE_BALANCED": 3 + } + }, + "ComputeEngineLicenseType": { + "values": { + "COMPUTE_ENGINE_LICENSE_TYPE_DEFAULT": 0, + "COMPUTE_ENGINE_LICENSE_TYPE_PAYG": 1, + "COMPUTE_ENGINE_LICENSE_TYPE_BYOL": 2 + } + }, + "ComputeEngineBootOption": { + "values": { + "COMPUTE_ENGINE_BOOT_OPTION_UNSPECIFIED": 0, + "COMPUTE_ENGINE_BOOT_OPTION_EFI": 1, + "COMPUTE_ENGINE_BOOT_OPTION_BIOS": 2 + } + }, + "ReplicationCycle": { + "fields": { + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 1 + }, + "progressPercent": { + "type": "int32", + "id": 5 + } + } + }, + "ReplicationSync": { + "fields": { + "lastSyncTime": { + "type": "google.protobuf.Timestamp", + "id": 1 + } + } + }, + "MigratingVm": { + "options": { + "(google.api.resource).type": "vmmigration.googleapis.com/MigratingVm", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/sources/{source}/migratingVms/{migrating_vm}" + }, + "oneofs": { + "targetVmDefaults": { + "oneof": [ + "computeEngineTargetDefaults" + ] + } + }, + "fields": { + "computeEngineTargetDefaults": { + "type": "ComputeEngineTargetDefaults", + "id": 26 + }, + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "sourceVmId": { + "type": "string", + "id": 2 + }, + "displayName": { + "type": "string", + "id": 18 + }, + "description": { + "type": "string", + "id": 3 + }, + "policy": { + "type": "SchedulePolicy", + "id": 8 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 10, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "lastSync": { + "type": "ReplicationSync", + "id": 11, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "state": { + "type": "State", + "id": 23, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "stateTime": { + "type": "google.protobuf.Timestamp", + "id": 22, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "currentSyncInfo": { + "type": "ReplicationCycle", + "id": 13, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "group": { + "type": "string", + "id": 15, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).child_type": "vmmigration.googleapis.com/Group" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 16 + }, + "recentCloneJobs": { + "rule": "repeated", + "type": "CloneJob", + "id": 17, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "error": { + "type": "google.rpc.Status", + "id": 19, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "recentCutoverJobs": { + "rule": "repeated", + "type": "CutoverJob", + "id": 20, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "PENDING": 1, + "READY": 2, + "FIRST_SYNC": 3, + "ACTIVE": 4, + "CUTTING_OVER": 7, + "CUTOVER": 8, + "FINAL_SYNC": 9, + "PAUSED": 10, + "FINALIZING": 11, + "FINALIZED": 12, + "ERROR": 13 + } + } + } + }, + "CloneJob": { + "options": { + "(google.api.resource).type": "vmmigration.googleapis.com/CloneJob", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/sources/{source}/migratingVms/{migrating_vm}/cloneJobs/{clone_job}" + }, + "oneofs": { + "targetVmDetails": { + "oneof": [ + "computeEngineTargetDetails" + ] + } + }, + "fields": { + "computeEngineTargetDetails": { + "type": "ComputeEngineTargetDetails", + "id": 20, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 22, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "name": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "state": { + "type": "State", + "id": 12, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "stateTime": { + "type": "google.protobuf.Timestamp", + "id": 14, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "error": { + "type": "google.rpc.Status", + "id": 17, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "PENDING": 1, + "ACTIVE": 2, + "FAILED": 3, + "SUCCEEDED": 4, + "CANCELLED": 5, + "CANCELLING": 6, + "ADAPTING_OS": 7 + } + } + } + }, + "CutoverJob": { + "options": { + "(google.api.resource).type": "vmmigration.googleapis.com/CutoverJob", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/sources/{source}/migratingVms/{migrating_vm}/cutoverJobs/{cutover_job}" + }, + "oneofs": { + "targetVmDetails": { + "oneof": [ + "computeEngineTargetDetails" + ] + } + }, + "fields": { + "computeEngineTargetDetails": { + "type": "ComputeEngineTargetDetails", + "id": 14, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 16, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "name": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "state": { + "type": "State", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "stateTime": { + "type": "google.protobuf.Timestamp", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "progressPercent": { + "type": "int32", + "id": 13, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "error": { + "type": "google.rpc.Status", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "stateMessage": { + "type": "string", + "id": 10, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "PENDING": 1, + "FAILED": 2, + "SUCCEEDED": 3, + "CANCELLED": 4, + "CANCELLING": 5, + "ACTIVE": 6, + "ADAPTING_OS": 7 + } + } + } + }, + "CreateCloneJobRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "vmmigration.googleapis.com/CloneJob" + } + }, + "cloneJobId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "cloneJob": { + "type": "CloneJob", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 4 + } + } + }, + "CancelCloneJobRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "vmmigration.googleapis.com/CloneJob" + } + } + } + }, + "CancelCloneJobResponse": { + "fields": {} + }, + "ListCloneJobsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "vmmigration.googleapis.com/CloneJob" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "filter": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "orderBy": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListCloneJobsResponse": { + "fields": { + "cloneJobs": { + "rule": "repeated", + "type": "CloneJob", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "nextPageToken": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "GetCloneJobRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "vmmigration.googleapis.com/CloneJob" + } + } + } + }, + "Source": { + "options": { + "(google.api.resource).type": "vmmigration.googleapis.com/Source", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/sources/{source}" + }, + "oneofs": { + "sourceDetails": { + "oneof": [ + "vmware" + ] + } + }, + "fields": { + "vmware": { + "type": "VmwareSourceDetails", + "id": 10 + }, + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "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 + }, + "description": { + "type": "string", + "id": 6 + } + } + }, + "VmwareSourceDetails": { + "fields": { + "username": { + "type": "string", + "id": 1 + }, + "password": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "INPUT_ONLY" + } + }, + "vcenterIp": { + "type": "string", + "id": 3 + }, + "thumbprint": { + "type": "string", + "id": 4 + } + } + }, + "DatacenterConnector": { + "options": { + "(google.api.resource).type": "vmmigration.googleapis.com/DatacenterConnector", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/sources/{source}/datacenterConnectors/{datacenter_connector}" + }, + "fields": { + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "name": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "registrationId": { + "type": "string", + "id": 12, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "serviceAccount": { + "type": "string", + "id": 5 + }, + "version": { + "type": "string", + "id": 6 + }, + "bucket": { + "type": "string", + "id": 10, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "state": { + "type": "State", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "stateTime": { + "type": "google.protobuf.Timestamp", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "error": { + "type": "google.rpc.Status", + "id": 11, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "applianceInfrastructureVersion": { + "type": "string", + "id": 13, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "applianceSoftwareVersion": { + "type": "string", + "id": 14, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "availableVersions": { + "type": "AvailableUpdates", + "id": 15, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "upgradeStatus": { + "type": "UpgradeStatus", + "id": 16, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "PENDING": 1, + "OFFLINE": 2, + "FAILED": 3, + "ACTIVE": 4 + } + } + } + }, + "UpgradeStatus": { + "fields": { + "version": { + "type": "string", + "id": 1 + }, + "state": { + "type": "State", + "id": 2 + }, + "error": { + "type": "google.rpc.Status", + "id": 3 + }, + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 4 + }, + "previousVersion": { + "type": "string", + "id": 5 + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "RUNNING": 1, + "FAILED": 2, + "SUCCEEDED": 3 + } + } + } + }, + "AvailableUpdates": { + "fields": { + "newDeployableAppliance": { + "type": "ApplianceVersion", + "id": 1 + }, + "inPlaceUpdate": { + "type": "ApplianceVersion", + "id": 2 + } + } + }, + "ApplianceVersion": { + "fields": { + "version": { + "type": "string", + "id": 1 + }, + "uri": { + "type": "string", + "id": 2 + }, + "critical": { + "type": "bool", + "id": 3 + }, + "releaseNotesUri": { + "type": "string", + "id": 4 + } + } + }, + "ListSourcesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "vmmigration.googleapis.com/Source" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "filter": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "orderBy": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListSourcesResponse": { + "fields": { + "sources": { + "rule": "repeated", + "type": "Source", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "nextPageToken": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "GetSourceRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "vmmigration.googleapis.com/Source" + } + } + } + }, + "CreateSourceRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "vmmigration.googleapis.com/Source" + } + }, + "sourceId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "source": { + "type": "Source", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 4 + } + } + }, + "UpdateSourceRequest": { + "fields": { + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 1 + }, + "source": { + "type": "Source", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 3 + } + } + }, + "DeleteSourceRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "vmmigration.googleapis.com/Source" + } + }, + "requestId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "FetchInventoryRequest": { + "fields": { + "source": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "vmmigration.googleapis.com/Source" + } + }, + "forceRefresh": { + "type": "bool", + "id": 2 + } + } + }, + "VmwareVmDetails": { + "fields": { + "vmId": { + "type": "string", + "id": 1 + }, + "datacenterId": { + "type": "string", + "id": 2 + }, + "datacenterDescription": { + "type": "string", + "id": 3 + }, + "uuid": { + "type": "string", + "id": 4 + }, + "displayName": { + "type": "string", + "id": 5 + }, + "powerState": { + "type": "PowerState", + "id": 6 + }, + "cpuCount": { + "type": "int32", + "id": 7 + }, + "memoryMb": { + "type": "int32", + "id": 8 + }, + "diskCount": { + "type": "int32", + "id": 9 + }, + "committedStorageMb": { + "type": "int64", + "id": 12 + }, + "guestDescription": { + "type": "string", + "id": 11 + }, + "bootOption": { + "type": "BootOption", + "id": 13, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "PowerState": { + "values": { + "POWER_STATE_UNSPECIFIED": 0, + "ON": 1, + "OFF": 2, + "SUSPENDED": 3 + } + }, + "BootOption": { + "values": { + "BOOT_OPTION_UNSPECIFIED": 0, + "EFI": 1, + "BIOS": 2 + } + } + } + }, + "VmwareVmsDetails": { + "fields": { + "details": { + "rule": "repeated", + "type": "VmwareVmDetails", + "id": 1 + } + } + }, + "FetchInventoryResponse": { + "oneofs": { + "SourceVms": { + "oneof": [ + "vmwareVms" + ] + } + }, + "fields": { + "vmwareVms": { + "type": "VmwareVmsDetails", + "id": 1 + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "UtilizationReport": { + "options": { + "(google.api.resource).type": "vmmigration.googleapis.com/UtilizationReport", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/sources/{source}/utilizationReports/{utilization_report}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "displayName": { + "type": "string", + "id": 2 + }, + "state": { + "type": "State", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "stateTime": { + "type": "google.protobuf.Timestamp", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "error": { + "type": "google.rpc.Status", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "timeFrame": { + "type": "TimeFrame", + "id": 7 + }, + "frameEndTime": { + "type": "google.protobuf.Timestamp", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "vmCount": { + "type": "int32", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "vms": { + "rule": "repeated", + "type": "VmUtilizationInfo", + "id": 10 + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "CREATING": 1, + "SUCCEEDED": 2, + "FAILED": 3 + } + }, + "TimeFrame": { + "values": { + "TIME_FRAME_UNSPECIFIED": 0, + "WEEK": 1, + "MONTH": 2, + "YEAR": 3 + } + } + } + }, + "VmUtilizationInfo": { + "oneofs": { + "VmDetails": { + "oneof": [ + "vmwareVmDetails" + ] + } + }, + "fields": { + "vmwareVmDetails": { + "type": "VmwareVmDetails", + "id": 1 + }, + "vmId": { + "type": "string", + "id": 3 + }, + "utilization": { + "type": "VmUtilizationMetrics", + "id": 2 + } + } + }, + "VmUtilizationMetrics": { + "fields": { + "cpuMaxPercent": { + "type": "int32", + "id": 9 + }, + "cpuAveragePercent": { + "type": "int32", + "id": 10 + }, + "memoryMaxPercent": { + "type": "int32", + "id": 11 + }, + "memoryAveragePercent": { + "type": "int32", + "id": 12 + }, + "diskIoRateMaxKbps": { + "type": "int64", + "id": 13 + }, + "diskIoRateAverageKbps": { + "type": "int64", + "id": 14 + }, + "networkThroughputMaxKbps": { + "type": "int64", + "id": 15 + }, + "networkThroughputAverageKbps": { + "type": "int64", + "id": 16 + } + } + }, + "ListUtilizationReportsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "vmmigration.googleapis.com/UtilizationReport" + } + }, + "view": { + "type": "UtilizationReportView", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageSize": { + "type": "int32", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "filter": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "orderBy": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListUtilizationReportsResponse": { + "fields": { + "utilizationReports": { + "rule": "repeated", + "type": "UtilizationReport", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "nextPageToken": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "GetUtilizationReportRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "vmmigration.googleapis.com/UtilizationReport" + } + }, + "view": { + "type": "UtilizationReportView", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "CreateUtilizationReportRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "vmmigration.googleapis.com/UtilizationReport" + } + }, + "utilizationReport": { + "type": "UtilizationReport", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "utilizationReportId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 4 + } + } + }, + "DeleteUtilizationReportRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "vmmigration.googleapis.com/UtilizationReport" + } + }, + "requestId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListDatacenterConnectorsResponse": { + "fields": { + "datacenterConnectors": { + "rule": "repeated", + "type": "DatacenterConnector", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "nextPageToken": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "GetDatacenterConnectorRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "vmmigration.googleapis.com/DatacenterConnector" + } + } + } + }, + "CreateDatacenterConnectorRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "vmmigration.googleapis.com/DatacenterConnector" + } + }, + "datacenterConnectorId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "datacenterConnector": { + "type": "DatacenterConnector", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 4 + } + } + }, + "DeleteDatacenterConnectorRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "vmmigration.googleapis.com/DatacenterConnector" + } + }, + "requestId": { + "type": "string", + "id": 2 + } + } + }, + "UpgradeApplianceRequest": { + "fields": { + "datacenterConnector": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "vmmigration.googleapis.com/DatacenterConnector" + } + }, + "requestId": { + "type": "string", + "id": 2 + } + } + }, + "UpgradeApplianceResponse": { + "fields": {} + }, + "ListDatacenterConnectorsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "vmmigration.googleapis.com/DatacenterConnector" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "filter": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "orderBy": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ComputeEngineTargetDefaults": { + "fields": { + "vmName": { + "type": "string", + "id": 1 + }, + "targetProject": { + "type": "string", + "id": 2, + "options": { + "(google.api.resource_reference).type": "vmmigration.googleapis.com/TargetProject" + } + }, + "zone": { + "type": "string", + "id": 3 + }, + "machineTypeSeries": { + "type": "string", + "id": 4 + }, + "machineType": { + "type": "string", + "id": 5 + }, + "networkTags": { + "rule": "repeated", + "type": "string", + "id": 6 + }, + "networkInterfaces": { + "rule": "repeated", + "type": "NetworkInterface", + "id": 7 + }, + "serviceAccount": { + "type": "string", + "id": 8 + }, + "diskType": { + "type": "ComputeEngineDiskType", + "id": 9 + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 10 + }, + "licenseType": { + "type": "ComputeEngineLicenseType", + "id": 11 + }, + "appliedLicense": { + "type": "AppliedLicense", + "id": 12, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "computeScheduling": { + "type": "ComputeScheduling", + "id": 13 + }, + "secureBoot": { + "type": "bool", + "id": 14 + }, + "bootOption": { + "type": "ComputeEngineBootOption", + "id": 15, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "metadata": { + "keyType": "string", + "type": "string", + "id": 16 + }, + "additionalLicenses": { + "rule": "repeated", + "type": "string", + "id": 17 + }, + "hostname": { + "type": "string", + "id": 18 + } + } + }, + "ComputeEngineTargetDetails": { + "fields": { + "vmName": { + "type": "string", + "id": 1 + }, + "project": { + "type": "string", + "id": 2 + }, + "zone": { + "type": "string", + "id": 3 + }, + "machineTypeSeries": { + "type": "string", + "id": 4 + }, + "machineType": { + "type": "string", + "id": 5 + }, + "networkTags": { + "rule": "repeated", + "type": "string", + "id": 6 + }, + "networkInterfaces": { + "rule": "repeated", + "type": "NetworkInterface", + "id": 7 + }, + "serviceAccount": { + "type": "string", + "id": 8 + }, + "diskType": { + "type": "ComputeEngineDiskType", + "id": 9 + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 10 + }, + "licenseType": { + "type": "ComputeEngineLicenseType", + "id": 11 + }, + "appliedLicense": { + "type": "AppliedLicense", + "id": 12 + }, + "computeScheduling": { + "type": "ComputeScheduling", + "id": 13 + }, + "secureBoot": { + "type": "bool", + "id": 14 + }, + "bootOption": { + "type": "ComputeEngineBootOption", + "id": 15 + }, + "metadata": { + "keyType": "string", + "type": "string", + "id": 16 + }, + "additionalLicenses": { + "rule": "repeated", + "type": "string", + "id": 17 + }, + "hostname": { + "type": "string", + "id": 18 + } + } + }, + "NetworkInterface": { + "fields": { + "network": { + "type": "string", + "id": 1 + }, + "subnetwork": { + "type": "string", + "id": 2 + }, + "internalIp": { + "type": "string", + "id": 3 + }, + "externalIp": { + "type": "string", + "id": 4 + } + } + }, + "AppliedLicense": { + "fields": { + "type": { + "type": "Type", + "id": 1 + }, + "osLicense": { + "type": "string", + "id": 2 + } + }, + "nested": { + "Type": { + "values": { + "TYPE_UNSPECIFIED": 0, + "NONE": 1, + "PAYG": 2, + "BYOL": 3 + } + } + } + }, + "SchedulingNodeAffinity": { + "fields": { + "key": { + "type": "string", + "id": 1 + }, + "operator": { + "type": "Operator", + "id": 2 + }, + "values": { + "rule": "repeated", + "type": "string", + "id": 3 + } + }, + "nested": { + "Operator": { + "values": { + "OPERATOR_UNSPECIFIED": 0, + "IN": 1, + "NOT_IN": 2 + } + } + } + }, + "ComputeScheduling": { + "fields": { + "onHostMaintenance": { + "type": "OnHostMaintenance", + "id": 1 + }, + "restartType": { + "type": "RestartType", + "id": 5 + }, + "nodeAffinities": { + "rule": "repeated", + "type": "SchedulingNodeAffinity", + "id": 3 + }, + "minNodeCpus": { + "type": "int32", + "id": 4 + } + }, + "nested": { + "OnHostMaintenance": { + "values": { + "ON_HOST_MAINTENANCE_UNSPECIFIED": 0, + "TERMINATE": 1, + "MIGRATE": 2 + } + }, + "RestartType": { + "values": { + "RESTART_TYPE_UNSPECIFIED": 0, + "AUTOMATIC_RESTART": 1, + "NO_AUTOMATIC_RESTART": 2 + } + } + } + }, + "SchedulePolicy": { + "fields": { + "idleDuration": { + "type": "google.protobuf.Duration", + "id": 1 + }, + "skipOsAdaptation": { + "type": "bool", + "id": 2 + } + } + }, + "CreateMigratingVmRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "vmmigration.googleapis.com/MigratingVm" + } + }, + "migratingVmId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "migratingVm": { + "type": "MigratingVm", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 4 + } + } + }, + "ListMigratingVmsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "vmmigration.googleapis.com/MigratingVm" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "filter": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "orderBy": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "view": { + "type": "MigratingVmView", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListMigratingVmsResponse": { + "fields": { + "migratingVms": { + "rule": "repeated", + "type": "MigratingVm", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "nextPageToken": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "GetMigratingVmRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "vmmigration.googleapis.com/MigratingVm" + } + }, + "view": { + "type": "MigratingVmView", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "UpdateMigratingVmRequest": { + "fields": { + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 1 + }, + "migratingVm": { + "type": "MigratingVm", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 3 + } + } + }, + "DeleteMigratingVmRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "vmmigration.googleapis.com/MigratingVm" + } + } + } + }, + "StartMigrationRequest": { + "fields": { + "migratingVm": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "vmmigration.googleapis.com/MigratingVm" + } + } + } + }, + "StartMigrationResponse": { + "fields": {} + }, + "PauseMigrationRequest": { + "fields": { + "migratingVm": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "vmmigration.googleapis.com/MigratingVm" + } + } + } + }, + "PauseMigrationResponse": { + "fields": {} + }, + "ResumeMigrationRequest": { + "fields": { + "migratingVm": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "vmmigration.googleapis.com/MigratingVm" + } + } + } + }, + "ResumeMigrationResponse": { + "fields": {} + }, + "FinalizeMigrationRequest": { + "fields": { + "migratingVm": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "vmmigration.googleapis.com/MigratingVm" + } + } + } + }, + "FinalizeMigrationResponse": { + "fields": {} + }, + "TargetProject": { + "options": { + "(google.api.resource).type": "vmmigration.googleapis.com/TargetProject", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/targetProjects/{target_project}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "project": { + "type": "string", + "id": 2 + }, + "description": { + "type": "string", + "id": 3 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "GetTargetProjectRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "vmmigration.googleapis.com/TargetProject" + } + } + } + }, + "ListTargetProjectsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "vmmigration.googleapis.com/TargetProject" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "filter": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "orderBy": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListTargetProjectsResponse": { + "fields": { + "targetProjects": { + "rule": "repeated", + "type": "TargetProject", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "nextPageToken": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "CreateTargetProjectRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "vmmigration.googleapis.com/TargetProject" + } + }, + "targetProjectId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "targetProject": { + "type": "TargetProject", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 4 + } + } + }, + "UpdateTargetProjectRequest": { + "fields": { + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 1 + }, + "targetProject": { + "type": "TargetProject", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 3 + } + } + }, + "DeleteTargetProjectRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "vmmigration.googleapis.com/TargetProject" + } + }, + "requestId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "Group": { + "options": { + "(google.api.resource).type": "vmmigration.googleapis.com/Group", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/groups/{group}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "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" + } + }, + "description": { + "type": "string", + "id": 4 + }, + "displayName": { + "type": "string", + "id": 5 + } + } + }, + "ListGroupsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "vmmigration.googleapis.com/Group" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "filter": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "orderBy": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListGroupsResponse": { + "fields": { + "groups": { + "rule": "repeated", + "type": "Group", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "nextPageToken": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "GetGroupRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "vmmigration.googleapis.com/Group" + } + } + } + }, + "CreateGroupRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "vmmigration.googleapis.com/Group" + } + }, + "groupId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "group": { + "type": "Group", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 4 + } + } + }, + "UpdateGroupRequest": { + "fields": { + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 1 + }, + "group": { + "type": "Group", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 3 + } + } + }, + "DeleteGroupRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "vmmigration.googleapis.com/Group" + } + }, + "requestId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "AddGroupMigrationRequest": { + "fields": { + "group": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "vmmigration.googleapis.com/Group" + } + }, + "migratingVm": { + "type": "string", + "id": 2, + "options": { + "(google.api.resource_reference).type": "vmmigration.googleapis.com/MigratingVm" + } + } + } + }, + "AddGroupMigrationResponse": { + "fields": {} + }, + "RemoveGroupMigrationRequest": { + "fields": { + "group": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "vmmigration.googleapis.com/Group" + } + }, + "migratingVm": { + "type": "string", + "id": 2, + "options": { + "(google.api.resource_reference).type": "vmmigration.googleapis.com/MigratingVm" + } + } + } + }, + "RemoveGroupMigrationResponse": { + "fields": {} + }, + "CreateCutoverJobRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "vmmigration.googleapis.com/CutoverJob" + } + }, + "cutoverJobId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "cutoverJob": { + "type": "CutoverJob", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 4 + } + } + }, + "CancelCutoverJobRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "vmmigration.googleapis.com/CutoverJob" + } + } + } + }, + "CancelCutoverJobResponse": { + "fields": {} + }, + "ListCutoverJobsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "vmmigration.googleapis.com/CutoverJob" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "filter": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "orderBy": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListCutoverJobsResponse": { + "fields": { + "cutoverJobs": { + "rule": "repeated", + "type": "CutoverJob", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "nextPageToken": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "GetCutoverJobRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "vmmigration.googleapis.com/CutoverJob" + } + } + } + }, + "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" + } + } + } + }, + "MigrationError": { + "fields": { + "code": { + "type": "ErrorCode", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "errorMessage": { + "type": "google.rpc.LocalizedMessage", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "actionItem": { + "type": "google.rpc.LocalizedMessage", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "helpLinks": { + "rule": "repeated", + "type": "google.rpc.Help.Link", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "errorTime": { + "type": "google.protobuf.Timestamp", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "ErrorCode": { + "values": { + "ERROR_CODE_UNSPECIFIED": 0, + "UNKNOWN_ERROR": 1, + "SOURCE_VALIDATION_ERROR": 2, + "SOURCE_REPLICATION_ERROR": 3, + "TARGET_REPLICATION_ERROR": 4, + "OS_ADAPTATION_ERROR": 5, + "CLONE_ERROR": 6, + "CUTOVER_ERROR": 7, + "UTILIZATION_REPORT_ERROR": 8, + "APPLIANCE_UPGRADE_ERROR": 9 + } + } + } + } + } + } + } + } + } + }, + "api": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/api/annotations;annotations", + "java_multiple_files": true, + "java_outer_classname": "ResourceProto", + "java_package": "com.google.api", + "objc_class_prefix": "GAPI", + "cc_enable_arenas": true + }, + "nested": { + "http": { + "type": "HttpRule", + "id": 72295728, + "extend": "google.protobuf.MethodOptions" + }, + "Http": { + "fields": { + "rules": { + "rule": "repeated", + "type": "HttpRule", + "id": 1 + }, + "fullyDecodeReservedExpansion": { + "type": "bool", + "id": 2 + } + } + }, + "HttpRule": { + "oneofs": { + "pattern": { + "oneof": [ + "get", + "put", + "post", + "delete", + "patch", + "custom" + ] + } + }, + "fields": { + "selector": { + "type": "string", + "id": 1 + }, + "get": { + "type": "string", + "id": 2 + }, + "put": { + "type": "string", + "id": 3 + }, + "post": { + "type": "string", + "id": 4 + }, + "delete": { + "type": "string", + "id": 5 + }, + "patch": { + "type": "string", + "id": 6 + }, + "custom": { + "type": "CustomHttpPattern", + "id": 8 + }, + "body": { + "type": "string", + "id": 7 + }, + "responseBody": { + "type": "string", + "id": 12 + }, + "additionalBindings": { + "rule": "repeated", + "type": "HttpRule", + "id": 11 + } + } + }, + "CustomHttpPattern": { + "fields": { + "kind": { + "type": "string", + "id": 1 + }, + "path": { + "type": "string", + "id": 2 + } + } + }, + "methodSignature": { + "rule": "repeated", + "type": "string", + "id": 1051, + "extend": "google.protobuf.MethodOptions" + }, + "defaultHost": { + "type": "string", + "id": 1049, + "extend": "google.protobuf.ServiceOptions" + }, + "oauthScopes": { + "type": "string", + "id": 1050, + "extend": "google.protobuf.ServiceOptions" + }, + "fieldBehavior": { + "rule": "repeated", + "type": "google.api.FieldBehavior", + "id": 1052, + "extend": "google.protobuf.FieldOptions" + }, + "FieldBehavior": { + "values": { + "FIELD_BEHAVIOR_UNSPECIFIED": 0, + "OPTIONAL": 1, + "REQUIRED": 2, + "OUTPUT_ONLY": 3, + "INPUT_ONLY": 4, + "IMMUTABLE": 5, + "UNORDERED_LIST": 6, + "NON_EMPTY_DEFAULT": 7 + } + }, + "resourceReference": { + "type": "google.api.ResourceReference", + "id": 1055, + "extend": "google.protobuf.FieldOptions" + }, + "resourceDefinition": { + "rule": "repeated", + "type": "google.api.ResourceDescriptor", + "id": 1053, + "extend": "google.protobuf.FileOptions" + }, + "resource": { + "type": "google.api.ResourceDescriptor", + "id": 1053, + "extend": "google.protobuf.MessageOptions" + }, + "ResourceDescriptor": { + "fields": { + "type": { + "type": "string", + "id": 1 + }, + "pattern": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "nameField": { + "type": "string", + "id": 3 + }, + "history": { + "type": "History", + "id": 4 + }, + "plural": { + "type": "string", + "id": 5 + }, + "singular": { + "type": "string", + "id": 6 + }, + "style": { + "rule": "repeated", + "type": "Style", + "id": 10 + } + }, + "nested": { + "History": { + "values": { + "HISTORY_UNSPECIFIED": 0, + "ORIGINALLY_SINGLE_PATTERN": 1, + "FUTURE_MULTI_PATTERN": 2 + } + }, + "Style": { + "values": { + "STYLE_UNSPECIFIED": 0, + "DECLARATIVE_FRIENDLY": 1 + } + } + } + }, + "ResourceReference": { + "fields": { + "type": { + "type": "string", + "id": 1 + }, + "childType": { + "type": "string", + "id": 2 + } + } + } + } + }, + "protobuf": { + "options": { + "go_package": "google.golang.org/protobuf/types/descriptorpb", + "java_package": "com.google.protobuf", + "java_outer_classname": "DescriptorProtos", + "csharp_namespace": "Google.Protobuf.Reflection", + "objc_class_prefix": "GPB", + "cc_enable_arenas": true, + "optimize_for": "SPEED" + }, + "nested": { + "FileDescriptorSet": { + "fields": { + "file": { + "rule": "repeated", + "type": "FileDescriptorProto", + "id": 1 + } + } + }, + "FileDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "package": { + "type": "string", + "id": 2 + }, + "dependency": { + "rule": "repeated", + "type": "string", + "id": 3 + }, + "publicDependency": { + "rule": "repeated", + "type": "int32", + "id": 10, + "options": { + "packed": false + } + }, + "weakDependency": { + "rule": "repeated", + "type": "int32", + "id": 11, + "options": { + "packed": false + } + }, + "messageType": { + "rule": "repeated", + "type": "DescriptorProto", + "id": 4 + }, + "enumType": { + "rule": "repeated", + "type": "EnumDescriptorProto", + "id": 5 + }, + "service": { + "rule": "repeated", + "type": "ServiceDescriptorProto", + "id": 6 + }, + "extension": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 7 + }, + "options": { + "type": "FileOptions", + "id": 8 + }, + "sourceCodeInfo": { + "type": "SourceCodeInfo", + "id": 9 + }, + "syntax": { + "type": "string", + "id": 12 + }, + "edition": { + "type": "string", + "id": 13 + } + } + }, + "DescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "field": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 2 + }, + "extension": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 6 + }, + "nestedType": { + "rule": "repeated", + "type": "DescriptorProto", + "id": 3 + }, + "enumType": { + "rule": "repeated", + "type": "EnumDescriptorProto", + "id": 4 + }, + "extensionRange": { + "rule": "repeated", + "type": "ExtensionRange", + "id": 5 + }, + "oneofDecl": { + "rule": "repeated", + "type": "OneofDescriptorProto", + "id": 8 + }, + "options": { + "type": "MessageOptions", + "id": 7 + }, + "reservedRange": { + "rule": "repeated", + "type": "ReservedRange", + "id": 9 + }, + "reservedName": { + "rule": "repeated", + "type": "string", + "id": 10 + } + }, + "nested": { + "ExtensionRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + }, + "options": { + "type": "ExtensionRangeOptions", + "id": 3 + } + } + }, + "ReservedRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + } + } + } + } + }, + "ExtensionRangeOptions": { + "fields": { + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "FieldDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "number": { + "type": "int32", + "id": 3 + }, + "label": { + "type": "Label", + "id": 4 + }, + "type": { + "type": "Type", + "id": 5 + }, + "typeName": { + "type": "string", + "id": 6 + }, + "extendee": { + "type": "string", + "id": 2 + }, + "defaultValue": { + "type": "string", + "id": 7 + }, + "oneofIndex": { + "type": "int32", + "id": 9 + }, + "jsonName": { + "type": "string", + "id": 10 + }, + "options": { + "type": "FieldOptions", + "id": 8 + }, + "proto3Optional": { + "type": "bool", + "id": 17 + } + }, + "nested": { + "Type": { + "values": { + "TYPE_DOUBLE": 1, + "TYPE_FLOAT": 2, + "TYPE_INT64": 3, + "TYPE_UINT64": 4, + "TYPE_INT32": 5, + "TYPE_FIXED64": 6, + "TYPE_FIXED32": 7, + "TYPE_BOOL": 8, + "TYPE_STRING": 9, + "TYPE_GROUP": 10, + "TYPE_MESSAGE": 11, + "TYPE_BYTES": 12, + "TYPE_UINT32": 13, + "TYPE_ENUM": 14, + "TYPE_SFIXED32": 15, + "TYPE_SFIXED64": 16, + "TYPE_SINT32": 17, + "TYPE_SINT64": 18 + } + }, + "Label": { + "values": { + "LABEL_OPTIONAL": 1, + "LABEL_REQUIRED": 2, + "LABEL_REPEATED": 3 + } + } + } + }, + "OneofDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "options": { + "type": "OneofOptions", + "id": 2 + } + } + }, + "EnumDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "value": { + "rule": "repeated", + "type": "EnumValueDescriptorProto", + "id": 2 + }, + "options": { + "type": "EnumOptions", + "id": 3 + }, + "reservedRange": { + "rule": "repeated", + "type": "EnumReservedRange", + "id": 4 + }, + "reservedName": { + "rule": "repeated", + "type": "string", + "id": 5 + } + }, + "nested": { + "EnumReservedRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + } + } + } + } + }, + "EnumValueDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "number": { + "type": "int32", + "id": 2 + }, + "options": { + "type": "EnumValueOptions", + "id": 3 + } + } + }, + "ServiceDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "method": { + "rule": "repeated", + "type": "MethodDescriptorProto", + "id": 2 + }, + "options": { + "type": "ServiceOptions", + "id": 3 + } + } + }, + "MethodDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "inputType": { + "type": "string", + "id": 2 + }, + "outputType": { + "type": "string", + "id": 3 + }, + "options": { + "type": "MethodOptions", + "id": 4 + }, + "clientStreaming": { + "type": "bool", + "id": 5, + "options": { + "default": false + } + }, + "serverStreaming": { + "type": "bool", + "id": 6, + "options": { + "default": false + } + } + } + }, + "FileOptions": { + "fields": { + "javaPackage": { + "type": "string", + "id": 1 + }, + "javaOuterClassname": { + "type": "string", + "id": 8 + }, + "javaMultipleFiles": { + "type": "bool", + "id": 10, + "options": { + "default": false + } + }, + "javaGenerateEqualsAndHash": { + "type": "bool", + "id": 20, + "options": { + "deprecated": true + } + }, + "javaStringCheckUtf8": { + "type": "bool", + "id": 27, + "options": { + "default": false + } + }, + "optimizeFor": { + "type": "OptimizeMode", + "id": 9, + "options": { + "default": "SPEED" + } + }, + "goPackage": { + "type": "string", + "id": 11 + }, + "ccGenericServices": { + "type": "bool", + "id": 16, + "options": { + "default": false + } + }, + "javaGenericServices": { + "type": "bool", + "id": 17, + "options": { + "default": false + } + }, + "pyGenericServices": { + "type": "bool", + "id": 18, + "options": { + "default": false + } + }, + "phpGenericServices": { + "type": "bool", + "id": 42, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 23, + "options": { + "default": false + } + }, + "ccEnableArenas": { + "type": "bool", + "id": 31, + "options": { + "default": true + } + }, + "objcClassPrefix": { + "type": "string", + "id": 36 + }, + "csharpNamespace": { + "type": "string", + "id": 37 + }, + "swiftPrefix": { + "type": "string", + "id": 39 + }, + "phpClassPrefix": { + "type": "string", + "id": 40 + }, + "phpNamespace": { + "type": "string", + "id": 41 + }, + "phpMetadataNamespace": { + "type": "string", + "id": 44 + }, + "rubyPackage": { + "type": "string", + "id": 45 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 38, + 38 + ] + ], + "nested": { + "OptimizeMode": { + "values": { + "SPEED": 1, + "CODE_SIZE": 2, + "LITE_RUNTIME": 3 + } + } + } + }, + "MessageOptions": { + "fields": { + "messageSetWireFormat": { + "type": "bool", + "id": 1, + "options": { + "default": false + } + }, + "noStandardDescriptorAccessor": { + "type": "bool", + "id": 2, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "mapEntry": { + "type": "bool", + "id": 7 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 4, + 4 + ], + [ + 5, + 5 + ], + [ + 6, + 6 + ], + [ + 8, + 8 + ], + [ + 9, + 9 + ] + ] + }, + "FieldOptions": { + "fields": { + "ctype": { + "type": "CType", + "id": 1, + "options": { + "default": "STRING" + } + }, + "packed": { + "type": "bool", + "id": 2 + }, + "jstype": { + "type": "JSType", + "id": 6, + "options": { + "default": "JS_NORMAL" + } + }, + "lazy": { + "type": "bool", + "id": 5, + "options": { + "default": false + } + }, + "unverifiedLazy": { + "type": "bool", + "id": 15, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "weak": { + "type": "bool", + "id": 10, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 4, + 4 + ] + ], + "nested": { + "CType": { + "values": { + "STRING": 0, + "CORD": 1, + "STRING_PIECE": 2 + } + }, + "JSType": { + "values": { + "JS_NORMAL": 0, + "JS_STRING": 1, + "JS_NUMBER": 2 + } + } + } + }, + "OneofOptions": { + "fields": { + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "EnumOptions": { + "fields": { + "allowAlias": { + "type": "bool", + "id": 2 + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 5, + 5 + ] + ] + }, + "EnumValueOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 1, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "ServiceOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 33, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "MethodOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 33, + "options": { + "default": false + } + }, + "idempotencyLevel": { + "type": "IdempotencyLevel", + "id": 34, + "options": { + "default": "IDEMPOTENCY_UNKNOWN" + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "nested": { + "IdempotencyLevel": { + "values": { + "IDEMPOTENCY_UNKNOWN": 0, + "NO_SIDE_EFFECTS": 1, + "IDEMPOTENT": 2 + } + } + } + }, + "UninterpretedOption": { + "fields": { + "name": { + "rule": "repeated", + "type": "NamePart", + "id": 2 + }, + "identifierValue": { + "type": "string", + "id": 3 + }, + "positiveIntValue": { + "type": "uint64", + "id": 4 + }, + "negativeIntValue": { + "type": "int64", + "id": 5 + }, + "doubleValue": { + "type": "double", + "id": 6 + }, + "stringValue": { + "type": "bytes", + "id": 7 + }, + "aggregateValue": { + "type": "string", + "id": 8 + } + }, + "nested": { + "NamePart": { + "fields": { + "namePart": { + "rule": "required", + "type": "string", + "id": 1 + }, + "isExtension": { + "rule": "required", + "type": "bool", + "id": 2 + } + } + } + } + }, + "SourceCodeInfo": { + "fields": { + "location": { + "rule": "repeated", + "type": "Location", + "id": 1 + } + }, + "nested": { + "Location": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1 + }, + "span": { + "rule": "repeated", + "type": "int32", + "id": 2 + }, + "leadingComments": { + "type": "string", + "id": 3 + }, + "trailingComments": { + "type": "string", + "id": 4 + }, + "leadingDetachedComments": { + "rule": "repeated", + "type": "string", + "id": 6 + } + } + } + } + }, + "GeneratedCodeInfo": { + "fields": { + "annotation": { + "rule": "repeated", + "type": "Annotation", + "id": 1 + } + }, + "nested": { + "Annotation": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1 + }, + "sourceFile": { + "type": "string", + "id": 2 + }, + "begin": { + "type": "int32", + "id": 3 + }, + "end": { + "type": "int32", + "id": 4 + }, + "semantic": { + "type": "Semantic", + "id": 5 + } + }, + "nested": { + "Semantic": { + "values": { + "NONE": 0, + "SET": 1, + "ALIAS": 2 + } + } + } + } + } + }, + "Any": { + "fields": { + "type_url": { + "type": "string", + "id": 1 + }, + "value": { + "type": "bytes", + "id": 2 + } + } + }, + "Duration": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + }, + "Empty": { + "fields": {} + }, + "FieldMask": { + "fields": { + "paths": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + }, + "Timestamp": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + } + } + }, + "longrunning": { + "options": { + "cc_enable_arenas": true, + "csharp_namespace": "Google.LongRunning", + "go_package": "google.golang.org/genproto/googleapis/longrunning;longrunning", + "java_multiple_files": true, + "java_outer_classname": "OperationsProto", + "java_package": "com.google.longrunning", + "php_namespace": "Google\\LongRunning" + }, + "nested": { + "operationInfo": { + "type": "google.longrunning.OperationInfo", + "id": 1049, + "extend": "google.protobuf.MethodOptions" + }, + "Operations": { + "options": { + "(google.api.default_host)": "longrunning.googleapis.com" + }, + "methods": { + "ListOperations": { + "requestType": "ListOperationsRequest", + "responseType": "ListOperationsResponse", + "options": { + "(google.api.http).get": "/v1/{name=operations}", + "(google.api.method_signature)": "name,filter" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=operations}" + } + }, + { + "(google.api.method_signature)": "name,filter" + } + ] + }, + "GetOperation": { + "requestType": "GetOperationRequest", + "responseType": "Operation", + "options": { + "(google.api.http).get": "/v1/{name=operations/**}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=operations/**}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "DeleteOperation": { + "requestType": "DeleteOperationRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=operations/**}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=operations/**}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CancelOperation": { + "requestType": "CancelOperationRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).post": "/v1/{name=operations/**}:cancel", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=operations/**}:cancel", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "WaitOperation": { + "requestType": "WaitOperationRequest", + "responseType": "Operation" + } + } + }, + "Operation": { + "oneofs": { + "result": { + "oneof": [ + "error", + "response" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "metadata": { + "type": "google.protobuf.Any", + "id": 2 + }, + "done": { + "type": "bool", + "id": 3 + }, + "error": { + "type": "google.rpc.Status", + "id": 4 + }, + "response": { + "type": "google.protobuf.Any", + "id": 5 + } + } + }, + "GetOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "ListOperationsRequest": { + "fields": { + "name": { + "type": "string", + "id": 4 + }, + "filter": { + "type": "string", + "id": 1 + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListOperationsResponse": { + "fields": { + "operations": { + "rule": "repeated", + "type": "Operation", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "CancelOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "DeleteOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "WaitOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "timeout": { + "type": "google.protobuf.Duration", + "id": 2 + } + } + }, + "OperationInfo": { + "fields": { + "responseType": { + "type": "string", + "id": 1 + }, + "metadataType": { + "type": "string", + "id": 2 + } + } + } + } + }, + "rpc": { + "options": { + "cc_enable_arenas": true, + "go_package": "google.golang.org/genproto/googleapis/rpc/errdetails;errdetails", + "java_multiple_files": true, + "java_outer_classname": "ErrorDetailsProto", + "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 + } + } + }, + "RetryInfo": { + "fields": { + "retryDelay": { + "type": "google.protobuf.Duration", + "id": 1 + } + } + }, + "DebugInfo": { + "fields": { + "stackEntries": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "detail": { + "type": "string", + "id": 2 + } + } + }, + "QuotaFailure": { + "fields": { + "violations": { + "rule": "repeated", + "type": "Violation", + "id": 1 + } + }, + "nested": { + "Violation": { + "fields": { + "subject": { + "type": "string", + "id": 1 + }, + "description": { + "type": "string", + "id": 2 + } + } + } + } + }, + "ErrorInfo": { + "fields": { + "reason": { + "type": "string", + "id": 1 + }, + "domain": { + "type": "string", + "id": 2 + }, + "metadata": { + "keyType": "string", + "type": "string", + "id": 3 + } + } + }, + "PreconditionFailure": { + "fields": { + "violations": { + "rule": "repeated", + "type": "Violation", + "id": 1 + } + }, + "nested": { + "Violation": { + "fields": { + "type": { + "type": "string", + "id": 1 + }, + "subject": { + "type": "string", + "id": 2 + }, + "description": { + "type": "string", + "id": 3 + } + } + } + } + }, + "BadRequest": { + "fields": { + "fieldViolations": { + "rule": "repeated", + "type": "FieldViolation", + "id": 1 + } + }, + "nested": { + "FieldViolation": { + "fields": { + "field": { + "type": "string", + "id": 1 + }, + "description": { + "type": "string", + "id": 2 + } + } + } + } + }, + "RequestInfo": { + "fields": { + "requestId": { + "type": "string", + "id": 1 + }, + "servingData": { + "type": "string", + "id": 2 + } + } + }, + "ResourceInfo": { + "fields": { + "resourceType": { + "type": "string", + "id": 1 + }, + "resourceName": { + "type": "string", + "id": 2 + }, + "owner": { + "type": "string", + "id": 3 + }, + "description": { + "type": "string", + "id": 4 + } + } + }, + "Help": { + "fields": { + "links": { + "rule": "repeated", + "type": "Link", + "id": 1 + } + }, + "nested": { + "Link": { + "fields": { + "description": { + "type": "string", + "id": 1 + }, + "url": { + "type": "string", + "id": 2 + } + } + } + } + }, + "LocalizedMessage": { + "fields": { + "locale": { + "type": "string", + "id": 1 + }, + "message": { + "type": "string", + "id": 2 + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/packages/google-cloud-vmmigration/samples/README.md b/packages/google-cloud-vmmigration/samples/README.md new file mode 100644 index 00000000000..1ad1a4b1f92 --- /dev/null +++ b/packages/google-cloud-vmmigration/samples/README.md @@ -0,0 +1,50 @@ +[//]: # "This README.md file is auto-generated, all changes to this file will be lost." +[//]: # "To regenerate it, use `python -m synthtool`." +Google Cloud Platform logo + +# [Migrate for Compute Engine: Node.js Samples](https://github.com/googleapis/nodejs-vmmigration) + +[![Open in Cloud Shell][shell_img]][shell_link] + + + +## Table of Contents + +* [Before you begin](#before-you-begin) +* [Samples](#samples) + * [Quickstart](#quickstart) + +## Before you begin + +Before running the samples, make sure you've followed the steps outlined in +[Using the client library](https://github.com/googleapis/nodejs-vmmigration#using-the-client-library). + +`cd samples` + +`npm install` + +`cd ..` + +## Samples + + + +### Quickstart + +View the [source code](https://github.com/googleapis/nodejs-vmmigration/blob/main/samples/quickstart.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-vmmigration&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) + +__Usage:__ + + +`node samples/quickstart.js` + + + + + + +[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png +[shell_link]: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-vmmigration&page=editor&open_in_editor=samples/README.md +[product-docs]: https://cloud.google.com/migrate/compute-engine/ diff --git a/packages/google-cloud-vmmigration/samples/generated/v1/snippet_metadata.google.cloud.vmmigration.v1.json b/packages/google-cloud-vmmigration/samples/generated/v1/snippet_metadata.google.cloud.vmmigration.v1.json new file mode 100644 index 00000000000..f5a2e1df93c --- /dev/null +++ b/packages/google-cloud-vmmigration/samples/generated/v1/snippet_metadata.google.cloud.vmmigration.v1.json @@ -0,0 +1,2083 @@ +{ + "clientLibrary": { + "name": "nodejs-vmmigration", + "version": "2.2.1", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.vmmigration.v1", + "version": "v1" + } + ] + }, + "snippets": [ + { + "regionTag": "vmmigration_v1_generated_VmMigration_ListSources_async", + "title": "VmMigration listSources Sample", + "origin": "API_DEFINITION", + "description": " Lists Sources in a given project and location.", + "canonical": true, + "file": "vm_migration.list_sources.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 78, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListSources", + "fullName": "google.cloud.vmmigration.v1.VmMigration.ListSources", + "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.vmmigration.v1.ListSourcesResponse", + "client": { + "shortName": "VmMigrationClient", + "fullName": "google.cloud.vmmigration.v1.VmMigrationClient" + }, + "method": { + "shortName": "ListSources", + "fullName": "google.cloud.vmmigration.v1.VmMigration.ListSources", + "service": { + "shortName": "VmMigration", + "fullName": "google.cloud.vmmigration.v1.VmMigration" + } + } + } + }, + { + "regionTag": "vmmigration_v1_generated_VmMigration_GetSource_async", + "title": "VmMigration getSource Sample", + "origin": "API_DEFINITION", + "description": " Gets details of a single Source.", + "canonical": true, + "file": "vm_migration.get_source.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetSource", + "fullName": "google.cloud.vmmigration.v1.VmMigration.GetSource", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.vmmigration.v1.Source", + "client": { + "shortName": "VmMigrationClient", + "fullName": "google.cloud.vmmigration.v1.VmMigrationClient" + }, + "method": { + "shortName": "GetSource", + "fullName": "google.cloud.vmmigration.v1.VmMigration.GetSource", + "service": { + "shortName": "VmMigration", + "fullName": "google.cloud.vmmigration.v1.VmMigration" + } + } + } + }, + { + "regionTag": "vmmigration_v1_generated_VmMigration_CreateSource_async", + "title": "VmMigration createSource Sample", + "origin": "API_DEFINITION", + "description": " Creates a new Source in a given project and location.", + "canonical": true, + "file": "vm_migration.create_source.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 78, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateSource", + "fullName": "google.cloud.vmmigration.v1.VmMigration.CreateSource", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "source_id", + "type": "TYPE_STRING" + }, + { + "name": "source", + "type": ".google.cloud.vmmigration.v1.Source" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "VmMigrationClient", + "fullName": "google.cloud.vmmigration.v1.VmMigrationClient" + }, + "method": { + "shortName": "CreateSource", + "fullName": "google.cloud.vmmigration.v1.VmMigration.CreateSource", + "service": { + "shortName": "VmMigration", + "fullName": "google.cloud.vmmigration.v1.VmMigration" + } + } + } + }, + { + "regionTag": "vmmigration_v1_generated_VmMigration_UpdateSource_async", + "title": "VmMigration updateSource Sample", + "origin": "API_DEFINITION", + "description": " Updates the parameters of a single Source.", + "canonical": true, + "file": "vm_migration.update_source.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 76, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateSource", + "fullName": "google.cloud.vmmigration.v1.VmMigration.UpdateSource", + "async": true, + "parameters": [ + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "source", + "type": ".google.cloud.vmmigration.v1.Source" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "VmMigrationClient", + "fullName": "google.cloud.vmmigration.v1.VmMigrationClient" + }, + "method": { + "shortName": "UpdateSource", + "fullName": "google.cloud.vmmigration.v1.VmMigration.UpdateSource", + "service": { + "shortName": "VmMigration", + "fullName": "google.cloud.vmmigration.v1.VmMigration" + } + } + } + }, + { + "regionTag": "vmmigration_v1_generated_VmMigration_DeleteSource_async", + "title": "VmMigration deleteSource Sample", + "origin": "API_DEFINITION", + "description": " Deletes a single Source.", + "canonical": true, + "file": "vm_migration.delete_source.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteSource", + "fullName": "google.cloud.vmmigration.v1.VmMigration.DeleteSource", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "VmMigrationClient", + "fullName": "google.cloud.vmmigration.v1.VmMigrationClient" + }, + "method": { + "shortName": "DeleteSource", + "fullName": "google.cloud.vmmigration.v1.VmMigration.DeleteSource", + "service": { + "shortName": "VmMigration", + "fullName": "google.cloud.vmmigration.v1.VmMigration" + } + } + } + }, + { + "regionTag": "vmmigration_v1_generated_VmMigration_FetchInventory_async", + "title": "VmMigration fetchInventory Sample", + "origin": "API_DEFINITION", + "description": " List remote source's inventory of VMs. The remote source is the onprem vCenter (remote in the sense it's not in Compute Engine). The inventory describes the list of existing VMs in that source. Note that this operation lists the VMs on the remote source, as opposed to listing the MigratingVms resources in the vmmigration service.", + "canonical": true, + "file": "vm_migration.fetch_inventory.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "FetchInventory", + "fullName": "google.cloud.vmmigration.v1.VmMigration.FetchInventory", + "async": true, + "parameters": [ + { + "name": "source", + "type": "TYPE_STRING" + }, + { + "name": "force_refresh", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.cloud.vmmigration.v1.FetchInventoryResponse", + "client": { + "shortName": "VmMigrationClient", + "fullName": "google.cloud.vmmigration.v1.VmMigrationClient" + }, + "method": { + "shortName": "FetchInventory", + "fullName": "google.cloud.vmmigration.v1.VmMigration.FetchInventory", + "service": { + "shortName": "VmMigration", + "fullName": "google.cloud.vmmigration.v1.VmMigration" + } + } + } + }, + { + "regionTag": "vmmigration_v1_generated_VmMigration_ListUtilizationReports_async", + "title": "VmMigration listUtilizationReports Sample", + "origin": "API_DEFINITION", + "description": " Lists Utilization Reports of the given Source.", + "canonical": true, + "file": "vm_migration.list_utilization_reports.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 83, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListUtilizationReports", + "fullName": "google.cloud.vmmigration.v1.VmMigration.ListUtilizationReports", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "view", + "type": ".google.cloud.vmmigration.v1.UtilizationReportView" + }, + { + "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.vmmigration.v1.ListUtilizationReportsResponse", + "client": { + "shortName": "VmMigrationClient", + "fullName": "google.cloud.vmmigration.v1.VmMigrationClient" + }, + "method": { + "shortName": "ListUtilizationReports", + "fullName": "google.cloud.vmmigration.v1.VmMigration.ListUtilizationReports", + "service": { + "shortName": "VmMigration", + "fullName": "google.cloud.vmmigration.v1.VmMigration" + } + } + } + }, + { + "regionTag": "vmmigration_v1_generated_VmMigration_GetUtilizationReport_async", + "title": "VmMigration getUtilizationReport Sample", + "origin": "API_DEFINITION", + "description": " Gets a single Utilization Report.", + "canonical": true, + "file": "vm_migration.get_utilization_report.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetUtilizationReport", + "fullName": "google.cloud.vmmigration.v1.VmMigration.GetUtilizationReport", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "view", + "type": ".google.cloud.vmmigration.v1.UtilizationReportView" + } + ], + "resultType": ".google.cloud.vmmigration.v1.UtilizationReport", + "client": { + "shortName": "VmMigrationClient", + "fullName": "google.cloud.vmmigration.v1.VmMigrationClient" + }, + "method": { + "shortName": "GetUtilizationReport", + "fullName": "google.cloud.vmmigration.v1.VmMigration.GetUtilizationReport", + "service": { + "shortName": "VmMigration", + "fullName": "google.cloud.vmmigration.v1.VmMigration" + } + } + } + }, + { + "regionTag": "vmmigration_v1_generated_VmMigration_CreateUtilizationReport_async", + "title": "VmMigration createUtilizationReport Sample", + "origin": "API_DEFINITION", + "description": " Creates a new UtilizationReport.", + "canonical": true, + "file": "vm_migration.create_utilization_report.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 82, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateUtilizationReport", + "fullName": "google.cloud.vmmigration.v1.VmMigration.CreateUtilizationReport", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "utilization_report", + "type": ".google.cloud.vmmigration.v1.UtilizationReport" + }, + { + "name": "utilization_report_id", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "VmMigrationClient", + "fullName": "google.cloud.vmmigration.v1.VmMigrationClient" + }, + "method": { + "shortName": "CreateUtilizationReport", + "fullName": "google.cloud.vmmigration.v1.VmMigration.CreateUtilizationReport", + "service": { + "shortName": "VmMigration", + "fullName": "google.cloud.vmmigration.v1.VmMigration" + } + } + } + }, + { + "regionTag": "vmmigration_v1_generated_VmMigration_DeleteUtilizationReport_async", + "title": "VmMigration deleteUtilizationReport Sample", + "origin": "API_DEFINITION", + "description": " Deletes a single Utilization Report.", + "canonical": true, + "file": "vm_migration.delete_utilization_report.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteUtilizationReport", + "fullName": "google.cloud.vmmigration.v1.VmMigration.DeleteUtilizationReport", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "VmMigrationClient", + "fullName": "google.cloud.vmmigration.v1.VmMigrationClient" + }, + "method": { + "shortName": "DeleteUtilizationReport", + "fullName": "google.cloud.vmmigration.v1.VmMigration.DeleteUtilizationReport", + "service": { + "shortName": "VmMigration", + "fullName": "google.cloud.vmmigration.v1.VmMigration" + } + } + } + }, + { + "regionTag": "vmmigration_v1_generated_VmMigration_ListDatacenterConnectors_async", + "title": "VmMigration listDatacenterConnectors Sample", + "origin": "API_DEFINITION", + "description": " Lists DatacenterConnectors in a given Source.", + "canonical": true, + "file": "vm_migration.list_datacenter_connectors.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 79, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListDatacenterConnectors", + "fullName": "google.cloud.vmmigration.v1.VmMigration.ListDatacenterConnectors", + "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.vmmigration.v1.ListDatacenterConnectorsResponse", + "client": { + "shortName": "VmMigrationClient", + "fullName": "google.cloud.vmmigration.v1.VmMigrationClient" + }, + "method": { + "shortName": "ListDatacenterConnectors", + "fullName": "google.cloud.vmmigration.v1.VmMigration.ListDatacenterConnectors", + "service": { + "shortName": "VmMigration", + "fullName": "google.cloud.vmmigration.v1.VmMigration" + } + } + } + }, + { + "regionTag": "vmmigration_v1_generated_VmMigration_GetDatacenterConnector_async", + "title": "VmMigration getDatacenterConnector Sample", + "origin": "API_DEFINITION", + "description": " Gets details of a single DatacenterConnector.", + "canonical": true, + "file": "vm_migration.get_datacenter_connector.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetDatacenterConnector", + "fullName": "google.cloud.vmmigration.v1.VmMigration.GetDatacenterConnector", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.vmmigration.v1.DatacenterConnector", + "client": { + "shortName": "VmMigrationClient", + "fullName": "google.cloud.vmmigration.v1.VmMigrationClient" + }, + "method": { + "shortName": "GetDatacenterConnector", + "fullName": "google.cloud.vmmigration.v1.VmMigration.GetDatacenterConnector", + "service": { + "shortName": "VmMigration", + "fullName": "google.cloud.vmmigration.v1.VmMigration" + } + } + } + }, + { + "regionTag": "vmmigration_v1_generated_VmMigration_CreateDatacenterConnector_async", + "title": "VmMigration createDatacenterConnector Sample", + "origin": "API_DEFINITION", + "description": " Creates a new DatacenterConnector in a given Source.", + "canonical": true, + "file": "vm_migration.create_datacenter_connector.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 81, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateDatacenterConnector", + "fullName": "google.cloud.vmmigration.v1.VmMigration.CreateDatacenterConnector", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "datacenter_connector_id", + "type": "TYPE_STRING" + }, + { + "name": "datacenter_connector", + "type": ".google.cloud.vmmigration.v1.DatacenterConnector" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "VmMigrationClient", + "fullName": "google.cloud.vmmigration.v1.VmMigrationClient" + }, + "method": { + "shortName": "CreateDatacenterConnector", + "fullName": "google.cloud.vmmigration.v1.VmMigration.CreateDatacenterConnector", + "service": { + "shortName": "VmMigration", + "fullName": "google.cloud.vmmigration.v1.VmMigration" + } + } + } + }, + { + "regionTag": "vmmigration_v1_generated_VmMigration_DeleteDatacenterConnector_async", + "title": "VmMigration deleteDatacenterConnector Sample", + "origin": "API_DEFINITION", + "description": " Deletes a single DatacenterConnector.", + "canonical": true, + "file": "vm_migration.delete_datacenter_connector.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteDatacenterConnector", + "fullName": "google.cloud.vmmigration.v1.VmMigration.DeleteDatacenterConnector", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "VmMigrationClient", + "fullName": "google.cloud.vmmigration.v1.VmMigrationClient" + }, + "method": { + "shortName": "DeleteDatacenterConnector", + "fullName": "google.cloud.vmmigration.v1.VmMigration.DeleteDatacenterConnector", + "service": { + "shortName": "VmMigration", + "fullName": "google.cloud.vmmigration.v1.VmMigration" + } + } + } + }, + { + "regionTag": "vmmigration_v1_generated_VmMigration_UpgradeAppliance_async", + "title": "VmMigration upgradeAppliance Sample", + "origin": "API_DEFINITION", + "description": " Upgrades the appliance relate to this DatacenterConnector to the in-place updateable version.", + "canonical": true, + "file": "vm_migration.upgrade_appliance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpgradeAppliance", + "fullName": "google.cloud.vmmigration.v1.VmMigration.UpgradeAppliance", + "async": true, + "parameters": [ + { + "name": "datacenter_connector", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "VmMigrationClient", + "fullName": "google.cloud.vmmigration.v1.VmMigrationClient" + }, + "method": { + "shortName": "UpgradeAppliance", + "fullName": "google.cloud.vmmigration.v1.VmMigration.UpgradeAppliance", + "service": { + "shortName": "VmMigration", + "fullName": "google.cloud.vmmigration.v1.VmMigration" + } + } + } + }, + { + "regionTag": "vmmigration_v1_generated_VmMigration_CreateMigratingVm_async", + "title": "VmMigration createMigratingVm Sample", + "origin": "API_DEFINITION", + "description": " Creates a new MigratingVm in a given Source.", + "canonical": true, + "file": "vm_migration.create_migrating_vm.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 78, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateMigratingVm", + "fullName": "google.cloud.vmmigration.v1.VmMigration.CreateMigratingVm", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "migrating_vm_id", + "type": "TYPE_STRING" + }, + { + "name": "migrating_vm", + "type": ".google.cloud.vmmigration.v1.MigratingVm" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "VmMigrationClient", + "fullName": "google.cloud.vmmigration.v1.VmMigrationClient" + }, + "method": { + "shortName": "CreateMigratingVm", + "fullName": "google.cloud.vmmigration.v1.VmMigration.CreateMigratingVm", + "service": { + "shortName": "VmMigration", + "fullName": "google.cloud.vmmigration.v1.VmMigration" + } + } + } + }, + { + "regionTag": "vmmigration_v1_generated_VmMigration_ListMigratingVms_async", + "title": "VmMigration listMigratingVms Sample", + "origin": "API_DEFINITION", + "description": " Lists MigratingVms in a given Source.", + "canonical": true, + "file": "vm_migration.list_migrating_vms.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 82, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListMigratingVms", + "fullName": "google.cloud.vmmigration.v1.VmMigration.ListMigratingVms", + "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" + }, + { + "name": "view", + "type": ".google.cloud.vmmigration.v1.MigratingVmView" + } + ], + "resultType": ".google.cloud.vmmigration.v1.ListMigratingVmsResponse", + "client": { + "shortName": "VmMigrationClient", + "fullName": "google.cloud.vmmigration.v1.VmMigrationClient" + }, + "method": { + "shortName": "ListMigratingVms", + "fullName": "google.cloud.vmmigration.v1.VmMigration.ListMigratingVms", + "service": { + "shortName": "VmMigration", + "fullName": "google.cloud.vmmigration.v1.VmMigration" + } + } + } + }, + { + "regionTag": "vmmigration_v1_generated_VmMigration_GetMigratingVm_async", + "title": "VmMigration getMigratingVm Sample", + "origin": "API_DEFINITION", + "description": " Gets details of a single MigratingVm.", + "canonical": true, + "file": "vm_migration.get_migrating_vm.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 57, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetMigratingVm", + "fullName": "google.cloud.vmmigration.v1.VmMigration.GetMigratingVm", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "view", + "type": ".google.cloud.vmmigration.v1.MigratingVmView" + } + ], + "resultType": ".google.cloud.vmmigration.v1.MigratingVm", + "client": { + "shortName": "VmMigrationClient", + "fullName": "google.cloud.vmmigration.v1.VmMigrationClient" + }, + "method": { + "shortName": "GetMigratingVm", + "fullName": "google.cloud.vmmigration.v1.VmMigration.GetMigratingVm", + "service": { + "shortName": "VmMigration", + "fullName": "google.cloud.vmmigration.v1.VmMigration" + } + } + } + }, + { + "regionTag": "vmmigration_v1_generated_VmMigration_UpdateMigratingVm_async", + "title": "VmMigration updateMigratingVm Sample", + "origin": "API_DEFINITION", + "description": " Updates the parameters of a single MigratingVm.", + "canonical": true, + "file": "vm_migration.update_migrating_vm.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 76, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateMigratingVm", + "fullName": "google.cloud.vmmigration.v1.VmMigration.UpdateMigratingVm", + "async": true, + "parameters": [ + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "migrating_vm", + "type": ".google.cloud.vmmigration.v1.MigratingVm" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "VmMigrationClient", + "fullName": "google.cloud.vmmigration.v1.VmMigrationClient" + }, + "method": { + "shortName": "UpdateMigratingVm", + "fullName": "google.cloud.vmmigration.v1.VmMigration.UpdateMigratingVm", + "service": { + "shortName": "VmMigration", + "fullName": "google.cloud.vmmigration.v1.VmMigration" + } + } + } + }, + { + "regionTag": "vmmigration_v1_generated_VmMigration_DeleteMigratingVm_async", + "title": "VmMigration deleteMigratingVm Sample", + "origin": "API_DEFINITION", + "description": " Deletes a single MigratingVm.", + "canonical": true, + "file": "vm_migration.delete_migrating_vm.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteMigratingVm", + "fullName": "google.cloud.vmmigration.v1.VmMigration.DeleteMigratingVm", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "VmMigrationClient", + "fullName": "google.cloud.vmmigration.v1.VmMigrationClient" + }, + "method": { + "shortName": "DeleteMigratingVm", + "fullName": "google.cloud.vmmigration.v1.VmMigration.DeleteMigratingVm", + "service": { + "shortName": "VmMigration", + "fullName": "google.cloud.vmmigration.v1.VmMigration" + } + } + } + }, + { + "regionTag": "vmmigration_v1_generated_VmMigration_StartMigration_async", + "title": "VmMigration startMigration Sample", + "origin": "API_DEFINITION", + "description": " Starts migration for a VM. Starts the process of uploading data and creating snapshots, in replication cycles scheduled by the policy.", + "canonical": true, + "file": "vm_migration.start_migration.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "StartMigration", + "fullName": "google.cloud.vmmigration.v1.VmMigration.StartMigration", + "async": true, + "parameters": [ + { + "name": "migrating_vm", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "VmMigrationClient", + "fullName": "google.cloud.vmmigration.v1.VmMigrationClient" + }, + "method": { + "shortName": "StartMigration", + "fullName": "google.cloud.vmmigration.v1.VmMigration.StartMigration", + "service": { + "shortName": "VmMigration", + "fullName": "google.cloud.vmmigration.v1.VmMigration" + } + } + } + }, + { + "regionTag": "vmmigration_v1_generated_VmMigration_ResumeMigration_async", + "title": "VmMigration resumeMigration Sample", + "origin": "API_DEFINITION", + "description": " Resumes a migration for a VM. When called on a paused migration, will start the process of uploading data and creating snapshots; when called on a completed cut-over migration, will update the migration to active state and start the process of uploading data and creating snapshots.", + "canonical": true, + "file": "vm_migration.resume_migration.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ResumeMigration", + "fullName": "google.cloud.vmmigration.v1.VmMigration.ResumeMigration", + "async": true, + "parameters": [ + { + "name": "migrating_vm", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "VmMigrationClient", + "fullName": "google.cloud.vmmigration.v1.VmMigrationClient" + }, + "method": { + "shortName": "ResumeMigration", + "fullName": "google.cloud.vmmigration.v1.VmMigration.ResumeMigration", + "service": { + "shortName": "VmMigration", + "fullName": "google.cloud.vmmigration.v1.VmMigration" + } + } + } + }, + { + "regionTag": "vmmigration_v1_generated_VmMigration_PauseMigration_async", + "title": "VmMigration pauseMigration Sample", + "origin": "API_DEFINITION", + "description": " Pauses a migration for a VM. If cycle tasks are running they will be cancelled, preserving source task data. Further replication cycles will not be triggered while the VM is paused.", + "canonical": true, + "file": "vm_migration.pause_migration.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "PauseMigration", + "fullName": "google.cloud.vmmigration.v1.VmMigration.PauseMigration", + "async": true, + "parameters": [ + { + "name": "migrating_vm", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "VmMigrationClient", + "fullName": "google.cloud.vmmigration.v1.VmMigrationClient" + }, + "method": { + "shortName": "PauseMigration", + "fullName": "google.cloud.vmmigration.v1.VmMigration.PauseMigration", + "service": { + "shortName": "VmMigration", + "fullName": "google.cloud.vmmigration.v1.VmMigration" + } + } + } + }, + { + "regionTag": "vmmigration_v1_generated_VmMigration_FinalizeMigration_async", + "title": "VmMigration finalizeMigration Sample", + "origin": "API_DEFINITION", + "description": " Marks a migration as completed, deleting migration resources that are no longer being used. Only applicable after cutover is done.", + "canonical": true, + "file": "vm_migration.finalize_migration.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "FinalizeMigration", + "fullName": "google.cloud.vmmigration.v1.VmMigration.FinalizeMigration", + "async": true, + "parameters": [ + { + "name": "migrating_vm", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "VmMigrationClient", + "fullName": "google.cloud.vmmigration.v1.VmMigrationClient" + }, + "method": { + "shortName": "FinalizeMigration", + "fullName": "google.cloud.vmmigration.v1.VmMigration.FinalizeMigration", + "service": { + "shortName": "VmMigration", + "fullName": "google.cloud.vmmigration.v1.VmMigration" + } + } + } + }, + { + "regionTag": "vmmigration_v1_generated_VmMigration_CreateCloneJob_async", + "title": "VmMigration createCloneJob Sample", + "origin": "API_DEFINITION", + "description": " Initiates a Clone of a specific migrating VM.", + "canonical": true, + "file": "vm_migration.create_clone_job.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 78, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateCloneJob", + "fullName": "google.cloud.vmmigration.v1.VmMigration.CreateCloneJob", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "clone_job_id", + "type": "TYPE_STRING" + }, + { + "name": "clone_job", + "type": ".google.cloud.vmmigration.v1.CloneJob" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "VmMigrationClient", + "fullName": "google.cloud.vmmigration.v1.VmMigrationClient" + }, + "method": { + "shortName": "CreateCloneJob", + "fullName": "google.cloud.vmmigration.v1.VmMigration.CreateCloneJob", + "service": { + "shortName": "VmMigration", + "fullName": "google.cloud.vmmigration.v1.VmMigration" + } + } + } + }, + { + "regionTag": "vmmigration_v1_generated_VmMigration_CancelCloneJob_async", + "title": "VmMigration cancelCloneJob Sample", + "origin": "API_DEFINITION", + "description": " Initiates the cancellation of a running clone job.", + "canonical": true, + "file": "vm_migration.cancel_clone_job.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CancelCloneJob", + "fullName": "google.cloud.vmmigration.v1.VmMigration.CancelCloneJob", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "VmMigrationClient", + "fullName": "google.cloud.vmmigration.v1.VmMigrationClient" + }, + "method": { + "shortName": "CancelCloneJob", + "fullName": "google.cloud.vmmigration.v1.VmMigration.CancelCloneJob", + "service": { + "shortName": "VmMigration", + "fullName": "google.cloud.vmmigration.v1.VmMigration" + } + } + } + }, + { + "regionTag": "vmmigration_v1_generated_VmMigration_ListCloneJobs_async", + "title": "VmMigration listCloneJobs Sample", + "origin": "API_DEFINITION", + "description": " Lists CloneJobs of a given migrating VM.", + "canonical": true, + "file": "vm_migration.list_clone_jobs.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 78, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListCloneJobs", + "fullName": "google.cloud.vmmigration.v1.VmMigration.ListCloneJobs", + "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.vmmigration.v1.ListCloneJobsResponse", + "client": { + "shortName": "VmMigrationClient", + "fullName": "google.cloud.vmmigration.v1.VmMigrationClient" + }, + "method": { + "shortName": "ListCloneJobs", + "fullName": "google.cloud.vmmigration.v1.VmMigration.ListCloneJobs", + "service": { + "shortName": "VmMigration", + "fullName": "google.cloud.vmmigration.v1.VmMigration" + } + } + } + }, + { + "regionTag": "vmmigration_v1_generated_VmMigration_GetCloneJob_async", + "title": "VmMigration getCloneJob Sample", + "origin": "API_DEFINITION", + "description": " Gets details of a single CloneJob.", + "canonical": true, + "file": "vm_migration.get_clone_job.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetCloneJob", + "fullName": "google.cloud.vmmigration.v1.VmMigration.GetCloneJob", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.vmmigration.v1.CloneJob", + "client": { + "shortName": "VmMigrationClient", + "fullName": "google.cloud.vmmigration.v1.VmMigrationClient" + }, + "method": { + "shortName": "GetCloneJob", + "fullName": "google.cloud.vmmigration.v1.VmMigration.GetCloneJob", + "service": { + "shortName": "VmMigration", + "fullName": "google.cloud.vmmigration.v1.VmMigration" + } + } + } + }, + { + "regionTag": "vmmigration_v1_generated_VmMigration_CreateCutoverJob_async", + "title": "VmMigration createCutoverJob Sample", + "origin": "API_DEFINITION", + "description": " Initiates a Cutover of a specific migrating VM. The returned LRO is completed when the cutover job resource is created and the job is initiated.", + "canonical": true, + "file": "vm_migration.create_cutover_job.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 78, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateCutoverJob", + "fullName": "google.cloud.vmmigration.v1.VmMigration.CreateCutoverJob", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "cutover_job_id", + "type": "TYPE_STRING" + }, + { + "name": "cutover_job", + "type": ".google.cloud.vmmigration.v1.CutoverJob" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "VmMigrationClient", + "fullName": "google.cloud.vmmigration.v1.VmMigrationClient" + }, + "method": { + "shortName": "CreateCutoverJob", + "fullName": "google.cloud.vmmigration.v1.VmMigration.CreateCutoverJob", + "service": { + "shortName": "VmMigration", + "fullName": "google.cloud.vmmigration.v1.VmMigration" + } + } + } + }, + { + "regionTag": "vmmigration_v1_generated_VmMigration_CancelCutoverJob_async", + "title": "VmMigration cancelCutoverJob Sample", + "origin": "API_DEFINITION", + "description": " Initiates the cancellation of a running cutover job.", + "canonical": true, + "file": "vm_migration.cancel_cutover_job.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CancelCutoverJob", + "fullName": "google.cloud.vmmigration.v1.VmMigration.CancelCutoverJob", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "VmMigrationClient", + "fullName": "google.cloud.vmmigration.v1.VmMigrationClient" + }, + "method": { + "shortName": "CancelCutoverJob", + "fullName": "google.cloud.vmmigration.v1.VmMigration.CancelCutoverJob", + "service": { + "shortName": "VmMigration", + "fullName": "google.cloud.vmmigration.v1.VmMigration" + } + } + } + }, + { + "regionTag": "vmmigration_v1_generated_VmMigration_ListCutoverJobs_async", + "title": "VmMigration listCutoverJobs Sample", + "origin": "API_DEFINITION", + "description": " Lists CutoverJobs of a given migrating VM.", + "canonical": true, + "file": "vm_migration.list_cutover_jobs.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 78, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListCutoverJobs", + "fullName": "google.cloud.vmmigration.v1.VmMigration.ListCutoverJobs", + "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.vmmigration.v1.ListCutoverJobsResponse", + "client": { + "shortName": "VmMigrationClient", + "fullName": "google.cloud.vmmigration.v1.VmMigrationClient" + }, + "method": { + "shortName": "ListCutoverJobs", + "fullName": "google.cloud.vmmigration.v1.VmMigration.ListCutoverJobs", + "service": { + "shortName": "VmMigration", + "fullName": "google.cloud.vmmigration.v1.VmMigration" + } + } + } + }, + { + "regionTag": "vmmigration_v1_generated_VmMigration_GetCutoverJob_async", + "title": "VmMigration getCutoverJob Sample", + "origin": "API_DEFINITION", + "description": " Gets details of a single CutoverJob.", + "canonical": true, + "file": "vm_migration.get_cutover_job.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetCutoverJob", + "fullName": "google.cloud.vmmigration.v1.VmMigration.GetCutoverJob", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.vmmigration.v1.CutoverJob", + "client": { + "shortName": "VmMigrationClient", + "fullName": "google.cloud.vmmigration.v1.VmMigrationClient" + }, + "method": { + "shortName": "GetCutoverJob", + "fullName": "google.cloud.vmmigration.v1.VmMigration.GetCutoverJob", + "service": { + "shortName": "VmMigration", + "fullName": "google.cloud.vmmigration.v1.VmMigration" + } + } + } + }, + { + "regionTag": "vmmigration_v1_generated_VmMigration_ListGroups_async", + "title": "VmMigration listGroups Sample", + "origin": "API_DEFINITION", + "description": " Lists Groups in a given project and location.", + "canonical": true, + "file": "vm_migration.list_groups.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 78, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListGroups", + "fullName": "google.cloud.vmmigration.v1.VmMigration.ListGroups", + "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.vmmigration.v1.ListGroupsResponse", + "client": { + "shortName": "VmMigrationClient", + "fullName": "google.cloud.vmmigration.v1.VmMigrationClient" + }, + "method": { + "shortName": "ListGroups", + "fullName": "google.cloud.vmmigration.v1.VmMigration.ListGroups", + "service": { + "shortName": "VmMigration", + "fullName": "google.cloud.vmmigration.v1.VmMigration" + } + } + } + }, + { + "regionTag": "vmmigration_v1_generated_VmMigration_GetGroup_async", + "title": "VmMigration getGroup Sample", + "origin": "API_DEFINITION", + "description": " Gets details of a single Group.", + "canonical": true, + "file": "vm_migration.get_group.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetGroup", + "fullName": "google.cloud.vmmigration.v1.VmMigration.GetGroup", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.vmmigration.v1.Group", + "client": { + "shortName": "VmMigrationClient", + "fullName": "google.cloud.vmmigration.v1.VmMigrationClient" + }, + "method": { + "shortName": "GetGroup", + "fullName": "google.cloud.vmmigration.v1.VmMigration.GetGroup", + "service": { + "shortName": "VmMigration", + "fullName": "google.cloud.vmmigration.v1.VmMigration" + } + } + } + }, + { + "regionTag": "vmmigration_v1_generated_VmMigration_CreateGroup_async", + "title": "VmMigration createGroup Sample", + "origin": "API_DEFINITION", + "description": " Creates a new Group in a given project and location.", + "canonical": true, + "file": "vm_migration.create_group.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 78, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateGroup", + "fullName": "google.cloud.vmmigration.v1.VmMigration.CreateGroup", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "group_id", + "type": "TYPE_STRING" + }, + { + "name": "group", + "type": ".google.cloud.vmmigration.v1.Group" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "VmMigrationClient", + "fullName": "google.cloud.vmmigration.v1.VmMigrationClient" + }, + "method": { + "shortName": "CreateGroup", + "fullName": "google.cloud.vmmigration.v1.VmMigration.CreateGroup", + "service": { + "shortName": "VmMigration", + "fullName": "google.cloud.vmmigration.v1.VmMigration" + } + } + } + }, + { + "regionTag": "vmmigration_v1_generated_VmMigration_UpdateGroup_async", + "title": "VmMigration updateGroup Sample", + "origin": "API_DEFINITION", + "description": " Updates the parameters of a single Group.", + "canonical": true, + "file": "vm_migration.update_group.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 76, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateGroup", + "fullName": "google.cloud.vmmigration.v1.VmMigration.UpdateGroup", + "async": true, + "parameters": [ + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "group", + "type": ".google.cloud.vmmigration.v1.Group" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "VmMigrationClient", + "fullName": "google.cloud.vmmigration.v1.VmMigrationClient" + }, + "method": { + "shortName": "UpdateGroup", + "fullName": "google.cloud.vmmigration.v1.VmMigration.UpdateGroup", + "service": { + "shortName": "VmMigration", + "fullName": "google.cloud.vmmigration.v1.VmMigration" + } + } + } + }, + { + "regionTag": "vmmigration_v1_generated_VmMigration_DeleteGroup_async", + "title": "VmMigration deleteGroup Sample", + "origin": "API_DEFINITION", + "description": " Deletes a single Group.", + "canonical": true, + "file": "vm_migration.delete_group.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteGroup", + "fullName": "google.cloud.vmmigration.v1.VmMigration.DeleteGroup", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "VmMigrationClient", + "fullName": "google.cloud.vmmigration.v1.VmMigrationClient" + }, + "method": { + "shortName": "DeleteGroup", + "fullName": "google.cloud.vmmigration.v1.VmMigration.DeleteGroup", + "service": { + "shortName": "VmMigration", + "fullName": "google.cloud.vmmigration.v1.VmMigration" + } + } + } + }, + { + "regionTag": "vmmigration_v1_generated_VmMigration_AddGroupMigration_async", + "title": "VmMigration addGroupMigration Sample", + "origin": "API_DEFINITION", + "description": " Adds a MigratingVm to a Group.", + "canonical": true, + "file": "vm_migration.add_group_migration.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "AddGroupMigration", + "fullName": "google.cloud.vmmigration.v1.VmMigration.AddGroupMigration", + "async": true, + "parameters": [ + { + "name": "group", + "type": "TYPE_STRING" + }, + { + "name": "migrating_vm", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "VmMigrationClient", + "fullName": "google.cloud.vmmigration.v1.VmMigrationClient" + }, + "method": { + "shortName": "AddGroupMigration", + "fullName": "google.cloud.vmmigration.v1.VmMigration.AddGroupMigration", + "service": { + "shortName": "VmMigration", + "fullName": "google.cloud.vmmigration.v1.VmMigration" + } + } + } + }, + { + "regionTag": "vmmigration_v1_generated_VmMigration_RemoveGroupMigration_async", + "title": "VmMigration removeGroupMigration Sample", + "origin": "API_DEFINITION", + "description": " Removes a MigratingVm from a Group.", + "canonical": true, + "file": "vm_migration.remove_group_migration.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "RemoveGroupMigration", + "fullName": "google.cloud.vmmigration.v1.VmMigration.RemoveGroupMigration", + "async": true, + "parameters": [ + { + "name": "group", + "type": "TYPE_STRING" + }, + { + "name": "migrating_vm", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "VmMigrationClient", + "fullName": "google.cloud.vmmigration.v1.VmMigrationClient" + }, + "method": { + "shortName": "RemoveGroupMigration", + "fullName": "google.cloud.vmmigration.v1.VmMigration.RemoveGroupMigration", + "service": { + "shortName": "VmMigration", + "fullName": "google.cloud.vmmigration.v1.VmMigration" + } + } + } + }, + { + "regionTag": "vmmigration_v1_generated_VmMigration_ListTargetProjects_async", + "title": "VmMigration listTargetProjects Sample", + "origin": "API_DEFINITION", + "description": " Lists TargetProjects in a given project. NOTE: TargetProject is a global resource; hence the only supported value for location is `global`.", + "canonical": true, + "file": "vm_migration.list_target_projects.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 78, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListTargetProjects", + "fullName": "google.cloud.vmmigration.v1.VmMigration.ListTargetProjects", + "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.vmmigration.v1.ListTargetProjectsResponse", + "client": { + "shortName": "VmMigrationClient", + "fullName": "google.cloud.vmmigration.v1.VmMigrationClient" + }, + "method": { + "shortName": "ListTargetProjects", + "fullName": "google.cloud.vmmigration.v1.VmMigration.ListTargetProjects", + "service": { + "shortName": "VmMigration", + "fullName": "google.cloud.vmmigration.v1.VmMigration" + } + } + } + }, + { + "regionTag": "vmmigration_v1_generated_VmMigration_GetTargetProject_async", + "title": "VmMigration getTargetProject Sample", + "origin": "API_DEFINITION", + "description": " Gets details of a single TargetProject. NOTE: TargetProject is a global resource; hence the only supported value for location is `global`.", + "canonical": true, + "file": "vm_migration.get_target_project.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetTargetProject", + "fullName": "google.cloud.vmmigration.v1.VmMigration.GetTargetProject", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.vmmigration.v1.TargetProject", + "client": { + "shortName": "VmMigrationClient", + "fullName": "google.cloud.vmmigration.v1.VmMigrationClient" + }, + "method": { + "shortName": "GetTargetProject", + "fullName": "google.cloud.vmmigration.v1.VmMigration.GetTargetProject", + "service": { + "shortName": "VmMigration", + "fullName": "google.cloud.vmmigration.v1.VmMigration" + } + } + } + }, + { + "regionTag": "vmmigration_v1_generated_VmMigration_CreateTargetProject_async", + "title": "VmMigration createTargetProject Sample", + "origin": "API_DEFINITION", + "description": " Creates a new TargetProject in a given project. NOTE: TargetProject is a global resource; hence the only supported value for location is `global`.", + "canonical": true, + "file": "vm_migration.create_target_project.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 78, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateTargetProject", + "fullName": "google.cloud.vmmigration.v1.VmMigration.CreateTargetProject", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "target_project_id", + "type": "TYPE_STRING" + }, + { + "name": "target_project", + "type": ".google.cloud.vmmigration.v1.TargetProject" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "VmMigrationClient", + "fullName": "google.cloud.vmmigration.v1.VmMigrationClient" + }, + "method": { + "shortName": "CreateTargetProject", + "fullName": "google.cloud.vmmigration.v1.VmMigration.CreateTargetProject", + "service": { + "shortName": "VmMigration", + "fullName": "google.cloud.vmmigration.v1.VmMigration" + } + } + } + }, + { + "regionTag": "vmmigration_v1_generated_VmMigration_UpdateTargetProject_async", + "title": "VmMigration updateTargetProject Sample", + "origin": "API_DEFINITION", + "description": " Updates the parameters of a single TargetProject. NOTE: TargetProject is a global resource; hence the only supported value for location is `global`.", + "canonical": true, + "file": "vm_migration.update_target_project.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 76, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateTargetProject", + "fullName": "google.cloud.vmmigration.v1.VmMigration.UpdateTargetProject", + "async": true, + "parameters": [ + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "target_project", + "type": ".google.cloud.vmmigration.v1.TargetProject" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "VmMigrationClient", + "fullName": "google.cloud.vmmigration.v1.VmMigrationClient" + }, + "method": { + "shortName": "UpdateTargetProject", + "fullName": "google.cloud.vmmigration.v1.VmMigration.UpdateTargetProject", + "service": { + "shortName": "VmMigration", + "fullName": "google.cloud.vmmigration.v1.VmMigration" + } + } + } + }, + { + "regionTag": "vmmigration_v1_generated_VmMigration_DeleteTargetProject_async", + "title": "VmMigration deleteTargetProject Sample", + "origin": "API_DEFINITION", + "description": " Deletes a single TargetProject. NOTE: TargetProject is a global resource; hence the only supported value for location is `global`.", + "canonical": true, + "file": "vm_migration.delete_target_project.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteTargetProject", + "fullName": "google.cloud.vmmigration.v1.VmMigration.DeleteTargetProject", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "VmMigrationClient", + "fullName": "google.cloud.vmmigration.v1.VmMigrationClient" + }, + "method": { + "shortName": "DeleteTargetProject", + "fullName": "google.cloud.vmmigration.v1.VmMigration.DeleteTargetProject", + "service": { + "shortName": "VmMigration", + "fullName": "google.cloud.vmmigration.v1.VmMigration" + } + } + } + } + ] +} \ No newline at end of file diff --git a/packages/google-cloud-vmmigration/samples/generated/v1/vm_migration.add_group_migration.js b/packages/google-cloud-vmmigration/samples/generated/v1/vm_migration.add_group_migration.js new file mode 100644 index 00000000000..38beeb239b8 --- /dev/null +++ b/packages/google-cloud-vmmigration/samples/generated/v1/vm_migration.add_group_migration.js @@ -0,0 +1,66 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(group) { + // [START vmmigration_v1_generated_VmMigration_AddGroupMigration_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 full path name of the Group to add to. + */ + // const group = 'abc123' + /** + * The full path name of the MigratingVm to add. + */ + // const migratingVm = 'abc123' + + // Imports the Vmmigration library + const {VmMigrationClient} = require('@google-cloud/vmmigration').v1; + + // Instantiates a client + const vmmigrationClient = new VmMigrationClient(); + + async function callAddGroupMigration() { + // Construct request + const request = { + group, + }; + + // Run request + const [operation] = await vmmigrationClient.addGroupMigration(request); + const [response] = await operation.promise(); + console.log(response); + } + + callAddGroupMigration(); + // [END vmmigration_v1_generated_VmMigration_AddGroupMigration_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-vmmigration/samples/generated/v1/vm_migration.cancel_clone_job.js b/packages/google-cloud-vmmigration/samples/generated/v1/vm_migration.cancel_clone_job.js new file mode 100644 index 00000000000..42eef503507 --- /dev/null +++ b/packages/google-cloud-vmmigration/samples/generated/v1/vm_migration.cancel_clone_job.js @@ -0,0 +1,62 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START vmmigration_v1_generated_VmMigration_CancelCloneJob_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 clone job id + */ + // const name = 'abc123' + + // Imports the Vmmigration library + const {VmMigrationClient} = require('@google-cloud/vmmigration').v1; + + // Instantiates a client + const vmmigrationClient = new VmMigrationClient(); + + async function callCancelCloneJob() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await vmmigrationClient.cancelCloneJob(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCancelCloneJob(); + // [END vmmigration_v1_generated_VmMigration_CancelCloneJob_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-vmmigration/samples/generated/v1/vm_migration.cancel_cutover_job.js b/packages/google-cloud-vmmigration/samples/generated/v1/vm_migration.cancel_cutover_job.js new file mode 100644 index 00000000000..bf0e4987680 --- /dev/null +++ b/packages/google-cloud-vmmigration/samples/generated/v1/vm_migration.cancel_cutover_job.js @@ -0,0 +1,62 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START vmmigration_v1_generated_VmMigration_CancelCutoverJob_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 cutover job id + */ + // const name = 'abc123' + + // Imports the Vmmigration library + const {VmMigrationClient} = require('@google-cloud/vmmigration').v1; + + // Instantiates a client + const vmmigrationClient = new VmMigrationClient(); + + async function callCancelCutoverJob() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await vmmigrationClient.cancelCutoverJob(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCancelCutoverJob(); + // [END vmmigration_v1_generated_VmMigration_CancelCutoverJob_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-vmmigration/samples/generated/v1/vm_migration.create_clone_job.js b/packages/google-cloud-vmmigration/samples/generated/v1/vm_migration.create_clone_job.js new file mode 100644 index 00000000000..d6b0d9c573a --- /dev/null +++ b/packages/google-cloud-vmmigration/samples/generated/v1/vm_migration.create_clone_job.js @@ -0,0 +1,86 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, cloneJobId, cloneJob) { + // [START vmmigration_v1_generated_VmMigration_CreateCloneJob_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 Clone's parent. + */ + // const parent = 'abc123' + /** + * Required. The clone job identifier. + */ + // const cloneJobId = 'abc123' + /** + * Required. The clone request body. + */ + // const cloneJob = {} + /** + * A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + + // Imports the Vmmigration library + const {VmMigrationClient} = require('@google-cloud/vmmigration').v1; + + // Instantiates a client + const vmmigrationClient = new VmMigrationClient(); + + async function callCreateCloneJob() { + // Construct request + const request = { + parent, + cloneJobId, + cloneJob, + }; + + // Run request + const [operation] = await vmmigrationClient.createCloneJob(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateCloneJob(); + // [END vmmigration_v1_generated_VmMigration_CreateCloneJob_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-vmmigration/samples/generated/v1/vm_migration.create_cutover_job.js b/packages/google-cloud-vmmigration/samples/generated/v1/vm_migration.create_cutover_job.js new file mode 100644 index 00000000000..444cbe7f0b1 --- /dev/null +++ b/packages/google-cloud-vmmigration/samples/generated/v1/vm_migration.create_cutover_job.js @@ -0,0 +1,86 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, cutoverJobId, cutoverJob) { + // [START vmmigration_v1_generated_VmMigration_CreateCutoverJob_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 Cutover's parent. + */ + // const parent = 'abc123' + /** + * Required. The cutover job identifier. + */ + // const cutoverJobId = 'abc123' + /** + * Required. The cutover request body. + */ + // const cutoverJob = {} + /** + * A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + + // Imports the Vmmigration library + const {VmMigrationClient} = require('@google-cloud/vmmigration').v1; + + // Instantiates a client + const vmmigrationClient = new VmMigrationClient(); + + async function callCreateCutoverJob() { + // Construct request + const request = { + parent, + cutoverJobId, + cutoverJob, + }; + + // Run request + const [operation] = await vmmigrationClient.createCutoverJob(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateCutoverJob(); + // [END vmmigration_v1_generated_VmMigration_CreateCutoverJob_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-vmmigration/samples/generated/v1/vm_migration.create_datacenter_connector.js b/packages/google-cloud-vmmigration/samples/generated/v1/vm_migration.create_datacenter_connector.js new file mode 100644 index 00000000000..d050de0d5a0 --- /dev/null +++ b/packages/google-cloud-vmmigration/samples/generated/v1/vm_migration.create_datacenter_connector.js @@ -0,0 +1,89 @@ +// 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, datacenterConnectorId, datacenterConnector) { + // [START vmmigration_v1_generated_VmMigration_CreateDatacenterConnector_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 DatacenterConnector's parent. + * Required. The Source in where the new DatacenterConnector will be created. + * For example: + * `projects/my-project/locations/us-central1/sources/my-source` + */ + // const parent = 'abc123' + /** + * Required. The datacenterConnector identifier. + */ + // const datacenterConnectorId = 'abc123' + /** + * Required. The create request body. + */ + // const datacenterConnector = {} + /** + * A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + + // Imports the Vmmigration library + const {VmMigrationClient} = require('@google-cloud/vmmigration').v1; + + // Instantiates a client + const vmmigrationClient = new VmMigrationClient(); + + async function callCreateDatacenterConnector() { + // Construct request + const request = { + parent, + datacenterConnectorId, + datacenterConnector, + }; + + // Run request + const [operation] = await vmmigrationClient.createDatacenterConnector(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateDatacenterConnector(); + // [END vmmigration_v1_generated_VmMigration_CreateDatacenterConnector_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-vmmigration/samples/generated/v1/vm_migration.create_group.js b/packages/google-cloud-vmmigration/samples/generated/v1/vm_migration.create_group.js new file mode 100644 index 00000000000..4b718ae25f0 --- /dev/null +++ b/packages/google-cloud-vmmigration/samples/generated/v1/vm_migration.create_group.js @@ -0,0 +1,86 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, groupId, group) { + // [START vmmigration_v1_generated_VmMigration_CreateGroup_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 Group's parent. + */ + // const parent = 'abc123' + /** + * Required. The group identifier. + */ + // const groupId = 'abc123' + /** + * Required. The create request body. + */ + // const group = {} + /** + * A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + + // Imports the Vmmigration library + const {VmMigrationClient} = require('@google-cloud/vmmigration').v1; + + // Instantiates a client + const vmmigrationClient = new VmMigrationClient(); + + async function callCreateGroup() { + // Construct request + const request = { + parent, + groupId, + group, + }; + + // Run request + const [operation] = await vmmigrationClient.createGroup(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateGroup(); + // [END vmmigration_v1_generated_VmMigration_CreateGroup_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-vmmigration/samples/generated/v1/vm_migration.create_migrating_vm.js b/packages/google-cloud-vmmigration/samples/generated/v1/vm_migration.create_migrating_vm.js new file mode 100644 index 00000000000..d3d7d453e94 --- /dev/null +++ b/packages/google-cloud-vmmigration/samples/generated/v1/vm_migration.create_migrating_vm.js @@ -0,0 +1,86 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, migratingVmId, migratingVm) { + // [START vmmigration_v1_generated_VmMigration_CreateMigratingVm_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 MigratingVm's parent. + */ + // const parent = 'abc123' + /** + * Required. The migratingVm identifier. + */ + // const migratingVmId = 'abc123' + /** + * Required. The create request body. + */ + // const migratingVm = {} + /** + * A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + + // Imports the Vmmigration library + const {VmMigrationClient} = require('@google-cloud/vmmigration').v1; + + // Instantiates a client + const vmmigrationClient = new VmMigrationClient(); + + async function callCreateMigratingVm() { + // Construct request + const request = { + parent, + migratingVmId, + migratingVm, + }; + + // Run request + const [operation] = await vmmigrationClient.createMigratingVm(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateMigratingVm(); + // [END vmmigration_v1_generated_VmMigration_CreateMigratingVm_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-vmmigration/samples/generated/v1/vm_migration.create_source.js b/packages/google-cloud-vmmigration/samples/generated/v1/vm_migration.create_source.js new file mode 100644 index 00000000000..7085810fb36 --- /dev/null +++ b/packages/google-cloud-vmmigration/samples/generated/v1/vm_migration.create_source.js @@ -0,0 +1,86 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, sourceId, source) { + // [START vmmigration_v1_generated_VmMigration_CreateSource_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 Source's parent. + */ + // const parent = 'abc123' + /** + * Required. The source identifier. + */ + // const sourceId = 'abc123' + /** + * Required. The create request body. + */ + // const source = {} + /** + * A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + + // Imports the Vmmigration library + const {VmMigrationClient} = require('@google-cloud/vmmigration').v1; + + // Instantiates a client + const vmmigrationClient = new VmMigrationClient(); + + async function callCreateSource() { + // Construct request + const request = { + parent, + sourceId, + source, + }; + + // Run request + const [operation] = await vmmigrationClient.createSource(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateSource(); + // [END vmmigration_v1_generated_VmMigration_CreateSource_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-vmmigration/samples/generated/v1/vm_migration.create_target_project.js b/packages/google-cloud-vmmigration/samples/generated/v1/vm_migration.create_target_project.js new file mode 100644 index 00000000000..23d1b63fac2 --- /dev/null +++ b/packages/google-cloud-vmmigration/samples/generated/v1/vm_migration.create_target_project.js @@ -0,0 +1,86 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, targetProjectId, targetProject) { + // [START vmmigration_v1_generated_VmMigration_CreateTargetProject_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 TargetProject's parent. + */ + // const parent = 'abc123' + /** + * Required. The target_project identifier. + */ + // const targetProjectId = 'abc123' + /** + * Required. The create request body. + */ + // const targetProject = {} + /** + * A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + + // Imports the Vmmigration library + const {VmMigrationClient} = require('@google-cloud/vmmigration').v1; + + // Instantiates a client + const vmmigrationClient = new VmMigrationClient(); + + async function callCreateTargetProject() { + // Construct request + const request = { + parent, + targetProjectId, + targetProject, + }; + + // Run request + const [operation] = await vmmigrationClient.createTargetProject(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateTargetProject(); + // [END vmmigration_v1_generated_VmMigration_CreateTargetProject_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-vmmigration/samples/generated/v1/vm_migration.create_utilization_report.js b/packages/google-cloud-vmmigration/samples/generated/v1/vm_migration.create_utilization_report.js new file mode 100644 index 00000000000..de798d4708d --- /dev/null +++ b/packages/google-cloud-vmmigration/samples/generated/v1/vm_migration.create_utilization_report.js @@ -0,0 +1,90 @@ +// 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, utilizationReport, utilizationReportId) { + // [START vmmigration_v1_generated_VmMigration_CreateUtilizationReport_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 Utilization Report's parent. + */ + // const parent = 'abc123' + /** + * Required. The report to create. + */ + // const utilizationReport = {} + /** + * Required. The ID to use for the report, which will become the final + * component of the reports's resource name. + * This value maximum length is 63 characters, and valid characters + * are /[a-z][0-9]-/. It must start with an english letter and must not + * end with a hyphen. + */ + // const utilizationReportId = 'abc123' + /** + * A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + + // Imports the Vmmigration library + const {VmMigrationClient} = require('@google-cloud/vmmigration').v1; + + // Instantiates a client + const vmmigrationClient = new VmMigrationClient(); + + async function callCreateUtilizationReport() { + // Construct request + const request = { + parent, + utilizationReport, + utilizationReportId, + }; + + // Run request + const [operation] = await vmmigrationClient.createUtilizationReport(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateUtilizationReport(); + // [END vmmigration_v1_generated_VmMigration_CreateUtilizationReport_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-vmmigration/samples/generated/v1/vm_migration.delete_datacenter_connector.js b/packages/google-cloud-vmmigration/samples/generated/v1/vm_migration.delete_datacenter_connector.js new file mode 100644 index 00000000000..0076874bcef --- /dev/null +++ b/packages/google-cloud-vmmigration/samples/generated/v1/vm_migration.delete_datacenter_connector.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 vmmigration_v1_generated_VmMigration_DeleteDatacenterConnector_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 DatacenterConnector name. + */ + // const name = 'abc123' + /** + * A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + + // Imports the Vmmigration library + const {VmMigrationClient} = require('@google-cloud/vmmigration').v1; + + // Instantiates a client + const vmmigrationClient = new VmMigrationClient(); + + async function callDeleteDatacenterConnector() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await vmmigrationClient.deleteDatacenterConnector(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteDatacenterConnector(); + // [END vmmigration_v1_generated_VmMigration_DeleteDatacenterConnector_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-vmmigration/samples/generated/v1/vm_migration.delete_group.js b/packages/google-cloud-vmmigration/samples/generated/v1/vm_migration.delete_group.js new file mode 100644 index 00000000000..a7b6ef4f9d8 --- /dev/null +++ b/packages/google-cloud-vmmigration/samples/generated/v1/vm_migration.delete_group.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 vmmigration_v1_generated_VmMigration_DeleteGroup_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 Group name. + */ + // const name = 'abc123' + /** + * Optional. A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + + // Imports the Vmmigration library + const {VmMigrationClient} = require('@google-cloud/vmmigration').v1; + + // Instantiates a client + const vmmigrationClient = new VmMigrationClient(); + + async function callDeleteGroup() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await vmmigrationClient.deleteGroup(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteGroup(); + // [END vmmigration_v1_generated_VmMigration_DeleteGroup_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-vmmigration/samples/generated/v1/vm_migration.delete_migrating_vm.js b/packages/google-cloud-vmmigration/samples/generated/v1/vm_migration.delete_migrating_vm.js new file mode 100644 index 00000000000..013f0ac5453 --- /dev/null +++ b/packages/google-cloud-vmmigration/samples/generated/v1/vm_migration.delete_migrating_vm.js @@ -0,0 +1,62 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START vmmigration_v1_generated_VmMigration_DeleteMigratingVm_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the MigratingVm. + */ + // const name = 'abc123' + + // Imports the Vmmigration library + const {VmMigrationClient} = require('@google-cloud/vmmigration').v1; + + // Instantiates a client + const vmmigrationClient = new VmMigrationClient(); + + async function callDeleteMigratingVm() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await vmmigrationClient.deleteMigratingVm(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteMigratingVm(); + // [END vmmigration_v1_generated_VmMigration_DeleteMigratingVm_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-vmmigration/samples/generated/v1/vm_migration.delete_source.js b/packages/google-cloud-vmmigration/samples/generated/v1/vm_migration.delete_source.js new file mode 100644 index 00000000000..f70a4129558 --- /dev/null +++ b/packages/google-cloud-vmmigration/samples/generated/v1/vm_migration.delete_source.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 vmmigration_v1_generated_VmMigration_DeleteSource_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 Source name. + */ + // const name = 'abc123' + /** + * Optional. A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + + // Imports the Vmmigration library + const {VmMigrationClient} = require('@google-cloud/vmmigration').v1; + + // Instantiates a client + const vmmigrationClient = new VmMigrationClient(); + + async function callDeleteSource() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await vmmigrationClient.deleteSource(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteSource(); + // [END vmmigration_v1_generated_VmMigration_DeleteSource_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-vmmigration/samples/generated/v1/vm_migration.delete_target_project.js b/packages/google-cloud-vmmigration/samples/generated/v1/vm_migration.delete_target_project.js new file mode 100644 index 00000000000..ed4fc99d652 --- /dev/null +++ b/packages/google-cloud-vmmigration/samples/generated/v1/vm_migration.delete_target_project.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 vmmigration_v1_generated_VmMigration_DeleteTargetProject_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 TargetProject name. + */ + // const name = 'abc123' + /** + * Optional. A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + + // Imports the Vmmigration library + const {VmMigrationClient} = require('@google-cloud/vmmigration').v1; + + // Instantiates a client + const vmmigrationClient = new VmMigrationClient(); + + async function callDeleteTargetProject() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await vmmigrationClient.deleteTargetProject(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteTargetProject(); + // [END vmmigration_v1_generated_VmMigration_DeleteTargetProject_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-vmmigration/samples/generated/v1/vm_migration.delete_utilization_report.js b/packages/google-cloud-vmmigration/samples/generated/v1/vm_migration.delete_utilization_report.js new file mode 100644 index 00000000000..103ca22330c --- /dev/null +++ b/packages/google-cloud-vmmigration/samples/generated/v1/vm_migration.delete_utilization_report.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 vmmigration_v1_generated_VmMigration_DeleteUtilizationReport_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 Utilization Report name. + */ + // const name = 'abc123' + /** + * Optional. A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + + // Imports the Vmmigration library + const {VmMigrationClient} = require('@google-cloud/vmmigration').v1; + + // Instantiates a client + const vmmigrationClient = new VmMigrationClient(); + + async function callDeleteUtilizationReport() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await vmmigrationClient.deleteUtilizationReport(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteUtilizationReport(); + // [END vmmigration_v1_generated_VmMigration_DeleteUtilizationReport_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-vmmigration/samples/generated/v1/vm_migration.fetch_inventory.js b/packages/google-cloud-vmmigration/samples/generated/v1/vm_migration.fetch_inventory.js new file mode 100644 index 00000000000..5cd214f01dd --- /dev/null +++ b/packages/google-cloud-vmmigration/samples/generated/v1/vm_migration.fetch_inventory.js @@ -0,0 +1,66 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(source) { + // [START vmmigration_v1_generated_VmMigration_FetchInventory_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the Source. + */ + // const source = 'abc123' + /** + * If this flag is set to true, the source will be queried instead of using + * cached results. Using this flag will make the call slower. + */ + // const forceRefresh = true + + // Imports the Vmmigration library + const {VmMigrationClient} = require('@google-cloud/vmmigration').v1; + + // Instantiates a client + const vmmigrationClient = new VmMigrationClient(); + + async function callFetchInventory() { + // Construct request + const request = { + source, + }; + + // Run request + const response = await vmmigrationClient.fetchInventory(request); + console.log(response); + } + + callFetchInventory(); + // [END vmmigration_v1_generated_VmMigration_FetchInventory_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-vmmigration/samples/generated/v1/vm_migration.finalize_migration.js b/packages/google-cloud-vmmigration/samples/generated/v1/vm_migration.finalize_migration.js new file mode 100644 index 00000000000..80718d6ec52 --- /dev/null +++ b/packages/google-cloud-vmmigration/samples/generated/v1/vm_migration.finalize_migration.js @@ -0,0 +1,62 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(migratingVm) { + // [START vmmigration_v1_generated_VmMigration_FinalizeMigration_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the MigratingVm. + */ + // const migratingVm = 'abc123' + + // Imports the Vmmigration library + const {VmMigrationClient} = require('@google-cloud/vmmigration').v1; + + // Instantiates a client + const vmmigrationClient = new VmMigrationClient(); + + async function callFinalizeMigration() { + // Construct request + const request = { + migratingVm, + }; + + // Run request + const [operation] = await vmmigrationClient.finalizeMigration(request); + const [response] = await operation.promise(); + console.log(response); + } + + callFinalizeMigration(); + // [END vmmigration_v1_generated_VmMigration_FinalizeMigration_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-vmmigration/samples/generated/v1/vm_migration.get_clone_job.js b/packages/google-cloud-vmmigration/samples/generated/v1/vm_migration.get_clone_job.js new file mode 100644 index 00000000000..bf3c34b69e6 --- /dev/null +++ b/packages/google-cloud-vmmigration/samples/generated/v1/vm_migration.get_clone_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 vmmigration_v1_generated_VmMigration_GetCloneJob_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the CloneJob. + */ + // const name = 'abc123' + + // Imports the Vmmigration library + const {VmMigrationClient} = require('@google-cloud/vmmigration').v1; + + // Instantiates a client + const vmmigrationClient = new VmMigrationClient(); + + async function callGetCloneJob() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await vmmigrationClient.getCloneJob(request); + console.log(response); + } + + callGetCloneJob(); + // [END vmmigration_v1_generated_VmMigration_GetCloneJob_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-vmmigration/samples/generated/v1/vm_migration.get_cutover_job.js b/packages/google-cloud-vmmigration/samples/generated/v1/vm_migration.get_cutover_job.js new file mode 100644 index 00000000000..06766e01c0a --- /dev/null +++ b/packages/google-cloud-vmmigration/samples/generated/v1/vm_migration.get_cutover_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 vmmigration_v1_generated_VmMigration_GetCutoverJob_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the CutoverJob. + */ + // const name = 'abc123' + + // Imports the Vmmigration library + const {VmMigrationClient} = require('@google-cloud/vmmigration').v1; + + // Instantiates a client + const vmmigrationClient = new VmMigrationClient(); + + async function callGetCutoverJob() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await vmmigrationClient.getCutoverJob(request); + console.log(response); + } + + callGetCutoverJob(); + // [END vmmigration_v1_generated_VmMigration_GetCutoverJob_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-vmmigration/samples/generated/v1/vm_migration.get_datacenter_connector.js b/packages/google-cloud-vmmigration/samples/generated/v1/vm_migration.get_datacenter_connector.js new file mode 100644 index 00000000000..7de7b1c3740 --- /dev/null +++ b/packages/google-cloud-vmmigration/samples/generated/v1/vm_migration.get_datacenter_connector.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 vmmigration_v1_generated_VmMigration_GetDatacenterConnector_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the DatacenterConnector. + */ + // const name = 'abc123' + + // Imports the Vmmigration library + const {VmMigrationClient} = require('@google-cloud/vmmigration').v1; + + // Instantiates a client + const vmmigrationClient = new VmMigrationClient(); + + async function callGetDatacenterConnector() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await vmmigrationClient.getDatacenterConnector(request); + console.log(response); + } + + callGetDatacenterConnector(); + // [END vmmigration_v1_generated_VmMigration_GetDatacenterConnector_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-vmmigration/samples/generated/v1/vm_migration.get_group.js b/packages/google-cloud-vmmigration/samples/generated/v1/vm_migration.get_group.js new file mode 100644 index 00000000000..4affa3ced3b --- /dev/null +++ b/packages/google-cloud-vmmigration/samples/generated/v1/vm_migration.get_group.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 vmmigration_v1_generated_VmMigration_GetGroup_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 group name. + */ + // const name = 'abc123' + + // Imports the Vmmigration library + const {VmMigrationClient} = require('@google-cloud/vmmigration').v1; + + // Instantiates a client + const vmmigrationClient = new VmMigrationClient(); + + async function callGetGroup() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await vmmigrationClient.getGroup(request); + console.log(response); + } + + callGetGroup(); + // [END vmmigration_v1_generated_VmMigration_GetGroup_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-vmmigration/samples/generated/v1/vm_migration.get_migrating_vm.js b/packages/google-cloud-vmmigration/samples/generated/v1/vm_migration.get_migrating_vm.js new file mode 100644 index 00000000000..e2b3b08d63c --- /dev/null +++ b/packages/google-cloud-vmmigration/samples/generated/v1/vm_migration.get_migrating_vm.js @@ -0,0 +1,65 @@ +// 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 vmmigration_v1_generated_VmMigration_GetMigratingVm_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the MigratingVm. + */ + // const name = 'abc123' + /** + * Optional. The level of details of the migrating VM. + */ + // const view = {} + + // Imports the Vmmigration library + const {VmMigrationClient} = require('@google-cloud/vmmigration').v1; + + // Instantiates a client + const vmmigrationClient = new VmMigrationClient(); + + async function callGetMigratingVm() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await vmmigrationClient.getMigratingVm(request); + console.log(response); + } + + callGetMigratingVm(); + // [END vmmigration_v1_generated_VmMigration_GetMigratingVm_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-vmmigration/samples/generated/v1/vm_migration.get_source.js b/packages/google-cloud-vmmigration/samples/generated/v1/vm_migration.get_source.js new file mode 100644 index 00000000000..543bf4fb8bc --- /dev/null +++ b/packages/google-cloud-vmmigration/samples/generated/v1/vm_migration.get_source.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 vmmigration_v1_generated_VmMigration_GetSource_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 Source name. + */ + // const name = 'abc123' + + // Imports the Vmmigration library + const {VmMigrationClient} = require('@google-cloud/vmmigration').v1; + + // Instantiates a client + const vmmigrationClient = new VmMigrationClient(); + + async function callGetSource() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await vmmigrationClient.getSource(request); + console.log(response); + } + + callGetSource(); + // [END vmmigration_v1_generated_VmMigration_GetSource_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-vmmigration/samples/generated/v1/vm_migration.get_target_project.js b/packages/google-cloud-vmmigration/samples/generated/v1/vm_migration.get_target_project.js new file mode 100644 index 00000000000..90365392bf0 --- /dev/null +++ b/packages/google-cloud-vmmigration/samples/generated/v1/vm_migration.get_target_project.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 vmmigration_v1_generated_VmMigration_GetTargetProject_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 TargetProject name. + */ + // const name = 'abc123' + + // Imports the Vmmigration library + const {VmMigrationClient} = require('@google-cloud/vmmigration').v1; + + // Instantiates a client + const vmmigrationClient = new VmMigrationClient(); + + async function callGetTargetProject() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await vmmigrationClient.getTargetProject(request); + console.log(response); + } + + callGetTargetProject(); + // [END vmmigration_v1_generated_VmMigration_GetTargetProject_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-vmmigration/samples/generated/v1/vm_migration.get_utilization_report.js b/packages/google-cloud-vmmigration/samples/generated/v1/vm_migration.get_utilization_report.js new file mode 100644 index 00000000000..91ad156b3d5 --- /dev/null +++ b/packages/google-cloud-vmmigration/samples/generated/v1/vm_migration.get_utilization_report.js @@ -0,0 +1,66 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START vmmigration_v1_generated_VmMigration_GetUtilizationReport_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 Utilization Report name. + */ + // const name = 'abc123' + /** + * Optional. The level of details of the report. + * Defaults to FULL + */ + // const view = {} + + // Imports the Vmmigration library + const {VmMigrationClient} = require('@google-cloud/vmmigration').v1; + + // Instantiates a client + const vmmigrationClient = new VmMigrationClient(); + + async function callGetUtilizationReport() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await vmmigrationClient.getUtilizationReport(request); + console.log(response); + } + + callGetUtilizationReport(); + // [END vmmigration_v1_generated_VmMigration_GetUtilizationReport_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-vmmigration/samples/generated/v1/vm_migration.list_clone_jobs.js b/packages/google-cloud-vmmigration/samples/generated/v1/vm_migration.list_clone_jobs.js new file mode 100644 index 00000000000..8ab37414932 --- /dev/null +++ b/packages/google-cloud-vmmigration/samples/generated/v1/vm_migration.list_clone_jobs.js @@ -0,0 +1,86 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, pageToken) { + // [START vmmigration_v1_generated_VmMigration_ListCloneJobs_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 source VMs. + */ + // const parent = 'abc123' + /** + * Optional. The maximum number of clone jobs to return. The service may + * return fewer than this value. If unspecified, at most 500 clone jobs will + * be returned. The maximum value is 1000; values above 1000 will be coerced + * to 1000. + */ + // const pageSize = 1234 + /** + * Required. A page token, received from a previous `ListCloneJobs` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListCloneJobs` must + * match the call that provided the page token. + */ + // const pageToken = 'abc123' + /** + * Optional. The filter request. + */ + // const filter = 'abc123' + /** + * Optional. the order by fields for the result. + */ + // const orderBy = 'abc123' + + // Imports the Vmmigration library + const {VmMigrationClient} = require('@google-cloud/vmmigration').v1; + + // Instantiates a client + const vmmigrationClient = new VmMigrationClient(); + + async function callListCloneJobs() { + // Construct request + const request = { + parent, + pageToken, + }; + + // Run request + const iterable = await vmmigrationClient.listCloneJobsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListCloneJobs(); + // [END vmmigration_v1_generated_VmMigration_ListCloneJobs_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-vmmigration/samples/generated/v1/vm_migration.list_cutover_jobs.js b/packages/google-cloud-vmmigration/samples/generated/v1/vm_migration.list_cutover_jobs.js new file mode 100644 index 00000000000..00a6d3301bb --- /dev/null +++ b/packages/google-cloud-vmmigration/samples/generated/v1/vm_migration.list_cutover_jobs.js @@ -0,0 +1,86 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, pageToken) { + // [START vmmigration_v1_generated_VmMigration_ListCutoverJobs_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 migrating VMs. + */ + // const parent = 'abc123' + /** + * Optional. The maximum number of cutover jobs to return. The service may + * return fewer than this value. If unspecified, at most 500 cutover jobs will + * be returned. The maximum value is 1000; values above 1000 will be coerced + * to 1000. + */ + // const pageSize = 1234 + /** + * Required. A page token, received from a previous `ListCutoverJobs` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListCutoverJobs` must + * match the call that provided the page token. + */ + // const pageToken = 'abc123' + /** + * Optional. The filter request. + */ + // const filter = 'abc123' + /** + * Optional. the order by fields for the result. + */ + // const orderBy = 'abc123' + + // Imports the Vmmigration library + const {VmMigrationClient} = require('@google-cloud/vmmigration').v1; + + // Instantiates a client + const vmmigrationClient = new VmMigrationClient(); + + async function callListCutoverJobs() { + // Construct request + const request = { + parent, + pageToken, + }; + + // Run request + const iterable = await vmmigrationClient.listCutoverJobsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListCutoverJobs(); + // [END vmmigration_v1_generated_VmMigration_ListCutoverJobs_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-vmmigration/samples/generated/v1/vm_migration.list_datacenter_connectors.js b/packages/google-cloud-vmmigration/samples/generated/v1/vm_migration.list_datacenter_connectors.js new file mode 100644 index 00000000000..54a6dce7f9d --- /dev/null +++ b/packages/google-cloud-vmmigration/samples/generated/v1/vm_migration.list_datacenter_connectors.js @@ -0,0 +1,87 @@ +// 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, pageToken) { + // [START vmmigration_v1_generated_VmMigration_ListDatacenterConnectors_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 connectors. + */ + // const parent = 'abc123' + /** + * Optional. The maximum number of connectors to return. The service may + * return fewer than this value. If unspecified, at most 500 sources will be + * returned. The maximum value is 1000; values above 1000 will be coerced to + * 1000. + */ + // const pageSize = 1234 + /** + * Required. A page token, received from a previous `ListDatacenterConnectors` + * call. Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to + * `ListDatacenterConnectors` must match the call that provided the page + * token. + */ + // const pageToken = 'abc123' + /** + * Optional. The filter request. + */ + // const filter = 'abc123' + /** + * Optional. the order by fields for the result. + */ + // const orderBy = 'abc123' + + // Imports the Vmmigration library + const {VmMigrationClient} = require('@google-cloud/vmmigration').v1; + + // Instantiates a client + const vmmigrationClient = new VmMigrationClient(); + + async function callListDatacenterConnectors() { + // Construct request + const request = { + parent, + pageToken, + }; + + // Run request + const iterable = await vmmigrationClient.listDatacenterConnectorsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListDatacenterConnectors(); + // [END vmmigration_v1_generated_VmMigration_ListDatacenterConnectors_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-vmmigration/samples/generated/v1/vm_migration.list_groups.js b/packages/google-cloud-vmmigration/samples/generated/v1/vm_migration.list_groups.js new file mode 100644 index 00000000000..cddfc0d70c0 --- /dev/null +++ b/packages/google-cloud-vmmigration/samples/generated/v1/vm_migration.list_groups.js @@ -0,0 +1,86 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, pageToken) { + // [START vmmigration_v1_generated_VmMigration_ListGroups_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 groups. + */ + // const parent = 'abc123' + /** + * Optional. The maximum number of groups to return. The service may return + * fewer than this value. If unspecified, at most 500 groups will be + * returned. The maximum value is 1000; values above 1000 will be coerced to + * 1000. + */ + // const pageSize = 1234 + /** + * Required. A page token, received from a previous `ListGroups` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListGroups` must + * match the call that provided the page token. + */ + // const pageToken = 'abc123' + /** + * Optional. The filter request. + */ + // const filter = 'abc123' + /** + * Optional. the order by fields for the result. + */ + // const orderBy = 'abc123' + + // Imports the Vmmigration library + const {VmMigrationClient} = require('@google-cloud/vmmigration').v1; + + // Instantiates a client + const vmmigrationClient = new VmMigrationClient(); + + async function callListGroups() { + // Construct request + const request = { + parent, + pageToken, + }; + + // Run request + const iterable = await vmmigrationClient.listGroupsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListGroups(); + // [END vmmigration_v1_generated_VmMigration_ListGroups_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-vmmigration/samples/generated/v1/vm_migration.list_migrating_vms.js b/packages/google-cloud-vmmigration/samples/generated/v1/vm_migration.list_migrating_vms.js new file mode 100644 index 00000000000..f9f4c9714c4 --- /dev/null +++ b/packages/google-cloud-vmmigration/samples/generated/v1/vm_migration.list_migrating_vms.js @@ -0,0 +1,90 @@ +// 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, pageToken) { + // [START vmmigration_v1_generated_VmMigration_ListMigratingVms_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 MigratingVms. + */ + // const parent = 'abc123' + /** + * Optional. The maximum number of migrating VMs to return. The service may + * return fewer than this value. If unspecified, at most 500 migrating VMs + * will be returned. The maximum value is 1000; values above 1000 will be + * coerced to 1000. + */ + // const pageSize = 1234 + /** + * Required. A page token, received from a previous `ListMigratingVms` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListMigratingVms` + * must match the call that provided the page token. + */ + // const pageToken = 'abc123' + /** + * Optional. The filter request. + */ + // const filter = 'abc123' + /** + * Optional. the order by fields for the result. + */ + // const orderBy = 'abc123' + /** + * Optional. The level of details of each migrating VM. + */ + // const view = {} + + // Imports the Vmmigration library + const {VmMigrationClient} = require('@google-cloud/vmmigration').v1; + + // Instantiates a client + const vmmigrationClient = new VmMigrationClient(); + + async function callListMigratingVms() { + // Construct request + const request = { + parent, + pageToken, + }; + + // Run request + const iterable = await vmmigrationClient.listMigratingVmsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListMigratingVms(); + // [END vmmigration_v1_generated_VmMigration_ListMigratingVms_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-vmmigration/samples/generated/v1/vm_migration.list_sources.js b/packages/google-cloud-vmmigration/samples/generated/v1/vm_migration.list_sources.js new file mode 100644 index 00000000000..85eca7b9e99 --- /dev/null +++ b/packages/google-cloud-vmmigration/samples/generated/v1/vm_migration.list_sources.js @@ -0,0 +1,86 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, pageToken) { + // [START vmmigration_v1_generated_VmMigration_ListSources_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 sources. + */ + // const parent = 'abc123' + /** + * Optional. The maximum number of sources to return. The service may return + * fewer than this value. If unspecified, at most 500 sources will be + * returned. The maximum value is 1000; values above 1000 will be coerced to + * 1000. + */ + // const pageSize = 1234 + /** + * Required. A page token, received from a previous `ListSources` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListSources` must + * match the call that provided the page token. + */ + // const pageToken = 'abc123' + /** + * Optional. The filter request. + */ + // const filter = 'abc123' + /** + * Optional. the order by fields for the result. + */ + // const orderBy = 'abc123' + + // Imports the Vmmigration library + const {VmMigrationClient} = require('@google-cloud/vmmigration').v1; + + // Instantiates a client + const vmmigrationClient = new VmMigrationClient(); + + async function callListSources() { + // Construct request + const request = { + parent, + pageToken, + }; + + // Run request + const iterable = await vmmigrationClient.listSourcesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListSources(); + // [END vmmigration_v1_generated_VmMigration_ListSources_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-vmmigration/samples/generated/v1/vm_migration.list_target_projects.js b/packages/google-cloud-vmmigration/samples/generated/v1/vm_migration.list_target_projects.js new file mode 100644 index 00000000000..6fd908b3f0b --- /dev/null +++ b/packages/google-cloud-vmmigration/samples/generated/v1/vm_migration.list_target_projects.js @@ -0,0 +1,86 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, pageToken) { + // [START vmmigration_v1_generated_VmMigration_ListTargetProjects_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 targets. + */ + // const parent = 'abc123' + /** + * Optional. The maximum number of targets to return. The service may return + * fewer than this value. If unspecified, at most 500 targets will be + * returned. The maximum value is 1000; values above 1000 will be coerced to + * 1000. + */ + // const pageSize = 1234 + /** + * Required. A page token, received from a previous `ListTargets` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListTargets` must + * match the call that provided the page token. + */ + // const pageToken = 'abc123' + /** + * Optional. The filter request. + */ + // const filter = 'abc123' + /** + * Optional. the order by fields for the result. + */ + // const orderBy = 'abc123' + + // Imports the Vmmigration library + const {VmMigrationClient} = require('@google-cloud/vmmigration').v1; + + // Instantiates a client + const vmmigrationClient = new VmMigrationClient(); + + async function callListTargetProjects() { + // Construct request + const request = { + parent, + pageToken, + }; + + // Run request + const iterable = await vmmigrationClient.listTargetProjectsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListTargetProjects(); + // [END vmmigration_v1_generated_VmMigration_ListTargetProjects_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-vmmigration/samples/generated/v1/vm_migration.list_utilization_reports.js b/packages/google-cloud-vmmigration/samples/generated/v1/vm_migration.list_utilization_reports.js new file mode 100644 index 00000000000..671303ce8d8 --- /dev/null +++ b/packages/google-cloud-vmmigration/samples/generated/v1/vm_migration.list_utilization_reports.js @@ -0,0 +1,91 @@ +// 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, pageToken) { + // [START vmmigration_v1_generated_VmMigration_ListUtilizationReports_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 Utilization Reports parent. + */ + // const parent = 'abc123' + /** + * Optional. The level of details of each report. + * Defaults to BASIC. + */ + // const view = {} + /** + * Optional. The maximum number of reports to return. The service may return + * fewer than this value. If unspecified, at most 500 reports will be + * returned. The maximum value is 1000; values above 1000 will be coerced to + * 1000. + */ + // const pageSize = 1234 + /** + * Required. A page token, received from a previous `ListUtilizationReports` + * call. Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListUtilizationReports` + * must match the call that provided the page token. + */ + // const pageToken = 'abc123' + /** + * Optional. The filter request. + */ + // const filter = 'abc123' + /** + * Optional. the order by fields for the result. + */ + // const orderBy = 'abc123' + + // Imports the Vmmigration library + const {VmMigrationClient} = require('@google-cloud/vmmigration').v1; + + // Instantiates a client + const vmmigrationClient = new VmMigrationClient(); + + async function callListUtilizationReports() { + // Construct request + const request = { + parent, + pageToken, + }; + + // Run request + const iterable = await vmmigrationClient.listUtilizationReportsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListUtilizationReports(); + // [END vmmigration_v1_generated_VmMigration_ListUtilizationReports_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-vmmigration/samples/generated/v1/vm_migration.pause_migration.js b/packages/google-cloud-vmmigration/samples/generated/v1/vm_migration.pause_migration.js new file mode 100644 index 00000000000..578d9c3e4ad --- /dev/null +++ b/packages/google-cloud-vmmigration/samples/generated/v1/vm_migration.pause_migration.js @@ -0,0 +1,62 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(migratingVm) { + // [START vmmigration_v1_generated_VmMigration_PauseMigration_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the MigratingVm. + */ + // const migratingVm = 'abc123' + + // Imports the Vmmigration library + const {VmMigrationClient} = require('@google-cloud/vmmigration').v1; + + // Instantiates a client + const vmmigrationClient = new VmMigrationClient(); + + async function callPauseMigration() { + // Construct request + const request = { + migratingVm, + }; + + // Run request + const [operation] = await vmmigrationClient.pauseMigration(request); + const [response] = await operation.promise(); + console.log(response); + } + + callPauseMigration(); + // [END vmmigration_v1_generated_VmMigration_PauseMigration_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-vmmigration/samples/generated/v1/vm_migration.remove_group_migration.js b/packages/google-cloud-vmmigration/samples/generated/v1/vm_migration.remove_group_migration.js new file mode 100644 index 00000000000..62d475d167d --- /dev/null +++ b/packages/google-cloud-vmmigration/samples/generated/v1/vm_migration.remove_group_migration.js @@ -0,0 +1,66 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(group) { + // [START vmmigration_v1_generated_VmMigration_RemoveGroupMigration_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the Group. + */ + // const group = 'abc123' + /** + * The MigratingVm to remove. + */ + // const migratingVm = 'abc123' + + // Imports the Vmmigration library + const {VmMigrationClient} = require('@google-cloud/vmmigration').v1; + + // Instantiates a client + const vmmigrationClient = new VmMigrationClient(); + + async function callRemoveGroupMigration() { + // Construct request + const request = { + group, + }; + + // Run request + const [operation] = await vmmigrationClient.removeGroupMigration(request); + const [response] = await operation.promise(); + console.log(response); + } + + callRemoveGroupMigration(); + // [END vmmigration_v1_generated_VmMigration_RemoveGroupMigration_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-vmmigration/samples/generated/v1/vm_migration.resume_migration.js b/packages/google-cloud-vmmigration/samples/generated/v1/vm_migration.resume_migration.js new file mode 100644 index 00000000000..88156c7fed7 --- /dev/null +++ b/packages/google-cloud-vmmigration/samples/generated/v1/vm_migration.resume_migration.js @@ -0,0 +1,62 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(migratingVm) { + // [START vmmigration_v1_generated_VmMigration_ResumeMigration_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the MigratingVm. + */ + // const migratingVm = 'abc123' + + // Imports the Vmmigration library + const {VmMigrationClient} = require('@google-cloud/vmmigration').v1; + + // Instantiates a client + const vmmigrationClient = new VmMigrationClient(); + + async function callResumeMigration() { + // Construct request + const request = { + migratingVm, + }; + + // Run request + const [operation] = await vmmigrationClient.resumeMigration(request); + const [response] = await operation.promise(); + console.log(response); + } + + callResumeMigration(); + // [END vmmigration_v1_generated_VmMigration_ResumeMigration_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-vmmigration/samples/generated/v1/vm_migration.start_migration.js b/packages/google-cloud-vmmigration/samples/generated/v1/vm_migration.start_migration.js new file mode 100644 index 00000000000..02ffeeb49f6 --- /dev/null +++ b/packages/google-cloud-vmmigration/samples/generated/v1/vm_migration.start_migration.js @@ -0,0 +1,62 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(migratingVm) { + // [START vmmigration_v1_generated_VmMigration_StartMigration_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the MigratingVm. + */ + // const migratingVm = 'abc123' + + // Imports the Vmmigration library + const {VmMigrationClient} = require('@google-cloud/vmmigration').v1; + + // Instantiates a client + const vmmigrationClient = new VmMigrationClient(); + + async function callStartMigration() { + // Construct request + const request = { + migratingVm, + }; + + // Run request + const [operation] = await vmmigrationClient.startMigration(request); + const [response] = await operation.promise(); + console.log(response); + } + + callStartMigration(); + // [END vmmigration_v1_generated_VmMigration_StartMigration_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-vmmigration/samples/generated/v1/vm_migration.update_group.js b/packages/google-cloud-vmmigration/samples/generated/v1/vm_migration.update_group.js new file mode 100644 index 00000000000..831c10668c4 --- /dev/null +++ b/packages/google-cloud-vmmigration/samples/generated/v1/vm_migration.update_group.js @@ -0,0 +1,84 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(group) { + // [START vmmigration_v1_generated_VmMigration_UpdateGroup_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. + */ + /** + * Field mask is used to specify the fields to be overwritten in the + * Group resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + */ + // const updateMask = {} + /** + * Required. The update request body. + */ + // const group = {} + /** + * A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + + // Imports the Vmmigration library + const {VmMigrationClient} = require('@google-cloud/vmmigration').v1; + + // Instantiates a client + const vmmigrationClient = new VmMigrationClient(); + + async function callUpdateGroup() { + // Construct request + const request = { + group, + }; + + // Run request + const [operation] = await vmmigrationClient.updateGroup(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateGroup(); + // [END vmmigration_v1_generated_VmMigration_UpdateGroup_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-vmmigration/samples/generated/v1/vm_migration.update_migrating_vm.js b/packages/google-cloud-vmmigration/samples/generated/v1/vm_migration.update_migrating_vm.js new file mode 100644 index 00000000000..2b8efa80adc --- /dev/null +++ b/packages/google-cloud-vmmigration/samples/generated/v1/vm_migration.update_migrating_vm.js @@ -0,0 +1,84 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(migratingVm) { + // [START vmmigration_v1_generated_VmMigration_UpdateMigratingVm_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. + */ + /** + * Field mask is used to specify the fields to be overwritten in the + * MigratingVm resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + */ + // const updateMask = {} + /** + * Required. The update request body. + */ + // const migratingVm = {} + /** + * A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + + // Imports the Vmmigration library + const {VmMigrationClient} = require('@google-cloud/vmmigration').v1; + + // Instantiates a client + const vmmigrationClient = new VmMigrationClient(); + + async function callUpdateMigratingVm() { + // Construct request + const request = { + migratingVm, + }; + + // Run request + const [operation] = await vmmigrationClient.updateMigratingVm(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateMigratingVm(); + // [END vmmigration_v1_generated_VmMigration_UpdateMigratingVm_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-vmmigration/samples/generated/v1/vm_migration.update_source.js b/packages/google-cloud-vmmigration/samples/generated/v1/vm_migration.update_source.js new file mode 100644 index 00000000000..3eebea6ad3b --- /dev/null +++ b/packages/google-cloud-vmmigration/samples/generated/v1/vm_migration.update_source.js @@ -0,0 +1,84 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(source) { + // [START vmmigration_v1_generated_VmMigration_UpdateSource_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. + */ + /** + * Field mask is used to specify the fields to be overwritten in the + * Source resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + */ + // const updateMask = {} + /** + * Required. The update request body. + */ + // const source = {} + /** + * A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + + // Imports the Vmmigration library + const {VmMigrationClient} = require('@google-cloud/vmmigration').v1; + + // Instantiates a client + const vmmigrationClient = new VmMigrationClient(); + + async function callUpdateSource() { + // Construct request + const request = { + source, + }; + + // Run request + const [operation] = await vmmigrationClient.updateSource(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateSource(); + // [END vmmigration_v1_generated_VmMigration_UpdateSource_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-vmmigration/samples/generated/v1/vm_migration.update_target_project.js b/packages/google-cloud-vmmigration/samples/generated/v1/vm_migration.update_target_project.js new file mode 100644 index 00000000000..afcd39d84a9 --- /dev/null +++ b/packages/google-cloud-vmmigration/samples/generated/v1/vm_migration.update_target_project.js @@ -0,0 +1,84 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(targetProject) { + // [START vmmigration_v1_generated_VmMigration_UpdateTargetProject_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. + */ + /** + * Field mask is used to specify the fields to be overwritten in the + * TargetProject resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + */ + // const updateMask = {} + /** + * Required. The update request body. + */ + // const targetProject = {} + /** + * A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + + // Imports the Vmmigration library + const {VmMigrationClient} = require('@google-cloud/vmmigration').v1; + + // Instantiates a client + const vmmigrationClient = new VmMigrationClient(); + + async function callUpdateTargetProject() { + // Construct request + const request = { + targetProject, + }; + + // Run request + const [operation] = await vmmigrationClient.updateTargetProject(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateTargetProject(); + // [END vmmigration_v1_generated_VmMigration_UpdateTargetProject_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-vmmigration/samples/generated/v1/vm_migration.upgrade_appliance.js b/packages/google-cloud-vmmigration/samples/generated/v1/vm_migration.upgrade_appliance.js new file mode 100644 index 00000000000..602ded3aaec --- /dev/null +++ b/packages/google-cloud-vmmigration/samples/generated/v1/vm_migration.upgrade_appliance.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(datacenterConnector) { + // [START vmmigration_v1_generated_VmMigration_UpgradeAppliance_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 DatacenterConnector name. + */ + // const datacenterConnector = 'abc123' + /** + * A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + + // Imports the Vmmigration library + const {VmMigrationClient} = require('@google-cloud/vmmigration').v1; + + // Instantiates a client + const vmmigrationClient = new VmMigrationClient(); + + async function callUpgradeAppliance() { + // Construct request + const request = { + datacenterConnector, + }; + + // Run request + const [operation] = await vmmigrationClient.upgradeAppliance(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpgradeAppliance(); + // [END vmmigration_v1_generated_VmMigration_UpgradeAppliance_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-vmmigration/samples/package.json b/packages/google-cloud-vmmigration/samples/package.json new file mode 100644 index 00000000000..0d7f946fe1c --- /dev/null +++ b/packages/google-cloud-vmmigration/samples/package.json @@ -0,0 +1,25 @@ +{ + "name": "nodejs-vmmigration-samples", + "private": true, + "license": "Apache-2.0", + "files": [ + "*.js" + ], + "author": "Google LLC", + "repository": "googleapis/nodejs-secret-manager", + "engines": { + "node": ">=12.0.0" + }, + "scripts": { + "test": "c8 mocha --recursive test/ --timeout=800000" + }, + "dependencies": { + "@google-cloud/vmmigration": "^2.2.1" + }, + "devDependencies": { + "c8": "^7.0.0", + "chai": "^4.2.0", + "mocha": "^9.0.0", + "uuid": "^9.0.0" + } +} diff --git a/packages/google-cloud-vmmigration/samples/quickstart.js b/packages/google-cloud-vmmigration/samples/quickstart.js new file mode 100644 index 00000000000..85d043d1810 --- /dev/null +++ b/packages/google-cloud-vmmigration/samples/quickstart.js @@ -0,0 +1,77 @@ +// 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. + +'use strict'; + +function main(parent, pageToken) { + // [START vmmigration_quickstart] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent, which owns this collection of targets. + */ + // const parent = 'abc123' + /** + * Optional. The maximum number of targets to return. The service may return + * fewer than this value. If unspecified, at most 500 targets will be + * returned. The maximum value is 1000; values above 1000 will be coerced to + * 1000. + */ + // const pageSize = 1234 + /** + * Required. A page token, received from a previous `ListTargets` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListTargets` must + * match the call that provided the page token. + */ + // const pageToken = 'abc123' + /** + * Optional. The filter request. + */ + // const filter = 'abc123' + /** + * Optional. the order by fields for the result. + */ + // const orderBy = 'abc123' + + // Imports the Vmmigration library + const {VmMigrationClient} = require('@google-cloud/vmmigration').v1; + + // Instantiates a client + const vmmigrationClient = new VmMigrationClient(); + + async function callListTargetProjects() { + // Construct request + const request = { + parent, + pageToken, + }; + + // Run request + const iterable = await vmmigrationClient.listTargetProjectsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListTargetProjects(); + // [END vmmigration_quickstart] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-vmmigration/samples/test/quickstart.js b/packages/google-cloud-vmmigration/samples/test/quickstart.js new file mode 100644 index 00000000000..814f40b16ee --- /dev/null +++ b/packages/google-cloud-vmmigration/samples/test/quickstart.js @@ -0,0 +1,44 @@ +// +// 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 {VmMigrationClient} = require('@google-cloud/vmmigration').v1; + +const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'}); + +const cwd = path.join(__dirname, '..'); + +const client = new VmMigrationClient(); + +describe('Quickstart', () => { + let projectId; + + before(async () => { + projectId = await client.getProjectId(); + }); + + it('should run quickstart', async () => { + // Should have 0 exit code, and therefore not throw: + execSync(`node ./quickstart.js projects/${projectId}/locations/global`, { + cwd, + }); + }); +}); diff --git a/packages/google-cloud-vmmigration/src/index.ts b/packages/google-cloud-vmmigration/src/index.ts new file mode 100644 index 00000000000..e8ed6f0e4cb --- /dev/null +++ b/packages/google-cloud-vmmigration/src/index.ts @@ -0,0 +1,27 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by synthtool. ** +// ** https://github.com/googleapis/synthtool ** +// ** All changes to this file may be overwritten. ** + +import * as v1 from './v1'; + +const VmMigrationClient = v1.VmMigrationClient; +type VmMigrationClient = v1.VmMigrationClient; + +export {v1, VmMigrationClient}; +export default {v1, VmMigrationClient}; +import * as protos from '../protos/protos'; +export {protos}; diff --git a/packages/google-cloud-vmmigration/src/v1/gapic_metadata.json b/packages/google-cloud-vmmigration/src/v1/gapic_metadata.json new file mode 100644 index 00000000000..5706daee8c8 --- /dev/null +++ b/packages/google-cloud-vmmigration/src/v1/gapic_metadata.json @@ -0,0 +1,495 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.cloud.vmmigration.v1", + "libraryPackage": "@google-cloud/vmmigration", + "services": { + "VmMigration": { + "clients": { + "grpc": { + "libraryClient": "VmMigrationClient", + "rpcs": { + "GetSource": { + "methods": [ + "getSource" + ] + }, + "FetchInventory": { + "methods": [ + "fetchInventory" + ] + }, + "GetUtilizationReport": { + "methods": [ + "getUtilizationReport" + ] + }, + "GetDatacenterConnector": { + "methods": [ + "getDatacenterConnector" + ] + }, + "GetMigratingVm": { + "methods": [ + "getMigratingVm" + ] + }, + "GetCloneJob": { + "methods": [ + "getCloneJob" + ] + }, + "GetCutoverJob": { + "methods": [ + "getCutoverJob" + ] + }, + "GetGroup": { + "methods": [ + "getGroup" + ] + }, + "GetTargetProject": { + "methods": [ + "getTargetProject" + ] + }, + "CreateSource": { + "methods": [ + "createSource" + ] + }, + "UpdateSource": { + "methods": [ + "updateSource" + ] + }, + "DeleteSource": { + "methods": [ + "deleteSource" + ] + }, + "CreateUtilizationReport": { + "methods": [ + "createUtilizationReport" + ] + }, + "DeleteUtilizationReport": { + "methods": [ + "deleteUtilizationReport" + ] + }, + "CreateDatacenterConnector": { + "methods": [ + "createDatacenterConnector" + ] + }, + "DeleteDatacenterConnector": { + "methods": [ + "deleteDatacenterConnector" + ] + }, + "UpgradeAppliance": { + "methods": [ + "upgradeAppliance" + ] + }, + "CreateMigratingVm": { + "methods": [ + "createMigratingVm" + ] + }, + "UpdateMigratingVm": { + "methods": [ + "updateMigratingVm" + ] + }, + "DeleteMigratingVm": { + "methods": [ + "deleteMigratingVm" + ] + }, + "StartMigration": { + "methods": [ + "startMigration" + ] + }, + "ResumeMigration": { + "methods": [ + "resumeMigration" + ] + }, + "PauseMigration": { + "methods": [ + "pauseMigration" + ] + }, + "FinalizeMigration": { + "methods": [ + "finalizeMigration" + ] + }, + "CreateCloneJob": { + "methods": [ + "createCloneJob" + ] + }, + "CancelCloneJob": { + "methods": [ + "cancelCloneJob" + ] + }, + "CreateCutoverJob": { + "methods": [ + "createCutoverJob" + ] + }, + "CancelCutoverJob": { + "methods": [ + "cancelCutoverJob" + ] + }, + "CreateGroup": { + "methods": [ + "createGroup" + ] + }, + "UpdateGroup": { + "methods": [ + "updateGroup" + ] + }, + "DeleteGroup": { + "methods": [ + "deleteGroup" + ] + }, + "AddGroupMigration": { + "methods": [ + "addGroupMigration" + ] + }, + "RemoveGroupMigration": { + "methods": [ + "removeGroupMigration" + ] + }, + "CreateTargetProject": { + "methods": [ + "createTargetProject" + ] + }, + "UpdateTargetProject": { + "methods": [ + "updateTargetProject" + ] + }, + "DeleteTargetProject": { + "methods": [ + "deleteTargetProject" + ] + }, + "ListSources": { + "methods": [ + "listSources", + "listSourcesStream", + "listSourcesAsync" + ] + }, + "ListUtilizationReports": { + "methods": [ + "listUtilizationReports", + "listUtilizationReportsStream", + "listUtilizationReportsAsync" + ] + }, + "ListDatacenterConnectors": { + "methods": [ + "listDatacenterConnectors", + "listDatacenterConnectorsStream", + "listDatacenterConnectorsAsync" + ] + }, + "ListMigratingVms": { + "methods": [ + "listMigratingVms", + "listMigratingVmsStream", + "listMigratingVmsAsync" + ] + }, + "ListCloneJobs": { + "methods": [ + "listCloneJobs", + "listCloneJobsStream", + "listCloneJobsAsync" + ] + }, + "ListCutoverJobs": { + "methods": [ + "listCutoverJobs", + "listCutoverJobsStream", + "listCutoverJobsAsync" + ] + }, + "ListGroups": { + "methods": [ + "listGroups", + "listGroupsStream", + "listGroupsAsync" + ] + }, + "ListTargetProjects": { + "methods": [ + "listTargetProjects", + "listTargetProjectsStream", + "listTargetProjectsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "VmMigrationClient", + "rpcs": { + "GetSource": { + "methods": [ + "getSource" + ] + }, + "FetchInventory": { + "methods": [ + "fetchInventory" + ] + }, + "GetUtilizationReport": { + "methods": [ + "getUtilizationReport" + ] + }, + "GetDatacenterConnector": { + "methods": [ + "getDatacenterConnector" + ] + }, + "GetMigratingVm": { + "methods": [ + "getMigratingVm" + ] + }, + "GetCloneJob": { + "methods": [ + "getCloneJob" + ] + }, + "GetCutoverJob": { + "methods": [ + "getCutoverJob" + ] + }, + "GetGroup": { + "methods": [ + "getGroup" + ] + }, + "GetTargetProject": { + "methods": [ + "getTargetProject" + ] + }, + "CreateSource": { + "methods": [ + "createSource" + ] + }, + "UpdateSource": { + "methods": [ + "updateSource" + ] + }, + "DeleteSource": { + "methods": [ + "deleteSource" + ] + }, + "CreateUtilizationReport": { + "methods": [ + "createUtilizationReport" + ] + }, + "DeleteUtilizationReport": { + "methods": [ + "deleteUtilizationReport" + ] + }, + "CreateDatacenterConnector": { + "methods": [ + "createDatacenterConnector" + ] + }, + "DeleteDatacenterConnector": { + "methods": [ + "deleteDatacenterConnector" + ] + }, + "UpgradeAppliance": { + "methods": [ + "upgradeAppliance" + ] + }, + "CreateMigratingVm": { + "methods": [ + "createMigratingVm" + ] + }, + "UpdateMigratingVm": { + "methods": [ + "updateMigratingVm" + ] + }, + "DeleteMigratingVm": { + "methods": [ + "deleteMigratingVm" + ] + }, + "StartMigration": { + "methods": [ + "startMigration" + ] + }, + "ResumeMigration": { + "methods": [ + "resumeMigration" + ] + }, + "PauseMigration": { + "methods": [ + "pauseMigration" + ] + }, + "FinalizeMigration": { + "methods": [ + "finalizeMigration" + ] + }, + "CreateCloneJob": { + "methods": [ + "createCloneJob" + ] + }, + "CancelCloneJob": { + "methods": [ + "cancelCloneJob" + ] + }, + "CreateCutoverJob": { + "methods": [ + "createCutoverJob" + ] + }, + "CancelCutoverJob": { + "methods": [ + "cancelCutoverJob" + ] + }, + "CreateGroup": { + "methods": [ + "createGroup" + ] + }, + "UpdateGroup": { + "methods": [ + "updateGroup" + ] + }, + "DeleteGroup": { + "methods": [ + "deleteGroup" + ] + }, + "AddGroupMigration": { + "methods": [ + "addGroupMigration" + ] + }, + "RemoveGroupMigration": { + "methods": [ + "removeGroupMigration" + ] + }, + "CreateTargetProject": { + "methods": [ + "createTargetProject" + ] + }, + "UpdateTargetProject": { + "methods": [ + "updateTargetProject" + ] + }, + "DeleteTargetProject": { + "methods": [ + "deleteTargetProject" + ] + }, + "ListSources": { + "methods": [ + "listSources", + "listSourcesStream", + "listSourcesAsync" + ] + }, + "ListUtilizationReports": { + "methods": [ + "listUtilizationReports", + "listUtilizationReportsStream", + "listUtilizationReportsAsync" + ] + }, + "ListDatacenterConnectors": { + "methods": [ + "listDatacenterConnectors", + "listDatacenterConnectorsStream", + "listDatacenterConnectorsAsync" + ] + }, + "ListMigratingVms": { + "methods": [ + "listMigratingVms", + "listMigratingVmsStream", + "listMigratingVmsAsync" + ] + }, + "ListCloneJobs": { + "methods": [ + "listCloneJobs", + "listCloneJobsStream", + "listCloneJobsAsync" + ] + }, + "ListCutoverJobs": { + "methods": [ + "listCutoverJobs", + "listCutoverJobsStream", + "listCutoverJobsAsync" + ] + }, + "ListGroups": { + "methods": [ + "listGroups", + "listGroupsStream", + "listGroupsAsync" + ] + }, + "ListTargetProjects": { + "methods": [ + "listTargetProjects", + "listTargetProjectsStream", + "listTargetProjectsAsync" + ] + } + } + } + } + } + } +} diff --git a/packages/google-cloud-vmmigration/src/v1/index.ts b/packages/google-cloud-vmmigration/src/v1/index.ts new file mode 100644 index 00000000000..bab90bd6854 --- /dev/null +++ b/packages/google-cloud-vmmigration/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 {VmMigrationClient} from './vm_migration_client'; diff --git a/packages/google-cloud-vmmigration/src/v1/vm_migration_client.ts b/packages/google-cloud-vmmigration/src/v1/vm_migration_client.ts new file mode 100644 index 00000000000..671d4e28c89 --- /dev/null +++ b/packages/google-cloud-vmmigration/src/v1/vm_migration_client.ts @@ -0,0 +1,8133 @@ +// 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/vm_migration_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './vm_migration_client_config.json'; +const version = require('../../../package.json').version; + +/** + * VM Migration Service + * @class + * @memberof v1 + */ +export class VmMigrationClient { + 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; + vmMigrationStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of VmMigrationClient. + * + * @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 VmMigrationClient({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 VmMigrationClient; + 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 = { + cloneJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/sources/{source}/migratingVms/{migrating_vm}/cloneJobs/{clone_job}' + ), + cutoverJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/sources/{source}/migratingVms/{migrating_vm}/cutoverJobs/{cutover_job}' + ), + datacenterConnectorPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/sources/{source}/datacenterConnectors/{datacenter_connector}' + ), + groupPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/groups/{group}' + ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}' + ), + migratingVmPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/sources/{source}/migratingVms/{migrating_vm}' + ), + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}' + ), + sourcePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/sources/{source}' + ), + targetProjectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/targetProjects/{target_project}' + ), + utilizationReportPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/sources/{source}/utilizationReports/{utilization_report}' + ), + }; + + // 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 = { + listSources: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'sources' + ), + listUtilizationReports: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'utilizationReports' + ), + listDatacenterConnectors: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'datacenterConnectors' + ), + listMigratingVms: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'migratingVms' + ), + listCloneJobs: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'cloneJobs' + ), + listCutoverJobs: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'cutoverJobs' + ), + listGroups: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'groups' + ), + listTargetProjects: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'targetProjects' + ), + }; + + 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.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 createSourceResponse = protoFilesRoot.lookup( + '.google.cloud.vmmigration.v1.Source' + ) as gax.protobuf.Type; + const createSourceMetadata = protoFilesRoot.lookup( + '.google.cloud.vmmigration.v1.OperationMetadata' + ) as gax.protobuf.Type; + const updateSourceResponse = protoFilesRoot.lookup( + '.google.cloud.vmmigration.v1.Source' + ) as gax.protobuf.Type; + const updateSourceMetadata = protoFilesRoot.lookup( + '.google.cloud.vmmigration.v1.OperationMetadata' + ) as gax.protobuf.Type; + const deleteSourceResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty' + ) as gax.protobuf.Type; + const deleteSourceMetadata = protoFilesRoot.lookup( + '.google.cloud.vmmigration.v1.OperationMetadata' + ) as gax.protobuf.Type; + const createUtilizationReportResponse = protoFilesRoot.lookup( + '.google.cloud.vmmigration.v1.UtilizationReport' + ) as gax.protobuf.Type; + const createUtilizationReportMetadata = protoFilesRoot.lookup( + '.google.cloud.vmmigration.v1.OperationMetadata' + ) as gax.protobuf.Type; + const deleteUtilizationReportResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty' + ) as gax.protobuf.Type; + const deleteUtilizationReportMetadata = protoFilesRoot.lookup( + '.google.cloud.vmmigration.v1.OperationMetadata' + ) as gax.protobuf.Type; + const createDatacenterConnectorResponse = protoFilesRoot.lookup( + '.google.cloud.vmmigration.v1.DatacenterConnector' + ) as gax.protobuf.Type; + const createDatacenterConnectorMetadata = protoFilesRoot.lookup( + '.google.cloud.vmmigration.v1.OperationMetadata' + ) as gax.protobuf.Type; + const deleteDatacenterConnectorResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty' + ) as gax.protobuf.Type; + const deleteDatacenterConnectorMetadata = protoFilesRoot.lookup( + '.google.cloud.vmmigration.v1.OperationMetadata' + ) as gax.protobuf.Type; + const upgradeApplianceResponse = protoFilesRoot.lookup( + '.google.cloud.vmmigration.v1.UpgradeApplianceResponse' + ) as gax.protobuf.Type; + const upgradeApplianceMetadata = protoFilesRoot.lookup( + '.google.cloud.vmmigration.v1.OperationMetadata' + ) as gax.protobuf.Type; + const createMigratingVmResponse = protoFilesRoot.lookup( + '.google.cloud.vmmigration.v1.MigratingVm' + ) as gax.protobuf.Type; + const createMigratingVmMetadata = protoFilesRoot.lookup( + '.google.cloud.vmmigration.v1.OperationMetadata' + ) as gax.protobuf.Type; + const updateMigratingVmResponse = protoFilesRoot.lookup( + '.google.cloud.vmmigration.v1.MigratingVm' + ) as gax.protobuf.Type; + const updateMigratingVmMetadata = protoFilesRoot.lookup( + '.google.cloud.vmmigration.v1.OperationMetadata' + ) as gax.protobuf.Type; + const deleteMigratingVmResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty' + ) as gax.protobuf.Type; + const deleteMigratingVmMetadata = protoFilesRoot.lookup( + '.google.cloud.vmmigration.v1.OperationMetadata' + ) as gax.protobuf.Type; + const startMigrationResponse = protoFilesRoot.lookup( + '.google.cloud.vmmigration.v1.StartMigrationResponse' + ) as gax.protobuf.Type; + const startMigrationMetadata = protoFilesRoot.lookup( + '.google.cloud.vmmigration.v1.OperationMetadata' + ) as gax.protobuf.Type; + const resumeMigrationResponse = protoFilesRoot.lookup( + '.google.cloud.vmmigration.v1.ResumeMigrationResponse' + ) as gax.protobuf.Type; + const resumeMigrationMetadata = protoFilesRoot.lookup( + '.google.cloud.vmmigration.v1.OperationMetadata' + ) as gax.protobuf.Type; + const pauseMigrationResponse = protoFilesRoot.lookup( + '.google.cloud.vmmigration.v1.PauseMigrationResponse' + ) as gax.protobuf.Type; + const pauseMigrationMetadata = protoFilesRoot.lookup( + '.google.cloud.vmmigration.v1.OperationMetadata' + ) as gax.protobuf.Type; + const finalizeMigrationResponse = protoFilesRoot.lookup( + '.google.cloud.vmmigration.v1.FinalizeMigrationResponse' + ) as gax.protobuf.Type; + const finalizeMigrationMetadata = protoFilesRoot.lookup( + '.google.cloud.vmmigration.v1.OperationMetadata' + ) as gax.protobuf.Type; + const createCloneJobResponse = protoFilesRoot.lookup( + '.google.cloud.vmmigration.v1.CloneJob' + ) as gax.protobuf.Type; + const createCloneJobMetadata = protoFilesRoot.lookup( + '.google.cloud.vmmigration.v1.OperationMetadata' + ) as gax.protobuf.Type; + const cancelCloneJobResponse = protoFilesRoot.lookup( + '.google.cloud.vmmigration.v1.CancelCloneJobResponse' + ) as gax.protobuf.Type; + const cancelCloneJobMetadata = protoFilesRoot.lookup( + '.google.cloud.vmmigration.v1.OperationMetadata' + ) as gax.protobuf.Type; + const createCutoverJobResponse = protoFilesRoot.lookup( + '.google.cloud.vmmigration.v1.CutoverJob' + ) as gax.protobuf.Type; + const createCutoverJobMetadata = protoFilesRoot.lookup( + '.google.cloud.vmmigration.v1.OperationMetadata' + ) as gax.protobuf.Type; + const cancelCutoverJobResponse = protoFilesRoot.lookup( + '.google.cloud.vmmigration.v1.CancelCutoverJobResponse' + ) as gax.protobuf.Type; + const cancelCutoverJobMetadata = protoFilesRoot.lookup( + '.google.cloud.vmmigration.v1.OperationMetadata' + ) as gax.protobuf.Type; + const createGroupResponse = protoFilesRoot.lookup( + '.google.cloud.vmmigration.v1.Group' + ) as gax.protobuf.Type; + const createGroupMetadata = protoFilesRoot.lookup( + '.google.cloud.vmmigration.v1.OperationMetadata' + ) as gax.protobuf.Type; + const updateGroupResponse = protoFilesRoot.lookup( + '.google.cloud.vmmigration.v1.Group' + ) as gax.protobuf.Type; + const updateGroupMetadata = protoFilesRoot.lookup( + '.google.cloud.vmmigration.v1.OperationMetadata' + ) as gax.protobuf.Type; + const deleteGroupResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty' + ) as gax.protobuf.Type; + const deleteGroupMetadata = protoFilesRoot.lookup( + '.google.cloud.vmmigration.v1.OperationMetadata' + ) as gax.protobuf.Type; + const addGroupMigrationResponse = protoFilesRoot.lookup( + '.google.cloud.vmmigration.v1.AddGroupMigrationResponse' + ) as gax.protobuf.Type; + const addGroupMigrationMetadata = protoFilesRoot.lookup( + '.google.cloud.vmmigration.v1.OperationMetadata' + ) as gax.protobuf.Type; + const removeGroupMigrationResponse = protoFilesRoot.lookup( + '.google.cloud.vmmigration.v1.RemoveGroupMigrationResponse' + ) as gax.protobuf.Type; + const removeGroupMigrationMetadata = protoFilesRoot.lookup( + '.google.cloud.vmmigration.v1.OperationMetadata' + ) as gax.protobuf.Type; + const createTargetProjectResponse = protoFilesRoot.lookup( + '.google.cloud.vmmigration.v1.TargetProject' + ) as gax.protobuf.Type; + const createTargetProjectMetadata = protoFilesRoot.lookup( + '.google.cloud.vmmigration.v1.OperationMetadata' + ) as gax.protobuf.Type; + const updateTargetProjectResponse = protoFilesRoot.lookup( + '.google.cloud.vmmigration.v1.TargetProject' + ) as gax.protobuf.Type; + const updateTargetProjectMetadata = protoFilesRoot.lookup( + '.google.cloud.vmmigration.v1.OperationMetadata' + ) as gax.protobuf.Type; + const deleteTargetProjectResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty' + ) as gax.protobuf.Type; + const deleteTargetProjectMetadata = protoFilesRoot.lookup( + '.google.cloud.vmmigration.v1.OperationMetadata' + ) as gax.protobuf.Type; + + this.descriptors.longrunning = { + createSource: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createSourceResponse.decode.bind(createSourceResponse), + createSourceMetadata.decode.bind(createSourceMetadata) + ), + updateSource: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateSourceResponse.decode.bind(updateSourceResponse), + updateSourceMetadata.decode.bind(updateSourceMetadata) + ), + deleteSource: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteSourceResponse.decode.bind(deleteSourceResponse), + deleteSourceMetadata.decode.bind(deleteSourceMetadata) + ), + createUtilizationReport: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createUtilizationReportResponse.decode.bind( + createUtilizationReportResponse + ), + createUtilizationReportMetadata.decode.bind( + createUtilizationReportMetadata + ) + ), + deleteUtilizationReport: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteUtilizationReportResponse.decode.bind( + deleteUtilizationReportResponse + ), + deleteUtilizationReportMetadata.decode.bind( + deleteUtilizationReportMetadata + ) + ), + createDatacenterConnector: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createDatacenterConnectorResponse.decode.bind( + createDatacenterConnectorResponse + ), + createDatacenterConnectorMetadata.decode.bind( + createDatacenterConnectorMetadata + ) + ), + deleteDatacenterConnector: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteDatacenterConnectorResponse.decode.bind( + deleteDatacenterConnectorResponse + ), + deleteDatacenterConnectorMetadata.decode.bind( + deleteDatacenterConnectorMetadata + ) + ), + upgradeAppliance: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + upgradeApplianceResponse.decode.bind(upgradeApplianceResponse), + upgradeApplianceMetadata.decode.bind(upgradeApplianceMetadata) + ), + createMigratingVm: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createMigratingVmResponse.decode.bind(createMigratingVmResponse), + createMigratingVmMetadata.decode.bind(createMigratingVmMetadata) + ), + updateMigratingVm: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateMigratingVmResponse.decode.bind(updateMigratingVmResponse), + updateMigratingVmMetadata.decode.bind(updateMigratingVmMetadata) + ), + deleteMigratingVm: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteMigratingVmResponse.decode.bind(deleteMigratingVmResponse), + deleteMigratingVmMetadata.decode.bind(deleteMigratingVmMetadata) + ), + startMigration: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + startMigrationResponse.decode.bind(startMigrationResponse), + startMigrationMetadata.decode.bind(startMigrationMetadata) + ), + resumeMigration: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + resumeMigrationResponse.decode.bind(resumeMigrationResponse), + resumeMigrationMetadata.decode.bind(resumeMigrationMetadata) + ), + pauseMigration: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + pauseMigrationResponse.decode.bind(pauseMigrationResponse), + pauseMigrationMetadata.decode.bind(pauseMigrationMetadata) + ), + finalizeMigration: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + finalizeMigrationResponse.decode.bind(finalizeMigrationResponse), + finalizeMigrationMetadata.decode.bind(finalizeMigrationMetadata) + ), + createCloneJob: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createCloneJobResponse.decode.bind(createCloneJobResponse), + createCloneJobMetadata.decode.bind(createCloneJobMetadata) + ), + cancelCloneJob: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + cancelCloneJobResponse.decode.bind(cancelCloneJobResponse), + cancelCloneJobMetadata.decode.bind(cancelCloneJobMetadata) + ), + createCutoverJob: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createCutoverJobResponse.decode.bind(createCutoverJobResponse), + createCutoverJobMetadata.decode.bind(createCutoverJobMetadata) + ), + cancelCutoverJob: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + cancelCutoverJobResponse.decode.bind(cancelCutoverJobResponse), + cancelCutoverJobMetadata.decode.bind(cancelCutoverJobMetadata) + ), + createGroup: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createGroupResponse.decode.bind(createGroupResponse), + createGroupMetadata.decode.bind(createGroupMetadata) + ), + updateGroup: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateGroupResponse.decode.bind(updateGroupResponse), + updateGroupMetadata.decode.bind(updateGroupMetadata) + ), + deleteGroup: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteGroupResponse.decode.bind(deleteGroupResponse), + deleteGroupMetadata.decode.bind(deleteGroupMetadata) + ), + addGroupMigration: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + addGroupMigrationResponse.decode.bind(addGroupMigrationResponse), + addGroupMigrationMetadata.decode.bind(addGroupMigrationMetadata) + ), + removeGroupMigration: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + removeGroupMigrationResponse.decode.bind(removeGroupMigrationResponse), + removeGroupMigrationMetadata.decode.bind(removeGroupMigrationMetadata) + ), + createTargetProject: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createTargetProjectResponse.decode.bind(createTargetProjectResponse), + createTargetProjectMetadata.decode.bind(createTargetProjectMetadata) + ), + updateTargetProject: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateTargetProjectResponse.decode.bind(updateTargetProjectResponse), + updateTargetProjectMetadata.decode.bind(updateTargetProjectMetadata) + ), + deleteTargetProject: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteTargetProjectResponse.decode.bind(deleteTargetProjectResponse), + deleteTargetProjectMetadata.decode.bind(deleteTargetProjectMetadata) + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.vmmigration.v1.VmMigration', + 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.vmMigrationStub) { + return this.vmMigrationStub; + } + + // Put together the "service stub" for + // google.cloud.vmmigration.v1.VmMigration. + this.vmMigrationStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.vmmigration.v1.VmMigration' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.vmmigration.v1.VmMigration, + 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 vmMigrationStubMethods = [ + 'listSources', + 'getSource', + 'createSource', + 'updateSource', + 'deleteSource', + 'fetchInventory', + 'listUtilizationReports', + 'getUtilizationReport', + 'createUtilizationReport', + 'deleteUtilizationReport', + 'listDatacenterConnectors', + 'getDatacenterConnector', + 'createDatacenterConnector', + 'deleteDatacenterConnector', + 'upgradeAppliance', + 'createMigratingVm', + 'listMigratingVms', + 'getMigratingVm', + 'updateMigratingVm', + 'deleteMigratingVm', + 'startMigration', + 'resumeMigration', + 'pauseMigration', + 'finalizeMigration', + 'createCloneJob', + 'cancelCloneJob', + 'listCloneJobs', + 'getCloneJob', + 'createCutoverJob', + 'cancelCutoverJob', + 'listCutoverJobs', + 'getCutoverJob', + 'listGroups', + 'getGroup', + 'createGroup', + 'updateGroup', + 'deleteGroup', + 'addGroupMigration', + 'removeGroupMigration', + 'listTargetProjects', + 'getTargetProject', + 'createTargetProject', + 'updateTargetProject', + 'deleteTargetProject', + ]; + for (const methodName of vmMigrationStubMethods) { + const callPromise = this.vmMigrationStub.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.vmMigrationStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'vmmigration.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 'vmmigration.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 Source. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The Source name. + * @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 [Source]{@link google.cloud.vmmigration.v1.Source}. + * 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/vm_migration.get_source.js + * region_tag:vmmigration_v1_generated_VmMigration_GetSource_async + */ + getSource( + request?: protos.google.cloud.vmmigration.v1.IGetSourceRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.vmmigration.v1.ISource, + protos.google.cloud.vmmigration.v1.IGetSourceRequest | undefined, + {} | undefined + ] + >; + getSource( + request: protos.google.cloud.vmmigration.v1.IGetSourceRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.vmmigration.v1.ISource, + protos.google.cloud.vmmigration.v1.IGetSourceRequest | null | undefined, + {} | null | undefined + > + ): void; + getSource( + request: protos.google.cloud.vmmigration.v1.IGetSourceRequest, + callback: Callback< + protos.google.cloud.vmmigration.v1.ISource, + protos.google.cloud.vmmigration.v1.IGetSourceRequest | null | undefined, + {} | null | undefined + > + ): void; + getSource( + request?: protos.google.cloud.vmmigration.v1.IGetSourceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.vmmigration.v1.ISource, + | protos.google.cloud.vmmigration.v1.IGetSourceRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.vmmigration.v1.ISource, + protos.google.cloud.vmmigration.v1.IGetSourceRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.vmmigration.v1.ISource, + protos.google.cloud.vmmigration.v1.IGetSourceRequest | 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.getSource(request, options, callback); + } + /** + * List remote source's inventory of VMs. + * The remote source is the onprem vCenter (remote in the sense it's not in + * Compute Engine). The inventory describes the list of existing VMs in that + * source. Note that this operation lists the VMs on the remote source, as + * opposed to listing the MigratingVms resources in the vmmigration service. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.source + * Required. The name of the Source. + * @param {boolean} request.forceRefresh + * If this flag is set to true, the source will be queried instead of using + * cached results. Using this flag will make the call slower. + * @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 [FetchInventoryResponse]{@link google.cloud.vmmigration.v1.FetchInventoryResponse}. + * 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/vm_migration.fetch_inventory.js + * region_tag:vmmigration_v1_generated_VmMigration_FetchInventory_async + */ + fetchInventory( + request?: protos.google.cloud.vmmigration.v1.IFetchInventoryRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.vmmigration.v1.IFetchInventoryResponse, + protos.google.cloud.vmmigration.v1.IFetchInventoryRequest | undefined, + {} | undefined + ] + >; + fetchInventory( + request: protos.google.cloud.vmmigration.v1.IFetchInventoryRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.vmmigration.v1.IFetchInventoryResponse, + | protos.google.cloud.vmmigration.v1.IFetchInventoryRequest + | null + | undefined, + {} | null | undefined + > + ): void; + fetchInventory( + request: protos.google.cloud.vmmigration.v1.IFetchInventoryRequest, + callback: Callback< + protos.google.cloud.vmmigration.v1.IFetchInventoryResponse, + | protos.google.cloud.vmmigration.v1.IFetchInventoryRequest + | null + | undefined, + {} | null | undefined + > + ): void; + fetchInventory( + request?: protos.google.cloud.vmmigration.v1.IFetchInventoryRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.vmmigration.v1.IFetchInventoryResponse, + | protos.google.cloud.vmmigration.v1.IFetchInventoryRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.vmmigration.v1.IFetchInventoryResponse, + | protos.google.cloud.vmmigration.v1.IFetchInventoryRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.vmmigration.v1.IFetchInventoryResponse, + protos.google.cloud.vmmigration.v1.IFetchInventoryRequest | 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({ + source: request.source ?? '', + }); + this.initialize(); + return this.innerApiCalls.fetchInventory(request, options, callback); + } + /** + * Gets a single Utilization Report. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The Utilization Report name. + * @param {google.cloud.vmmigration.v1.UtilizationReportView} [request.view] + * Optional. The level of details of the report. + * Defaults to FULL + * @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 [UtilizationReport]{@link google.cloud.vmmigration.v1.UtilizationReport}. + * 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/vm_migration.get_utilization_report.js + * region_tag:vmmigration_v1_generated_VmMigration_GetUtilizationReport_async + */ + getUtilizationReport( + request?: protos.google.cloud.vmmigration.v1.IGetUtilizationReportRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.vmmigration.v1.IUtilizationReport, + ( + | protos.google.cloud.vmmigration.v1.IGetUtilizationReportRequest + | undefined + ), + {} | undefined + ] + >; + getUtilizationReport( + request: protos.google.cloud.vmmigration.v1.IGetUtilizationReportRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.vmmigration.v1.IUtilizationReport, + | protos.google.cloud.vmmigration.v1.IGetUtilizationReportRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getUtilizationReport( + request: protos.google.cloud.vmmigration.v1.IGetUtilizationReportRequest, + callback: Callback< + protos.google.cloud.vmmigration.v1.IUtilizationReport, + | protos.google.cloud.vmmigration.v1.IGetUtilizationReportRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getUtilizationReport( + request?: protos.google.cloud.vmmigration.v1.IGetUtilizationReportRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.vmmigration.v1.IUtilizationReport, + | protos.google.cloud.vmmigration.v1.IGetUtilizationReportRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.vmmigration.v1.IUtilizationReport, + | protos.google.cloud.vmmigration.v1.IGetUtilizationReportRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.vmmigration.v1.IUtilizationReport, + ( + | protos.google.cloud.vmmigration.v1.IGetUtilizationReportRequest + | 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.getUtilizationReport(request, options, callback); + } + /** + * Gets details of a single DatacenterConnector. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the DatacenterConnector. + * @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 [DatacenterConnector]{@link google.cloud.vmmigration.v1.DatacenterConnector}. + * 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/vm_migration.get_datacenter_connector.js + * region_tag:vmmigration_v1_generated_VmMigration_GetDatacenterConnector_async + */ + getDatacenterConnector( + request?: protos.google.cloud.vmmigration.v1.IGetDatacenterConnectorRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.vmmigration.v1.IDatacenterConnector, + ( + | protos.google.cloud.vmmigration.v1.IGetDatacenterConnectorRequest + | undefined + ), + {} | undefined + ] + >; + getDatacenterConnector( + request: protos.google.cloud.vmmigration.v1.IGetDatacenterConnectorRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.vmmigration.v1.IDatacenterConnector, + | protos.google.cloud.vmmigration.v1.IGetDatacenterConnectorRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getDatacenterConnector( + request: protos.google.cloud.vmmigration.v1.IGetDatacenterConnectorRequest, + callback: Callback< + protos.google.cloud.vmmigration.v1.IDatacenterConnector, + | protos.google.cloud.vmmigration.v1.IGetDatacenterConnectorRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getDatacenterConnector( + request?: protos.google.cloud.vmmigration.v1.IGetDatacenterConnectorRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.vmmigration.v1.IDatacenterConnector, + | protos.google.cloud.vmmigration.v1.IGetDatacenterConnectorRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.vmmigration.v1.IDatacenterConnector, + | protos.google.cloud.vmmigration.v1.IGetDatacenterConnectorRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.vmmigration.v1.IDatacenterConnector, + ( + | protos.google.cloud.vmmigration.v1.IGetDatacenterConnectorRequest + | 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.getDatacenterConnector( + request, + options, + callback + ); + } + /** + * Gets details of a single MigratingVm. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the MigratingVm. + * @param {google.cloud.vmmigration.v1.MigratingVmView} [request.view] + * Optional. The level of details of the migrating VM. + * @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 [MigratingVm]{@link google.cloud.vmmigration.v1.MigratingVm}. + * 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/vm_migration.get_migrating_vm.js + * region_tag:vmmigration_v1_generated_VmMigration_GetMigratingVm_async + */ + getMigratingVm( + request?: protos.google.cloud.vmmigration.v1.IGetMigratingVmRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.vmmigration.v1.IMigratingVm, + protos.google.cloud.vmmigration.v1.IGetMigratingVmRequest | undefined, + {} | undefined + ] + >; + getMigratingVm( + request: protos.google.cloud.vmmigration.v1.IGetMigratingVmRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.vmmigration.v1.IMigratingVm, + | protos.google.cloud.vmmigration.v1.IGetMigratingVmRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getMigratingVm( + request: protos.google.cloud.vmmigration.v1.IGetMigratingVmRequest, + callback: Callback< + protos.google.cloud.vmmigration.v1.IMigratingVm, + | protos.google.cloud.vmmigration.v1.IGetMigratingVmRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getMigratingVm( + request?: protos.google.cloud.vmmigration.v1.IGetMigratingVmRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.vmmigration.v1.IMigratingVm, + | protos.google.cloud.vmmigration.v1.IGetMigratingVmRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.vmmigration.v1.IMigratingVm, + | protos.google.cloud.vmmigration.v1.IGetMigratingVmRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.vmmigration.v1.IMigratingVm, + protos.google.cloud.vmmigration.v1.IGetMigratingVmRequest | 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.getMigratingVm(request, options, callback); + } + /** + * Gets details of a single CloneJob. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the CloneJob. + * @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 [CloneJob]{@link google.cloud.vmmigration.v1.CloneJob}. + * 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/vm_migration.get_clone_job.js + * region_tag:vmmigration_v1_generated_VmMigration_GetCloneJob_async + */ + getCloneJob( + request?: protos.google.cloud.vmmigration.v1.IGetCloneJobRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.vmmigration.v1.ICloneJob, + protos.google.cloud.vmmigration.v1.IGetCloneJobRequest | undefined, + {} | undefined + ] + >; + getCloneJob( + request: protos.google.cloud.vmmigration.v1.IGetCloneJobRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.vmmigration.v1.ICloneJob, + protos.google.cloud.vmmigration.v1.IGetCloneJobRequest | null | undefined, + {} | null | undefined + > + ): void; + getCloneJob( + request: protos.google.cloud.vmmigration.v1.IGetCloneJobRequest, + callback: Callback< + protos.google.cloud.vmmigration.v1.ICloneJob, + protos.google.cloud.vmmigration.v1.IGetCloneJobRequest | null | undefined, + {} | null | undefined + > + ): void; + getCloneJob( + request?: protos.google.cloud.vmmigration.v1.IGetCloneJobRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.vmmigration.v1.ICloneJob, + | protos.google.cloud.vmmigration.v1.IGetCloneJobRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.vmmigration.v1.ICloneJob, + protos.google.cloud.vmmigration.v1.IGetCloneJobRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.vmmigration.v1.ICloneJob, + protos.google.cloud.vmmigration.v1.IGetCloneJobRequest | 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.getCloneJob(request, options, callback); + } + /** + * Gets details of a single CutoverJob. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the CutoverJob. + * @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 [CutoverJob]{@link google.cloud.vmmigration.v1.CutoverJob}. + * 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/vm_migration.get_cutover_job.js + * region_tag:vmmigration_v1_generated_VmMigration_GetCutoverJob_async + */ + getCutoverJob( + request?: protos.google.cloud.vmmigration.v1.IGetCutoverJobRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.vmmigration.v1.ICutoverJob, + protos.google.cloud.vmmigration.v1.IGetCutoverJobRequest | undefined, + {} | undefined + ] + >; + getCutoverJob( + request: protos.google.cloud.vmmigration.v1.IGetCutoverJobRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.vmmigration.v1.ICutoverJob, + | protos.google.cloud.vmmigration.v1.IGetCutoverJobRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getCutoverJob( + request: protos.google.cloud.vmmigration.v1.IGetCutoverJobRequest, + callback: Callback< + protos.google.cloud.vmmigration.v1.ICutoverJob, + | protos.google.cloud.vmmigration.v1.IGetCutoverJobRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getCutoverJob( + request?: protos.google.cloud.vmmigration.v1.IGetCutoverJobRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.vmmigration.v1.ICutoverJob, + | protos.google.cloud.vmmigration.v1.IGetCutoverJobRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.vmmigration.v1.ICutoverJob, + | protos.google.cloud.vmmigration.v1.IGetCutoverJobRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.vmmigration.v1.ICutoverJob, + protos.google.cloud.vmmigration.v1.IGetCutoverJobRequest | 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.getCutoverJob(request, options, callback); + } + /** + * Gets details of a single Group. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The group name. + * @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 [Group]{@link google.cloud.vmmigration.v1.Group}. + * 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/vm_migration.get_group.js + * region_tag:vmmigration_v1_generated_VmMigration_GetGroup_async + */ + getGroup( + request?: protos.google.cloud.vmmigration.v1.IGetGroupRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.vmmigration.v1.IGroup, + protos.google.cloud.vmmigration.v1.IGetGroupRequest | undefined, + {} | undefined + ] + >; + getGroup( + request: protos.google.cloud.vmmigration.v1.IGetGroupRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.vmmigration.v1.IGroup, + protos.google.cloud.vmmigration.v1.IGetGroupRequest | null | undefined, + {} | null | undefined + > + ): void; + getGroup( + request: protos.google.cloud.vmmigration.v1.IGetGroupRequest, + callback: Callback< + protos.google.cloud.vmmigration.v1.IGroup, + protos.google.cloud.vmmigration.v1.IGetGroupRequest | null | undefined, + {} | null | undefined + > + ): void; + getGroup( + request?: protos.google.cloud.vmmigration.v1.IGetGroupRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.vmmigration.v1.IGroup, + | protos.google.cloud.vmmigration.v1.IGetGroupRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.vmmigration.v1.IGroup, + protos.google.cloud.vmmigration.v1.IGetGroupRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.vmmigration.v1.IGroup, + protos.google.cloud.vmmigration.v1.IGetGroupRequest | 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.getGroup(request, options, callback); + } + /** + * Gets details of a single TargetProject. + * + * NOTE: TargetProject is a global resource; hence the only supported value + * for location is `global`. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The TargetProject name. + * @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 [TargetProject]{@link google.cloud.vmmigration.v1.TargetProject}. + * 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/vm_migration.get_target_project.js + * region_tag:vmmigration_v1_generated_VmMigration_GetTargetProject_async + */ + getTargetProject( + request?: protos.google.cloud.vmmigration.v1.IGetTargetProjectRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.vmmigration.v1.ITargetProject, + protos.google.cloud.vmmigration.v1.IGetTargetProjectRequest | undefined, + {} | undefined + ] + >; + getTargetProject( + request: protos.google.cloud.vmmigration.v1.IGetTargetProjectRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.vmmigration.v1.ITargetProject, + | protos.google.cloud.vmmigration.v1.IGetTargetProjectRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getTargetProject( + request: protos.google.cloud.vmmigration.v1.IGetTargetProjectRequest, + callback: Callback< + protos.google.cloud.vmmigration.v1.ITargetProject, + | protos.google.cloud.vmmigration.v1.IGetTargetProjectRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getTargetProject( + request?: protos.google.cloud.vmmigration.v1.IGetTargetProjectRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.vmmigration.v1.ITargetProject, + | protos.google.cloud.vmmigration.v1.IGetTargetProjectRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.vmmigration.v1.ITargetProject, + | protos.google.cloud.vmmigration.v1.IGetTargetProjectRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.vmmigration.v1.ITargetProject, + protos.google.cloud.vmmigration.v1.IGetTargetProjectRequest | 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.getTargetProject(request, options, callback); + } + + /** + * Creates a new Source in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The Source's parent. + * @param {string} request.sourceId + * Required. The source identifier. + * @param {google.cloud.vmmigration.v1.Source} request.source + * Required. The create request body. + * @param {string} request.requestId + * A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @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/vm_migration.create_source.js + * region_tag:vmmigration_v1_generated_VmMigration_CreateSource_async + */ + createSource( + request?: protos.google.cloud.vmmigration.v1.ICreateSourceRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.vmmigration.v1.ISource, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + createSource( + request: protos.google.cloud.vmmigration.v1.ICreateSourceRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.vmmigration.v1.ISource, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createSource( + request: protos.google.cloud.vmmigration.v1.ICreateSourceRequest, + callback: Callback< + LROperation< + protos.google.cloud.vmmigration.v1.ISource, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createSource( + request?: protos.google.cloud.vmmigration.v1.ICreateSourceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.vmmigration.v1.ISource, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.vmmigration.v1.ISource, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.vmmigration.v1.ISource, + protos.google.cloud.vmmigration.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.createSource(request, options, callback); + } + /** + * Check the status of the long running operation returned by `createSource()`. + * @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/vm_migration.create_source.js + * region_tag:vmmigration_v1_generated_VmMigration_CreateSource_async + */ + async checkCreateSourceProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.vmmigration.v1.Source, + protos.google.cloud.vmmigration.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.createSource, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.vmmigration.v1.Source, + protos.google.cloud.vmmigration.v1.OperationMetadata + >; + } + /** + * Updates the parameters of a single Source. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.protobuf.FieldMask} request.updateMask + * Field mask is used to specify the fields to be overwritten in the + * Source resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * @param {google.cloud.vmmigration.v1.Source} request.source + * Required. The update request body. + * @param {string} request.requestId + * A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @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/vm_migration.update_source.js + * region_tag:vmmigration_v1_generated_VmMigration_UpdateSource_async + */ + updateSource( + request?: protos.google.cloud.vmmigration.v1.IUpdateSourceRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.vmmigration.v1.ISource, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + updateSource( + request: protos.google.cloud.vmmigration.v1.IUpdateSourceRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.vmmigration.v1.ISource, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateSource( + request: protos.google.cloud.vmmigration.v1.IUpdateSourceRequest, + callback: Callback< + LROperation< + protos.google.cloud.vmmigration.v1.ISource, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateSource( + request?: protos.google.cloud.vmmigration.v1.IUpdateSourceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.vmmigration.v1.ISource, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.vmmigration.v1.ISource, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.vmmigration.v1.ISource, + protos.google.cloud.vmmigration.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({ + 'source.name': request.source!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateSource(request, options, callback); + } + /** + * Check the status of the long running operation returned by `updateSource()`. + * @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/vm_migration.update_source.js + * region_tag:vmmigration_v1_generated_VmMigration_UpdateSource_async + */ + async checkUpdateSourceProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.vmmigration.v1.Source, + protos.google.cloud.vmmigration.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.updateSource, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.vmmigration.v1.Source, + protos.google.cloud.vmmigration.v1.OperationMetadata + >; + } + /** + * Deletes a single Source. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The Source name. + * @param {string} [request.requestId] + * Optional. A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes after the first request. + * + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @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/vm_migration.delete_source.js + * region_tag:vmmigration_v1_generated_VmMigration_DeleteSource_async + */ + deleteSource( + request?: protos.google.cloud.vmmigration.v1.IDeleteSourceRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + deleteSource( + request: protos.google.cloud.vmmigration.v1.IDeleteSourceRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteSource( + request: protos.google.cloud.vmmigration.v1.IDeleteSourceRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteSource( + request?: protos.google.cloud.vmmigration.v1.IDeleteSourceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.vmmigration.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.deleteSource(request, options, callback); + } + /** + * Check the status of the long running operation returned by `deleteSource()`. + * @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/vm_migration.delete_source.js + * region_tag:vmmigration_v1_generated_VmMigration_DeleteSource_async + */ + async checkDeleteSourceProgress( + name: string + ): Promise< + LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.vmmigration.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.deleteSource, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.vmmigration.v1.OperationMetadata + >; + } + /** + * Creates a new UtilizationReport. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The Utilization Report's parent. + * @param {google.cloud.vmmigration.v1.UtilizationReport} request.utilizationReport + * Required. The report to create. + * @param {string} request.utilizationReportId + * Required. The ID to use for the report, which will become the final + * component of the reports's resource name. + * + * This value maximum length is 63 characters, and valid characters + * are /{@link 0-9|a-z}-/. It must start with an english letter and must not + * end with a hyphen. + * @param {string} request.requestId + * A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @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/vm_migration.create_utilization_report.js + * region_tag:vmmigration_v1_generated_VmMigration_CreateUtilizationReport_async + */ + createUtilizationReport( + request?: protos.google.cloud.vmmigration.v1.ICreateUtilizationReportRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.vmmigration.v1.IUtilizationReport, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + createUtilizationReport( + request: protos.google.cloud.vmmigration.v1.ICreateUtilizationReportRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.vmmigration.v1.IUtilizationReport, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createUtilizationReport( + request: protos.google.cloud.vmmigration.v1.ICreateUtilizationReportRequest, + callback: Callback< + LROperation< + protos.google.cloud.vmmigration.v1.IUtilizationReport, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createUtilizationReport( + request?: protos.google.cloud.vmmigration.v1.ICreateUtilizationReportRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.vmmigration.v1.IUtilizationReport, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.vmmigration.v1.IUtilizationReport, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.vmmigration.v1.IUtilizationReport, + protos.google.cloud.vmmigration.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.createUtilizationReport( + request, + options, + callback + ); + } + /** + * Check the status of the long running operation returned by `createUtilizationReport()`. + * @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/vm_migration.create_utilization_report.js + * region_tag:vmmigration_v1_generated_VmMigration_CreateUtilizationReport_async + */ + async checkCreateUtilizationReportProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.vmmigration.v1.UtilizationReport, + protos.google.cloud.vmmigration.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.createUtilizationReport, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.vmmigration.v1.UtilizationReport, + protos.google.cloud.vmmigration.v1.OperationMetadata + >; + } + /** + * Deletes a single Utilization Report. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The Utilization Report name. + * @param {string} [request.requestId] + * Optional. A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes after the first request. + * + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @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/vm_migration.delete_utilization_report.js + * region_tag:vmmigration_v1_generated_VmMigration_DeleteUtilizationReport_async + */ + deleteUtilizationReport( + request?: protos.google.cloud.vmmigration.v1.IDeleteUtilizationReportRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + deleteUtilizationReport( + request: protos.google.cloud.vmmigration.v1.IDeleteUtilizationReportRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteUtilizationReport( + request: protos.google.cloud.vmmigration.v1.IDeleteUtilizationReportRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteUtilizationReport( + request?: protos.google.cloud.vmmigration.v1.IDeleteUtilizationReportRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.vmmigration.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.deleteUtilizationReport( + request, + options, + callback + ); + } + /** + * Check the status of the long running operation returned by `deleteUtilizationReport()`. + * @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/vm_migration.delete_utilization_report.js + * region_tag:vmmigration_v1_generated_VmMigration_DeleteUtilizationReport_async + */ + async checkDeleteUtilizationReportProgress( + name: string + ): Promise< + LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.vmmigration.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.deleteUtilizationReport, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.vmmigration.v1.OperationMetadata + >; + } + /** + * Creates a new DatacenterConnector in a given Source. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The DatacenterConnector's parent. + * Required. The Source in where the new DatacenterConnector will be created. + * For example: + * `projects/my-project/locations/us-central1/sources/my-source` + * @param {string} request.datacenterConnectorId + * Required. The datacenterConnector identifier. + * @param {google.cloud.vmmigration.v1.DatacenterConnector} request.datacenterConnector + * Required. The create request body. + * @param {string} request.requestId + * A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @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/vm_migration.create_datacenter_connector.js + * region_tag:vmmigration_v1_generated_VmMigration_CreateDatacenterConnector_async + */ + createDatacenterConnector( + request?: protos.google.cloud.vmmigration.v1.ICreateDatacenterConnectorRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.vmmigration.v1.IDatacenterConnector, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + createDatacenterConnector( + request: protos.google.cloud.vmmigration.v1.ICreateDatacenterConnectorRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.vmmigration.v1.IDatacenterConnector, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createDatacenterConnector( + request: protos.google.cloud.vmmigration.v1.ICreateDatacenterConnectorRequest, + callback: Callback< + LROperation< + protos.google.cloud.vmmigration.v1.IDatacenterConnector, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createDatacenterConnector( + request?: protos.google.cloud.vmmigration.v1.ICreateDatacenterConnectorRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.vmmigration.v1.IDatacenterConnector, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.vmmigration.v1.IDatacenterConnector, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.vmmigration.v1.IDatacenterConnector, + protos.google.cloud.vmmigration.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.createDatacenterConnector( + request, + options, + callback + ); + } + /** + * Check the status of the long running operation returned by `createDatacenterConnector()`. + * @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/vm_migration.create_datacenter_connector.js + * region_tag:vmmigration_v1_generated_VmMigration_CreateDatacenterConnector_async + */ + async checkCreateDatacenterConnectorProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.vmmigration.v1.DatacenterConnector, + protos.google.cloud.vmmigration.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.createDatacenterConnector, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.vmmigration.v1.DatacenterConnector, + protos.google.cloud.vmmigration.v1.OperationMetadata + >; + } + /** + * Deletes a single DatacenterConnector. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The DatacenterConnector name. + * @param {string} request.requestId + * A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes after the first request. + * + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @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/vm_migration.delete_datacenter_connector.js + * region_tag:vmmigration_v1_generated_VmMigration_DeleteDatacenterConnector_async + */ + deleteDatacenterConnector( + request?: protos.google.cloud.vmmigration.v1.IDeleteDatacenterConnectorRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + deleteDatacenterConnector( + request: protos.google.cloud.vmmigration.v1.IDeleteDatacenterConnectorRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteDatacenterConnector( + request: protos.google.cloud.vmmigration.v1.IDeleteDatacenterConnectorRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteDatacenterConnector( + request?: protos.google.cloud.vmmigration.v1.IDeleteDatacenterConnectorRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.vmmigration.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.deleteDatacenterConnector( + request, + options, + callback + ); + } + /** + * Check the status of the long running operation returned by `deleteDatacenterConnector()`. + * @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/vm_migration.delete_datacenter_connector.js + * region_tag:vmmigration_v1_generated_VmMigration_DeleteDatacenterConnector_async + */ + async checkDeleteDatacenterConnectorProgress( + name: string + ): Promise< + LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.vmmigration.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.deleteDatacenterConnector, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.vmmigration.v1.OperationMetadata + >; + } + /** + * Upgrades the appliance relate to this DatacenterConnector to the in-place + * updateable version. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.datacenterConnector + * Required. The DatacenterConnector name. + * @param {string} request.requestId + * A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes after the first request. + * + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @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/vm_migration.upgrade_appliance.js + * region_tag:vmmigration_v1_generated_VmMigration_UpgradeAppliance_async + */ + upgradeAppliance( + request?: protos.google.cloud.vmmigration.v1.IUpgradeApplianceRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.vmmigration.v1.IUpgradeApplianceResponse, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + upgradeAppliance( + request: protos.google.cloud.vmmigration.v1.IUpgradeApplianceRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.vmmigration.v1.IUpgradeApplianceResponse, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + upgradeAppliance( + request: protos.google.cloud.vmmigration.v1.IUpgradeApplianceRequest, + callback: Callback< + LROperation< + protos.google.cloud.vmmigration.v1.IUpgradeApplianceResponse, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + upgradeAppliance( + request?: protos.google.cloud.vmmigration.v1.IUpgradeApplianceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.vmmigration.v1.IUpgradeApplianceResponse, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.vmmigration.v1.IUpgradeApplianceResponse, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.vmmigration.v1.IUpgradeApplianceResponse, + protos.google.cloud.vmmigration.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({ + datacenter_connector: request.datacenterConnector ?? '', + }); + this.initialize(); + return this.innerApiCalls.upgradeAppliance(request, options, callback); + } + /** + * Check the status of the long running operation returned by `upgradeAppliance()`. + * @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/vm_migration.upgrade_appliance.js + * region_tag:vmmigration_v1_generated_VmMigration_UpgradeAppliance_async + */ + async checkUpgradeApplianceProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.vmmigration.v1.UpgradeApplianceResponse, + protos.google.cloud.vmmigration.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.upgradeAppliance, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.vmmigration.v1.UpgradeApplianceResponse, + protos.google.cloud.vmmigration.v1.OperationMetadata + >; + } + /** + * Creates a new MigratingVm in a given Source. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The MigratingVm's parent. + * @param {string} request.migratingVmId + * Required. The migratingVm identifier. + * @param {google.cloud.vmmigration.v1.MigratingVm} request.migratingVm + * Required. The create request body. + * @param {string} request.requestId + * A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @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/vm_migration.create_migrating_vm.js + * region_tag:vmmigration_v1_generated_VmMigration_CreateMigratingVm_async + */ + createMigratingVm( + request?: protos.google.cloud.vmmigration.v1.ICreateMigratingVmRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.vmmigration.v1.IMigratingVm, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + createMigratingVm( + request: protos.google.cloud.vmmigration.v1.ICreateMigratingVmRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.vmmigration.v1.IMigratingVm, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createMigratingVm( + request: protos.google.cloud.vmmigration.v1.ICreateMigratingVmRequest, + callback: Callback< + LROperation< + protos.google.cloud.vmmigration.v1.IMigratingVm, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createMigratingVm( + request?: protos.google.cloud.vmmigration.v1.ICreateMigratingVmRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.vmmigration.v1.IMigratingVm, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.vmmigration.v1.IMigratingVm, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.vmmigration.v1.IMigratingVm, + protos.google.cloud.vmmigration.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.createMigratingVm(request, options, callback); + } + /** + * Check the status of the long running operation returned by `createMigratingVm()`. + * @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/vm_migration.create_migrating_vm.js + * region_tag:vmmigration_v1_generated_VmMigration_CreateMigratingVm_async + */ + async checkCreateMigratingVmProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.vmmigration.v1.MigratingVm, + protos.google.cloud.vmmigration.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.createMigratingVm, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.vmmigration.v1.MigratingVm, + protos.google.cloud.vmmigration.v1.OperationMetadata + >; + } + /** + * Updates the parameters of a single MigratingVm. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.protobuf.FieldMask} request.updateMask + * Field mask is used to specify the fields to be overwritten in the + * MigratingVm resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * @param {google.cloud.vmmigration.v1.MigratingVm} request.migratingVm + * Required. The update request body. + * @param {string} request.requestId + * A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @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/vm_migration.update_migrating_vm.js + * region_tag:vmmigration_v1_generated_VmMigration_UpdateMigratingVm_async + */ + updateMigratingVm( + request?: protos.google.cloud.vmmigration.v1.IUpdateMigratingVmRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.vmmigration.v1.IMigratingVm, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + updateMigratingVm( + request: protos.google.cloud.vmmigration.v1.IUpdateMigratingVmRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.vmmigration.v1.IMigratingVm, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateMigratingVm( + request: protos.google.cloud.vmmigration.v1.IUpdateMigratingVmRequest, + callback: Callback< + LROperation< + protos.google.cloud.vmmigration.v1.IMigratingVm, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateMigratingVm( + request?: protos.google.cloud.vmmigration.v1.IUpdateMigratingVmRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.vmmigration.v1.IMigratingVm, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.vmmigration.v1.IMigratingVm, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.vmmigration.v1.IMigratingVm, + protos.google.cloud.vmmigration.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({ + 'migrating_vm.name': request.migratingVm!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateMigratingVm(request, options, callback); + } + /** + * Check the status of the long running operation returned by `updateMigratingVm()`. + * @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/vm_migration.update_migrating_vm.js + * region_tag:vmmigration_v1_generated_VmMigration_UpdateMigratingVm_async + */ + async checkUpdateMigratingVmProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.vmmigration.v1.MigratingVm, + protos.google.cloud.vmmigration.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.updateMigratingVm, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.vmmigration.v1.MigratingVm, + protos.google.cloud.vmmigration.v1.OperationMetadata + >; + } + /** + * Deletes a single MigratingVm. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the MigratingVm. + * @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/vm_migration.delete_migrating_vm.js + * region_tag:vmmigration_v1_generated_VmMigration_DeleteMigratingVm_async + */ + deleteMigratingVm( + request?: protos.google.cloud.vmmigration.v1.IDeleteMigratingVmRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + deleteMigratingVm( + request: protos.google.cloud.vmmigration.v1.IDeleteMigratingVmRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteMigratingVm( + request: protos.google.cloud.vmmigration.v1.IDeleteMigratingVmRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteMigratingVm( + request?: protos.google.cloud.vmmigration.v1.IDeleteMigratingVmRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.vmmigration.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.deleteMigratingVm(request, options, callback); + } + /** + * Check the status of the long running operation returned by `deleteMigratingVm()`. + * @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/vm_migration.delete_migrating_vm.js + * region_tag:vmmigration_v1_generated_VmMigration_DeleteMigratingVm_async + */ + async checkDeleteMigratingVmProgress( + name: string + ): Promise< + LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.vmmigration.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.deleteMigratingVm, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.vmmigration.v1.OperationMetadata + >; + } + /** + * Starts migration for a VM. Starts the process of uploading + * data and creating snapshots, in replication cycles scheduled by the policy. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.migratingVm + * Required. The name of the MigratingVm. + * @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/vm_migration.start_migration.js + * region_tag:vmmigration_v1_generated_VmMigration_StartMigration_async + */ + startMigration( + request?: protos.google.cloud.vmmigration.v1.IStartMigrationRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.vmmigration.v1.IStartMigrationResponse, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + startMigration( + request: protos.google.cloud.vmmigration.v1.IStartMigrationRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.vmmigration.v1.IStartMigrationResponse, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + startMigration( + request: protos.google.cloud.vmmigration.v1.IStartMigrationRequest, + callback: Callback< + LROperation< + protos.google.cloud.vmmigration.v1.IStartMigrationResponse, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + startMigration( + request?: protos.google.cloud.vmmigration.v1.IStartMigrationRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.vmmigration.v1.IStartMigrationResponse, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.vmmigration.v1.IStartMigrationResponse, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.vmmigration.v1.IStartMigrationResponse, + protos.google.cloud.vmmigration.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({ + migrating_vm: request.migratingVm ?? '', + }); + this.initialize(); + return this.innerApiCalls.startMigration(request, options, callback); + } + /** + * Check the status of the long running operation returned by `startMigration()`. + * @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/vm_migration.start_migration.js + * region_tag:vmmigration_v1_generated_VmMigration_StartMigration_async + */ + async checkStartMigrationProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.vmmigration.v1.StartMigrationResponse, + protos.google.cloud.vmmigration.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.startMigration, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.vmmigration.v1.StartMigrationResponse, + protos.google.cloud.vmmigration.v1.OperationMetadata + >; + } + /** + * Resumes a migration for a VM. When called on a paused migration, will start + * the process of uploading data and creating snapshots; when called on a + * completed cut-over migration, will update the migration to active state and + * start the process of uploading data and creating snapshots. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.migratingVm + * Required. The name of the MigratingVm. + * @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/vm_migration.resume_migration.js + * region_tag:vmmigration_v1_generated_VmMigration_ResumeMigration_async + */ + resumeMigration( + request?: protos.google.cloud.vmmigration.v1.IResumeMigrationRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.vmmigration.v1.IResumeMigrationResponse, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + resumeMigration( + request: protos.google.cloud.vmmigration.v1.IResumeMigrationRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.vmmigration.v1.IResumeMigrationResponse, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + resumeMigration( + request: protos.google.cloud.vmmigration.v1.IResumeMigrationRequest, + callback: Callback< + LROperation< + protos.google.cloud.vmmigration.v1.IResumeMigrationResponse, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + resumeMigration( + request?: protos.google.cloud.vmmigration.v1.IResumeMigrationRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.vmmigration.v1.IResumeMigrationResponse, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.vmmigration.v1.IResumeMigrationResponse, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.vmmigration.v1.IResumeMigrationResponse, + protos.google.cloud.vmmigration.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({ + migrating_vm: request.migratingVm ?? '', + }); + this.initialize(); + return this.innerApiCalls.resumeMigration(request, options, callback); + } + /** + * Check the status of the long running operation returned by `resumeMigration()`. + * @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/vm_migration.resume_migration.js + * region_tag:vmmigration_v1_generated_VmMigration_ResumeMigration_async + */ + async checkResumeMigrationProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.vmmigration.v1.ResumeMigrationResponse, + protos.google.cloud.vmmigration.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.resumeMigration, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.vmmigration.v1.ResumeMigrationResponse, + protos.google.cloud.vmmigration.v1.OperationMetadata + >; + } + /** + * Pauses a migration for a VM. If cycle tasks are running they will be + * cancelled, preserving source task data. Further replication cycles will not + * be triggered while the VM is paused. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.migratingVm + * Required. The name of the MigratingVm. + * @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/vm_migration.pause_migration.js + * region_tag:vmmigration_v1_generated_VmMigration_PauseMigration_async + */ + pauseMigration( + request?: protos.google.cloud.vmmigration.v1.IPauseMigrationRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.vmmigration.v1.IPauseMigrationResponse, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + pauseMigration( + request: protos.google.cloud.vmmigration.v1.IPauseMigrationRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.vmmigration.v1.IPauseMigrationResponse, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + pauseMigration( + request: protos.google.cloud.vmmigration.v1.IPauseMigrationRequest, + callback: Callback< + LROperation< + protos.google.cloud.vmmigration.v1.IPauseMigrationResponse, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + pauseMigration( + request?: protos.google.cloud.vmmigration.v1.IPauseMigrationRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.vmmigration.v1.IPauseMigrationResponse, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.vmmigration.v1.IPauseMigrationResponse, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.vmmigration.v1.IPauseMigrationResponse, + protos.google.cloud.vmmigration.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({ + migrating_vm: request.migratingVm ?? '', + }); + this.initialize(); + return this.innerApiCalls.pauseMigration(request, options, callback); + } + /** + * Check the status of the long running operation returned by `pauseMigration()`. + * @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/vm_migration.pause_migration.js + * region_tag:vmmigration_v1_generated_VmMigration_PauseMigration_async + */ + async checkPauseMigrationProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.vmmigration.v1.PauseMigrationResponse, + protos.google.cloud.vmmigration.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.pauseMigration, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.vmmigration.v1.PauseMigrationResponse, + protos.google.cloud.vmmigration.v1.OperationMetadata + >; + } + /** + * Marks a migration as completed, deleting migration resources that are no + * longer being used. Only applicable after cutover is done. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.migratingVm + * Required. The name of the MigratingVm. + * @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/vm_migration.finalize_migration.js + * region_tag:vmmigration_v1_generated_VmMigration_FinalizeMigration_async + */ + finalizeMigration( + request?: protos.google.cloud.vmmigration.v1.IFinalizeMigrationRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.vmmigration.v1.IFinalizeMigrationResponse, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + finalizeMigration( + request: protos.google.cloud.vmmigration.v1.IFinalizeMigrationRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.vmmigration.v1.IFinalizeMigrationResponse, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + finalizeMigration( + request: protos.google.cloud.vmmigration.v1.IFinalizeMigrationRequest, + callback: Callback< + LROperation< + protos.google.cloud.vmmigration.v1.IFinalizeMigrationResponse, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + finalizeMigration( + request?: protos.google.cloud.vmmigration.v1.IFinalizeMigrationRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.vmmigration.v1.IFinalizeMigrationResponse, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.vmmigration.v1.IFinalizeMigrationResponse, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.vmmigration.v1.IFinalizeMigrationResponse, + protos.google.cloud.vmmigration.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({ + migrating_vm: request.migratingVm ?? '', + }); + this.initialize(); + return this.innerApiCalls.finalizeMigration(request, options, callback); + } + /** + * Check the status of the long running operation returned by `finalizeMigration()`. + * @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/vm_migration.finalize_migration.js + * region_tag:vmmigration_v1_generated_VmMigration_FinalizeMigration_async + */ + async checkFinalizeMigrationProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.vmmigration.v1.FinalizeMigrationResponse, + protos.google.cloud.vmmigration.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.finalizeMigration, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.vmmigration.v1.FinalizeMigrationResponse, + protos.google.cloud.vmmigration.v1.OperationMetadata + >; + } + /** + * Initiates a Clone of a specific migrating VM. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The Clone's parent. + * @param {string} request.cloneJobId + * Required. The clone job identifier. + * @param {google.cloud.vmmigration.v1.CloneJob} request.cloneJob + * Required. The clone request body. + * @param {string} request.requestId + * A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @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/vm_migration.create_clone_job.js + * region_tag:vmmigration_v1_generated_VmMigration_CreateCloneJob_async + */ + createCloneJob( + request?: protos.google.cloud.vmmigration.v1.ICreateCloneJobRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.vmmigration.v1.ICloneJob, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + createCloneJob( + request: protos.google.cloud.vmmigration.v1.ICreateCloneJobRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.vmmigration.v1.ICloneJob, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createCloneJob( + request: protos.google.cloud.vmmigration.v1.ICreateCloneJobRequest, + callback: Callback< + LROperation< + protos.google.cloud.vmmigration.v1.ICloneJob, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createCloneJob( + request?: protos.google.cloud.vmmigration.v1.ICreateCloneJobRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.vmmigration.v1.ICloneJob, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.vmmigration.v1.ICloneJob, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.vmmigration.v1.ICloneJob, + protos.google.cloud.vmmigration.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.createCloneJob(request, options, callback); + } + /** + * Check the status of the long running operation returned by `createCloneJob()`. + * @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/vm_migration.create_clone_job.js + * region_tag:vmmigration_v1_generated_VmMigration_CreateCloneJob_async + */ + async checkCreateCloneJobProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.vmmigration.v1.CloneJob, + protos.google.cloud.vmmigration.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.createCloneJob, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.vmmigration.v1.CloneJob, + protos.google.cloud.vmmigration.v1.OperationMetadata + >; + } + /** + * Initiates the cancellation of a running clone job. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The clone job id + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * 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/vm_migration.cancel_clone_job.js + * region_tag:vmmigration_v1_generated_VmMigration_CancelCloneJob_async + */ + cancelCloneJob( + request?: protos.google.cloud.vmmigration.v1.ICancelCloneJobRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.vmmigration.v1.ICancelCloneJobResponse, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + cancelCloneJob( + request: protos.google.cloud.vmmigration.v1.ICancelCloneJobRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.vmmigration.v1.ICancelCloneJobResponse, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + cancelCloneJob( + request: protos.google.cloud.vmmigration.v1.ICancelCloneJobRequest, + callback: Callback< + LROperation< + protos.google.cloud.vmmigration.v1.ICancelCloneJobResponse, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + cancelCloneJob( + request?: protos.google.cloud.vmmigration.v1.ICancelCloneJobRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.vmmigration.v1.ICancelCloneJobResponse, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.vmmigration.v1.ICancelCloneJobResponse, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.vmmigration.v1.ICancelCloneJobResponse, + protos.google.cloud.vmmigration.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.cancelCloneJob(request, options, callback); + } + /** + * Check the status of the long running operation returned by `cancelCloneJob()`. + * @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/vm_migration.cancel_clone_job.js + * region_tag:vmmigration_v1_generated_VmMigration_CancelCloneJob_async + */ + async checkCancelCloneJobProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.vmmigration.v1.CancelCloneJobResponse, + protos.google.cloud.vmmigration.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.cancelCloneJob, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.vmmigration.v1.CancelCloneJobResponse, + protos.google.cloud.vmmigration.v1.OperationMetadata + >; + } + /** + * Initiates a Cutover of a specific migrating VM. + * The returned LRO is completed when the cutover job resource is created + * and the job is initiated. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The Cutover's parent. + * @param {string} request.cutoverJobId + * Required. The cutover job identifier. + * @param {google.cloud.vmmigration.v1.CutoverJob} request.cutoverJob + * Required. The cutover request body. + * @param {string} request.requestId + * A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @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/vm_migration.create_cutover_job.js + * region_tag:vmmigration_v1_generated_VmMigration_CreateCutoverJob_async + */ + createCutoverJob( + request?: protos.google.cloud.vmmigration.v1.ICreateCutoverJobRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.vmmigration.v1.ICutoverJob, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + createCutoverJob( + request: protos.google.cloud.vmmigration.v1.ICreateCutoverJobRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.vmmigration.v1.ICutoverJob, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createCutoverJob( + request: protos.google.cloud.vmmigration.v1.ICreateCutoverJobRequest, + callback: Callback< + LROperation< + protos.google.cloud.vmmigration.v1.ICutoverJob, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createCutoverJob( + request?: protos.google.cloud.vmmigration.v1.ICreateCutoverJobRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.vmmigration.v1.ICutoverJob, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.vmmigration.v1.ICutoverJob, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.vmmigration.v1.ICutoverJob, + protos.google.cloud.vmmigration.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.createCutoverJob(request, options, callback); + } + /** + * Check the status of the long running operation returned by `createCutoverJob()`. + * @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/vm_migration.create_cutover_job.js + * region_tag:vmmigration_v1_generated_VmMigration_CreateCutoverJob_async + */ + async checkCreateCutoverJobProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.vmmigration.v1.CutoverJob, + protos.google.cloud.vmmigration.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.createCutoverJob, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.vmmigration.v1.CutoverJob, + protos.google.cloud.vmmigration.v1.OperationMetadata + >; + } + /** + * Initiates the cancellation of a running cutover job. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The cutover job id + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * 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/vm_migration.cancel_cutover_job.js + * region_tag:vmmigration_v1_generated_VmMigration_CancelCutoverJob_async + */ + cancelCutoverJob( + request?: protos.google.cloud.vmmigration.v1.ICancelCutoverJobRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.vmmigration.v1.ICancelCutoverJobResponse, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + cancelCutoverJob( + request: protos.google.cloud.vmmigration.v1.ICancelCutoverJobRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.vmmigration.v1.ICancelCutoverJobResponse, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + cancelCutoverJob( + request: protos.google.cloud.vmmigration.v1.ICancelCutoverJobRequest, + callback: Callback< + LROperation< + protos.google.cloud.vmmigration.v1.ICancelCutoverJobResponse, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + cancelCutoverJob( + request?: protos.google.cloud.vmmigration.v1.ICancelCutoverJobRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.vmmigration.v1.ICancelCutoverJobResponse, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.vmmigration.v1.ICancelCutoverJobResponse, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.vmmigration.v1.ICancelCutoverJobResponse, + protos.google.cloud.vmmigration.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.cancelCutoverJob(request, options, callback); + } + /** + * Check the status of the long running operation returned by `cancelCutoverJob()`. + * @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/vm_migration.cancel_cutover_job.js + * region_tag:vmmigration_v1_generated_VmMigration_CancelCutoverJob_async + */ + async checkCancelCutoverJobProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.vmmigration.v1.CancelCutoverJobResponse, + protos.google.cloud.vmmigration.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.cancelCutoverJob, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.vmmigration.v1.CancelCutoverJobResponse, + protos.google.cloud.vmmigration.v1.OperationMetadata + >; + } + /** + * Creates a new Group in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The Group's parent. + * @param {string} request.groupId + * Required. The group identifier. + * @param {google.cloud.vmmigration.v1.Group} request.group + * Required. The create request body. + * @param {string} request.requestId + * A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @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/vm_migration.create_group.js + * region_tag:vmmigration_v1_generated_VmMigration_CreateGroup_async + */ + createGroup( + request?: protos.google.cloud.vmmigration.v1.ICreateGroupRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.vmmigration.v1.IGroup, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + createGroup( + request: protos.google.cloud.vmmigration.v1.ICreateGroupRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.vmmigration.v1.IGroup, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createGroup( + request: protos.google.cloud.vmmigration.v1.ICreateGroupRequest, + callback: Callback< + LROperation< + protos.google.cloud.vmmigration.v1.IGroup, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createGroup( + request?: protos.google.cloud.vmmigration.v1.ICreateGroupRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.vmmigration.v1.IGroup, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.vmmigration.v1.IGroup, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.vmmigration.v1.IGroup, + protos.google.cloud.vmmigration.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.createGroup(request, options, callback); + } + /** + * Check the status of the long running operation returned by `createGroup()`. + * @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/vm_migration.create_group.js + * region_tag:vmmigration_v1_generated_VmMigration_CreateGroup_async + */ + async checkCreateGroupProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.vmmigration.v1.Group, + protos.google.cloud.vmmigration.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.createGroup, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.vmmigration.v1.Group, + protos.google.cloud.vmmigration.v1.OperationMetadata + >; + } + /** + * Updates the parameters of a single Group. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.protobuf.FieldMask} request.updateMask + * Field mask is used to specify the fields to be overwritten in the + * Group resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * @param {google.cloud.vmmigration.v1.Group} request.group + * Required. The update request body. + * @param {string} request.requestId + * A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @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/vm_migration.update_group.js + * region_tag:vmmigration_v1_generated_VmMigration_UpdateGroup_async + */ + updateGroup( + request?: protos.google.cloud.vmmigration.v1.IUpdateGroupRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.vmmigration.v1.IGroup, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + updateGroup( + request: protos.google.cloud.vmmigration.v1.IUpdateGroupRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.vmmigration.v1.IGroup, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateGroup( + request: protos.google.cloud.vmmigration.v1.IUpdateGroupRequest, + callback: Callback< + LROperation< + protos.google.cloud.vmmigration.v1.IGroup, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateGroup( + request?: protos.google.cloud.vmmigration.v1.IUpdateGroupRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.vmmigration.v1.IGroup, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.vmmigration.v1.IGroup, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.vmmigration.v1.IGroup, + protos.google.cloud.vmmigration.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({ + 'group.name': request.group!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateGroup(request, options, callback); + } + /** + * Check the status of the long running operation returned by `updateGroup()`. + * @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/vm_migration.update_group.js + * region_tag:vmmigration_v1_generated_VmMigration_UpdateGroup_async + */ + async checkUpdateGroupProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.vmmigration.v1.Group, + protos.google.cloud.vmmigration.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.updateGroup, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.vmmigration.v1.Group, + protos.google.cloud.vmmigration.v1.OperationMetadata + >; + } + /** + * Deletes a single Group. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The Group name. + * @param {string} [request.requestId] + * Optional. A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes after the first request. + * + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @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/vm_migration.delete_group.js + * region_tag:vmmigration_v1_generated_VmMigration_DeleteGroup_async + */ + deleteGroup( + request?: protos.google.cloud.vmmigration.v1.IDeleteGroupRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + deleteGroup( + request: protos.google.cloud.vmmigration.v1.IDeleteGroupRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteGroup( + request: protos.google.cloud.vmmigration.v1.IDeleteGroupRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteGroup( + request?: protos.google.cloud.vmmigration.v1.IDeleteGroupRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.vmmigration.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.deleteGroup(request, options, callback); + } + /** + * Check the status of the long running operation returned by `deleteGroup()`. + * @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/vm_migration.delete_group.js + * region_tag:vmmigration_v1_generated_VmMigration_DeleteGroup_async + */ + async checkDeleteGroupProgress( + name: string + ): Promise< + LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.vmmigration.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.deleteGroup, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.vmmigration.v1.OperationMetadata + >; + } + /** + * Adds a MigratingVm to a Group. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.group + * Required. The full path name of the Group to add to. + * @param {string} request.migratingVm + * The full path name of the MigratingVm to add. + * @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/vm_migration.add_group_migration.js + * region_tag:vmmigration_v1_generated_VmMigration_AddGroupMigration_async + */ + addGroupMigration( + request?: protos.google.cloud.vmmigration.v1.IAddGroupMigrationRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.vmmigration.v1.IAddGroupMigrationResponse, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + addGroupMigration( + request: protos.google.cloud.vmmigration.v1.IAddGroupMigrationRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.vmmigration.v1.IAddGroupMigrationResponse, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + addGroupMigration( + request: protos.google.cloud.vmmigration.v1.IAddGroupMigrationRequest, + callback: Callback< + LROperation< + protos.google.cloud.vmmigration.v1.IAddGroupMigrationResponse, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + addGroupMigration( + request?: protos.google.cloud.vmmigration.v1.IAddGroupMigrationRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.vmmigration.v1.IAddGroupMigrationResponse, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.vmmigration.v1.IAddGroupMigrationResponse, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.vmmigration.v1.IAddGroupMigrationResponse, + protos.google.cloud.vmmigration.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({ + group: request.group ?? '', + }); + this.initialize(); + return this.innerApiCalls.addGroupMigration(request, options, callback); + } + /** + * Check the status of the long running operation returned by `addGroupMigration()`. + * @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/vm_migration.add_group_migration.js + * region_tag:vmmigration_v1_generated_VmMigration_AddGroupMigration_async + */ + async checkAddGroupMigrationProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.vmmigration.v1.AddGroupMigrationResponse, + protos.google.cloud.vmmigration.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.addGroupMigration, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.vmmigration.v1.AddGroupMigrationResponse, + protos.google.cloud.vmmigration.v1.OperationMetadata + >; + } + /** + * Removes a MigratingVm from a Group. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.group + * Required. The name of the Group. + * @param {string} request.migratingVm + * The MigratingVm to remove. + * @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/vm_migration.remove_group_migration.js + * region_tag:vmmigration_v1_generated_VmMigration_RemoveGroupMigration_async + */ + removeGroupMigration( + request?: protos.google.cloud.vmmigration.v1.IRemoveGroupMigrationRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.vmmigration.v1.IRemoveGroupMigrationResponse, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + removeGroupMigration( + request: protos.google.cloud.vmmigration.v1.IRemoveGroupMigrationRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.vmmigration.v1.IRemoveGroupMigrationResponse, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + removeGroupMigration( + request: protos.google.cloud.vmmigration.v1.IRemoveGroupMigrationRequest, + callback: Callback< + LROperation< + protos.google.cloud.vmmigration.v1.IRemoveGroupMigrationResponse, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + removeGroupMigration( + request?: protos.google.cloud.vmmigration.v1.IRemoveGroupMigrationRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.vmmigration.v1.IRemoveGroupMigrationResponse, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.vmmigration.v1.IRemoveGroupMigrationResponse, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.vmmigration.v1.IRemoveGroupMigrationResponse, + protos.google.cloud.vmmigration.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({ + group: request.group ?? '', + }); + this.initialize(); + return this.innerApiCalls.removeGroupMigration(request, options, callback); + } + /** + * Check the status of the long running operation returned by `removeGroupMigration()`. + * @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/vm_migration.remove_group_migration.js + * region_tag:vmmigration_v1_generated_VmMigration_RemoveGroupMigration_async + */ + async checkRemoveGroupMigrationProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.vmmigration.v1.RemoveGroupMigrationResponse, + protos.google.cloud.vmmigration.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.removeGroupMigration, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.vmmigration.v1.RemoveGroupMigrationResponse, + protos.google.cloud.vmmigration.v1.OperationMetadata + >; + } + /** + * Creates a new TargetProject in a given project. + * + * NOTE: TargetProject is a global resource; hence the only supported value + * for location is `global`. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The TargetProject's parent. + * @param {string} request.targetProjectId + * Required. The target_project identifier. + * @param {google.cloud.vmmigration.v1.TargetProject} request.targetProject + * Required. The create request body. + * @param {string} request.requestId + * A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @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/vm_migration.create_target_project.js + * region_tag:vmmigration_v1_generated_VmMigration_CreateTargetProject_async + */ + createTargetProject( + request?: protos.google.cloud.vmmigration.v1.ICreateTargetProjectRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.vmmigration.v1.ITargetProject, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + createTargetProject( + request: protos.google.cloud.vmmigration.v1.ICreateTargetProjectRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.vmmigration.v1.ITargetProject, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createTargetProject( + request: protos.google.cloud.vmmigration.v1.ICreateTargetProjectRequest, + callback: Callback< + LROperation< + protos.google.cloud.vmmigration.v1.ITargetProject, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createTargetProject( + request?: protos.google.cloud.vmmigration.v1.ICreateTargetProjectRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.vmmigration.v1.ITargetProject, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.vmmigration.v1.ITargetProject, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.vmmigration.v1.ITargetProject, + protos.google.cloud.vmmigration.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.createTargetProject(request, options, callback); + } + /** + * Check the status of the long running operation returned by `createTargetProject()`. + * @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/vm_migration.create_target_project.js + * region_tag:vmmigration_v1_generated_VmMigration_CreateTargetProject_async + */ + async checkCreateTargetProjectProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.vmmigration.v1.TargetProject, + protos.google.cloud.vmmigration.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.createTargetProject, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.vmmigration.v1.TargetProject, + protos.google.cloud.vmmigration.v1.OperationMetadata + >; + } + /** + * Updates the parameters of a single TargetProject. + * + * NOTE: TargetProject is a global resource; hence the only supported value + * for location is `global`. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.protobuf.FieldMask} request.updateMask + * Field mask is used to specify the fields to be overwritten in the + * TargetProject resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * @param {google.cloud.vmmigration.v1.TargetProject} request.targetProject + * Required. The update request body. + * @param {string} request.requestId + * A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @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/vm_migration.update_target_project.js + * region_tag:vmmigration_v1_generated_VmMigration_UpdateTargetProject_async + */ + updateTargetProject( + request?: protos.google.cloud.vmmigration.v1.IUpdateTargetProjectRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.vmmigration.v1.ITargetProject, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + updateTargetProject( + request: protos.google.cloud.vmmigration.v1.IUpdateTargetProjectRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.vmmigration.v1.ITargetProject, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateTargetProject( + request: protos.google.cloud.vmmigration.v1.IUpdateTargetProjectRequest, + callback: Callback< + LROperation< + protos.google.cloud.vmmigration.v1.ITargetProject, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateTargetProject( + request?: protos.google.cloud.vmmigration.v1.IUpdateTargetProjectRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.vmmigration.v1.ITargetProject, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.vmmigration.v1.ITargetProject, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.vmmigration.v1.ITargetProject, + protos.google.cloud.vmmigration.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({ + 'target_project.name': request.targetProject!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateTargetProject(request, options, callback); + } + /** + * Check the status of the long running operation returned by `updateTargetProject()`. + * @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/vm_migration.update_target_project.js + * region_tag:vmmigration_v1_generated_VmMigration_UpdateTargetProject_async + */ + async checkUpdateTargetProjectProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.vmmigration.v1.TargetProject, + protos.google.cloud.vmmigration.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.updateTargetProject, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.vmmigration.v1.TargetProject, + protos.google.cloud.vmmigration.v1.OperationMetadata + >; + } + /** + * Deletes a single TargetProject. + * + * NOTE: TargetProject is a global resource; hence the only supported value + * for location is `global`. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The TargetProject name. + * @param {string} [request.requestId] + * Optional. A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes after the first request. + * + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @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/vm_migration.delete_target_project.js + * region_tag:vmmigration_v1_generated_VmMigration_DeleteTargetProject_async + */ + deleteTargetProject( + request?: protos.google.cloud.vmmigration.v1.IDeleteTargetProjectRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + deleteTargetProject( + request: protos.google.cloud.vmmigration.v1.IDeleteTargetProjectRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteTargetProject( + request: protos.google.cloud.vmmigration.v1.IDeleteTargetProjectRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteTargetProject( + request?: protos.google.cloud.vmmigration.v1.IDeleteTargetProjectRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.vmmigration.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.deleteTargetProject(request, options, callback); + } + /** + * Check the status of the long running operation returned by `deleteTargetProject()`. + * @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/vm_migration.delete_target_project.js + * region_tag:vmmigration_v1_generated_VmMigration_DeleteTargetProject_async + */ + async checkDeleteTargetProjectProgress( + name: string + ): Promise< + LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.vmmigration.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.deleteTargetProject, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.vmmigration.v1.OperationMetadata + >; + } + /** + * Lists Sources 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 sources. + * @param {number} [request.pageSize] + * Optional. The maximum number of sources to return. The service may return + * fewer than this value. If unspecified, at most 500 sources will be + * returned. The maximum value is 1000; values above 1000 will be coerced to + * 1000. + * @param {string} request.pageToken + * Required. A page token, received from a previous `ListSources` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListSources` must + * match the call that provided the page token. + * @param {string} [request.filter] + * Optional. The filter request. + * @param {string} [request.orderBy] + * Optional. 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 [Source]{@link google.cloud.vmmigration.v1.Source}. + * 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 `listSourcesAsync()` + * 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. + */ + listSources( + request?: protos.google.cloud.vmmigration.v1.IListSourcesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.vmmigration.v1.ISource[], + protos.google.cloud.vmmigration.v1.IListSourcesRequest | null, + protos.google.cloud.vmmigration.v1.IListSourcesResponse + ] + >; + listSources( + request: protos.google.cloud.vmmigration.v1.IListSourcesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.vmmigration.v1.IListSourcesRequest, + | protos.google.cloud.vmmigration.v1.IListSourcesResponse + | null + | undefined, + protos.google.cloud.vmmigration.v1.ISource + > + ): void; + listSources( + request: protos.google.cloud.vmmigration.v1.IListSourcesRequest, + callback: PaginationCallback< + protos.google.cloud.vmmigration.v1.IListSourcesRequest, + | protos.google.cloud.vmmigration.v1.IListSourcesResponse + | null + | undefined, + protos.google.cloud.vmmigration.v1.ISource + > + ): void; + listSources( + request?: protos.google.cloud.vmmigration.v1.IListSourcesRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.vmmigration.v1.IListSourcesRequest, + | protos.google.cloud.vmmigration.v1.IListSourcesResponse + | null + | undefined, + protos.google.cloud.vmmigration.v1.ISource + >, + callback?: PaginationCallback< + protos.google.cloud.vmmigration.v1.IListSourcesRequest, + | protos.google.cloud.vmmigration.v1.IListSourcesResponse + | null + | undefined, + protos.google.cloud.vmmigration.v1.ISource + > + ): Promise< + [ + protos.google.cloud.vmmigration.v1.ISource[], + protos.google.cloud.vmmigration.v1.IListSourcesRequest | null, + protos.google.cloud.vmmigration.v1.IListSourcesResponse + ] + > | 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.listSources(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 sources. + * @param {number} [request.pageSize] + * Optional. The maximum number of sources to return. The service may return + * fewer than this value. If unspecified, at most 500 sources will be + * returned. The maximum value is 1000; values above 1000 will be coerced to + * 1000. + * @param {string} request.pageToken + * Required. A page token, received from a previous `ListSources` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListSources` must + * match the call that provided the page token. + * @param {string} [request.filter] + * Optional. The filter request. + * @param {string} [request.orderBy] + * Optional. 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 [Source]{@link google.cloud.vmmigration.v1.Source} 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 `listSourcesAsync()` + * 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. + */ + listSourcesStream( + request?: protos.google.cloud.vmmigration.v1.IListSourcesRequest, + 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['listSources']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listSources.createStream( + this.innerApiCalls.listSources as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listSources`, 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 sources. + * @param {number} [request.pageSize] + * Optional. The maximum number of sources to return. The service may return + * fewer than this value. If unspecified, at most 500 sources will be + * returned. The maximum value is 1000; values above 1000 will be coerced to + * 1000. + * @param {string} request.pageToken + * Required. A page token, received from a previous `ListSources` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListSources` must + * match the call that provided the page token. + * @param {string} [request.filter] + * Optional. The filter request. + * @param {string} [request.orderBy] + * Optional. 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 + * [Source]{@link google.cloud.vmmigration.v1.Source}. 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/vm_migration.list_sources.js + * region_tag:vmmigration_v1_generated_VmMigration_ListSources_async + */ + listSourcesAsync( + request?: protos.google.cloud.vmmigration.v1.IListSourcesRequest, + 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['listSources']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listSources.asyncIterate( + this.innerApiCalls['listSources'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists Utilization Reports of the given Source. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The Utilization Reports parent. + * @param {google.cloud.vmmigration.v1.UtilizationReportView} [request.view] + * Optional. The level of details of each report. + * Defaults to BASIC. + * @param {number} [request.pageSize] + * Optional. The maximum number of reports to return. The service may return + * fewer than this value. If unspecified, at most 500 reports will be + * returned. The maximum value is 1000; values above 1000 will be coerced to + * 1000. + * @param {string} request.pageToken + * Required. A page token, received from a previous `ListUtilizationReports` + * call. Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListUtilizationReports` + * must match the call that provided the page token. + * @param {string} [request.filter] + * Optional. The filter request. + * @param {string} [request.orderBy] + * Optional. 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 [UtilizationReport]{@link google.cloud.vmmigration.v1.UtilizationReport}. + * 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 `listUtilizationReportsAsync()` + * 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. + */ + listUtilizationReports( + request?: protos.google.cloud.vmmigration.v1.IListUtilizationReportsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.vmmigration.v1.IUtilizationReport[], + protos.google.cloud.vmmigration.v1.IListUtilizationReportsRequest | null, + protos.google.cloud.vmmigration.v1.IListUtilizationReportsResponse + ] + >; + listUtilizationReports( + request: protos.google.cloud.vmmigration.v1.IListUtilizationReportsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.vmmigration.v1.IListUtilizationReportsRequest, + | protos.google.cloud.vmmigration.v1.IListUtilizationReportsResponse + | null + | undefined, + protos.google.cloud.vmmigration.v1.IUtilizationReport + > + ): void; + listUtilizationReports( + request: protos.google.cloud.vmmigration.v1.IListUtilizationReportsRequest, + callback: PaginationCallback< + protos.google.cloud.vmmigration.v1.IListUtilizationReportsRequest, + | protos.google.cloud.vmmigration.v1.IListUtilizationReportsResponse + | null + | undefined, + protos.google.cloud.vmmigration.v1.IUtilizationReport + > + ): void; + listUtilizationReports( + request?: protos.google.cloud.vmmigration.v1.IListUtilizationReportsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.vmmigration.v1.IListUtilizationReportsRequest, + | protos.google.cloud.vmmigration.v1.IListUtilizationReportsResponse + | null + | undefined, + protos.google.cloud.vmmigration.v1.IUtilizationReport + >, + callback?: PaginationCallback< + protos.google.cloud.vmmigration.v1.IListUtilizationReportsRequest, + | protos.google.cloud.vmmigration.v1.IListUtilizationReportsResponse + | null + | undefined, + protos.google.cloud.vmmigration.v1.IUtilizationReport + > + ): Promise< + [ + protos.google.cloud.vmmigration.v1.IUtilizationReport[], + protos.google.cloud.vmmigration.v1.IListUtilizationReportsRequest | null, + protos.google.cloud.vmmigration.v1.IListUtilizationReportsResponse + ] + > | 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.listUtilizationReports( + 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 Utilization Reports parent. + * @param {google.cloud.vmmigration.v1.UtilizationReportView} [request.view] + * Optional. The level of details of each report. + * Defaults to BASIC. + * @param {number} [request.pageSize] + * Optional. The maximum number of reports to return. The service may return + * fewer than this value. If unspecified, at most 500 reports will be + * returned. The maximum value is 1000; values above 1000 will be coerced to + * 1000. + * @param {string} request.pageToken + * Required. A page token, received from a previous `ListUtilizationReports` + * call. Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListUtilizationReports` + * must match the call that provided the page token. + * @param {string} [request.filter] + * Optional. The filter request. + * @param {string} [request.orderBy] + * Optional. 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 [UtilizationReport]{@link google.cloud.vmmigration.v1.UtilizationReport} 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 `listUtilizationReportsAsync()` + * 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. + */ + listUtilizationReportsStream( + request?: protos.google.cloud.vmmigration.v1.IListUtilizationReportsRequest, + 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['listUtilizationReports']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listUtilizationReports.createStream( + this.innerApiCalls.listUtilizationReports as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listUtilizationReports`, 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 Utilization Reports parent. + * @param {google.cloud.vmmigration.v1.UtilizationReportView} [request.view] + * Optional. The level of details of each report. + * Defaults to BASIC. + * @param {number} [request.pageSize] + * Optional. The maximum number of reports to return. The service may return + * fewer than this value. If unspecified, at most 500 reports will be + * returned. The maximum value is 1000; values above 1000 will be coerced to + * 1000. + * @param {string} request.pageToken + * Required. A page token, received from a previous `ListUtilizationReports` + * call. Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListUtilizationReports` + * must match the call that provided the page token. + * @param {string} [request.filter] + * Optional. The filter request. + * @param {string} [request.orderBy] + * Optional. 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 + * [UtilizationReport]{@link google.cloud.vmmigration.v1.UtilizationReport}. 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/vm_migration.list_utilization_reports.js + * region_tag:vmmigration_v1_generated_VmMigration_ListUtilizationReports_async + */ + listUtilizationReportsAsync( + request?: protos.google.cloud.vmmigration.v1.IListUtilizationReportsRequest, + 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['listUtilizationReports']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listUtilizationReports.asyncIterate( + this.innerApiCalls['listUtilizationReports'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists DatacenterConnectors in a given Source. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of connectors. + * @param {number} [request.pageSize] + * Optional. The maximum number of connectors to return. The service may + * return fewer than this value. If unspecified, at most 500 sources will be + * returned. The maximum value is 1000; values above 1000 will be coerced to + * 1000. + * @param {string} request.pageToken + * Required. A page token, received from a previous `ListDatacenterConnectors` + * call. Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to + * `ListDatacenterConnectors` must match the call that provided the page + * token. + * @param {string} [request.filter] + * Optional. The filter request. + * @param {string} [request.orderBy] + * Optional. 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 [DatacenterConnector]{@link google.cloud.vmmigration.v1.DatacenterConnector}. + * 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 `listDatacenterConnectorsAsync()` + * 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. + */ + listDatacenterConnectors( + request?: protos.google.cloud.vmmigration.v1.IListDatacenterConnectorsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.vmmigration.v1.IDatacenterConnector[], + protos.google.cloud.vmmigration.v1.IListDatacenterConnectorsRequest | null, + protos.google.cloud.vmmigration.v1.IListDatacenterConnectorsResponse + ] + >; + listDatacenterConnectors( + request: protos.google.cloud.vmmigration.v1.IListDatacenterConnectorsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.vmmigration.v1.IListDatacenterConnectorsRequest, + | protos.google.cloud.vmmigration.v1.IListDatacenterConnectorsResponse + | null + | undefined, + protos.google.cloud.vmmigration.v1.IDatacenterConnector + > + ): void; + listDatacenterConnectors( + request: protos.google.cloud.vmmigration.v1.IListDatacenterConnectorsRequest, + callback: PaginationCallback< + protos.google.cloud.vmmigration.v1.IListDatacenterConnectorsRequest, + | protos.google.cloud.vmmigration.v1.IListDatacenterConnectorsResponse + | null + | undefined, + protos.google.cloud.vmmigration.v1.IDatacenterConnector + > + ): void; + listDatacenterConnectors( + request?: protos.google.cloud.vmmigration.v1.IListDatacenterConnectorsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.vmmigration.v1.IListDatacenterConnectorsRequest, + | protos.google.cloud.vmmigration.v1.IListDatacenterConnectorsResponse + | null + | undefined, + protos.google.cloud.vmmigration.v1.IDatacenterConnector + >, + callback?: PaginationCallback< + protos.google.cloud.vmmigration.v1.IListDatacenterConnectorsRequest, + | protos.google.cloud.vmmigration.v1.IListDatacenterConnectorsResponse + | null + | undefined, + protos.google.cloud.vmmigration.v1.IDatacenterConnector + > + ): Promise< + [ + protos.google.cloud.vmmigration.v1.IDatacenterConnector[], + protos.google.cloud.vmmigration.v1.IListDatacenterConnectorsRequest | null, + protos.google.cloud.vmmigration.v1.IListDatacenterConnectorsResponse + ] + > | 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.listDatacenterConnectors( + 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 connectors. + * @param {number} [request.pageSize] + * Optional. The maximum number of connectors to return. The service may + * return fewer than this value. If unspecified, at most 500 sources will be + * returned. The maximum value is 1000; values above 1000 will be coerced to + * 1000. + * @param {string} request.pageToken + * Required. A page token, received from a previous `ListDatacenterConnectors` + * call. Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to + * `ListDatacenterConnectors` must match the call that provided the page + * token. + * @param {string} [request.filter] + * Optional. The filter request. + * @param {string} [request.orderBy] + * Optional. 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 [DatacenterConnector]{@link google.cloud.vmmigration.v1.DatacenterConnector} 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 `listDatacenterConnectorsAsync()` + * 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. + */ + listDatacenterConnectorsStream( + request?: protos.google.cloud.vmmigration.v1.IListDatacenterConnectorsRequest, + 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['listDatacenterConnectors']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listDatacenterConnectors.createStream( + this.innerApiCalls.listDatacenterConnectors as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listDatacenterConnectors`, 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 connectors. + * @param {number} [request.pageSize] + * Optional. The maximum number of connectors to return. The service may + * return fewer than this value. If unspecified, at most 500 sources will be + * returned. The maximum value is 1000; values above 1000 will be coerced to + * 1000. + * @param {string} request.pageToken + * Required. A page token, received from a previous `ListDatacenterConnectors` + * call. Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to + * `ListDatacenterConnectors` must match the call that provided the page + * token. + * @param {string} [request.filter] + * Optional. The filter request. + * @param {string} [request.orderBy] + * Optional. 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 + * [DatacenterConnector]{@link google.cloud.vmmigration.v1.DatacenterConnector}. 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/vm_migration.list_datacenter_connectors.js + * region_tag:vmmigration_v1_generated_VmMigration_ListDatacenterConnectors_async + */ + listDatacenterConnectorsAsync( + request?: protos.google.cloud.vmmigration.v1.IListDatacenterConnectorsRequest, + 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['listDatacenterConnectors']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listDatacenterConnectors.asyncIterate( + this.innerApiCalls['listDatacenterConnectors'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists MigratingVms in a given Source. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of MigratingVms. + * @param {number} [request.pageSize] + * Optional. The maximum number of migrating VMs to return. The service may + * return fewer than this value. If unspecified, at most 500 migrating VMs + * will be returned. The maximum value is 1000; values above 1000 will be + * coerced to 1000. + * @param {string} request.pageToken + * Required. A page token, received from a previous `ListMigratingVms` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListMigratingVms` + * must match the call that provided the page token. + * @param {string} [request.filter] + * Optional. The filter request. + * @param {string} [request.orderBy] + * Optional. the order by fields for the result. + * @param {google.cloud.vmmigration.v1.MigratingVmView} [request.view] + * Optional. The level of details of each migrating VM. + * @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 [MigratingVm]{@link google.cloud.vmmigration.v1.MigratingVm}. + * 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 `listMigratingVmsAsync()` + * 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. + */ + listMigratingVms( + request?: protos.google.cloud.vmmigration.v1.IListMigratingVmsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.vmmigration.v1.IMigratingVm[], + protos.google.cloud.vmmigration.v1.IListMigratingVmsRequest | null, + protos.google.cloud.vmmigration.v1.IListMigratingVmsResponse + ] + >; + listMigratingVms( + request: protos.google.cloud.vmmigration.v1.IListMigratingVmsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.vmmigration.v1.IListMigratingVmsRequest, + | protos.google.cloud.vmmigration.v1.IListMigratingVmsResponse + | null + | undefined, + protos.google.cloud.vmmigration.v1.IMigratingVm + > + ): void; + listMigratingVms( + request: protos.google.cloud.vmmigration.v1.IListMigratingVmsRequest, + callback: PaginationCallback< + protos.google.cloud.vmmigration.v1.IListMigratingVmsRequest, + | protos.google.cloud.vmmigration.v1.IListMigratingVmsResponse + | null + | undefined, + protos.google.cloud.vmmigration.v1.IMigratingVm + > + ): void; + listMigratingVms( + request?: protos.google.cloud.vmmigration.v1.IListMigratingVmsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.vmmigration.v1.IListMigratingVmsRequest, + | protos.google.cloud.vmmigration.v1.IListMigratingVmsResponse + | null + | undefined, + protos.google.cloud.vmmigration.v1.IMigratingVm + >, + callback?: PaginationCallback< + protos.google.cloud.vmmigration.v1.IListMigratingVmsRequest, + | protos.google.cloud.vmmigration.v1.IListMigratingVmsResponse + | null + | undefined, + protos.google.cloud.vmmigration.v1.IMigratingVm + > + ): Promise< + [ + protos.google.cloud.vmmigration.v1.IMigratingVm[], + protos.google.cloud.vmmigration.v1.IListMigratingVmsRequest | null, + protos.google.cloud.vmmigration.v1.IListMigratingVmsResponse + ] + > | 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.listMigratingVms(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 MigratingVms. + * @param {number} [request.pageSize] + * Optional. The maximum number of migrating VMs to return. The service may + * return fewer than this value. If unspecified, at most 500 migrating VMs + * will be returned. The maximum value is 1000; values above 1000 will be + * coerced to 1000. + * @param {string} request.pageToken + * Required. A page token, received from a previous `ListMigratingVms` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListMigratingVms` + * must match the call that provided the page token. + * @param {string} [request.filter] + * Optional. The filter request. + * @param {string} [request.orderBy] + * Optional. the order by fields for the result. + * @param {google.cloud.vmmigration.v1.MigratingVmView} [request.view] + * Optional. The level of details of each migrating VM. + * @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 [MigratingVm]{@link google.cloud.vmmigration.v1.MigratingVm} 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 `listMigratingVmsAsync()` + * 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. + */ + listMigratingVmsStream( + request?: protos.google.cloud.vmmigration.v1.IListMigratingVmsRequest, + 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['listMigratingVms']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listMigratingVms.createStream( + this.innerApiCalls.listMigratingVms as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listMigratingVms`, 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 MigratingVms. + * @param {number} [request.pageSize] + * Optional. The maximum number of migrating VMs to return. The service may + * return fewer than this value. If unspecified, at most 500 migrating VMs + * will be returned. The maximum value is 1000; values above 1000 will be + * coerced to 1000. + * @param {string} request.pageToken + * Required. A page token, received from a previous `ListMigratingVms` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListMigratingVms` + * must match the call that provided the page token. + * @param {string} [request.filter] + * Optional. The filter request. + * @param {string} [request.orderBy] + * Optional. the order by fields for the result. + * @param {google.cloud.vmmigration.v1.MigratingVmView} [request.view] + * Optional. The level of details of each migrating VM. + * @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 + * [MigratingVm]{@link google.cloud.vmmigration.v1.MigratingVm}. 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/vm_migration.list_migrating_vms.js + * region_tag:vmmigration_v1_generated_VmMigration_ListMigratingVms_async + */ + listMigratingVmsAsync( + request?: protos.google.cloud.vmmigration.v1.IListMigratingVmsRequest, + 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['listMigratingVms']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listMigratingVms.asyncIterate( + this.innerApiCalls['listMigratingVms'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists CloneJobs of a given migrating VM. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of source VMs. + * @param {number} [request.pageSize] + * Optional. The maximum number of clone jobs to return. The service may + * return fewer than this value. If unspecified, at most 500 clone jobs will + * be returned. The maximum value is 1000; values above 1000 will be coerced + * to 1000. + * @param {string} request.pageToken + * Required. A page token, received from a previous `ListCloneJobs` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListCloneJobs` must + * match the call that provided the page token. + * @param {string} [request.filter] + * Optional. The filter request. + * @param {string} [request.orderBy] + * Optional. 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 [CloneJob]{@link google.cloud.vmmigration.v1.CloneJob}. + * 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 `listCloneJobsAsync()` + * 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. + */ + listCloneJobs( + request?: protos.google.cloud.vmmigration.v1.IListCloneJobsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.vmmigration.v1.ICloneJob[], + protos.google.cloud.vmmigration.v1.IListCloneJobsRequest | null, + protos.google.cloud.vmmigration.v1.IListCloneJobsResponse + ] + >; + listCloneJobs( + request: protos.google.cloud.vmmigration.v1.IListCloneJobsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.vmmigration.v1.IListCloneJobsRequest, + | protos.google.cloud.vmmigration.v1.IListCloneJobsResponse + | null + | undefined, + protos.google.cloud.vmmigration.v1.ICloneJob + > + ): void; + listCloneJobs( + request: protos.google.cloud.vmmigration.v1.IListCloneJobsRequest, + callback: PaginationCallback< + protos.google.cloud.vmmigration.v1.IListCloneJobsRequest, + | protos.google.cloud.vmmigration.v1.IListCloneJobsResponse + | null + | undefined, + protos.google.cloud.vmmigration.v1.ICloneJob + > + ): void; + listCloneJobs( + request?: protos.google.cloud.vmmigration.v1.IListCloneJobsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.vmmigration.v1.IListCloneJobsRequest, + | protos.google.cloud.vmmigration.v1.IListCloneJobsResponse + | null + | undefined, + protos.google.cloud.vmmigration.v1.ICloneJob + >, + callback?: PaginationCallback< + protos.google.cloud.vmmigration.v1.IListCloneJobsRequest, + | protos.google.cloud.vmmigration.v1.IListCloneJobsResponse + | null + | undefined, + protos.google.cloud.vmmigration.v1.ICloneJob + > + ): Promise< + [ + protos.google.cloud.vmmigration.v1.ICloneJob[], + protos.google.cloud.vmmigration.v1.IListCloneJobsRequest | null, + protos.google.cloud.vmmigration.v1.IListCloneJobsResponse + ] + > | 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.listCloneJobs(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 source VMs. + * @param {number} [request.pageSize] + * Optional. The maximum number of clone jobs to return. The service may + * return fewer than this value. If unspecified, at most 500 clone jobs will + * be returned. The maximum value is 1000; values above 1000 will be coerced + * to 1000. + * @param {string} request.pageToken + * Required. A page token, received from a previous `ListCloneJobs` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListCloneJobs` must + * match the call that provided the page token. + * @param {string} [request.filter] + * Optional. The filter request. + * @param {string} [request.orderBy] + * Optional. 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 [CloneJob]{@link google.cloud.vmmigration.v1.CloneJob} 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 `listCloneJobsAsync()` + * 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. + */ + listCloneJobsStream( + request?: protos.google.cloud.vmmigration.v1.IListCloneJobsRequest, + 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['listCloneJobs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listCloneJobs.createStream( + this.innerApiCalls.listCloneJobs as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listCloneJobs`, 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 source VMs. + * @param {number} [request.pageSize] + * Optional. The maximum number of clone jobs to return. The service may + * return fewer than this value. If unspecified, at most 500 clone jobs will + * be returned. The maximum value is 1000; values above 1000 will be coerced + * to 1000. + * @param {string} request.pageToken + * Required. A page token, received from a previous `ListCloneJobs` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListCloneJobs` must + * match the call that provided the page token. + * @param {string} [request.filter] + * Optional. The filter request. + * @param {string} [request.orderBy] + * Optional. 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 + * [CloneJob]{@link google.cloud.vmmigration.v1.CloneJob}. 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/vm_migration.list_clone_jobs.js + * region_tag:vmmigration_v1_generated_VmMigration_ListCloneJobs_async + */ + listCloneJobsAsync( + request?: protos.google.cloud.vmmigration.v1.IListCloneJobsRequest, + 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['listCloneJobs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listCloneJobs.asyncIterate( + this.innerApiCalls['listCloneJobs'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists CutoverJobs of a given migrating VM. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of migrating VMs. + * @param {number} [request.pageSize] + * Optional. The maximum number of cutover jobs to return. The service may + * return fewer than this value. If unspecified, at most 500 cutover jobs will + * be returned. The maximum value is 1000; values above 1000 will be coerced + * to 1000. + * @param {string} request.pageToken + * Required. A page token, received from a previous `ListCutoverJobs` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListCutoverJobs` must + * match the call that provided the page token. + * @param {string} [request.filter] + * Optional. The filter request. + * @param {string} [request.orderBy] + * Optional. 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 [CutoverJob]{@link google.cloud.vmmigration.v1.CutoverJob}. + * 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 `listCutoverJobsAsync()` + * 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. + */ + listCutoverJobs( + request?: protos.google.cloud.vmmigration.v1.IListCutoverJobsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.vmmigration.v1.ICutoverJob[], + protos.google.cloud.vmmigration.v1.IListCutoverJobsRequest | null, + protos.google.cloud.vmmigration.v1.IListCutoverJobsResponse + ] + >; + listCutoverJobs( + request: protos.google.cloud.vmmigration.v1.IListCutoverJobsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.vmmigration.v1.IListCutoverJobsRequest, + | protos.google.cloud.vmmigration.v1.IListCutoverJobsResponse + | null + | undefined, + protos.google.cloud.vmmigration.v1.ICutoverJob + > + ): void; + listCutoverJobs( + request: protos.google.cloud.vmmigration.v1.IListCutoverJobsRequest, + callback: PaginationCallback< + protos.google.cloud.vmmigration.v1.IListCutoverJobsRequest, + | protos.google.cloud.vmmigration.v1.IListCutoverJobsResponse + | null + | undefined, + protos.google.cloud.vmmigration.v1.ICutoverJob + > + ): void; + listCutoverJobs( + request?: protos.google.cloud.vmmigration.v1.IListCutoverJobsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.vmmigration.v1.IListCutoverJobsRequest, + | protos.google.cloud.vmmigration.v1.IListCutoverJobsResponse + | null + | undefined, + protos.google.cloud.vmmigration.v1.ICutoverJob + >, + callback?: PaginationCallback< + protos.google.cloud.vmmigration.v1.IListCutoverJobsRequest, + | protos.google.cloud.vmmigration.v1.IListCutoverJobsResponse + | null + | undefined, + protos.google.cloud.vmmigration.v1.ICutoverJob + > + ): Promise< + [ + protos.google.cloud.vmmigration.v1.ICutoverJob[], + protos.google.cloud.vmmigration.v1.IListCutoverJobsRequest | null, + protos.google.cloud.vmmigration.v1.IListCutoverJobsResponse + ] + > | 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.listCutoverJobs(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 migrating VMs. + * @param {number} [request.pageSize] + * Optional. The maximum number of cutover jobs to return. The service may + * return fewer than this value. If unspecified, at most 500 cutover jobs will + * be returned. The maximum value is 1000; values above 1000 will be coerced + * to 1000. + * @param {string} request.pageToken + * Required. A page token, received from a previous `ListCutoverJobs` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListCutoverJobs` must + * match the call that provided the page token. + * @param {string} [request.filter] + * Optional. The filter request. + * @param {string} [request.orderBy] + * Optional. 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 [CutoverJob]{@link google.cloud.vmmigration.v1.CutoverJob} 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 `listCutoverJobsAsync()` + * 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. + */ + listCutoverJobsStream( + request?: protos.google.cloud.vmmigration.v1.IListCutoverJobsRequest, + 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['listCutoverJobs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listCutoverJobs.createStream( + this.innerApiCalls.listCutoverJobs as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listCutoverJobs`, 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 migrating VMs. + * @param {number} [request.pageSize] + * Optional. The maximum number of cutover jobs to return. The service may + * return fewer than this value. If unspecified, at most 500 cutover jobs will + * be returned. The maximum value is 1000; values above 1000 will be coerced + * to 1000. + * @param {string} request.pageToken + * Required. A page token, received from a previous `ListCutoverJobs` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListCutoverJobs` must + * match the call that provided the page token. + * @param {string} [request.filter] + * Optional. The filter request. + * @param {string} [request.orderBy] + * Optional. 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 + * [CutoverJob]{@link google.cloud.vmmigration.v1.CutoverJob}. 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/vm_migration.list_cutover_jobs.js + * region_tag:vmmigration_v1_generated_VmMigration_ListCutoverJobs_async + */ + listCutoverJobsAsync( + request?: protos.google.cloud.vmmigration.v1.IListCutoverJobsRequest, + 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['listCutoverJobs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listCutoverJobs.asyncIterate( + this.innerApiCalls['listCutoverJobs'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists Groups 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 groups. + * @param {number} [request.pageSize] + * Optional. The maximum number of groups to return. The service may return + * fewer than this value. If unspecified, at most 500 groups will be + * returned. The maximum value is 1000; values above 1000 will be coerced to + * 1000. + * @param {string} request.pageToken + * Required. A page token, received from a previous `ListGroups` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListGroups` must + * match the call that provided the page token. + * @param {string} [request.filter] + * Optional. The filter request. + * @param {string} [request.orderBy] + * Optional. 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 [Group]{@link google.cloud.vmmigration.v1.Group}. + * 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 `listGroupsAsync()` + * 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. + */ + listGroups( + request?: protos.google.cloud.vmmigration.v1.IListGroupsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.vmmigration.v1.IGroup[], + protos.google.cloud.vmmigration.v1.IListGroupsRequest | null, + protos.google.cloud.vmmigration.v1.IListGroupsResponse + ] + >; + listGroups( + request: protos.google.cloud.vmmigration.v1.IListGroupsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.vmmigration.v1.IListGroupsRequest, + protos.google.cloud.vmmigration.v1.IListGroupsResponse | null | undefined, + protos.google.cloud.vmmigration.v1.IGroup + > + ): void; + listGroups( + request: protos.google.cloud.vmmigration.v1.IListGroupsRequest, + callback: PaginationCallback< + protos.google.cloud.vmmigration.v1.IListGroupsRequest, + protos.google.cloud.vmmigration.v1.IListGroupsResponse | null | undefined, + protos.google.cloud.vmmigration.v1.IGroup + > + ): void; + listGroups( + request?: protos.google.cloud.vmmigration.v1.IListGroupsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.vmmigration.v1.IListGroupsRequest, + | protos.google.cloud.vmmigration.v1.IListGroupsResponse + | null + | undefined, + protos.google.cloud.vmmigration.v1.IGroup + >, + callback?: PaginationCallback< + protos.google.cloud.vmmigration.v1.IListGroupsRequest, + protos.google.cloud.vmmigration.v1.IListGroupsResponse | null | undefined, + protos.google.cloud.vmmigration.v1.IGroup + > + ): Promise< + [ + protos.google.cloud.vmmigration.v1.IGroup[], + protos.google.cloud.vmmigration.v1.IListGroupsRequest | null, + protos.google.cloud.vmmigration.v1.IListGroupsResponse + ] + > | 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.listGroups(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 groups. + * @param {number} [request.pageSize] + * Optional. The maximum number of groups to return. The service may return + * fewer than this value. If unspecified, at most 500 groups will be + * returned. The maximum value is 1000; values above 1000 will be coerced to + * 1000. + * @param {string} request.pageToken + * Required. A page token, received from a previous `ListGroups` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListGroups` must + * match the call that provided the page token. + * @param {string} [request.filter] + * Optional. The filter request. + * @param {string} [request.orderBy] + * Optional. 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 [Group]{@link google.cloud.vmmigration.v1.Group} 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 `listGroupsAsync()` + * 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. + */ + listGroupsStream( + request?: protos.google.cloud.vmmigration.v1.IListGroupsRequest, + 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['listGroups']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listGroups.createStream( + this.innerApiCalls.listGroups as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listGroups`, 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 groups. + * @param {number} [request.pageSize] + * Optional. The maximum number of groups to return. The service may return + * fewer than this value. If unspecified, at most 500 groups will be + * returned. The maximum value is 1000; values above 1000 will be coerced to + * 1000. + * @param {string} request.pageToken + * Required. A page token, received from a previous `ListGroups` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListGroups` must + * match the call that provided the page token. + * @param {string} [request.filter] + * Optional. The filter request. + * @param {string} [request.orderBy] + * Optional. 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 + * [Group]{@link google.cloud.vmmigration.v1.Group}. 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/vm_migration.list_groups.js + * region_tag:vmmigration_v1_generated_VmMigration_ListGroups_async + */ + listGroupsAsync( + request?: protos.google.cloud.vmmigration.v1.IListGroupsRequest, + 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['listGroups']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listGroups.asyncIterate( + this.innerApiCalls['listGroups'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists TargetProjects in a given project. + * + * NOTE: TargetProject is a global resource; hence the only supported value + * for location is `global`. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of targets. + * @param {number} [request.pageSize] + * Optional. The maximum number of targets to return. The service may return + * fewer than this value. If unspecified, at most 500 targets will be + * returned. The maximum value is 1000; values above 1000 will be coerced to + * 1000. + * @param {string} request.pageToken + * Required. A page token, received from a previous `ListTargets` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListTargets` must + * match the call that provided the page token. + * @param {string} [request.filter] + * Optional. The filter request. + * @param {string} [request.orderBy] + * Optional. 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 [TargetProject]{@link google.cloud.vmmigration.v1.TargetProject}. + * 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 `listTargetProjectsAsync()` + * 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. + */ + listTargetProjects( + request?: protos.google.cloud.vmmigration.v1.IListTargetProjectsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.vmmigration.v1.ITargetProject[], + protos.google.cloud.vmmigration.v1.IListTargetProjectsRequest | null, + protos.google.cloud.vmmigration.v1.IListTargetProjectsResponse + ] + >; + listTargetProjects( + request: protos.google.cloud.vmmigration.v1.IListTargetProjectsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.vmmigration.v1.IListTargetProjectsRequest, + | protos.google.cloud.vmmigration.v1.IListTargetProjectsResponse + | null + | undefined, + protos.google.cloud.vmmigration.v1.ITargetProject + > + ): void; + listTargetProjects( + request: protos.google.cloud.vmmigration.v1.IListTargetProjectsRequest, + callback: PaginationCallback< + protos.google.cloud.vmmigration.v1.IListTargetProjectsRequest, + | protos.google.cloud.vmmigration.v1.IListTargetProjectsResponse + | null + | undefined, + protos.google.cloud.vmmigration.v1.ITargetProject + > + ): void; + listTargetProjects( + request?: protos.google.cloud.vmmigration.v1.IListTargetProjectsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.vmmigration.v1.IListTargetProjectsRequest, + | protos.google.cloud.vmmigration.v1.IListTargetProjectsResponse + | null + | undefined, + protos.google.cloud.vmmigration.v1.ITargetProject + >, + callback?: PaginationCallback< + protos.google.cloud.vmmigration.v1.IListTargetProjectsRequest, + | protos.google.cloud.vmmigration.v1.IListTargetProjectsResponse + | null + | undefined, + protos.google.cloud.vmmigration.v1.ITargetProject + > + ): Promise< + [ + protos.google.cloud.vmmigration.v1.ITargetProject[], + protos.google.cloud.vmmigration.v1.IListTargetProjectsRequest | null, + protos.google.cloud.vmmigration.v1.IListTargetProjectsResponse + ] + > | 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.listTargetProjects(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 targets. + * @param {number} [request.pageSize] + * Optional. The maximum number of targets to return. The service may return + * fewer than this value. If unspecified, at most 500 targets will be + * returned. The maximum value is 1000; values above 1000 will be coerced to + * 1000. + * @param {string} request.pageToken + * Required. A page token, received from a previous `ListTargets` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListTargets` must + * match the call that provided the page token. + * @param {string} [request.filter] + * Optional. The filter request. + * @param {string} [request.orderBy] + * Optional. 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 [TargetProject]{@link google.cloud.vmmigration.v1.TargetProject} 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 `listTargetProjectsAsync()` + * 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. + */ + listTargetProjectsStream( + request?: protos.google.cloud.vmmigration.v1.IListTargetProjectsRequest, + 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['listTargetProjects']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listTargetProjects.createStream( + this.innerApiCalls.listTargetProjects as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listTargetProjects`, 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 targets. + * @param {number} [request.pageSize] + * Optional. The maximum number of targets to return. The service may return + * fewer than this value. If unspecified, at most 500 targets will be + * returned. The maximum value is 1000; values above 1000 will be coerced to + * 1000. + * @param {string} request.pageToken + * Required. A page token, received from a previous `ListTargets` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListTargets` must + * match the call that provided the page token. + * @param {string} [request.filter] + * Optional. The filter request. + * @param {string} [request.orderBy] + * Optional. 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 + * [TargetProject]{@link google.cloud.vmmigration.v1.TargetProject}. 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/vm_migration.list_target_projects.js + * region_tag:vmmigration_v1_generated_VmMigration_ListTargetProjects_async + */ + listTargetProjectsAsync( + request?: protos.google.cloud.vmmigration.v1.IListTargetProjectsRequest, + 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['listTargetProjects']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listTargetProjects.asyncIterate( + this.innerApiCalls['listTargetProjects'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified cloneJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} source + * @param {string} migrating_vm + * @param {string} clone_job + * @returns {string} Resource name string. + */ + cloneJobPath( + project: string, + location: string, + source: string, + migratingVm: string, + cloneJob: string + ) { + return this.pathTemplates.cloneJobPathTemplate.render({ + project: project, + location: location, + source: source, + migrating_vm: migratingVm, + clone_job: cloneJob, + }); + } + + /** + * Parse the project from CloneJob resource. + * + * @param {string} cloneJobName + * A fully-qualified path representing CloneJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromCloneJobName(cloneJobName: string) { + return this.pathTemplates.cloneJobPathTemplate.match(cloneJobName).project; + } + + /** + * Parse the location from CloneJob resource. + * + * @param {string} cloneJobName + * A fully-qualified path representing CloneJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromCloneJobName(cloneJobName: string) { + return this.pathTemplates.cloneJobPathTemplate.match(cloneJobName).location; + } + + /** + * Parse the source from CloneJob resource. + * + * @param {string} cloneJobName + * A fully-qualified path representing CloneJob resource. + * @returns {string} A string representing the source. + */ + matchSourceFromCloneJobName(cloneJobName: string) { + return this.pathTemplates.cloneJobPathTemplate.match(cloneJobName).source; + } + + /** + * Parse the migrating_vm from CloneJob resource. + * + * @param {string} cloneJobName + * A fully-qualified path representing CloneJob resource. + * @returns {string} A string representing the migrating_vm. + */ + matchMigratingVmFromCloneJobName(cloneJobName: string) { + return this.pathTemplates.cloneJobPathTemplate.match(cloneJobName) + .migrating_vm; + } + + /** + * Parse the clone_job from CloneJob resource. + * + * @param {string} cloneJobName + * A fully-qualified path representing CloneJob resource. + * @returns {string} A string representing the clone_job. + */ + matchCloneJobFromCloneJobName(cloneJobName: string) { + return this.pathTemplates.cloneJobPathTemplate.match(cloneJobName) + .clone_job; + } + + /** + * Return a fully-qualified cutoverJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} source + * @param {string} migrating_vm + * @param {string} cutover_job + * @returns {string} Resource name string. + */ + cutoverJobPath( + project: string, + location: string, + source: string, + migratingVm: string, + cutoverJob: string + ) { + return this.pathTemplates.cutoverJobPathTemplate.render({ + project: project, + location: location, + source: source, + migrating_vm: migratingVm, + cutover_job: cutoverJob, + }); + } + + /** + * Parse the project from CutoverJob resource. + * + * @param {string} cutoverJobName + * A fully-qualified path representing CutoverJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromCutoverJobName(cutoverJobName: string) { + return this.pathTemplates.cutoverJobPathTemplate.match(cutoverJobName) + .project; + } + + /** + * Parse the location from CutoverJob resource. + * + * @param {string} cutoverJobName + * A fully-qualified path representing CutoverJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromCutoverJobName(cutoverJobName: string) { + return this.pathTemplates.cutoverJobPathTemplate.match(cutoverJobName) + .location; + } + + /** + * Parse the source from CutoverJob resource. + * + * @param {string} cutoverJobName + * A fully-qualified path representing CutoverJob resource. + * @returns {string} A string representing the source. + */ + matchSourceFromCutoverJobName(cutoverJobName: string) { + return this.pathTemplates.cutoverJobPathTemplate.match(cutoverJobName) + .source; + } + + /** + * Parse the migrating_vm from CutoverJob resource. + * + * @param {string} cutoverJobName + * A fully-qualified path representing CutoverJob resource. + * @returns {string} A string representing the migrating_vm. + */ + matchMigratingVmFromCutoverJobName(cutoverJobName: string) { + return this.pathTemplates.cutoverJobPathTemplate.match(cutoverJobName) + .migrating_vm; + } + + /** + * Parse the cutover_job from CutoverJob resource. + * + * @param {string} cutoverJobName + * A fully-qualified path representing CutoverJob resource. + * @returns {string} A string representing the cutover_job. + */ + matchCutoverJobFromCutoverJobName(cutoverJobName: string) { + return this.pathTemplates.cutoverJobPathTemplate.match(cutoverJobName) + .cutover_job; + } + + /** + * Return a fully-qualified datacenterConnector resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} source + * @param {string} datacenter_connector + * @returns {string} Resource name string. + */ + datacenterConnectorPath( + project: string, + location: string, + source: string, + datacenterConnector: string + ) { + return this.pathTemplates.datacenterConnectorPathTemplate.render({ + project: project, + location: location, + source: source, + datacenter_connector: datacenterConnector, + }); + } + + /** + * Parse the project from DatacenterConnector resource. + * + * @param {string} datacenterConnectorName + * A fully-qualified path representing DatacenterConnector resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDatacenterConnectorName(datacenterConnectorName: string) { + return this.pathTemplates.datacenterConnectorPathTemplate.match( + datacenterConnectorName + ).project; + } + + /** + * Parse the location from DatacenterConnector resource. + * + * @param {string} datacenterConnectorName + * A fully-qualified path representing DatacenterConnector resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDatacenterConnectorName(datacenterConnectorName: string) { + return this.pathTemplates.datacenterConnectorPathTemplate.match( + datacenterConnectorName + ).location; + } + + /** + * Parse the source from DatacenterConnector resource. + * + * @param {string} datacenterConnectorName + * A fully-qualified path representing DatacenterConnector resource. + * @returns {string} A string representing the source. + */ + matchSourceFromDatacenterConnectorName(datacenterConnectorName: string) { + return this.pathTemplates.datacenterConnectorPathTemplate.match( + datacenterConnectorName + ).source; + } + + /** + * Parse the datacenter_connector from DatacenterConnector resource. + * + * @param {string} datacenterConnectorName + * A fully-qualified path representing DatacenterConnector resource. + * @returns {string} A string representing the datacenter_connector. + */ + matchDatacenterConnectorFromDatacenterConnectorName( + datacenterConnectorName: string + ) { + return this.pathTemplates.datacenterConnectorPathTemplate.match( + datacenterConnectorName + ).datacenter_connector; + } + + /** + * Return a fully-qualified group resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} group + * @returns {string} Resource name string. + */ + groupPath(project: string, location: string, group: string) { + return this.pathTemplates.groupPathTemplate.render({ + project: project, + location: location, + group: group, + }); + } + + /** + * Parse the project from Group resource. + * + * @param {string} groupName + * A fully-qualified path representing Group resource. + * @returns {string} A string representing the project. + */ + matchProjectFromGroupName(groupName: string) { + return this.pathTemplates.groupPathTemplate.match(groupName).project; + } + + /** + * Parse the location from Group resource. + * + * @param {string} groupName + * A fully-qualified path representing Group resource. + * @returns {string} A string representing the location. + */ + matchLocationFromGroupName(groupName: string) { + return this.pathTemplates.groupPathTemplate.match(groupName).location; + } + + /** + * Parse the group from Group resource. + * + * @param {string} groupName + * A fully-qualified path representing Group resource. + * @returns {string} A string representing the group. + */ + matchGroupFromGroupName(groupName: string) { + return this.pathTemplates.groupPathTemplate.match(groupName).group; + } + + /** + * 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 migratingVm resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} source + * @param {string} migrating_vm + * @returns {string} Resource name string. + */ + migratingVmPath( + project: string, + location: string, + source: string, + migratingVm: string + ) { + return this.pathTemplates.migratingVmPathTemplate.render({ + project: project, + location: location, + source: source, + migrating_vm: migratingVm, + }); + } + + /** + * Parse the project from MigratingVm resource. + * + * @param {string} migratingVmName + * A fully-qualified path representing MigratingVm resource. + * @returns {string} A string representing the project. + */ + matchProjectFromMigratingVmName(migratingVmName: string) { + return this.pathTemplates.migratingVmPathTemplate.match(migratingVmName) + .project; + } + + /** + * Parse the location from MigratingVm resource. + * + * @param {string} migratingVmName + * A fully-qualified path representing MigratingVm resource. + * @returns {string} A string representing the location. + */ + matchLocationFromMigratingVmName(migratingVmName: string) { + return this.pathTemplates.migratingVmPathTemplate.match(migratingVmName) + .location; + } + + /** + * Parse the source from MigratingVm resource. + * + * @param {string} migratingVmName + * A fully-qualified path representing MigratingVm resource. + * @returns {string} A string representing the source. + */ + matchSourceFromMigratingVmName(migratingVmName: string) { + return this.pathTemplates.migratingVmPathTemplate.match(migratingVmName) + .source; + } + + /** + * Parse the migrating_vm from MigratingVm resource. + * + * @param {string} migratingVmName + * A fully-qualified path representing MigratingVm resource. + * @returns {string} A string representing the migrating_vm. + */ + matchMigratingVmFromMigratingVmName(migratingVmName: string) { + return this.pathTemplates.migratingVmPathTemplate.match(migratingVmName) + .migrating_vm; + } + + /** + * Return a fully-qualified project resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + projectPath(project: string) { + return this.pathTemplates.projectPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from Project resource. + * + * @param {string} projectName + * A fully-qualified path representing Project resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectName(projectName: string) { + return this.pathTemplates.projectPathTemplate.match(projectName).project; + } + + /** + * Return a fully-qualified source resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} source + * @returns {string} Resource name string. + */ + sourcePath(project: string, location: string, source: string) { + return this.pathTemplates.sourcePathTemplate.render({ + project: project, + location: location, + source: source, + }); + } + + /** + * Parse the project from Source resource. + * + * @param {string} sourceName + * A fully-qualified path representing Source resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSourceName(sourceName: string) { + return this.pathTemplates.sourcePathTemplate.match(sourceName).project; + } + + /** + * Parse the location from Source resource. + * + * @param {string} sourceName + * A fully-qualified path representing Source resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSourceName(sourceName: string) { + return this.pathTemplates.sourcePathTemplate.match(sourceName).location; + } + + /** + * Parse the source from Source resource. + * + * @param {string} sourceName + * A fully-qualified path representing Source resource. + * @returns {string} A string representing the source. + */ + matchSourceFromSourceName(sourceName: string) { + return this.pathTemplates.sourcePathTemplate.match(sourceName).source; + } + + /** + * Return a fully-qualified targetProject resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} target_project + * @returns {string} Resource name string. + */ + targetProjectPath(project: string, location: string, targetProject: string) { + return this.pathTemplates.targetProjectPathTemplate.render({ + project: project, + location: location, + target_project: targetProject, + }); + } + + /** + * Parse the project from TargetProject resource. + * + * @param {string} targetProjectName + * A fully-qualified path representing TargetProject resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTargetProjectName(targetProjectName: string) { + return this.pathTemplates.targetProjectPathTemplate.match(targetProjectName) + .project; + } + + /** + * Parse the location from TargetProject resource. + * + * @param {string} targetProjectName + * A fully-qualified path representing TargetProject resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTargetProjectName(targetProjectName: string) { + return this.pathTemplates.targetProjectPathTemplate.match(targetProjectName) + .location; + } + + /** + * Parse the target_project from TargetProject resource. + * + * @param {string} targetProjectName + * A fully-qualified path representing TargetProject resource. + * @returns {string} A string representing the target_project. + */ + matchTargetProjectFromTargetProjectName(targetProjectName: string) { + return this.pathTemplates.targetProjectPathTemplate.match(targetProjectName) + .target_project; + } + + /** + * Return a fully-qualified utilizationReport resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} source + * @param {string} utilization_report + * @returns {string} Resource name string. + */ + utilizationReportPath( + project: string, + location: string, + source: string, + utilizationReport: string + ) { + return this.pathTemplates.utilizationReportPathTemplate.render({ + project: project, + location: location, + source: source, + utilization_report: utilizationReport, + }); + } + + /** + * Parse the project from UtilizationReport resource. + * + * @param {string} utilizationReportName + * A fully-qualified path representing UtilizationReport resource. + * @returns {string} A string representing the project. + */ + matchProjectFromUtilizationReportName(utilizationReportName: string) { + return this.pathTemplates.utilizationReportPathTemplate.match( + utilizationReportName + ).project; + } + + /** + * Parse the location from UtilizationReport resource. + * + * @param {string} utilizationReportName + * A fully-qualified path representing UtilizationReport resource. + * @returns {string} A string representing the location. + */ + matchLocationFromUtilizationReportName(utilizationReportName: string) { + return this.pathTemplates.utilizationReportPathTemplate.match( + utilizationReportName + ).location; + } + + /** + * Parse the source from UtilizationReport resource. + * + * @param {string} utilizationReportName + * A fully-qualified path representing UtilizationReport resource. + * @returns {string} A string representing the source. + */ + matchSourceFromUtilizationReportName(utilizationReportName: string) { + return this.pathTemplates.utilizationReportPathTemplate.match( + utilizationReportName + ).source; + } + + /** + * Parse the utilization_report from UtilizationReport resource. + * + * @param {string} utilizationReportName + * A fully-qualified path representing UtilizationReport resource. + * @returns {string} A string representing the utilization_report. + */ + matchUtilizationReportFromUtilizationReportName( + utilizationReportName: string + ) { + return this.pathTemplates.utilizationReportPathTemplate.match( + utilizationReportName + ).utilization_report; + } + + /** + * 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.vmMigrationStub && !this._terminated) { + return this.vmMigrationStub.then(stub => { + this._terminated = true; + stub.close(); + this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-vmmigration/src/v1/vm_migration_client_config.json b/packages/google-cloud-vmmigration/src/v1/vm_migration_client_config.json new file mode 100644 index 00000000000..c80684857cf --- /dev/null +++ b/packages/google-cloud-vmmigration/src/v1/vm_migration_client_config.json @@ -0,0 +1,246 @@ +{ + "interfaces": { + "google.cloud.vmmigration.v1.VmMigration": { + "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": { + "ListSources": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetSource": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateSource": { + "timeout_millis": 900000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateSource": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteSource": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "FetchInventory": { + "timeout_millis": 300000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListUtilizationReports": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetUtilizationReport": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateUtilizationReport": { + "timeout_millis": 300000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteUtilizationReport": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListDatacenterConnectors": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetDatacenterConnector": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateDatacenterConnector": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteDatacenterConnector": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpgradeAppliance": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateMigratingVm": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListMigratingVms": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetMigratingVm": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateMigratingVm": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteMigratingVm": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "StartMigration": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ResumeMigration": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "PauseMigration": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "FinalizeMigration": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateCloneJob": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CancelCloneJob": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListCloneJobs": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetCloneJob": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateCutoverJob": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CancelCutoverJob": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListCutoverJobs": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetCutoverJob": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListGroups": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetGroup": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateGroup": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateGroup": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteGroup": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "AddGroupMigration": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "RemoveGroupMigration": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListTargetProjects": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetTargetProject": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateTargetProject": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateTargetProject": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteTargetProject": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-cloud-vmmigration/src/v1/vm_migration_proto_list.json b/packages/google-cloud-vmmigration/src/v1/vm_migration_proto_list.json new file mode 100644 index 00000000000..a168e8f6d37 --- /dev/null +++ b/packages/google-cloud-vmmigration/src/v1/vm_migration_proto_list.json @@ -0,0 +1,3 @@ +[ + "../../protos/google/cloud/vmmigration/v1/vmmigration.proto" +] diff --git a/packages/google-cloud-vmmigration/system-test/fixtures/sample/src/index.js b/packages/google-cloud-vmmigration/system-test/fixtures/sample/src/index.js new file mode 100644 index 00000000000..3478bb1cda4 --- /dev/null +++ b/packages/google-cloud-vmmigration/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 vmmigration = require('@google-cloud/vmmigration'); + +function main() { + const vmMigrationClient = new vmmigration.VmMigrationClient(); +} + +main(); diff --git a/packages/google-cloud-vmmigration/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-vmmigration/system-test/fixtures/sample/src/index.ts new file mode 100644 index 00000000000..d58155341ac --- /dev/null +++ b/packages/google-cloud-vmmigration/system-test/fixtures/sample/src/index.ts @@ -0,0 +1,32 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import {VmMigrationClient} from '@google-cloud/vmmigration'; + +// check that the client class type name can be used +function doStuffWithVmMigrationClient(client: VmMigrationClient) { + client.close(); +} + +function main() { + // check that the client instance can be created + const vmMigrationClient = new VmMigrationClient(); + doStuffWithVmMigrationClient(vmMigrationClient); +} + +main(); diff --git a/packages/google-cloud-vmmigration/system-test/install.ts b/packages/google-cloud-vmmigration/system-test/install.ts new file mode 100644 index 00000000000..6dd1eaadafa --- /dev/null +++ b/packages/google-cloud-vmmigration/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-vmmigration/test/gapic_vm_migration_v1.ts b/packages/google-cloud-vmmigration/test/gapic_vm_migration_v1.ts new file mode 100644 index 00000000000..1f2bbd82ee9 --- /dev/null +++ b/packages/google-cloud-vmmigration/test/gapic_vm_migration_v1.ts @@ -0,0 +1,10023 @@ +// 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 vmmigrationModule 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.VmMigrationClient', () => { + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = vmmigrationModule.v1.VmMigrationClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = vmmigrationModule.v1.VmMigrationClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = vmmigrationModule.v1.VmMigrationClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new vmmigrationModule.v1.VmMigrationClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.vmMigrationStub, undefined); + await client.initialize(); + assert(client.vmMigrationStub); + }); + + it('has close method for the initialized client', done => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.vmMigrationStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.vmMigrationStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new vmmigrationModule.v1.VmMigrationClient({ + 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 vmmigrationModule.v1.VmMigrationClient({ + 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('getSource', () => { + it('invokes getSource without error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.GetSourceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.GetSourceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.Source() + ); + client.innerApiCalls.getSource = stubSimpleCall(expectedResponse); + const [response] = await client.getSource(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getSource as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getSource as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getSource without error using callback', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.GetSourceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.GetSourceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.Source() + ); + client.innerApiCalls.getSource = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getSource( + request, + ( + err?: Error | null, + result?: protos.google.cloud.vmmigration.v1.ISource | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getSource as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getSource as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getSource with error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.GetSourceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.GetSourceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getSource = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getSource(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getSource as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getSource as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getSource with closed client', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.GetSourceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.GetSourceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getSource(request), expectedError); + }); + }); + + describe('fetchInventory', () => { + it('invokes fetchInventory without error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.FetchInventoryRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.FetchInventoryRequest', + ['source'] + ); + request.source = defaultValue1; + const expectedHeaderRequestParams = `source=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.FetchInventoryResponse() + ); + client.innerApiCalls.fetchInventory = stubSimpleCall(expectedResponse); + const [response] = await client.fetchInventory(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.fetchInventory as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.fetchInventory as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes fetchInventory without error using callback', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.FetchInventoryRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.FetchInventoryRequest', + ['source'] + ); + request.source = defaultValue1; + const expectedHeaderRequestParams = `source=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.FetchInventoryResponse() + ); + client.innerApiCalls.fetchInventory = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.fetchInventory( + request, + ( + err?: Error | null, + result?: protos.google.cloud.vmmigration.v1.IFetchInventoryResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.fetchInventory as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.fetchInventory as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes fetchInventory with error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.FetchInventoryRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.FetchInventoryRequest', + ['source'] + ); + request.source = defaultValue1; + const expectedHeaderRequestParams = `source=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.fetchInventory = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.fetchInventory(request), expectedError); + const actualRequest = ( + client.innerApiCalls.fetchInventory as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.fetchInventory as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes fetchInventory with closed client', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.FetchInventoryRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.FetchInventoryRequest', + ['source'] + ); + request.source = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.fetchInventory(request), expectedError); + }); + }); + + describe('getUtilizationReport', () => { + it('invokes getUtilizationReport without error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.GetUtilizationReportRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.GetUtilizationReportRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.UtilizationReport() + ); + client.innerApiCalls.getUtilizationReport = + stubSimpleCall(expectedResponse); + const [response] = await client.getUtilizationReport(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getUtilizationReport as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getUtilizationReport as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getUtilizationReport without error using callback', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.GetUtilizationReportRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.GetUtilizationReportRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.UtilizationReport() + ); + client.innerApiCalls.getUtilizationReport = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getUtilizationReport( + request, + ( + err?: Error | null, + result?: protos.google.cloud.vmmigration.v1.IUtilizationReport | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getUtilizationReport as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getUtilizationReport as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getUtilizationReport with error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.GetUtilizationReportRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.GetUtilizationReportRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getUtilizationReport = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getUtilizationReport(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getUtilizationReport as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getUtilizationReport as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getUtilizationReport with closed client', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.GetUtilizationReportRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.GetUtilizationReportRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getUtilizationReport(request), expectedError); + }); + }); + + describe('getDatacenterConnector', () => { + it('invokes getDatacenterConnector without error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.GetDatacenterConnectorRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.GetDatacenterConnectorRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.DatacenterConnector() + ); + client.innerApiCalls.getDatacenterConnector = + stubSimpleCall(expectedResponse); + const [response] = await client.getDatacenterConnector(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getDatacenterConnector as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getDatacenterConnector as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getDatacenterConnector without error using callback', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.GetDatacenterConnectorRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.GetDatacenterConnectorRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.DatacenterConnector() + ); + client.innerApiCalls.getDatacenterConnector = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getDatacenterConnector( + request, + ( + err?: Error | null, + result?: protos.google.cloud.vmmigration.v1.IDatacenterConnector | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getDatacenterConnector as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getDatacenterConnector as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getDatacenterConnector with error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.GetDatacenterConnectorRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.GetDatacenterConnectorRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getDatacenterConnector = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.getDatacenterConnector(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.getDatacenterConnector as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getDatacenterConnector as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getDatacenterConnector with closed client', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.GetDatacenterConnectorRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.GetDatacenterConnectorRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.getDatacenterConnector(request), + expectedError + ); + }); + }); + + describe('getMigratingVm', () => { + it('invokes getMigratingVm without error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.GetMigratingVmRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.GetMigratingVmRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.MigratingVm() + ); + client.innerApiCalls.getMigratingVm = stubSimpleCall(expectedResponse); + const [response] = await client.getMigratingVm(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getMigratingVm as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getMigratingVm as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getMigratingVm without error using callback', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.GetMigratingVmRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.GetMigratingVmRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.MigratingVm() + ); + client.innerApiCalls.getMigratingVm = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getMigratingVm( + request, + ( + err?: Error | null, + result?: protos.google.cloud.vmmigration.v1.IMigratingVm | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getMigratingVm as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getMigratingVm as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getMigratingVm with error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.GetMigratingVmRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.GetMigratingVmRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getMigratingVm = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getMigratingVm(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getMigratingVm as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getMigratingVm as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getMigratingVm with closed client', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.GetMigratingVmRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.GetMigratingVmRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getMigratingVm(request), expectedError); + }); + }); + + describe('getCloneJob', () => { + it('invokes getCloneJob without error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.GetCloneJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.GetCloneJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.CloneJob() + ); + client.innerApiCalls.getCloneJob = stubSimpleCall(expectedResponse); + const [response] = await client.getCloneJob(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getCloneJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getCloneJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getCloneJob without error using callback', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.GetCloneJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.GetCloneJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.CloneJob() + ); + client.innerApiCalls.getCloneJob = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getCloneJob( + request, + ( + err?: Error | null, + result?: protos.google.cloud.vmmigration.v1.ICloneJob | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getCloneJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getCloneJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getCloneJob with error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.GetCloneJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.GetCloneJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getCloneJob = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getCloneJob(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getCloneJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getCloneJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getCloneJob with closed client', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.GetCloneJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.GetCloneJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getCloneJob(request), expectedError); + }); + }); + + describe('getCutoverJob', () => { + it('invokes getCutoverJob without error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.GetCutoverJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.GetCutoverJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.CutoverJob() + ); + client.innerApiCalls.getCutoverJob = stubSimpleCall(expectedResponse); + const [response] = await client.getCutoverJob(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getCutoverJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getCutoverJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getCutoverJob without error using callback', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.GetCutoverJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.GetCutoverJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.CutoverJob() + ); + client.innerApiCalls.getCutoverJob = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getCutoverJob( + request, + ( + err?: Error | null, + result?: protos.google.cloud.vmmigration.v1.ICutoverJob | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getCutoverJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getCutoverJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getCutoverJob with error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.GetCutoverJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.GetCutoverJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getCutoverJob = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getCutoverJob(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getCutoverJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getCutoverJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getCutoverJob with closed client', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.GetCutoverJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.GetCutoverJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getCutoverJob(request), expectedError); + }); + }); + + describe('getGroup', () => { + it('invokes getGroup without error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.GetGroupRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.GetGroupRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.Group() + ); + client.innerApiCalls.getGroup = stubSimpleCall(expectedResponse); + const [response] = await client.getGroup(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getGroup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getGroup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getGroup without error using callback', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.GetGroupRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.GetGroupRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.Group() + ); + client.innerApiCalls.getGroup = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getGroup( + request, + ( + err?: Error | null, + result?: protos.google.cloud.vmmigration.v1.IGroup | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getGroup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getGroup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getGroup with error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.GetGroupRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.GetGroupRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getGroup = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getGroup(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getGroup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getGroup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getGroup with closed client', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.GetGroupRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.GetGroupRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getGroup(request), expectedError); + }); + }); + + describe('getTargetProject', () => { + it('invokes getTargetProject without error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.GetTargetProjectRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.GetTargetProjectRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.TargetProject() + ); + client.innerApiCalls.getTargetProject = stubSimpleCall(expectedResponse); + const [response] = await client.getTargetProject(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getTargetProject as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getTargetProject as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getTargetProject without error using callback', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.GetTargetProjectRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.GetTargetProjectRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.TargetProject() + ); + client.innerApiCalls.getTargetProject = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getTargetProject( + request, + ( + err?: Error | null, + result?: protos.google.cloud.vmmigration.v1.ITargetProject | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getTargetProject as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getTargetProject as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getTargetProject with error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.GetTargetProjectRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.GetTargetProjectRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getTargetProject = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getTargetProject(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getTargetProject as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getTargetProject as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getTargetProject with closed client', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.GetTargetProjectRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.GetTargetProjectRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getTargetProject(request), expectedError); + }); + }); + + describe('createSource', () => { + it('invokes createSource without error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.CreateSourceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.CreateSourceRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createSource = stubLongRunningCall(expectedResponse); + const [operation] = await client.createSource(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createSource as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createSource as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createSource without error using callback', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.CreateSourceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.CreateSourceRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createSource = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createSource( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.vmmigration.v1.ISource, + protos.google.cloud.vmmigration.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.vmmigration.v1.ISource, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createSource as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createSource as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createSource with call error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.CreateSourceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.CreateSourceRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createSource = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.createSource(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createSource as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createSource as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createSource with LRO error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.CreateSourceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.CreateSourceRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createSource = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.createSource(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.createSource as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createSource as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateSourceProgress without error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + 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.checkCreateSourceProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateSourceProgress with error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + 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.checkCreateSourceProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('updateSource', () => { + it('invokes updateSource without error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.UpdateSourceRequest() + ); + request.source ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.UpdateSourceRequest', + ['source', 'name'] + ); + request.source.name = defaultValue1; + const expectedHeaderRequestParams = `source.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateSource = stubLongRunningCall(expectedResponse); + const [operation] = await client.updateSource(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateSource as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateSource as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateSource without error using callback', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.UpdateSourceRequest() + ); + request.source ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.UpdateSourceRequest', + ['source', 'name'] + ); + request.source.name = defaultValue1; + const expectedHeaderRequestParams = `source.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateSource = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateSource( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.vmmigration.v1.ISource, + protos.google.cloud.vmmigration.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.vmmigration.v1.ISource, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateSource as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateSource as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateSource with call error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.UpdateSourceRequest() + ); + request.source ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.UpdateSourceRequest', + ['source', 'name'] + ); + request.source.name = defaultValue1; + const expectedHeaderRequestParams = `source.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateSource = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.updateSource(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateSource as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateSource as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateSource with LRO error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.UpdateSourceRequest() + ); + request.source ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.UpdateSourceRequest', + ['source', 'name'] + ); + request.source.name = defaultValue1; + const expectedHeaderRequestParams = `source.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateSource = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.updateSource(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.updateSource as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateSource as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateSourceProgress without error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + 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.checkUpdateSourceProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateSourceProgress with error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + 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.checkUpdateSourceProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('deleteSource', () => { + it('invokes deleteSource without error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.DeleteSourceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.DeleteSourceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteSource = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteSource(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteSource as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteSource as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteSource without error using callback', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.DeleteSourceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.DeleteSourceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteSource = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteSource( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.vmmigration.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteSource as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteSource as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteSource with call error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.DeleteSourceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.DeleteSourceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteSource = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteSource(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteSource as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteSource as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteSource with LRO error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.DeleteSourceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.DeleteSourceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteSource = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.deleteSource(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteSource as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteSource as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteSourceProgress without error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + 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.checkDeleteSourceProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteSourceProgress with error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + 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.checkDeleteSourceProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('createUtilizationReport', () => { + it('invokes createUtilizationReport without error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.CreateUtilizationReportRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.CreateUtilizationReportRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createUtilizationReport = + stubLongRunningCall(expectedResponse); + const [operation] = await client.createUtilizationReport(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createUtilizationReport as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createUtilizationReport as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createUtilizationReport without error using callback', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.CreateUtilizationReportRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.CreateUtilizationReportRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createUtilizationReport = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createUtilizationReport( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.vmmigration.v1.IUtilizationReport, + protos.google.cloud.vmmigration.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.vmmigration.v1.IUtilizationReport, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createUtilizationReport as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createUtilizationReport as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createUtilizationReport with call error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.CreateUtilizationReportRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.CreateUtilizationReportRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createUtilizationReport = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects( + client.createUtilizationReport(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.createUtilizationReport as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createUtilizationReport as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createUtilizationReport with LRO error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.CreateUtilizationReportRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.CreateUtilizationReportRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createUtilizationReport = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.createUtilizationReport(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.createUtilizationReport as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createUtilizationReport as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateUtilizationReportProgress without error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + 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.checkCreateUtilizationReportProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateUtilizationReportProgress with error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + 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.checkCreateUtilizationReportProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('deleteUtilizationReport', () => { + it('invokes deleteUtilizationReport without error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.DeleteUtilizationReportRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.DeleteUtilizationReportRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteUtilizationReport = + stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteUtilizationReport(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteUtilizationReport as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteUtilizationReport as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteUtilizationReport without error using callback', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.DeleteUtilizationReportRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.DeleteUtilizationReportRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteUtilizationReport = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteUtilizationReport( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.vmmigration.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteUtilizationReport as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteUtilizationReport as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteUtilizationReport with call error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.DeleteUtilizationReportRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.DeleteUtilizationReportRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteUtilizationReport = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects( + client.deleteUtilizationReport(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.deleteUtilizationReport as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteUtilizationReport as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteUtilizationReport with LRO error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.DeleteUtilizationReportRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.DeleteUtilizationReportRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteUtilizationReport = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.deleteUtilizationReport(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteUtilizationReport as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteUtilizationReport as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteUtilizationReportProgress without error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + 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.checkDeleteUtilizationReportProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteUtilizationReportProgress with error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + 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.checkDeleteUtilizationReportProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('createDatacenterConnector', () => { + it('invokes createDatacenterConnector without error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.CreateDatacenterConnectorRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.CreateDatacenterConnectorRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createDatacenterConnector = + stubLongRunningCall(expectedResponse); + const [operation] = await client.createDatacenterConnector(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createDatacenterConnector as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createDatacenterConnector as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createDatacenterConnector without error using callback', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.CreateDatacenterConnectorRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.CreateDatacenterConnectorRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createDatacenterConnector = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createDatacenterConnector( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.vmmigration.v1.IDatacenterConnector, + protos.google.cloud.vmmigration.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.vmmigration.v1.IDatacenterConnector, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createDatacenterConnector as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createDatacenterConnector as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createDatacenterConnector with call error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.CreateDatacenterConnectorRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.CreateDatacenterConnectorRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createDatacenterConnector = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects( + client.createDatacenterConnector(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.createDatacenterConnector as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createDatacenterConnector as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createDatacenterConnector with LRO error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.CreateDatacenterConnectorRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.CreateDatacenterConnectorRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createDatacenterConnector = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.createDatacenterConnector(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.createDatacenterConnector as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createDatacenterConnector as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateDatacenterConnectorProgress without error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + 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.checkCreateDatacenterConnectorProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateDatacenterConnectorProgress with error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + 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.checkCreateDatacenterConnectorProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('deleteDatacenterConnector', () => { + it('invokes deleteDatacenterConnector without error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.DeleteDatacenterConnectorRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.DeleteDatacenterConnectorRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteDatacenterConnector = + stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteDatacenterConnector(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteDatacenterConnector as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteDatacenterConnector as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteDatacenterConnector without error using callback', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.DeleteDatacenterConnectorRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.DeleteDatacenterConnectorRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteDatacenterConnector = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteDatacenterConnector( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.vmmigration.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteDatacenterConnector as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteDatacenterConnector as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteDatacenterConnector with call error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.DeleteDatacenterConnectorRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.DeleteDatacenterConnectorRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteDatacenterConnector = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects( + client.deleteDatacenterConnector(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.deleteDatacenterConnector as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteDatacenterConnector as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteDatacenterConnector with LRO error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.DeleteDatacenterConnectorRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.DeleteDatacenterConnectorRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteDatacenterConnector = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.deleteDatacenterConnector(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteDatacenterConnector as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteDatacenterConnector as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteDatacenterConnectorProgress without error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + 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.checkDeleteDatacenterConnectorProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteDatacenterConnectorProgress with error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + 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.checkDeleteDatacenterConnectorProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('upgradeAppliance', () => { + it('invokes upgradeAppliance without error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.UpgradeApplianceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.UpgradeApplianceRequest', + ['datacenterConnector'] + ); + request.datacenterConnector = defaultValue1; + const expectedHeaderRequestParams = `datacenter_connector=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.upgradeAppliance = + stubLongRunningCall(expectedResponse); + const [operation] = await client.upgradeAppliance(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.upgradeAppliance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.upgradeAppliance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes upgradeAppliance without error using callback', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.UpgradeApplianceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.UpgradeApplianceRequest', + ['datacenterConnector'] + ); + request.datacenterConnector = defaultValue1; + const expectedHeaderRequestParams = `datacenter_connector=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.upgradeAppliance = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.upgradeAppliance( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.vmmigration.v1.IUpgradeApplianceResponse, + protos.google.cloud.vmmigration.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.vmmigration.v1.IUpgradeApplianceResponse, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.upgradeAppliance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.upgradeAppliance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes upgradeAppliance with call error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.UpgradeApplianceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.UpgradeApplianceRequest', + ['datacenterConnector'] + ); + request.datacenterConnector = defaultValue1; + const expectedHeaderRequestParams = `datacenter_connector=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.upgradeAppliance = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.upgradeAppliance(request), expectedError); + const actualRequest = ( + client.innerApiCalls.upgradeAppliance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.upgradeAppliance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes upgradeAppliance with LRO error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.UpgradeApplianceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.UpgradeApplianceRequest', + ['datacenterConnector'] + ); + request.datacenterConnector = defaultValue1; + const expectedHeaderRequestParams = `datacenter_connector=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.upgradeAppliance = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.upgradeAppliance(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.upgradeAppliance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.upgradeAppliance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpgradeApplianceProgress without error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + 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.checkUpgradeApplianceProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpgradeApplianceProgress with error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + 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.checkUpgradeApplianceProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('createMigratingVm', () => { + it('invokes createMigratingVm without error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.CreateMigratingVmRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.CreateMigratingVmRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createMigratingVm = + stubLongRunningCall(expectedResponse); + const [operation] = await client.createMigratingVm(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createMigratingVm as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createMigratingVm as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createMigratingVm without error using callback', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.CreateMigratingVmRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.CreateMigratingVmRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createMigratingVm = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createMigratingVm( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.vmmigration.v1.IMigratingVm, + protos.google.cloud.vmmigration.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.vmmigration.v1.IMigratingVm, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createMigratingVm as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createMigratingVm as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createMigratingVm with call error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.CreateMigratingVmRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.CreateMigratingVmRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createMigratingVm = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.createMigratingVm(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createMigratingVm as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createMigratingVm as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createMigratingVm with LRO error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.CreateMigratingVmRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.CreateMigratingVmRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createMigratingVm = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.createMigratingVm(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.createMigratingVm as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createMigratingVm as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateMigratingVmProgress without error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + 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.checkCreateMigratingVmProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateMigratingVmProgress with error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + 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.checkCreateMigratingVmProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('updateMigratingVm', () => { + it('invokes updateMigratingVm without error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.UpdateMigratingVmRequest() + ); + request.migratingVm ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.UpdateMigratingVmRequest', + ['migratingVm', 'name'] + ); + request.migratingVm.name = defaultValue1; + const expectedHeaderRequestParams = `migrating_vm.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateMigratingVm = + stubLongRunningCall(expectedResponse); + const [operation] = await client.updateMigratingVm(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateMigratingVm as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateMigratingVm as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateMigratingVm without error using callback', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.UpdateMigratingVmRequest() + ); + request.migratingVm ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.UpdateMigratingVmRequest', + ['migratingVm', 'name'] + ); + request.migratingVm.name = defaultValue1; + const expectedHeaderRequestParams = `migrating_vm.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateMigratingVm = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateMigratingVm( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.vmmigration.v1.IMigratingVm, + protos.google.cloud.vmmigration.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.vmmigration.v1.IMigratingVm, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateMigratingVm as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateMigratingVm as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateMigratingVm with call error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.UpdateMigratingVmRequest() + ); + request.migratingVm ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.UpdateMigratingVmRequest', + ['migratingVm', 'name'] + ); + request.migratingVm.name = defaultValue1; + const expectedHeaderRequestParams = `migrating_vm.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateMigratingVm = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.updateMigratingVm(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateMigratingVm as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateMigratingVm as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateMigratingVm with LRO error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.UpdateMigratingVmRequest() + ); + request.migratingVm ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.UpdateMigratingVmRequest', + ['migratingVm', 'name'] + ); + request.migratingVm.name = defaultValue1; + const expectedHeaderRequestParams = `migrating_vm.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateMigratingVm = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.updateMigratingVm(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.updateMigratingVm as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateMigratingVm as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateMigratingVmProgress without error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + 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.checkUpdateMigratingVmProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateMigratingVmProgress with error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + 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.checkUpdateMigratingVmProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('deleteMigratingVm', () => { + it('invokes deleteMigratingVm without error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.DeleteMigratingVmRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.DeleteMigratingVmRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteMigratingVm = + stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteMigratingVm(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteMigratingVm as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteMigratingVm as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteMigratingVm without error using callback', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.DeleteMigratingVmRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.DeleteMigratingVmRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteMigratingVm = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteMigratingVm( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.vmmigration.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteMigratingVm as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteMigratingVm as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteMigratingVm with call error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.DeleteMigratingVmRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.DeleteMigratingVmRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteMigratingVm = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteMigratingVm(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteMigratingVm as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteMigratingVm as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteMigratingVm with LRO error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.DeleteMigratingVmRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.DeleteMigratingVmRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteMigratingVm = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.deleteMigratingVm(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteMigratingVm as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteMigratingVm as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteMigratingVmProgress without error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + 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.checkDeleteMigratingVmProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteMigratingVmProgress with error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + 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.checkDeleteMigratingVmProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('startMigration', () => { + it('invokes startMigration without error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.StartMigrationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.StartMigrationRequest', + ['migratingVm'] + ); + request.migratingVm = defaultValue1; + const expectedHeaderRequestParams = `migrating_vm=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.startMigration = + stubLongRunningCall(expectedResponse); + const [operation] = await client.startMigration(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.startMigration as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.startMigration as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes startMigration without error using callback', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.StartMigrationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.StartMigrationRequest', + ['migratingVm'] + ); + request.migratingVm = defaultValue1; + const expectedHeaderRequestParams = `migrating_vm=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.startMigration = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.startMigration( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.vmmigration.v1.IStartMigrationResponse, + protos.google.cloud.vmmigration.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.vmmigration.v1.IStartMigrationResponse, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.startMigration as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.startMigration as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes startMigration with call error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.StartMigrationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.StartMigrationRequest', + ['migratingVm'] + ); + request.migratingVm = defaultValue1; + const expectedHeaderRequestParams = `migrating_vm=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.startMigration = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.startMigration(request), expectedError); + const actualRequest = ( + client.innerApiCalls.startMigration as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.startMigration as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes startMigration with LRO error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.StartMigrationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.StartMigrationRequest', + ['migratingVm'] + ); + request.migratingVm = defaultValue1; + const expectedHeaderRequestParams = `migrating_vm=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.startMigration = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.startMigration(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.startMigration as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.startMigration as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkStartMigrationProgress without error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + 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.checkStartMigrationProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkStartMigrationProgress with error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + 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.checkStartMigrationProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('resumeMigration', () => { + it('invokes resumeMigration without error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.ResumeMigrationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.ResumeMigrationRequest', + ['migratingVm'] + ); + request.migratingVm = defaultValue1; + const expectedHeaderRequestParams = `migrating_vm=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.resumeMigration = + stubLongRunningCall(expectedResponse); + const [operation] = await client.resumeMigration(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.resumeMigration as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.resumeMigration as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes resumeMigration without error using callback', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.ResumeMigrationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.ResumeMigrationRequest', + ['migratingVm'] + ); + request.migratingVm = defaultValue1; + const expectedHeaderRequestParams = `migrating_vm=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.resumeMigration = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.resumeMigration( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.vmmigration.v1.IResumeMigrationResponse, + protos.google.cloud.vmmigration.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.vmmigration.v1.IResumeMigrationResponse, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.resumeMigration as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.resumeMigration as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes resumeMigration with call error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.ResumeMigrationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.ResumeMigrationRequest', + ['migratingVm'] + ); + request.migratingVm = defaultValue1; + const expectedHeaderRequestParams = `migrating_vm=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.resumeMigration = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.resumeMigration(request), expectedError); + const actualRequest = ( + client.innerApiCalls.resumeMigration as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.resumeMigration as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes resumeMigration with LRO error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.ResumeMigrationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.ResumeMigrationRequest', + ['migratingVm'] + ); + request.migratingVm = defaultValue1; + const expectedHeaderRequestParams = `migrating_vm=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.resumeMigration = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.resumeMigration(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.resumeMigration as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.resumeMigration as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkResumeMigrationProgress without error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + 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.checkResumeMigrationProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkResumeMigrationProgress with error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + 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.checkResumeMigrationProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('pauseMigration', () => { + it('invokes pauseMigration without error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.PauseMigrationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.PauseMigrationRequest', + ['migratingVm'] + ); + request.migratingVm = defaultValue1; + const expectedHeaderRequestParams = `migrating_vm=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.pauseMigration = + stubLongRunningCall(expectedResponse); + const [operation] = await client.pauseMigration(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.pauseMigration as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.pauseMigration as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes pauseMigration without error using callback', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.PauseMigrationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.PauseMigrationRequest', + ['migratingVm'] + ); + request.migratingVm = defaultValue1; + const expectedHeaderRequestParams = `migrating_vm=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.pauseMigration = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.pauseMigration( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.vmmigration.v1.IPauseMigrationResponse, + protos.google.cloud.vmmigration.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.vmmigration.v1.IPauseMigrationResponse, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.pauseMigration as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.pauseMigration as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes pauseMigration with call error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.PauseMigrationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.PauseMigrationRequest', + ['migratingVm'] + ); + request.migratingVm = defaultValue1; + const expectedHeaderRequestParams = `migrating_vm=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.pauseMigration = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.pauseMigration(request), expectedError); + const actualRequest = ( + client.innerApiCalls.pauseMigration as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.pauseMigration as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes pauseMigration with LRO error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.PauseMigrationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.PauseMigrationRequest', + ['migratingVm'] + ); + request.migratingVm = defaultValue1; + const expectedHeaderRequestParams = `migrating_vm=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.pauseMigration = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.pauseMigration(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.pauseMigration as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.pauseMigration as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkPauseMigrationProgress without error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + 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.checkPauseMigrationProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkPauseMigrationProgress with error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + 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.checkPauseMigrationProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('finalizeMigration', () => { + it('invokes finalizeMigration without error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.FinalizeMigrationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.FinalizeMigrationRequest', + ['migratingVm'] + ); + request.migratingVm = defaultValue1; + const expectedHeaderRequestParams = `migrating_vm=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.finalizeMigration = + stubLongRunningCall(expectedResponse); + const [operation] = await client.finalizeMigration(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.finalizeMigration as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.finalizeMigration as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes finalizeMigration without error using callback', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.FinalizeMigrationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.FinalizeMigrationRequest', + ['migratingVm'] + ); + request.migratingVm = defaultValue1; + const expectedHeaderRequestParams = `migrating_vm=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.finalizeMigration = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.finalizeMigration( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.vmmigration.v1.IFinalizeMigrationResponse, + protos.google.cloud.vmmigration.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.vmmigration.v1.IFinalizeMigrationResponse, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.finalizeMigration as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.finalizeMigration as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes finalizeMigration with call error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.FinalizeMigrationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.FinalizeMigrationRequest', + ['migratingVm'] + ); + request.migratingVm = defaultValue1; + const expectedHeaderRequestParams = `migrating_vm=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.finalizeMigration = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.finalizeMigration(request), expectedError); + const actualRequest = ( + client.innerApiCalls.finalizeMigration as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.finalizeMigration as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes finalizeMigration with LRO error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.FinalizeMigrationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.FinalizeMigrationRequest', + ['migratingVm'] + ); + request.migratingVm = defaultValue1; + const expectedHeaderRequestParams = `migrating_vm=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.finalizeMigration = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.finalizeMigration(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.finalizeMigration as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.finalizeMigration as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkFinalizeMigrationProgress without error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + 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.checkFinalizeMigrationProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkFinalizeMigrationProgress with error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + 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.checkFinalizeMigrationProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('createCloneJob', () => { + it('invokes createCloneJob without error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.CreateCloneJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.CreateCloneJobRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createCloneJob = + stubLongRunningCall(expectedResponse); + const [operation] = await client.createCloneJob(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createCloneJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createCloneJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createCloneJob without error using callback', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.CreateCloneJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.CreateCloneJobRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createCloneJob = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createCloneJob( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.vmmigration.v1.ICloneJob, + protos.google.cloud.vmmigration.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.vmmigration.v1.ICloneJob, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createCloneJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createCloneJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createCloneJob with call error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.CreateCloneJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.CreateCloneJobRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createCloneJob = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.createCloneJob(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createCloneJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createCloneJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createCloneJob with LRO error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.CreateCloneJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.CreateCloneJobRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createCloneJob = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.createCloneJob(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.createCloneJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createCloneJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateCloneJobProgress without error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + 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.checkCreateCloneJobProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateCloneJobProgress with error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + 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.checkCreateCloneJobProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('cancelCloneJob', () => { + it('invokes cancelCloneJob without error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.CancelCloneJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.CancelCloneJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.cancelCloneJob = + stubLongRunningCall(expectedResponse); + const [operation] = await client.cancelCloneJob(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.cancelCloneJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.cancelCloneJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes cancelCloneJob without error using callback', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.CancelCloneJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.CancelCloneJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.cancelCloneJob = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.cancelCloneJob( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.vmmigration.v1.ICancelCloneJobResponse, + protos.google.cloud.vmmigration.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.vmmigration.v1.ICancelCloneJobResponse, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.cancelCloneJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.cancelCloneJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes cancelCloneJob with call error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.CancelCloneJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.CancelCloneJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.cancelCloneJob = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.cancelCloneJob(request), expectedError); + const actualRequest = ( + client.innerApiCalls.cancelCloneJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.cancelCloneJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes cancelCloneJob with LRO error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.CancelCloneJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.CancelCloneJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.cancelCloneJob = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.cancelCloneJob(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.cancelCloneJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.cancelCloneJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCancelCloneJobProgress without error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + 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.checkCancelCloneJobProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCancelCloneJobProgress with error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + 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.checkCancelCloneJobProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('createCutoverJob', () => { + it('invokes createCutoverJob without error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.CreateCutoverJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.CreateCutoverJobRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createCutoverJob = + stubLongRunningCall(expectedResponse); + const [operation] = await client.createCutoverJob(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createCutoverJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createCutoverJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createCutoverJob without error using callback', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.CreateCutoverJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.CreateCutoverJobRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createCutoverJob = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createCutoverJob( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.vmmigration.v1.ICutoverJob, + protos.google.cloud.vmmigration.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.vmmigration.v1.ICutoverJob, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createCutoverJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createCutoverJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createCutoverJob with call error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.CreateCutoverJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.CreateCutoverJobRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createCutoverJob = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.createCutoverJob(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createCutoverJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createCutoverJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createCutoverJob with LRO error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.CreateCutoverJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.CreateCutoverJobRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createCutoverJob = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.createCutoverJob(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.createCutoverJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createCutoverJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateCutoverJobProgress without error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + 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.checkCreateCutoverJobProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateCutoverJobProgress with error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + 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.checkCreateCutoverJobProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('cancelCutoverJob', () => { + it('invokes cancelCutoverJob without error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.CancelCutoverJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.CancelCutoverJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.cancelCutoverJob = + stubLongRunningCall(expectedResponse); + const [operation] = await client.cancelCutoverJob(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.cancelCutoverJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.cancelCutoverJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes cancelCutoverJob without error using callback', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.CancelCutoverJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.CancelCutoverJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.cancelCutoverJob = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.cancelCutoverJob( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.vmmigration.v1.ICancelCutoverJobResponse, + protos.google.cloud.vmmigration.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.vmmigration.v1.ICancelCutoverJobResponse, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.cancelCutoverJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.cancelCutoverJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes cancelCutoverJob with call error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.CancelCutoverJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.CancelCutoverJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.cancelCutoverJob = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.cancelCutoverJob(request), expectedError); + const actualRequest = ( + client.innerApiCalls.cancelCutoverJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.cancelCutoverJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes cancelCutoverJob with LRO error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.CancelCutoverJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.CancelCutoverJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.cancelCutoverJob = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.cancelCutoverJob(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.cancelCutoverJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.cancelCutoverJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCancelCutoverJobProgress without error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + 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.checkCancelCutoverJobProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCancelCutoverJobProgress with error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + 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.checkCancelCutoverJobProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('createGroup', () => { + it('invokes createGroup without error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.CreateGroupRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.CreateGroupRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createGroup = stubLongRunningCall(expectedResponse); + const [operation] = await client.createGroup(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createGroup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createGroup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createGroup without error using callback', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.CreateGroupRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.CreateGroupRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createGroup = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createGroup( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.vmmigration.v1.IGroup, + protos.google.cloud.vmmigration.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.vmmigration.v1.IGroup, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createGroup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createGroup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createGroup with call error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.CreateGroupRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.CreateGroupRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createGroup = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.createGroup(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createGroup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createGroup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createGroup with LRO error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.CreateGroupRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.CreateGroupRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createGroup = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.createGroup(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.createGroup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createGroup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateGroupProgress without error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + 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.checkCreateGroupProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateGroupProgress with error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + 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.checkCreateGroupProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('updateGroup', () => { + it('invokes updateGroup without error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.UpdateGroupRequest() + ); + request.group ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.UpdateGroupRequest', + ['group', 'name'] + ); + request.group.name = defaultValue1; + const expectedHeaderRequestParams = `group.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateGroup = stubLongRunningCall(expectedResponse); + const [operation] = await client.updateGroup(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateGroup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateGroup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateGroup without error using callback', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.UpdateGroupRequest() + ); + request.group ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.UpdateGroupRequest', + ['group', 'name'] + ); + request.group.name = defaultValue1; + const expectedHeaderRequestParams = `group.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateGroup = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateGroup( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.vmmigration.v1.IGroup, + protos.google.cloud.vmmigration.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.vmmigration.v1.IGroup, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateGroup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateGroup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateGroup with call error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.UpdateGroupRequest() + ); + request.group ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.UpdateGroupRequest', + ['group', 'name'] + ); + request.group.name = defaultValue1; + const expectedHeaderRequestParams = `group.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateGroup = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.updateGroup(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateGroup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateGroup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateGroup with LRO error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.UpdateGroupRequest() + ); + request.group ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.UpdateGroupRequest', + ['group', 'name'] + ); + request.group.name = defaultValue1; + const expectedHeaderRequestParams = `group.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateGroup = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.updateGroup(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.updateGroup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateGroup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateGroupProgress without error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + 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.checkUpdateGroupProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateGroupProgress with error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + 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.checkUpdateGroupProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('deleteGroup', () => { + it('invokes deleteGroup without error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.DeleteGroupRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.DeleteGroupRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteGroup = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteGroup(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteGroup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteGroup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteGroup without error using callback', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.DeleteGroupRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.DeleteGroupRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteGroup = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteGroup( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.vmmigration.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteGroup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteGroup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteGroup with call error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.DeleteGroupRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.DeleteGroupRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteGroup = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteGroup(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteGroup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteGroup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteGroup with LRO error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.DeleteGroupRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.DeleteGroupRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteGroup = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.deleteGroup(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteGroup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteGroup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteGroupProgress without error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + 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.checkDeleteGroupProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteGroupProgress with error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + 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.checkDeleteGroupProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('addGroupMigration', () => { + it('invokes addGroupMigration without error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.AddGroupMigrationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.AddGroupMigrationRequest', + ['group'] + ); + request.group = defaultValue1; + const expectedHeaderRequestParams = `group=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.addGroupMigration = + stubLongRunningCall(expectedResponse); + const [operation] = await client.addGroupMigration(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.addGroupMigration as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.addGroupMigration as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes addGroupMigration without error using callback', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.AddGroupMigrationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.AddGroupMigrationRequest', + ['group'] + ); + request.group = defaultValue1; + const expectedHeaderRequestParams = `group=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.addGroupMigration = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.addGroupMigration( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.vmmigration.v1.IAddGroupMigrationResponse, + protos.google.cloud.vmmigration.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.vmmigration.v1.IAddGroupMigrationResponse, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.addGroupMigration as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.addGroupMigration as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes addGroupMigration with call error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.AddGroupMigrationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.AddGroupMigrationRequest', + ['group'] + ); + request.group = defaultValue1; + const expectedHeaderRequestParams = `group=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.addGroupMigration = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.addGroupMigration(request), expectedError); + const actualRequest = ( + client.innerApiCalls.addGroupMigration as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.addGroupMigration as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes addGroupMigration with LRO error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.AddGroupMigrationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.AddGroupMigrationRequest', + ['group'] + ); + request.group = defaultValue1; + const expectedHeaderRequestParams = `group=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.addGroupMigration = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.addGroupMigration(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.addGroupMigration as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.addGroupMigration as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkAddGroupMigrationProgress without error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + 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.checkAddGroupMigrationProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkAddGroupMigrationProgress with error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + 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.checkAddGroupMigrationProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('removeGroupMigration', () => { + it('invokes removeGroupMigration without error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.RemoveGroupMigrationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.RemoveGroupMigrationRequest', + ['group'] + ); + request.group = defaultValue1; + const expectedHeaderRequestParams = `group=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.removeGroupMigration = + stubLongRunningCall(expectedResponse); + const [operation] = await client.removeGroupMigration(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.removeGroupMigration as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.removeGroupMigration as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes removeGroupMigration without error using callback', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.RemoveGroupMigrationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.RemoveGroupMigrationRequest', + ['group'] + ); + request.group = defaultValue1; + const expectedHeaderRequestParams = `group=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.removeGroupMigration = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.removeGroupMigration( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.vmmigration.v1.IRemoveGroupMigrationResponse, + protos.google.cloud.vmmigration.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.vmmigration.v1.IRemoveGroupMigrationResponse, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.removeGroupMigration as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.removeGroupMigration as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes removeGroupMigration with call error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.RemoveGroupMigrationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.RemoveGroupMigrationRequest', + ['group'] + ); + request.group = defaultValue1; + const expectedHeaderRequestParams = `group=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.removeGroupMigration = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.removeGroupMigration(request), expectedError); + const actualRequest = ( + client.innerApiCalls.removeGroupMigration as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.removeGroupMigration as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes removeGroupMigration with LRO error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.RemoveGroupMigrationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.RemoveGroupMigrationRequest', + ['group'] + ); + request.group = defaultValue1; + const expectedHeaderRequestParams = `group=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.removeGroupMigration = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.removeGroupMigration(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.removeGroupMigration as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.removeGroupMigration as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkRemoveGroupMigrationProgress without error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + 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.checkRemoveGroupMigrationProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkRemoveGroupMigrationProgress with error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + 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.checkRemoveGroupMigrationProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('createTargetProject', () => { + it('invokes createTargetProject without error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.CreateTargetProjectRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.CreateTargetProjectRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createTargetProject = + stubLongRunningCall(expectedResponse); + const [operation] = await client.createTargetProject(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createTargetProject as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createTargetProject as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createTargetProject without error using callback', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.CreateTargetProjectRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.CreateTargetProjectRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createTargetProject = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createTargetProject( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.vmmigration.v1.ITargetProject, + protos.google.cloud.vmmigration.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.vmmigration.v1.ITargetProject, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createTargetProject as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createTargetProject as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createTargetProject with call error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.CreateTargetProjectRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.CreateTargetProjectRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createTargetProject = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.createTargetProject(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createTargetProject as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createTargetProject as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createTargetProject with LRO error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.CreateTargetProjectRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.CreateTargetProjectRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createTargetProject = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.createTargetProject(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.createTargetProject as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createTargetProject as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateTargetProjectProgress without error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + 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.checkCreateTargetProjectProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateTargetProjectProgress with error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + 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.checkCreateTargetProjectProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('updateTargetProject', () => { + it('invokes updateTargetProject without error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.UpdateTargetProjectRequest() + ); + request.targetProject ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.UpdateTargetProjectRequest', + ['targetProject', 'name'] + ); + request.targetProject.name = defaultValue1; + const expectedHeaderRequestParams = `target_project.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateTargetProject = + stubLongRunningCall(expectedResponse); + const [operation] = await client.updateTargetProject(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateTargetProject as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateTargetProject as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateTargetProject without error using callback', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.UpdateTargetProjectRequest() + ); + request.targetProject ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.UpdateTargetProjectRequest', + ['targetProject', 'name'] + ); + request.targetProject.name = defaultValue1; + const expectedHeaderRequestParams = `target_project.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateTargetProject = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateTargetProject( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.vmmigration.v1.ITargetProject, + protos.google.cloud.vmmigration.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.vmmigration.v1.ITargetProject, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateTargetProject as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateTargetProject as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateTargetProject with call error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.UpdateTargetProjectRequest() + ); + request.targetProject ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.UpdateTargetProjectRequest', + ['targetProject', 'name'] + ); + request.targetProject.name = defaultValue1; + const expectedHeaderRequestParams = `target_project.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateTargetProject = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.updateTargetProject(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateTargetProject as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateTargetProject as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateTargetProject with LRO error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.UpdateTargetProjectRequest() + ); + request.targetProject ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.UpdateTargetProjectRequest', + ['targetProject', 'name'] + ); + request.targetProject.name = defaultValue1; + const expectedHeaderRequestParams = `target_project.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateTargetProject = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.updateTargetProject(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.updateTargetProject as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateTargetProject as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateTargetProjectProgress without error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + 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.checkUpdateTargetProjectProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateTargetProjectProgress with error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + 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.checkUpdateTargetProjectProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('deleteTargetProject', () => { + it('invokes deleteTargetProject without error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.DeleteTargetProjectRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.DeleteTargetProjectRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteTargetProject = + stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteTargetProject(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteTargetProject as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteTargetProject as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteTargetProject without error using callback', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.DeleteTargetProjectRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.DeleteTargetProjectRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteTargetProject = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteTargetProject( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.vmmigration.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.vmmigration.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteTargetProject as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteTargetProject as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteTargetProject with call error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.DeleteTargetProjectRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.DeleteTargetProjectRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteTargetProject = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteTargetProject(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteTargetProject as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteTargetProject as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteTargetProject with LRO error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.DeleteTargetProjectRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.DeleteTargetProjectRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteTargetProject = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.deleteTargetProject(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteTargetProject as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteTargetProject as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteTargetProjectProgress without error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + 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.checkDeleteTargetProjectProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteTargetProjectProgress with error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + 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.checkDeleteTargetProjectProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('listSources', () => { + it('invokes listSources without error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.ListSourcesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.ListSourcesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.vmmigration.v1.Source()), + generateSampleMessage(new protos.google.cloud.vmmigration.v1.Source()), + generateSampleMessage(new protos.google.cloud.vmmigration.v1.Source()), + ]; + client.innerApiCalls.listSources = stubSimpleCall(expectedResponse); + const [response] = await client.listSources(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listSources as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listSources as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSources without error using callback', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.ListSourcesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.ListSourcesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.vmmigration.v1.Source()), + generateSampleMessage(new protos.google.cloud.vmmigration.v1.Source()), + generateSampleMessage(new protos.google.cloud.vmmigration.v1.Source()), + ]; + client.innerApiCalls.listSources = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listSources( + request, + ( + err?: Error | null, + result?: protos.google.cloud.vmmigration.v1.ISource[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listSources as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listSources as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSources with error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.ListSourcesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.ListSourcesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listSources = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listSources(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listSources as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listSources as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSourcesStream without error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.ListSourcesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.ListSourcesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.vmmigration.v1.Source()), + generateSampleMessage(new protos.google.cloud.vmmigration.v1.Source()), + generateSampleMessage(new protos.google.cloud.vmmigration.v1.Source()), + ]; + client.descriptors.page.listSources.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listSourcesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.vmmigration.v1.Source[] = []; + stream.on( + 'data', + (response: protos.google.cloud.vmmigration.v1.Source) => { + 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.listSources.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listSources, request) + ); + assert( + (client.descriptors.page.listSources.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listSourcesStream with error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.ListSourcesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.ListSourcesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listSources.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listSourcesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.vmmigration.v1.Source[] = []; + stream.on( + 'data', + (response: protos.google.cloud.vmmigration.v1.Source) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listSources.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listSources, request) + ); + assert( + (client.descriptors.page.listSources.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listSources without error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.ListSourcesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.ListSourcesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.vmmigration.v1.Source()), + generateSampleMessage(new protos.google.cloud.vmmigration.v1.Source()), + generateSampleMessage(new protos.google.cloud.vmmigration.v1.Source()), + ]; + client.descriptors.page.listSources.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.vmmigration.v1.ISource[] = []; + const iterable = client.listSourcesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listSources.asyncIterate as SinonStub).getCall( + 0 + ).args[1], + request + ); + assert( + (client.descriptors.page.listSources.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listSources with error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.ListSourcesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.ListSourcesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listSources.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listSourcesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.vmmigration.v1.ISource[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listSources.asyncIterate as SinonStub).getCall( + 0 + ).args[1], + request + ); + assert( + (client.descriptors.page.listSources.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listUtilizationReports', () => { + it('invokes listUtilizationReports without error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.ListUtilizationReportsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.ListUtilizationReportsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.vmmigration.v1.UtilizationReport() + ), + generateSampleMessage( + new protos.google.cloud.vmmigration.v1.UtilizationReport() + ), + generateSampleMessage( + new protos.google.cloud.vmmigration.v1.UtilizationReport() + ), + ]; + client.innerApiCalls.listUtilizationReports = + stubSimpleCall(expectedResponse); + const [response] = await client.listUtilizationReports(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listUtilizationReports as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listUtilizationReports as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listUtilizationReports without error using callback', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.ListUtilizationReportsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.ListUtilizationReportsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.vmmigration.v1.UtilizationReport() + ), + generateSampleMessage( + new protos.google.cloud.vmmigration.v1.UtilizationReport() + ), + generateSampleMessage( + new protos.google.cloud.vmmigration.v1.UtilizationReport() + ), + ]; + client.innerApiCalls.listUtilizationReports = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listUtilizationReports( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.vmmigration.v1.IUtilizationReport[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listUtilizationReports as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listUtilizationReports as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listUtilizationReports with error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.ListUtilizationReportsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.ListUtilizationReportsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listUtilizationReports = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.listUtilizationReports(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.listUtilizationReports as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listUtilizationReports as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listUtilizationReportsStream without error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.ListUtilizationReportsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.ListUtilizationReportsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.vmmigration.v1.UtilizationReport() + ), + generateSampleMessage( + new protos.google.cloud.vmmigration.v1.UtilizationReport() + ), + generateSampleMessage( + new protos.google.cloud.vmmigration.v1.UtilizationReport() + ), + ]; + client.descriptors.page.listUtilizationReports.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listUtilizationReportsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.vmmigration.v1.UtilizationReport[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.vmmigration.v1.UtilizationReport) => { + 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.listUtilizationReports + .createStream as SinonStub + ) + .getCall(0) + .calledWith(client.innerApiCalls.listUtilizationReports, request) + ); + assert( + ( + client.descriptors.page.listUtilizationReports + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listUtilizationReportsStream with error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.ListUtilizationReportsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.ListUtilizationReportsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listUtilizationReports.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listUtilizationReportsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.vmmigration.v1.UtilizationReport[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.vmmigration.v1.UtilizationReport) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + ( + client.descriptors.page.listUtilizationReports + .createStream as SinonStub + ) + .getCall(0) + .calledWith(client.innerApiCalls.listUtilizationReports, request) + ); + assert( + ( + client.descriptors.page.listUtilizationReports + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listUtilizationReports without error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.ListUtilizationReportsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.ListUtilizationReportsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.vmmigration.v1.UtilizationReport() + ), + generateSampleMessage( + new protos.google.cloud.vmmigration.v1.UtilizationReport() + ), + generateSampleMessage( + new protos.google.cloud.vmmigration.v1.UtilizationReport() + ), + ]; + client.descriptors.page.listUtilizationReports.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.vmmigration.v1.IUtilizationReport[] = + []; + const iterable = client.listUtilizationReportsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listUtilizationReports + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.descriptors.page.listUtilizationReports + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listUtilizationReports with error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.ListUtilizationReportsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.ListUtilizationReportsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listUtilizationReports.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listUtilizationReportsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.vmmigration.v1.IUtilizationReport[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listUtilizationReports + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.descriptors.page.listUtilizationReports + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listDatacenterConnectors', () => { + it('invokes listDatacenterConnectors without error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.ListDatacenterConnectorsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.ListDatacenterConnectorsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.vmmigration.v1.DatacenterConnector() + ), + generateSampleMessage( + new protos.google.cloud.vmmigration.v1.DatacenterConnector() + ), + generateSampleMessage( + new protos.google.cloud.vmmigration.v1.DatacenterConnector() + ), + ]; + client.innerApiCalls.listDatacenterConnectors = + stubSimpleCall(expectedResponse); + const [response] = await client.listDatacenterConnectors(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listDatacenterConnectors as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listDatacenterConnectors as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listDatacenterConnectors without error using callback', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.ListDatacenterConnectorsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.ListDatacenterConnectorsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.vmmigration.v1.DatacenterConnector() + ), + generateSampleMessage( + new protos.google.cloud.vmmigration.v1.DatacenterConnector() + ), + generateSampleMessage( + new protos.google.cloud.vmmigration.v1.DatacenterConnector() + ), + ]; + client.innerApiCalls.listDatacenterConnectors = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listDatacenterConnectors( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.vmmigration.v1.IDatacenterConnector[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listDatacenterConnectors as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listDatacenterConnectors as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listDatacenterConnectors with error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.ListDatacenterConnectorsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.ListDatacenterConnectorsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listDatacenterConnectors = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.listDatacenterConnectors(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.listDatacenterConnectors as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listDatacenterConnectors as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listDatacenterConnectorsStream without error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.ListDatacenterConnectorsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.ListDatacenterConnectorsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.vmmigration.v1.DatacenterConnector() + ), + generateSampleMessage( + new protos.google.cloud.vmmigration.v1.DatacenterConnector() + ), + generateSampleMessage( + new protos.google.cloud.vmmigration.v1.DatacenterConnector() + ), + ]; + client.descriptors.page.listDatacenterConnectors.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listDatacenterConnectorsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.vmmigration.v1.DatacenterConnector[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.vmmigration.v1.DatacenterConnector + ) => { + 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.listDatacenterConnectors + .createStream as SinonStub + ) + .getCall(0) + .calledWith(client.innerApiCalls.listDatacenterConnectors, request) + ); + assert( + ( + client.descriptors.page.listDatacenterConnectors + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listDatacenterConnectorsStream with error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.ListDatacenterConnectorsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.ListDatacenterConnectorsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listDatacenterConnectors.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listDatacenterConnectorsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.vmmigration.v1.DatacenterConnector[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.vmmigration.v1.DatacenterConnector + ) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + ( + client.descriptors.page.listDatacenterConnectors + .createStream as SinonStub + ) + .getCall(0) + .calledWith(client.innerApiCalls.listDatacenterConnectors, request) + ); + assert( + ( + client.descriptors.page.listDatacenterConnectors + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listDatacenterConnectors without error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.ListDatacenterConnectorsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.ListDatacenterConnectorsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.vmmigration.v1.DatacenterConnector() + ), + generateSampleMessage( + new protos.google.cloud.vmmigration.v1.DatacenterConnector() + ), + generateSampleMessage( + new protos.google.cloud.vmmigration.v1.DatacenterConnector() + ), + ]; + client.descriptors.page.listDatacenterConnectors.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.vmmigration.v1.IDatacenterConnector[] = + []; + const iterable = client.listDatacenterConnectorsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listDatacenterConnectors + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.descriptors.page.listDatacenterConnectors + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listDatacenterConnectors with error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.ListDatacenterConnectorsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.ListDatacenterConnectorsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listDatacenterConnectors.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listDatacenterConnectorsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.vmmigration.v1.IDatacenterConnector[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listDatacenterConnectors + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.descriptors.page.listDatacenterConnectors + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listMigratingVms', () => { + it('invokes listMigratingVms without error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.ListMigratingVmsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.ListMigratingVmsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.vmmigration.v1.MigratingVm() + ), + generateSampleMessage( + new protos.google.cloud.vmmigration.v1.MigratingVm() + ), + generateSampleMessage( + new protos.google.cloud.vmmigration.v1.MigratingVm() + ), + ]; + client.innerApiCalls.listMigratingVms = stubSimpleCall(expectedResponse); + const [response] = await client.listMigratingVms(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listMigratingVms as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listMigratingVms as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listMigratingVms without error using callback', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.ListMigratingVmsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.ListMigratingVmsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.vmmigration.v1.MigratingVm() + ), + generateSampleMessage( + new protos.google.cloud.vmmigration.v1.MigratingVm() + ), + generateSampleMessage( + new protos.google.cloud.vmmigration.v1.MigratingVm() + ), + ]; + client.innerApiCalls.listMigratingVms = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listMigratingVms( + request, + ( + err?: Error | null, + result?: protos.google.cloud.vmmigration.v1.IMigratingVm[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listMigratingVms as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listMigratingVms as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listMigratingVms with error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.ListMigratingVmsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.ListMigratingVmsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listMigratingVms = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listMigratingVms(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listMigratingVms as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listMigratingVms as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listMigratingVmsStream without error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.ListMigratingVmsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.ListMigratingVmsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.vmmigration.v1.MigratingVm() + ), + generateSampleMessage( + new protos.google.cloud.vmmigration.v1.MigratingVm() + ), + generateSampleMessage( + new protos.google.cloud.vmmigration.v1.MigratingVm() + ), + ]; + client.descriptors.page.listMigratingVms.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listMigratingVmsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.vmmigration.v1.MigratingVm[] = []; + stream.on( + 'data', + (response: protos.google.cloud.vmmigration.v1.MigratingVm) => { + 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.listMigratingVms.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listMigratingVms, request) + ); + assert( + (client.descriptors.page.listMigratingVms.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listMigratingVmsStream with error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.ListMigratingVmsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.ListMigratingVmsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listMigratingVms.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listMigratingVmsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.vmmigration.v1.MigratingVm[] = []; + stream.on( + 'data', + (response: protos.google.cloud.vmmigration.v1.MigratingVm) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listMigratingVms.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listMigratingVms, request) + ); + assert( + (client.descriptors.page.listMigratingVms.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listMigratingVms without error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.ListMigratingVmsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.ListMigratingVmsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.vmmigration.v1.MigratingVm() + ), + generateSampleMessage( + new protos.google.cloud.vmmigration.v1.MigratingVm() + ), + generateSampleMessage( + new protos.google.cloud.vmmigration.v1.MigratingVm() + ), + ]; + client.descriptors.page.listMigratingVms.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.vmmigration.v1.IMigratingVm[] = []; + const iterable = client.listMigratingVmsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listMigratingVms.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listMigratingVms.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listMigratingVms with error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.ListMigratingVmsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.ListMigratingVmsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listMigratingVms.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listMigratingVmsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.vmmigration.v1.IMigratingVm[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listMigratingVms.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listMigratingVms.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listCloneJobs', () => { + it('invokes listCloneJobs without error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.ListCloneJobsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.ListCloneJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.vmmigration.v1.CloneJob() + ), + generateSampleMessage( + new protos.google.cloud.vmmigration.v1.CloneJob() + ), + generateSampleMessage( + new protos.google.cloud.vmmigration.v1.CloneJob() + ), + ]; + client.innerApiCalls.listCloneJobs = stubSimpleCall(expectedResponse); + const [response] = await client.listCloneJobs(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listCloneJobs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listCloneJobs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listCloneJobs without error using callback', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.ListCloneJobsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.ListCloneJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.vmmigration.v1.CloneJob() + ), + generateSampleMessage( + new protos.google.cloud.vmmigration.v1.CloneJob() + ), + generateSampleMessage( + new protos.google.cloud.vmmigration.v1.CloneJob() + ), + ]; + client.innerApiCalls.listCloneJobs = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listCloneJobs( + request, + ( + err?: Error | null, + result?: protos.google.cloud.vmmigration.v1.ICloneJob[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listCloneJobs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listCloneJobs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listCloneJobs with error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.ListCloneJobsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.ListCloneJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listCloneJobs = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listCloneJobs(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listCloneJobs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listCloneJobs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listCloneJobsStream without error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.ListCloneJobsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.ListCloneJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.vmmigration.v1.CloneJob() + ), + generateSampleMessage( + new protos.google.cloud.vmmigration.v1.CloneJob() + ), + generateSampleMessage( + new protos.google.cloud.vmmigration.v1.CloneJob() + ), + ]; + client.descriptors.page.listCloneJobs.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listCloneJobsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.vmmigration.v1.CloneJob[] = []; + stream.on( + 'data', + (response: protos.google.cloud.vmmigration.v1.CloneJob) => { + 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.listCloneJobs.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listCloneJobs, request) + ); + assert( + (client.descriptors.page.listCloneJobs.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listCloneJobsStream with error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.ListCloneJobsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.ListCloneJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listCloneJobs.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listCloneJobsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.vmmigration.v1.CloneJob[] = []; + stream.on( + 'data', + (response: protos.google.cloud.vmmigration.v1.CloneJob) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listCloneJobs.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listCloneJobs, request) + ); + assert( + (client.descriptors.page.listCloneJobs.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listCloneJobs without error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.ListCloneJobsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.ListCloneJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.vmmigration.v1.CloneJob() + ), + generateSampleMessage( + new protos.google.cloud.vmmigration.v1.CloneJob() + ), + generateSampleMessage( + new protos.google.cloud.vmmigration.v1.CloneJob() + ), + ]; + client.descriptors.page.listCloneJobs.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.vmmigration.v1.ICloneJob[] = []; + const iterable = client.listCloneJobsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listCloneJobs.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listCloneJobs.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listCloneJobs with error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.ListCloneJobsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.ListCloneJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listCloneJobs.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listCloneJobsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.vmmigration.v1.ICloneJob[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listCloneJobs.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listCloneJobs.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listCutoverJobs', () => { + it('invokes listCutoverJobs without error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.ListCutoverJobsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.ListCutoverJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.vmmigration.v1.CutoverJob() + ), + generateSampleMessage( + new protos.google.cloud.vmmigration.v1.CutoverJob() + ), + generateSampleMessage( + new protos.google.cloud.vmmigration.v1.CutoverJob() + ), + ]; + client.innerApiCalls.listCutoverJobs = stubSimpleCall(expectedResponse); + const [response] = await client.listCutoverJobs(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listCutoverJobs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listCutoverJobs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listCutoverJobs without error using callback', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.ListCutoverJobsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.ListCutoverJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.vmmigration.v1.CutoverJob() + ), + generateSampleMessage( + new protos.google.cloud.vmmigration.v1.CutoverJob() + ), + generateSampleMessage( + new protos.google.cloud.vmmigration.v1.CutoverJob() + ), + ]; + client.innerApiCalls.listCutoverJobs = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listCutoverJobs( + request, + ( + err?: Error | null, + result?: protos.google.cloud.vmmigration.v1.ICutoverJob[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listCutoverJobs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listCutoverJobs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listCutoverJobs with error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.ListCutoverJobsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.ListCutoverJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listCutoverJobs = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listCutoverJobs(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listCutoverJobs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listCutoverJobs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listCutoverJobsStream without error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.ListCutoverJobsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.ListCutoverJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.vmmigration.v1.CutoverJob() + ), + generateSampleMessage( + new protos.google.cloud.vmmigration.v1.CutoverJob() + ), + generateSampleMessage( + new protos.google.cloud.vmmigration.v1.CutoverJob() + ), + ]; + client.descriptors.page.listCutoverJobs.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listCutoverJobsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.vmmigration.v1.CutoverJob[] = []; + stream.on( + 'data', + (response: protos.google.cloud.vmmigration.v1.CutoverJob) => { + 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.listCutoverJobs.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listCutoverJobs, request) + ); + assert( + (client.descriptors.page.listCutoverJobs.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listCutoverJobsStream with error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.ListCutoverJobsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.ListCutoverJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listCutoverJobs.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listCutoverJobsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.vmmigration.v1.CutoverJob[] = []; + stream.on( + 'data', + (response: protos.google.cloud.vmmigration.v1.CutoverJob) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listCutoverJobs.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listCutoverJobs, request) + ); + assert( + (client.descriptors.page.listCutoverJobs.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listCutoverJobs without error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.ListCutoverJobsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.ListCutoverJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.vmmigration.v1.CutoverJob() + ), + generateSampleMessage( + new protos.google.cloud.vmmigration.v1.CutoverJob() + ), + generateSampleMessage( + new protos.google.cloud.vmmigration.v1.CutoverJob() + ), + ]; + client.descriptors.page.listCutoverJobs.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.vmmigration.v1.ICutoverJob[] = []; + const iterable = client.listCutoverJobsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listCutoverJobs.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listCutoverJobs.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listCutoverJobs with error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.ListCutoverJobsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.ListCutoverJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listCutoverJobs.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listCutoverJobsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.vmmigration.v1.ICutoverJob[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listCutoverJobs.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listCutoverJobs.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listGroups', () => { + it('invokes listGroups without error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.ListGroupsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.ListGroupsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.vmmigration.v1.Group()), + generateSampleMessage(new protos.google.cloud.vmmigration.v1.Group()), + generateSampleMessage(new protos.google.cloud.vmmigration.v1.Group()), + ]; + client.innerApiCalls.listGroups = stubSimpleCall(expectedResponse); + const [response] = await client.listGroups(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listGroups as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listGroups as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listGroups without error using callback', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.ListGroupsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.ListGroupsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.vmmigration.v1.Group()), + generateSampleMessage(new protos.google.cloud.vmmigration.v1.Group()), + generateSampleMessage(new protos.google.cloud.vmmigration.v1.Group()), + ]; + client.innerApiCalls.listGroups = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listGroups( + request, + ( + err?: Error | null, + result?: protos.google.cloud.vmmigration.v1.IGroup[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listGroups as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listGroups as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listGroups with error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.ListGroupsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.ListGroupsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listGroups = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listGroups(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listGroups as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listGroups as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listGroupsStream without error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.ListGroupsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.ListGroupsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.vmmigration.v1.Group()), + generateSampleMessage(new protos.google.cloud.vmmigration.v1.Group()), + generateSampleMessage(new protos.google.cloud.vmmigration.v1.Group()), + ]; + client.descriptors.page.listGroups.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listGroupsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.vmmigration.v1.Group[] = []; + stream.on( + 'data', + (response: protos.google.cloud.vmmigration.v1.Group) => { + 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.listGroups.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listGroups, request) + ); + assert( + (client.descriptors.page.listGroups.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listGroupsStream with error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.ListGroupsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.ListGroupsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listGroups.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listGroupsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.vmmigration.v1.Group[] = []; + stream.on( + 'data', + (response: protos.google.cloud.vmmigration.v1.Group) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listGroups.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listGroups, request) + ); + assert( + (client.descriptors.page.listGroups.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listGroups without error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.ListGroupsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.ListGroupsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.vmmigration.v1.Group()), + generateSampleMessage(new protos.google.cloud.vmmigration.v1.Group()), + generateSampleMessage(new protos.google.cloud.vmmigration.v1.Group()), + ]; + client.descriptors.page.listGroups.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.vmmigration.v1.IGroup[] = []; + const iterable = client.listGroupsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listGroups.asyncIterate as SinonStub).getCall( + 0 + ).args[1], + request + ); + assert( + (client.descriptors.page.listGroups.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listGroups with error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.ListGroupsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.ListGroupsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listGroups.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listGroupsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.vmmigration.v1.IGroup[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listGroups.asyncIterate as SinonStub).getCall( + 0 + ).args[1], + request + ); + assert( + (client.descriptors.page.listGroups.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listTargetProjects', () => { + it('invokes listTargetProjects without error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.ListTargetProjectsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.ListTargetProjectsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.vmmigration.v1.TargetProject() + ), + generateSampleMessage( + new protos.google.cloud.vmmigration.v1.TargetProject() + ), + generateSampleMessage( + new protos.google.cloud.vmmigration.v1.TargetProject() + ), + ]; + client.innerApiCalls.listTargetProjects = + stubSimpleCall(expectedResponse); + const [response] = await client.listTargetProjects(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listTargetProjects as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listTargetProjects as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listTargetProjects without error using callback', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.ListTargetProjectsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.ListTargetProjectsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.vmmigration.v1.TargetProject() + ), + generateSampleMessage( + new protos.google.cloud.vmmigration.v1.TargetProject() + ), + generateSampleMessage( + new protos.google.cloud.vmmigration.v1.TargetProject() + ), + ]; + client.innerApiCalls.listTargetProjects = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listTargetProjects( + request, + ( + err?: Error | null, + result?: protos.google.cloud.vmmigration.v1.ITargetProject[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listTargetProjects as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listTargetProjects as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listTargetProjects with error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.ListTargetProjectsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.ListTargetProjectsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listTargetProjects = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listTargetProjects(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listTargetProjects as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listTargetProjects as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listTargetProjectsStream without error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.ListTargetProjectsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.ListTargetProjectsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.vmmigration.v1.TargetProject() + ), + generateSampleMessage( + new protos.google.cloud.vmmigration.v1.TargetProject() + ), + generateSampleMessage( + new protos.google.cloud.vmmigration.v1.TargetProject() + ), + ]; + client.descriptors.page.listTargetProjects.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listTargetProjectsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.vmmigration.v1.TargetProject[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.vmmigration.v1.TargetProject) => { + 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.listTargetProjects.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listTargetProjects, request) + ); + assert( + (client.descriptors.page.listTargetProjects.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listTargetProjectsStream with error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.ListTargetProjectsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.ListTargetProjectsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listTargetProjects.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listTargetProjectsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.vmmigration.v1.TargetProject[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.vmmigration.v1.TargetProject) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listTargetProjects.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listTargetProjects, request) + ); + assert( + (client.descriptors.page.listTargetProjects.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listTargetProjects without error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.ListTargetProjectsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.ListTargetProjectsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.vmmigration.v1.TargetProject() + ), + generateSampleMessage( + new protos.google.cloud.vmmigration.v1.TargetProject() + ), + generateSampleMessage( + new protos.google.cloud.vmmigration.v1.TargetProject() + ), + ]; + client.descriptors.page.listTargetProjects.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.vmmigration.v1.ITargetProject[] = []; + const iterable = client.listTargetProjectsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listTargetProjects.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listTargetProjects.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listTargetProjects with error', async () => { + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmmigration.v1.ListTargetProjectsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmmigration.v1.ListTargetProjectsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listTargetProjects.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listTargetProjectsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.vmmigration.v1.ITargetProject[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listTargetProjects.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listTargetProjects.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('Path templates', () => { + describe('cloneJob', () => { + const fakePath = '/rendered/path/cloneJob'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + source: 'sourceValue', + migrating_vm: 'migratingVmValue', + clone_job: 'cloneJobValue', + }; + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.cloneJobPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.cloneJobPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('cloneJobPath', () => { + const result = client.cloneJobPath( + 'projectValue', + 'locationValue', + 'sourceValue', + 'migratingVmValue', + 'cloneJobValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.cloneJobPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromCloneJobName', () => { + const result = client.matchProjectFromCloneJobName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.cloneJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromCloneJobName', () => { + const result = client.matchLocationFromCloneJobName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.cloneJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSourceFromCloneJobName', () => { + const result = client.matchSourceFromCloneJobName(fakePath); + assert.strictEqual(result, 'sourceValue'); + assert( + (client.pathTemplates.cloneJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchMigratingVmFromCloneJobName', () => { + const result = client.matchMigratingVmFromCloneJobName(fakePath); + assert.strictEqual(result, 'migratingVmValue'); + assert( + (client.pathTemplates.cloneJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCloneJobFromCloneJobName', () => { + const result = client.matchCloneJobFromCloneJobName(fakePath); + assert.strictEqual(result, 'cloneJobValue'); + assert( + (client.pathTemplates.cloneJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('cutoverJob', () => { + const fakePath = '/rendered/path/cutoverJob'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + source: 'sourceValue', + migrating_vm: 'migratingVmValue', + cutover_job: 'cutoverJobValue', + }; + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.cutoverJobPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.cutoverJobPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('cutoverJobPath', () => { + const result = client.cutoverJobPath( + 'projectValue', + 'locationValue', + 'sourceValue', + 'migratingVmValue', + 'cutoverJobValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.cutoverJobPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromCutoverJobName', () => { + const result = client.matchProjectFromCutoverJobName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.cutoverJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromCutoverJobName', () => { + const result = client.matchLocationFromCutoverJobName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.cutoverJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSourceFromCutoverJobName', () => { + const result = client.matchSourceFromCutoverJobName(fakePath); + assert.strictEqual(result, 'sourceValue'); + assert( + (client.pathTemplates.cutoverJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchMigratingVmFromCutoverJobName', () => { + const result = client.matchMigratingVmFromCutoverJobName(fakePath); + assert.strictEqual(result, 'migratingVmValue'); + assert( + (client.pathTemplates.cutoverJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCutoverJobFromCutoverJobName', () => { + const result = client.matchCutoverJobFromCutoverJobName(fakePath); + assert.strictEqual(result, 'cutoverJobValue'); + assert( + (client.pathTemplates.cutoverJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('datacenterConnector', () => { + const fakePath = '/rendered/path/datacenterConnector'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + source: 'sourceValue', + datacenter_connector: 'datacenterConnectorValue', + }; + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.datacenterConnectorPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.datacenterConnectorPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('datacenterConnectorPath', () => { + const result = client.datacenterConnectorPath( + 'projectValue', + 'locationValue', + 'sourceValue', + 'datacenterConnectorValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.datacenterConnectorPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromDatacenterConnectorName', () => { + const result = client.matchProjectFromDatacenterConnectorName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.datacenterConnectorPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromDatacenterConnectorName', () => { + const result = + client.matchLocationFromDatacenterConnectorName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.datacenterConnectorPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSourceFromDatacenterConnectorName', () => { + const result = client.matchSourceFromDatacenterConnectorName(fakePath); + assert.strictEqual(result, 'sourceValue'); + assert( + ( + client.pathTemplates.datacenterConnectorPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDatacenterConnectorFromDatacenterConnectorName', () => { + const result = + client.matchDatacenterConnectorFromDatacenterConnectorName(fakePath); + assert.strictEqual(result, 'datacenterConnectorValue'); + assert( + ( + client.pathTemplates.datacenterConnectorPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('group', () => { + const fakePath = '/rendered/path/group'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + group: 'groupValue', + }; + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.groupPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.groupPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('groupPath', () => { + const result = client.groupPath( + 'projectValue', + 'locationValue', + 'groupValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.groupPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromGroupName', () => { + const result = client.matchProjectFromGroupName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.groupPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromGroupName', () => { + const result = client.matchLocationFromGroupName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.groupPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchGroupFromGroupName', () => { + const result = client.matchGroupFromGroupName(fakePath); + assert.strictEqual(result, 'groupValue'); + assert( + (client.pathTemplates.groupPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('location', () => { + const fakePath = '/rendered/path/location'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + }; + const client = new vmmigrationModule.v1.VmMigrationClient({ + 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('migratingVm', () => { + const fakePath = '/rendered/path/migratingVm'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + source: 'sourceValue', + migrating_vm: 'migratingVmValue', + }; + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.migratingVmPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.migratingVmPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('migratingVmPath', () => { + const result = client.migratingVmPath( + 'projectValue', + 'locationValue', + 'sourceValue', + 'migratingVmValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.migratingVmPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromMigratingVmName', () => { + const result = client.matchProjectFromMigratingVmName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.migratingVmPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromMigratingVmName', () => { + const result = client.matchLocationFromMigratingVmName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.migratingVmPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSourceFromMigratingVmName', () => { + const result = client.matchSourceFromMigratingVmName(fakePath); + assert.strictEqual(result, 'sourceValue'); + assert( + (client.pathTemplates.migratingVmPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchMigratingVmFromMigratingVmName', () => { + const result = client.matchMigratingVmFromMigratingVmName(fakePath); + assert.strictEqual(result, 'migratingVmValue'); + assert( + (client.pathTemplates.migratingVmPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('project', () => { + const fakePath = '/rendered/path/project'; + const expectedParameters = { + project: 'projectValue', + }; + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectPath', () => { + const result = client.projectPath('projectValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectName', () => { + const result = client.matchProjectFromProjectName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('source', () => { + const fakePath = '/rendered/path/source'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + source: 'sourceValue', + }; + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.sourcePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.sourcePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('sourcePath', () => { + const result = client.sourcePath( + 'projectValue', + 'locationValue', + 'sourceValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.sourcePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromSourceName', () => { + const result = client.matchProjectFromSourceName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.sourcePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromSourceName', () => { + const result = client.matchLocationFromSourceName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.sourcePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSourceFromSourceName', () => { + const result = client.matchSourceFromSourceName(fakePath); + assert.strictEqual(result, 'sourceValue'); + assert( + (client.pathTemplates.sourcePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('targetProject', () => { + const fakePath = '/rendered/path/targetProject'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + target_project: 'targetProjectValue', + }; + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.targetProjectPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.targetProjectPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('targetProjectPath', () => { + const result = client.targetProjectPath( + 'projectValue', + 'locationValue', + 'targetProjectValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.targetProjectPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromTargetProjectName', () => { + const result = client.matchProjectFromTargetProjectName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.targetProjectPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromTargetProjectName', () => { + const result = client.matchLocationFromTargetProjectName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.targetProjectPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTargetProjectFromTargetProjectName', () => { + const result = client.matchTargetProjectFromTargetProjectName(fakePath); + assert.strictEqual(result, 'targetProjectValue'); + assert( + (client.pathTemplates.targetProjectPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('utilizationReport', () => { + const fakePath = '/rendered/path/utilizationReport'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + source: 'sourceValue', + utilization_report: 'utilizationReportValue', + }; + const client = new vmmigrationModule.v1.VmMigrationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.utilizationReportPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.utilizationReportPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('utilizationReportPath', () => { + const result = client.utilizationReportPath( + 'projectValue', + 'locationValue', + 'sourceValue', + 'utilizationReportValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.utilizationReportPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromUtilizationReportName', () => { + const result = client.matchProjectFromUtilizationReportName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.utilizationReportPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromUtilizationReportName', () => { + const result = client.matchLocationFromUtilizationReportName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.utilizationReportPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSourceFromUtilizationReportName', () => { + const result = client.matchSourceFromUtilizationReportName(fakePath); + assert.strictEqual(result, 'sourceValue'); + assert( + ( + client.pathTemplates.utilizationReportPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchUtilizationReportFromUtilizationReportName', () => { + const result = + client.matchUtilizationReportFromUtilizationReportName(fakePath); + assert.strictEqual(result, 'utilizationReportValue'); + assert( + ( + client.pathTemplates.utilizationReportPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); diff --git a/packages/google-cloud-vmmigration/tsconfig.json b/packages/google-cloud-vmmigration/tsconfig.json new file mode 100644 index 00000000000..c78f1c884ef --- /dev/null +++ b/packages/google-cloud-vmmigration/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-vmmigration/webpack.config.js b/packages/google-cloud-vmmigration/webpack.config.js new file mode 100644 index 00000000000..a9ba440309a --- /dev/null +++ b/packages/google-cloud-vmmigration/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: 'VmMigration', + filename: './vm-migration.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', +};